Class FeatureDrawingUtil

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

public class FeatureDrawingUtil extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • 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 concatenate
      ls2 - 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 merge
      ls2 - 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 selected
      rollingBackInvalidEdits - true to rollback invalid edits
      tool - AbstractCursorTool - the current cursor tool
      panel - LayerViewPanel
    • selectGeometry

      public void selectGeometry(LayerViewPanel panel, org.locationtech.jts.geom.Geometry geom)