Class DragTool
- java.lang.Object
-
- org.locationtech.jts.jump.workbench.ui.cursortool.AbstractCursorTool
-
- org.locationtech.jts.jump.workbench.ui.cursortool.DragTool
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener,CursorTool
- Direct Known Subclasses:
EditDelineationTool,MoveSelectedItemsTool,MoveVertexTool,PanTool,RectangleTool,SelectTool,SpecifyFeaturesTool,ZoomTool
public abstract class DragTool extends AbstractCursorTool
The default implementation draws a selection box, but this can be overridden (even to draw nothing).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.locationtech.jts.jump.workbench.ui.cursortool.AbstractCursorTool
AbstractCursorTool.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_VIEW_CLICK_BUFFERprotected org.locationtech.jts.geom.CoordinatemodelDestinationModify using #setDestinationprotected org.locationtech.jts.geom.CoordinatemodelSourceModify using #setSource
-
Constructor Summary
Constructors Constructor Description DragTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.locationtech.jts.geom.EnvelopegetBoxInModelCoordinates()protected org.locationtech.jts.geom.CoordinategetModelDestination()protected org.locationtech.jts.geom.CoordinategetModelSource()protected ShapegetShape()protected ShapegetShape(Point2D source, Point2D destination)protected Point2DgetViewDestination()protected Point2DgetViewSource()protected doublemodelClickBuffer()voidmouseDragged(MouseEvent e)voidmousePressed(MouseEvent e)Begins handling of the drag.voidmouseReleased(MouseEvent e)protected voidsetModelDestination(org.locationtech.jts.geom.Coordinate destination)protected voidsetModelSource(org.locationtech.jts.geom.Coordinate source)protected voidsetViewClickBuffer(int clickBuffer)A click is converted into a box by being expanded by this amount in the four directions.protected voidsetViewDestination(Point2D destination)protected voidsetViewSource(Point2D source)protected booleanwasClick()-
Methods inherited from class org.locationtech.jts.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 org.locationtech.jts.jump.workbench.ui.cursortool.CursorTool
getIcon
-
-
-
-
Field Detail
-
DEFAULT_VIEW_CLICK_BUFFER
public static final int DEFAULT_VIEW_CLICK_BUFFER
- See Also:
- Constant Field Values
-
modelSource
protected org.locationtech.jts.geom.Coordinate modelSource
Modify using #setSource
-
modelDestination
protected org.locationtech.jts.geom.Coordinate modelDestination
Modify using #setDestination
-
-
Method Detail
-
mousePressed
public void mousePressed(MouseEvent e)
Begins handling of the drag. Subclasses can prevent handling of the drag by overriding this method and not calling it.- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classAbstractCursorTool
-
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 org.locationtech.jts.geom.Envelope getBoxInModelCoordinates() throws NoninvertibleTransformException- Throws:
NoninvertibleTransformException
-
modelClickBuffer
protected double modelClickBuffer()
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classAbstractCursorTool
-
getModelSource
protected org.locationtech.jts.geom.Coordinate getModelSource()
-
getModelDestination
protected org.locationtech.jts.geom.Coordinate getModelDestination()
-
setModelSource
protected void setModelSource(org.locationtech.jts.geom.Coordinate source)
-
setViewSource
protected void setViewSource(Point2D source) throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
setViewDestination
protected void setViewDestination(Point2D destination) throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
setModelDestination
protected void setModelDestination(org.locationtech.jts.geom.Coordinate destination)
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classAbstractCursorTool
-
getShape
protected Shape getShape() throws Exception
- Specified by:
getShapein classAbstractCursorTool- Returns:
- null if nothing should be drawn
- Throws:
Exception
-
getViewSource
protected Point2D getViewSource() throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
getViewDestination
protected Point2D getViewDestination() throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
-