org.openjump.util.python.pythonexampleclasses
Class DrawCustomTool

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
      extended by org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedMultiClickTool
          extended by org.openjump.util.python.pythonexampleclasses.ConstrainedNClickTool
              extended by org.openjump.util.python.pythonexampleclasses.DrawCustomTool
All Implemented Interfaces:
CursorTool, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class DrawCustomTool
extends ConstrainedNClickTool


Nested Class Summary
static interface DrawCustomTool.ActivationListener
           
 class DrawCustomTool.CustomToolEvent
           
static interface DrawCustomTool.DeActivationListener
           
static interface DrawCustomTool.FeedbackListener
           
static interface DrawCustomTool.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, tentativeCoordinate
 
Constructor Summary
DrawCustomTool(FeatureDrawingUtil featureDrawingUtil)
           
 
Method Summary
 void activate(LayerViewPanel layerViewPanel)
           
 void deactivate()
           
protected  java.util.List fireFeedbackEvent(java.util.List coordsIn)
           
protected  java.util.List fireFinalGeoEvent(java.util.List coordsIn)
           
protected  void gestureFinished()
           
protected  com.vividsolutions.jts.geom.Geometry getFinalGeometry()
           
 javax.swing.Icon getIcon()
           
 java.lang.String getName()
          Returns a very brief description of this CursorTool.
protected  java.awt.Shape getShape()
           
 void setActivationListener(DrawCustomTool.ActivationListener listener)
           
 void setDeActivationListener(DrawCustomTool.DeActivationListener listener)
           
 void setFeedbackListener(DrawCustomTool.FeedbackListener listener)
           
 void setFinalGeoListener(DrawCustomTool.FinalDrawListener listener)
           
 void setFireClicks(int fireClicks)
           
 void setGeometryType(java.lang.String geoType)
           
 void setIcon(javax.swing.Icon icon)
           
 void setMaxClicks(int maxClicks)
           
 void setMinClicks(int minClicks)
           
 void setStrokeWidth(int width)
           
 void setToolName(java.lang.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, isRightMouseButtonUsed, mouseDragged, mouseLocationChanged, mouseMoved, mousePressed, mouseReleased, toArray
 
Methods inherited from class com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool
add, allowSnapping, check, cleanup, clearShape, createCursor, createCursor, createStandardSnappingPolicies, drawShapeXOR, drawShapeXOR, execute, fireGestureFinished, getColor, getCursor, getPanel, getSnapManager, getTaskFrame, getWorkbench, isGestureInProgress, isRollingBackInvalidEdits, isShapeOnScreen, mouseClicked, mouseEntered, mouseExited, name, redrawShape, reportNothingToUndoYet, setColor, setFilling, setStroke, 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
 

Constructor Detail

DrawCustomTool

public DrawCustomTool(FeatureDrawingUtil featureDrawingUtil)
Method Detail

activate

public void activate(LayerViewPanel layerViewPanel)
Specified by:
activate in interface CursorTool
Overrides:
activate in class ConstrainedMultiClickTool

deactivate

public void deactivate()
Specified by:
deactivate in interface CursorTool
Overrides:
deactivate in class ConstrainedMultiClickTool

setFireClicks

public void setFireClicks(int fireClicks)

setMinClicks

public void setMinClicks(int minClicks)

setMaxClicks

public void setMaxClicks(int maxClicks)

setIcon

public void setIcon(javax.swing.Icon icon)

setToolName

public void setToolName(java.lang.String toolName)

setGeometryType

public void setGeometryType(java.lang.String geoType)

setStrokeWidth

public void setStrokeWidth(int width)
Overrides:
setStrokeWidth in class AbstractCursorTool

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 java.lang.String getName()
Description copied from interface: CursorTool
Returns a very brief description of this CursorTool.

Specified by:
getName in interface CursorTool
Overrides:
getName in class AbstractCursorTool
Returns:
the name of this CursorTool

getIcon

public javax.swing.Icon getIcon()
Returns:
null to use a default icon

gestureFinished

protected void gestureFinished()
                        throws java.lang.Exception
Specified by:
gestureFinished in class AbstractCursorTool
Throws:
java.lang.Exception

getShape

protected java.awt.Shape getShape()
                           throws java.awt.geom.NoninvertibleTransformException
Overrides:
getShape in class ConstrainedMultiClickTool
Returns:
null if nothing should be drawn
Throws:
java.awt.geom.NoninvertibleTransformException

getFinalGeometry

protected com.vividsolutions.jts.geom.Geometry getFinalGeometry()
                                                         throws java.awt.geom.NoninvertibleTransformException
Throws:
java.awt.geom.NoninvertibleTransformException

fireFeedbackEvent

protected java.util.List fireFeedbackEvent(java.util.List coordsIn)

fireFinalGeoEvent

protected java.util.List fireFinalGeoEvent(java.util.List coordsIn)