Class FeatureDrawingUtil
- java.lang.Object
-
- com.vividsolutions.jump.workbench.ui.cursortool.editing.FeatureDrawingUtil
-
public class FeatureDrawingUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Feature>featsToAdd
-
Constructor Summary
Constructors Constructor Description FeatureDrawingUtil(LayerNamePanelProxy layerNamePanelProxy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.LineStringconcatLineStrings(org.locationtech.jts.geom.LineString ls1, org.locationtech.jts.geom.LineString ls2)UndoableCommandcreateAddCommand(org.locationtech.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.voiddrawLineString(org.locationtech.jts.geom.LineString newLineString, boolean rollingBackInvalidEdits, AbstractCursorTool tool, LayerViewPanel panel)Implement the special check for adding to the end of a selected LineStringvoiddrawRing(org.locationtech.jts.geom.Polygon polygon, boolean rollingBackInvalidEdits, AbstractCursorTool tool, LayerViewPanel panel)org.locationtech.jts.geom.LineStringmergeLineStrings(org.locationtech.jts.geom.LineString ls1, org.locationtech.jts.geom.LineString ls2)CursorToolprepare(AbstractCursorTool drawFeatureTool, boolean allowSnapping)Apply settings common to all feature-drawing tools.createAddCommandorg.locationtech.jts.geom.LineStringreverse(org.locationtech.jts.geom.LineString lineString)voidselectGeometry(LayerViewPanel panel, org.locationtech.jts.geom.Geometry geom)
-
-
-
Constructor Detail
-
FeatureDrawingUtil
public FeatureDrawingUtil(LayerNamePanelProxy layerNamePanelProxy)
-
-
Method Detail
-
createAddCommand
public UndoableCommand createAddCommand(org.locationtech.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.createAddCommand
-
drawRing
public void drawRing(org.locationtech.jts.geom.Polygon polygon, boolean rollingBackInvalidEdits, AbstractCursorTool tool, LayerViewPanel panel)
-
reverse
public org.locationtech.jts.geom.LineString reverse(org.locationtech.jts.geom.LineString lineString)
- Parameters:
lineString- to reverse- Returns:
- new LineString made from old LineString's points in reverse order
-
concatLineStrings
public org.locationtech.jts.geom.LineString concatLineStrings(org.locationtech.jts.geom.LineString ls1, org.locationtech.jts.geom.LineString ls2)- Parameters:
ls1- first LineString to concatenatels2- second LineString to concatenate- Returns:
- new LineString made of (first - last point) + second
-
mergeLineStrings
public org.locationtech.jts.geom.LineString mergeLineStrings(org.locationtech.jts.geom.LineString ls1, org.locationtech.jts.geom.LineString ls2)- Parameters:
ls1- first LineString to mergels2- second LineString to merge- Returns:
- merged LineString if end point in common, otherwise return second LineString
-
drawLineString
public void drawLineString(org.locationtech.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 selectedrollingBackInvalidEdits- true to rollback invalid editstool- AbstractCursorTool - the current cursor toolpanel- LayerViewPanel
-
selectGeometry
public void selectGeometry(LayerViewPanel panel, org.locationtech.jts.geom.Geometry geom)
-
-