Class ConstrainedMultiClickTool
- java.lang.Object
-
- com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
-
- org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedMultiClickTool
-
- All Implemented Interfaces:
CursorTool,MouseListener,MouseMotionListener,EventListener
- Direct Known Subclasses:
ConstrainedMultiClickArcTool,ConstrainedNClickTool,ConstrainedNClickTool,ConstrainedPolygonTool,DrawConstrainedCircleTool,DrawConstrainedLineStringTool
public abstract class ConstrainedMultiClickTool extends AbstractCursorTool
A VisualIndicatorTool that allows the user to draw shapes with multiple vertices. Double-clicking ends the gesture.
-
-
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 Listcoordinatesprotected booleandrawClosedprotected PointmouseLastLocprotected org.locationtech.jts.geom.CoordinatetentativeCoordinate-
Fields inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
isLinuxOS, panel
-
-
Constructor Summary
Constructors Constructor Description ConstrainedMultiClickTool(WorkbenchContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(LayerViewPanel layerViewPanel)protected voidadd(org.locationtech.jts.geom.Coordinate c)voidcancelGesture()Notifies the CursorTool that a party is requesting that the gesture currently in progress be aborted.voiddeactivate()protected org.locationtech.jts.geom.CoordinatedoConstraint(MouseEvent e)protected voidfinishGesture()ListgetCoordinates()Will return an empty List once the shape is cleared.protected org.locationtech.jts.geom.CoordinategetIntersection(org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p2, org.locationtech.jts.geom.Coordinate p3, org.locationtech.jts.geom.Coordinate p4)protected ShapegetShape()protected booleanisFinishingRelease(MouseEvent e)voidmouseDragged(MouseEvent e)protected voidmouseLocationChanged(MouseEvent e)voidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)protected org.locationtech.jts.geom.Coordinate[]toArray(List coordinates)-
Methods inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
add, allowSnapping, check, cleanup, clearImage, clearShape, componentWithFocusIsHandledByCursorTools, createCursor, createCursor, createCursor, createStandardSnappingPolicies, 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, name, prohibitSnapping, redrawImage, redrawShape, reportNothingToUndoYet, setColor, setControlPressed, setFilling, setPanel, setShiftPressed, setStroke, setup, snap, snap, supportsSnapping, toString, wasControlPressed, wasShiftPressed
-
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
-
-
-
-
Constructor Detail
-
ConstrainedMultiClickTool
public ConstrainedMultiClickTool(WorkbenchContext context)
-
-
Method Detail
-
getCoordinates
public List getCoordinates()
Will return an empty List once the shape is cleared.- See Also:
AbstractCursorTool.clearShape()
-
cancelGesture
public void cancelGesture()
Description copied from interface:CursorToolNotifies the CursorTool that a party is requesting that the gesture currently in progress be aborted.- Specified by:
cancelGesturein interfaceCursorTool- Overrides:
cancelGesturein classAbstractCursorTool
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classAbstractCursorTool
-
doConstraint
protected org.locationtech.jts.geom.Coordinate doConstraint(MouseEvent e) throws NoninvertibleTransformException
- Throws:
NoninvertibleTransformException
-
mouseLocationChanged
protected void mouseLocationChanged(MouseEvent e)
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classAbstractCursorTool
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classAbstractCursorTool
-
add
protected void add(org.locationtech.jts.geom.Coordinate c)
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classAbstractCursorTool
-
getShape
protected Shape getShape() throws NoninvertibleTransformException
- Specified by:
getShapein classAbstractCursorTool- Returns:
- null if nothing should be drawn
- Throws:
NoninvertibleTransformException
-
isFinishingRelease
protected boolean isFinishingRelease(MouseEvent e)
-
toArray
protected org.locationtech.jts.geom.Coordinate[] toArray(List coordinates)
-
deactivate
public void deactivate()
- Specified by:
deactivatein interfaceCursorTool- Overrides:
deactivatein classAbstractCursorTool
-
getIntersection
protected org.locationtech.jts.geom.Coordinate getIntersection(org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p2, org.locationtech.jts.geom.Coordinate p3, org.locationtech.jts.geom.Coordinate p4)
-
activate
public void activate(LayerViewPanel layerViewPanel)
- Specified by:
activatein interfaceCursorTool- Overrides:
activatein classAbstractCursorTool
-
-