Class ConstrainedDragTool
java.lang.Object
com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedDragTool
- All Implemented Interfaces:
CursorTool, MouseListener, MouseMotionListener, EventListener
- Direct Known Subclasses:
ConstrainedMoveVertexTool
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 AbstractCursorTool
AbstractCursorTool.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Liststatic final intprotected org.locationtech.jts.geom.CoordinateModify using #setDestinationprotected org.locationtech.jts.geom.CoordinateModify using #setSourceFields inherited from class AbstractCursorTool
isLinuxOS, panel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(LayerViewPanel layerViewPanel) protected org.locationtech.jts.geom.Coordinateprotected org.locationtech.jts.geom.Envelopeprotected org.locationtech.jts.geom.Coordinateprotected org.locationtech.jts.geom.Coordinateprotected ShapegetShape()protected Shapeprotected Point2Dprotected Point2Dprotected doublevoidprotected voidvoidBegins handling of the drag.voidprotected 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 voidsetViewSource(Point2D source) protected booleanwasClick()Methods inherited from class AbstractCursorTool
add, allowSnapping, cancelGesture, check, cleanup, clearImage, clearShape, componentWithFocusIsHandledByCursorTools, createCursor, createCursor, createCursor, createStandardSnappingPolicies, deactivate, drawImageXOR, drawImageXOR, drawShapeXOR, drawShapeXOR, execute, execute, fireGestureFinished, gestureFinished, getColor, getCursor, 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, wasShiftPressedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CursorTool
getIcon
-
Field Details
-
DEFAULT_VIEW_CLICK_BUFFER
public static final int DEFAULT_VIEW_CLICK_BUFFER- See Also:
-
modelSource
protected org.locationtech.jts.geom.Coordinate modelSourceModify using #setSource -
modelDestination
protected org.locationtech.jts.geom.Coordinate modelDestinationModify using #setDestination -
coordinates
-
-
Constructor Details
-
ConstrainedDragTool
-
-
Method Details
-
mousePressed
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
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classAbstractCursorTool
-
doConstraint
protected org.locationtech.jts.geom.Coordinate doConstraint(MouseEvent e) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
getCoordinates
-
mouseLocationChanged
-
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
- Throws:
NoninvertibleTransformException
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classAbstractCursorTool
-
getShape
- Specified by:
getShapein classAbstractCursorTool- Returns:
- null if nothing should be drawn
- Throws:
Exception- if an Exception occurs during Shape construction
-
getViewSource
- Throws:
NoninvertibleTransformException
-
getViewDestination
- Throws:
NoninvertibleTransformException
-
getShape
-
activate
- Specified by:
activatein interfaceCursorTool- Overrides:
activatein classAbstractCursorTool
-