com.vividsolutions.jump.workbench.ui.cursortool.editing
Class FeatureDrawingUtil

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.cursortool.editing.FeatureDrawingUtil

public class FeatureDrawingUtil
extends java.lang.Object


Constructor Summary
FeatureDrawingUtil(LayerNamePanelProxy layerNamePanelProxy)
           
 
Method Summary
 com.vividsolutions.jts.geom.LineString concatLineStrings(com.vividsolutions.jts.geom.LineString ls1, com.vividsolutions.jts.geom.LineString ls2)
           
 UndoableCommand createAddCommand(com.vividsolutions.jts.geom.Geometry geometry, boolean rollingBackInvalidEdits, LayerViewPanel layerViewPanel, AbstractCursorTool tool)
          The calling CursorTool should call #preserveUndoHistory; otherwise the undo history will be (unnecessarily) truncated if a problem occurs.
 void drawLineString(com.vividsolutions.jts.geom.LineString newLineString, boolean rollingBackInvalidEdits, AbstractCursorTool tool, LayerViewPanel panel)
          Implement the special check for adding to the end of a selected LineString
 void drawRing(com.vividsolutions.jts.geom.Polygon polygon, boolean rollingBackInvalidEdits, AbstractCursorTool tool, LayerViewPanel panel)
           
 com.vividsolutions.jts.geom.LineString mergeLineStrings(com.vividsolutions.jts.geom.LineString ls1, com.vividsolutions.jts.geom.LineString ls2)
           
 CursorTool prepare(AbstractCursorTool drawFeatureTool, boolean allowSnapping)
          Apply settings common to all feature-drawing tools.
 com.vividsolutions.jts.geom.LineString reverse(com.vividsolutions.jts.geom.LineString lineString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureDrawingUtil

public FeatureDrawingUtil(LayerNamePanelProxy layerNamePanelProxy)
Method Detail

createAddCommand

public UndoableCommand createAddCommand(com.vividsolutions.jts.geom.Geometry geometry,
                                        boolean rollingBackInvalidEdits,
                                        LayerViewPanel layerViewPanel,
                                        AbstractCursorTool tool)
The calling CursorTool should call #preserveUndoHistory; otherwise the undo history will be (unnecessarily) truncated if a problem occurs.

Returns:
null if the geometry is invalid

prepare

public CursorTool prepare(AbstractCursorTool drawFeatureTool,
                          boolean allowSnapping)
Apply settings common to all feature-drawing tools.


drawRing

public void drawRing(com.vividsolutions.jts.geom.Polygon polygon,
                     boolean rollingBackInvalidEdits,
                     AbstractCursorTool tool,
                     LayerViewPanel panel)

reverse

public com.vividsolutions.jts.geom.LineString reverse(com.vividsolutions.jts.geom.LineString lineString)
Parameters:
lineString - to reverse
Returns:
new LineString made from old LineString's points in reverse order

concatLineStrings

public com.vividsolutions.jts.geom.LineString concatLineStrings(com.vividsolutions.jts.geom.LineString ls1,
                                                                com.vividsolutions.jts.geom.LineString ls2)
Parameters:
ls1 - first LineString to concatenate
ls2 - second LineString to concatenate
Returns:
new LineString made of (first - last point) + second

mergeLineStrings

public com.vividsolutions.jts.geom.LineString mergeLineStrings(com.vividsolutions.jts.geom.LineString ls1,
                                                               com.vividsolutions.jts.geom.LineString ls2)
Parameters:
ls1 - first LineString to merge
ls2 - second LineString to merge
Returns:
merged LineString if end point in common, otherwise return second LineString

drawLineString

public void drawLineString(com.vividsolutions.jts.geom.LineString newLineString,
                           boolean rollingBackInvalidEdits,
                           AbstractCursorTool tool,
                           LayerViewPanel panel)
Implement the special check for adding to the end of a selected LineString

Parameters:
newLineString - LineString to create or add to selected
rollingBackInvalidEdits -
tool - AbstractCursorTool - the current cursor tool
panel - LayerViewPanel