Class DrawCustomTool
- java.lang.Object
-
- com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
-
- org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedMultiClickTool
-
- org.openjump.util.python.pythonexampleclasses.ConstrainedNClickTool
-
- org.openjump.util.python.pythonexampleclasses.DrawCustomTool
-
- All Implemented Interfaces:
CursorTool,MouseListener,MouseMotionListener,EventListener
public class DrawCustomTool extends ConstrainedNClickTool
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDrawCustomTool.ActivationListenerclassDrawCustomTool.CustomToolEventstatic interfaceDrawCustomTool.DeActivationListenerstatic interfaceDrawCustomTool.FeedbackListenerstatic interfaceDrawCustomTool.FinalDrawListener-
Nested classes/interfaces inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
AbstractCursorTool.Listener
-
-
Field Summary
-
Fields inherited from class org.openjump.util.python.pythonexampleclasses.ConstrainedNClickTool
n
-
Fields inherited from class org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedMultiClickTool
coordinates, drawClosed, mouseLastLoc, tentativeCoordinate
-
Fields inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
isLinuxOS, panel
-
-
Constructor Summary
Constructors Constructor Description DrawCustomTool(WorkbenchContext context, FeatureDrawingUtil featureDrawingUtil)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(LayerViewPanel layerViewPanel)voiddeactivate()protected ListfireFeedbackEvent(List coordsIn)protected ListfireFinalGeoEvent(List coordsIn)protected voidgestureFinished()protected org.locationtech.jts.geom.GeometrygetFinalGeometry()IcongetIcon()StringgetName()Returns a very brief description of this CursorTool.protected ShapegetShape()voidsetActivationListener(DrawCustomTool.ActivationListener listener)voidsetDeActivationListener(DrawCustomTool.DeActivationListener listener)voidsetFeedbackListener(DrawCustomTool.FeedbackListener listener)voidsetFinalGeoListener(DrawCustomTool.FinalDrawListener listener)voidsetFireClicks(int fireClicks)voidsetGeometryType(String geoType)voidsetIcon(Icon icon)voidsetMaxClicks(int maxClicks)voidsetMinClicks(int minClicks)voidsetStrokeWidth(int width)voidsetToolName(String toolName)-
Methods inherited from class org.openjump.util.python.pythonexampleclasses.ConstrainedNClickTool
getModelDestination, getModelSource, isFinishingRelease
-
Methods inherited from class org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedMultiClickTool
add, cancelGesture, doConstraint, finishGesture, getCoordinates, getIntersection, mouseDragged, mouseLocationChanged, mouseMoved, mousePressed, mouseReleased, toArray
-
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, getColor, getCursor, getImage, getImagePosition, 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
-
-
-
-
Constructor Detail
-
DrawCustomTool
public DrawCustomTool(WorkbenchContext context, FeatureDrawingUtil featureDrawingUtil)
-
-
Method Detail
-
activate
public void activate(LayerViewPanel layerViewPanel)
- Specified by:
activatein interfaceCursorTool- Overrides:
activatein classConstrainedMultiClickTool
-
deactivate
public void deactivate()
- Specified by:
deactivatein interfaceCursorTool- Overrides:
deactivatein classConstrainedMultiClickTool
-
setFireClicks
public void setFireClicks(int fireClicks)
-
setMinClicks
public void setMinClicks(int minClicks)
-
setMaxClicks
public void setMaxClicks(int maxClicks)
-
setIcon
public void setIcon(Icon icon)
-
setToolName
public void setToolName(String toolName)
-
setGeometryType
public void setGeometryType(String geoType)
-
setStrokeWidth
public void setStrokeWidth(int width)
-
setFeedbackListener
public void setFeedbackListener(DrawCustomTool.FeedbackListener listener)
-
setFinalGeoListener
public void setFinalGeoListener(DrawCustomTool.FinalDrawListener listener)
-
setActivationListener
public void setActivationListener(DrawCustomTool.ActivationListener listener)
-
setDeActivationListener
public void setDeActivationListener(DrawCustomTool.DeActivationListener listener)
-
getName
public String getName()
Description copied from interface:CursorToolReturns a very brief description of this CursorTool.- Specified by:
getNamein interfaceCursorTool- Overrides:
getNamein classAbstractCursorTool- Returns:
- the name of this CursorTool
-
getIcon
public Icon getIcon()
- Returns:
- null to use a default icon
-
gestureFinished
protected void gestureFinished() throws Exception- Specified by:
gestureFinishedin classAbstractCursorTool- Throws:
Exception
-
getShape
protected Shape getShape() throws NoninvertibleTransformException
- Overrides:
getShapein classConstrainedMultiClickTool- Returns:
- null if nothing should be drawn
- Throws:
NoninvertibleTransformException
-
getFinalGeometry
protected org.locationtech.jts.geom.Geometry getFinalGeometry() throws NoninvertibleTransformException- Throws:
NoninvertibleTransformException
-
-