Class AbstractZoomTool
- java.lang.Object
-
- com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
-
- com.vividsolutions.jump.workbench.ui.cursortool.DragTool
-
- com.vividsolutions.jump.workbench.ui.zoom.AbstractZoomTool
-
- All Implemented Interfaces:
CursorTool,MouseListener,MouseMotionListener,EventListener
- Direct Known Subclasses:
PanTool,ZoomRealtimeTool,ZoomTool
public abstract class AbstractZoomTool extends DragTool
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
AbstractCursorTool.Listener
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageauxImageprotected intmouseWheelCountprotected ImageorigImageprotected doublescaleprotected Point2D.DoublezoomTo-
Fields inherited from class com.vividsolutions.jump.workbench.ui.cursortool.DragTool
DEFAULT_VIEW_CLICK_BUFFER, modelDestination, modelSource
-
Fields inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
isLinuxOS, panel
-
-
Constructor Summary
Constructors Constructor Description AbstractZoomTool(WorkbenchContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcacheImage()ImagecreateImageIfNeeded(Image currImage)Creates a new Image if currImage doesn't exist or is the wrong size for the panel.voiddrawImage(int dx, int dy, double scale)protected voidgestureFinished()booleangetAnimatingZoom()protected Point2DgetCentre()CursorgetCursor()IcongetIcon()voidmouseWheelMoved(MouseWheelEvent e)protected voidscaleImageAtCentre(double zoomFactor)protected voidscaleImageAtPoint(Point2D p, double zoomFactor)booleansetAnimatingZoom(boolean animating)protected voidzoomAt(Point2D p, double zoomFactor, boolean animatingZoom)-
Methods inherited from class com.vividsolutions.jump.workbench.ui.cursortool.DragTool
deactivate, getBoxInModelCoordinates, getModelDestination, getModelSource, getShape, getShape, getViewDestination, getViewSource, modelClickBuffer, mouseDragged, mousePressed, mouseReleased, setModelDestination, setModelSource, setViewClickBuffer, setViewDestination, setViewSource, wasClick
-
Methods inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
activate, add, allowSnapping, cancelGesture, check, cleanup, clearImage, clearShape, componentWithFocusIsHandledByCursorTools, createCursor, createCursor, createCursor, createStandardSnappingPolicies, drawImageXOR, drawImageXOR, drawShapeXOR, drawShapeXOR, execute, execute, fireGestureFinished, getColor, getImage, getImagePosition, getName, getPanel, getPanel, getSnapManager, getStroke, getTaskFrame, getWorkbench, getWorkbenchContext, isGestureInProgress, isRightMouseButtonUsed, isRollingBackInvalidEdits, isShapeOnScreen, mouseClicked, mouseEntered, mouseExited, mouseMoved, name, prohibitSnapping, redrawImage, redrawShape, reportNothingToUndoYet, setColor, setControlPressed, setFilling, setPanel, setShiftPressed, setStroke, setup, snap, snap, supportsSnapping, toString, wasControlPressed, wasShiftPressed
-
-
-
-
Field Detail
-
origImage
protected Image origImage
-
auxImage
protected Image auxImage
-
scale
protected double scale
-
mouseWheelCount
protected int mouseWheelCount
-
zoomTo
protected Point2D.Double zoomTo
-
-
Constructor Detail
-
AbstractZoomTool
public AbstractZoomTool(WorkbenchContext context)
-
-
Method Detail
-
setAnimatingZoom
public boolean setAnimatingZoom(boolean animating)
-
getAnimatingZoom
public boolean getAnimatingZoom()
-
getIcon
public Icon getIcon()
- Returns:
- null to use a default icon
-
getCursor
public Cursor getCursor()
- Specified by:
getCursorin interfaceCursorTool- Overrides:
getCursorin classAbstractCursorTool
-
gestureFinished
protected void gestureFinished() throws NoninvertibleTransformException- Specified by:
gestureFinishedin classAbstractCursorTool- Throws:
NoninvertibleTransformException
-
mouseWheelMoved
public void mouseWheelMoved(MouseWheelEvent e)
-
scaleImageAtCentre
protected void scaleImageAtCentre(double zoomFactor)
-
scaleImageAtPoint
protected void scaleImageAtPoint(Point2D p, double zoomFactor)
-
createImageIfNeeded
public Image createImageIfNeeded(Image currImage)
Creates a new Image if currImage doesn't exist or is the wrong size for the panel.- Parameters:
currImage- an image buffer- Returns:
- a new image, or the existing one if it's compatible
-
cacheImage
public void cacheImage()
-
getCentre
protected Point2D getCentre() throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
zoomAt
protected void zoomAt(Point2D p, double zoomFactor, boolean animatingZoom) throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
drawImage
public void drawImage(int dx, int dy, double scale)
-
-