public class SuperZoomPanTool extends DragTool implements java.awt.event.MouseWheelListener
AbstractCursorTool.Listener
Modifier and Type | Field and Description |
---|---|
static java.awt.Cursor |
CURSOR_PAN |
static java.awt.Cursor |
CURSOR_WHEEL |
static java.awt.Cursor |
CURSOR_ZOOM |
static int |
INDICATOR_MODE_IMAGE
The visual indicator (area of interest) is painted as an Image.
|
static int |
INDICATOR_MODE_SHAPE
The visual indicator (area of interest) is painted as a Shape.
|
static double |
WHEEL_ZOOM_FACTOR |
static double |
ZOOM_IN_FACTOR |
DEFAULT_VIEW_CLICK_BUFFER, modelDestination, modelSource
isLinuxOS, panel
Constructor and Description |
---|
SuperZoomPanTool() |
Modifier and Type | Method and Description |
---|---|
void |
activate(LayerViewPanel layerViewPanel) |
void |
cacheImage() |
java.awt.Image |
createImageIfNeeded(java.awt.Image currImage)
Creates a new Image if currImage doesn't exist
or is the wrong size for the panel.
|
void |
deactivate() |
protected void |
gestureFinished() |
boolean |
getAnimatingZoom() |
java.awt.Cursor |
getCursor() |
javax.swing.Icon |
getIcon() |
protected java.awt.Image |
getImage()
This method have to return an Image as a visual indicator.
|
protected java.awt.Point |
getImagePosition()
This method have to return the position for the Image.
|
int |
getIndicatorMode() |
java.lang.String |
getName()
Returns a very brief description of this CursorTool.
|
protected java.awt.Shape |
getShape() |
protected java.awt.Shape |
getShape(java.awt.geom.Point2D source,
java.awt.geom.Point2D destination) |
boolean |
isRightMouseButtonUsed() |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e)
Begins handling of the drag.
|
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e) |
void |
redrawIndicator()
Redraws the visual indicator.
|
boolean |
setAnimatingZoom(boolean animating) |
void |
setIndicatorMode(int indicatorMode)
Sets the indicatorMode.
|
protected void |
zoomAt(java.awt.geom.Point2D p,
double zoomFactor,
boolean animatingZoom) |
getBoxInModelCoordinates, getModelDestination, getModelSource, getViewDestination, getViewSource, modelClickBuffer, setModelDestination, setModelSource, setViewClickBuffer, setViewDestination, setViewSource, wasClick
add, allowSnapping, cancelGesture, check, cleanup, clearImage, clearShape, createCursor, createCursor, drawImageXOR, drawImageXOR, drawShapeXOR, drawShapeXOR, execute, fireGestureFinished, getColor, getPanel, getPanel, getSnapManager, getTaskFrame, getWorkbench, getWorkbenchFrame, isGestureInProgress, isRollingBackInvalidEdits, isShapeOnScreen, mouseEntered, mouseExited, name, prohibitSnapping, redrawImage, redrawShape, reportNothingToUndoYet, setColor, setFilling, setPanel, setStroke, setStrokeWidth, setup, snap, snap, supportsSnapping, toString, wasControlPressed, wasShiftPressed, workbench, workbenchFrame
public static final double WHEEL_ZOOM_FACTOR
public static final double ZOOM_IN_FACTOR
public static java.awt.Cursor CURSOR_ZOOM
public static java.awt.Cursor CURSOR_PAN
public static java.awt.Cursor CURSOR_WHEEL
public static final int INDICATOR_MODE_SHAPE
public static final int INDICATOR_MODE_IMAGE
public void activate(LayerViewPanel layerViewPanel)
activate
in interface CursorTool
activate
in class AbstractCursorTool
public void deactivate()
deactivate
in interface CursorTool
deactivate
in class DragTool
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
protected java.awt.Shape getShape() throws java.lang.Exception
protected java.awt.Image getImage()
AbstractCursorTool
getImage
in class AbstractCursorTool
protected java.awt.Point getImagePosition()
AbstractCursorTool
AbstractCursorTool.getImage()
method.
For the abstract problematic please see AbstractCursorTool.getImage()
.getImagePosition
in class AbstractCursorTool
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractCursorTool
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractCursorTool
public void mousePressed(java.awt.event.MouseEvent e)
DragTool
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class DragTool
public boolean isRightMouseButtonUsed()
isRightMouseButtonUsed
in interface CursorTool
isRightMouseButtonUsed
in class AbstractCursorTool
public java.awt.Cursor getCursor()
getCursor
in interface CursorTool
getCursor
in class AbstractCursorTool
public javax.swing.Icon getIcon()
getIcon
in interface CursorTool
public java.lang.String getName()
CursorTool
getName
in interface CursorTool
getName
in class AbstractCursorTool
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class DragTool
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class DragTool
protected java.awt.Shape getShape(java.awt.geom.Point2D source, java.awt.geom.Point2D destination)
protected void gestureFinished() throws java.awt.geom.NoninvertibleTransformException
gestureFinished
in class AbstractCursorTool
java.awt.geom.NoninvertibleTransformException
public java.awt.Image createImageIfNeeded(java.awt.Image currImage)
currImage
- an image bufferpublic void cacheImage()
public boolean setAnimatingZoom(boolean animating)
public boolean getAnimatingZoom()
protected void zoomAt(java.awt.geom.Point2D p, double zoomFactor, boolean animatingZoom) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public void redrawIndicator()
public int getIndicatorMode()
public void setIndicatorMode(int indicatorMode)
INDICATOR_MODE_SHAPE
,
INDICATOR_MODE_IMAGE
.indicatorMode
- the indicatorMode to set