public class AbstractZoomControl extends ControlAdapter
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_MAX_SCALE |
static double |
DEFAULT_MIN_SCALE |
protected double |
m_maxScale |
protected double |
m_minScale |
protected boolean |
m_zoomOverItem |
protected static int |
MAX_ZOOM
Indicates the maximum allowed zoom level has been reached.
|
protected static int |
MIN_ZOOM
Indicates the minimum allowed zoom level has been reached.
|
protected static int |
NO_ZOOM
Indicates no zooming can be performed.
|
protected static int |
ZOOM
Indicates a zoom operation completed successfully.
|
LEFT_MOUSE_BUTTON, MIDDLE_MOUSE_BUTTON, RIGHT_MOUSE_BUTTON
Constructor and Description |
---|
AbstractZoomControl() |
Modifier and Type | Method and Description |
---|---|
double |
getMaxScale()
Gets the maximum scale value allowed by this zoom control
|
double |
getMinScale()
Gets the minimum scale value allowed by this zoom control
|
boolean |
isZoomOverItem()
Indicates if the zoom control will work while the mouse is
over a VisualItem.
|
void |
setMaxScale(double maxScale)
Sets the maximum scale value allowed by this zoom control
|
void |
setMinScale(double minScale)
Sets the minimum scale value allowed by this zoom control
|
void |
setZoomOverItem(boolean zoomOverItem)
Determines if the zoom control will work while the mouse is
over a VisualItem
|
protected int |
zoom(Display display,
java.awt.geom.Point2D p,
double zoom,
boolean abs)
Zoom the given display at the given point by the zoom factor,
in either absolute (item-space) or screen co-ordinates.
|
isEnabled, itemClicked, itemDragged, itemEntered, itemExited, itemKeyPressed, itemKeyReleased, itemKeyTyped, itemMoved, itemPressed, itemReleased, itemWheelMoved, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, setEnabled
public static final double DEFAULT_MIN_SCALE
public static final double DEFAULT_MAX_SCALE
protected static final int ZOOM
protected static final int MIN_ZOOM
protected static final int MAX_ZOOM
protected static final int NO_ZOOM
protected double m_minScale
protected double m_maxScale
protected boolean m_zoomOverItem
protected int zoom(Display display, java.awt.geom.Point2D p, double zoom, boolean abs)
display
- the Display to zoomp
- the point to center the zoom uponzoom
- the scale factor by which to zoomabs
- if true, the point p should be assumed to be in absolute
coordinates, otherwise it will be treated as scree (pixel) coordinatesZOOM
, NO_ZOOM
, MIN_ZOOM
,
MAX_ZOOM
.public double getMaxScale()
public void setMaxScale(double maxScale)
public double getMinScale()
public void setMinScale(double minScale)
public boolean isZoomOverItem()
public void setZoomOverItem(boolean zoomOverItem)
zoomOverItem
- true to indicate the control operates
over VisualItems, false otherwiseCopyright ? 2013 Regents of the University of California