com.vividsolutions.jump.workbench.ui.cursortool
Class DragTool
java.lang.Object
com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
com.vividsolutions.jump.workbench.ui.cursortool.DragTool
- All Implemented Interfaces:
- CursorTool, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener
- Direct Known Subclasses:
- AbstractZoomTool, MoveSelectedItemsTool, MoveVertexTool, RectangleTool, RotateSelectedItemTool, ScaleSelectedItemsTool, SelectItemsByCircleTool, SelectTool, SpecifyFeaturesTool, ZoomRealtimeTool
public abstract class DragTool
- extends AbstractCursorTool
The default implementation draws a selection box, but this can be overridden
(even to draw nothing).
| Methods inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool |
activate, add, allowSnapping, cancelGesture, check, cleanup, clearShape, createCursor, createCursor, createStandardSnappingPolicies, deactivate, drawShapeXOR, drawShapeXOR, execute, fireGestureFinished, gestureFinished, getColor, getCursor, getName, getPanel, getSnapManager, getTaskFrame, getWorkbench, isGestureInProgress, isRightMouseButtonUsed, isRollingBackInvalidEdits, isShapeOnScreen, mouseClicked, mouseEntered, mouseExited, mouseMoved, name, redrawShape, reportNothingToUndoYet, setColor, setFilling, setStroke, setStrokeWidth, setup, snap, snap, toString, wasControlPressed, wasShiftPressed, workbench, workbenchFrame |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.vividsolutions.jump.workbench.ui.cursortool.CursorTool |
getIcon |
DEFAULT_VIEW_CLICK_BUFFER
public static final int DEFAULT_VIEW_CLICK_BUFFER
- See Also:
- Constant Field Values
modelSource
protected com.vividsolutions.jts.geom.Coordinate modelSource
- Modify using #setSource
modelDestination
protected com.vividsolutions.jts.geom.Coordinate modelDestination
- Modify using #setDestination
DragTool
public DragTool()
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Begins handling of the drag. Subclasses can prevent handling of the drag
by overriding this method and not calling it.
- Specified by:
mousePressed in interface java.awt.event.MouseListener- Overrides:
mousePressed in class AbstractCursorTool
setViewClickBuffer
protected void setViewClickBuffer(int clickBuffer)
- A click is converted into a box by being expanded by this amount in the
four directions.
wasClick
protected boolean wasClick()
getBoxInModelCoordinates
protected com.vividsolutions.jts.geom.Envelope getBoxInModelCoordinates()
throws java.awt.geom.NoninvertibleTransformException
- Throws:
java.awt.geom.NoninvertibleTransformException
modelClickBuffer
protected double modelClickBuffer()
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener- Overrides:
mouseDragged in class AbstractCursorTool
getModelSource
protected com.vividsolutions.jts.geom.Coordinate getModelSource()
getModelDestination
protected com.vividsolutions.jts.geom.Coordinate getModelDestination()
setModelSource
protected void setModelSource(com.vividsolutions.jts.geom.Coordinate source)
setViewSource
protected void setViewSource(java.awt.geom.Point2D source)
throws java.awt.geom.NoninvertibleTransformException
- Throws:
java.awt.geom.NoninvertibleTransformException
setViewDestination
protected void setViewDestination(java.awt.geom.Point2D destination)
throws java.awt.geom.NoninvertibleTransformException
- Throws:
java.awt.geom.NoninvertibleTransformException
setModelDestination
protected void setModelDestination(com.vividsolutions.jts.geom.Coordinate destination)
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased in interface java.awt.event.MouseListener- Overrides:
mouseReleased in class AbstractCursorTool
getShape
protected java.awt.Shape getShape()
throws java.lang.Exception
- Specified by:
getShape in class AbstractCursorTool
- Returns:
- null if nothing should be drawn
- Throws:
java.lang.Exception
getViewSource
protected java.awt.geom.Point2D getViewSource()
throws java.awt.geom.NoninvertibleTransformException
- Throws:
java.awt.geom.NoninvertibleTransformException
getViewDestination
protected java.awt.geom.Point2D getViewDestination()
throws java.awt.geom.NoninvertibleTransformException
- Throws:
java.awt.geom.NoninvertibleTransformException
getShape
protected java.awt.Shape getShape(java.awt.geom.Point2D source,
java.awt.geom.Point2D destination)
throws java.lang.Exception
- Returns:
- null if nothing should be drawn
- Throws:
java.lang.Exception