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 List
coordinates
protected boolean
drawClosed
protected Point
mouseLastLoc
protected org.locationtech.jts.geom.Coordinate
tentativeCoordinate
-
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 void
activate(LayerViewPanel layerViewPanel)
protected void
add(org.locationtech.jts.geom.Coordinate c)
void
cancelGesture()
Notifies the CursorTool that a party is requesting that the gesture currently in progress be aborted.void
deactivate()
protected org.locationtech.jts.geom.Coordinate
doConstraint(MouseEvent e)
protected void
finishGesture()
List
getCoordinates()
Will return an empty List once the shape is cleared.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)
protected Shape
getShape()
protected boolean
isFinishingRelease(MouseEvent e)
void
mouseDragged(MouseEvent e)
protected void
mouseLocationChanged(MouseEvent e)
void
mouseMoved(MouseEvent e)
void
mousePressed(MouseEvent e)
void
mouseReleased(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:CursorTool
Notifies the CursorTool that a party is requesting that the gesture currently in progress be aborted.- Specified by:
cancelGesture
in interfaceCursorTool
- Overrides:
cancelGesture
in classAbstractCursorTool
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in 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:
mouseMoved
in interfaceMouseMotionListener
- Overrides:
mouseMoved
in classAbstractCursorTool
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classAbstractCursorTool
-
add
protected void add(org.locationtech.jts.geom.Coordinate c)
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classAbstractCursorTool
-
getShape
protected Shape getShape() throws NoninvertibleTransformException
- Specified by:
getShape
in 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:
deactivate
in interfaceCursorTool
- Overrides:
deactivate
in 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:
activate
in interfaceCursorTool
- Overrides:
activate
in classAbstractCursorTool
-
-