com.vividsolutions.jump.workbench.ui
Class GeometryEditor

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.GeometryEditor

public class GeometryEditor
extends java.lang.Object

Geometry objects are unmodifiable; this class allows you to "modify" a Geometry in a sense -- the modified Geometry is returned as a new Geometry. The new Geometry's #isValid should be checked.


Nested Class Summary
static interface GeometryEditor.GeometryEditorOperation
           
 
Constructor Summary
GeometryEditor()
           
 
Method Summary
 boolean containsReference(java.util.Collection collection, java.lang.Object o)
           
 com.vividsolutions.jts.geom.Geometry deleteVertices(com.vividsolutions.jts.geom.Geometry geometry, java.util.Collection vertices)
          Deletes the given vertices (matched using ==, not #equals).
 com.vividsolutions.jts.geom.Geometry edit(com.vividsolutions.jts.geom.Geometry geometry, GeometryEditor.GeometryEditorOperation operation)
           
 com.vividsolutions.jts.geom.Geometry insertVertex(com.vividsolutions.jts.geom.Geometry geometry, com.vividsolutions.jts.geom.Coordinate existing1, com.vividsolutions.jts.geom.Coordinate existing2, com.vividsolutions.jts.geom.Coordinate v)
          Inserts v on the line segment with endpoints equal to existing1 and existing2
 com.vividsolutions.jts.geom.Geometry insertVertex(com.vividsolutions.jts.geom.Geometry geometry, com.vividsolutions.jts.geom.Coordinate target, com.vividsolutions.jts.geom.Geometry ignoreSegmentsOutside)
          The vertex will be inserted at the point closest to the target.
 com.vividsolutions.jts.geom.Geometry remove(com.vividsolutions.jts.geom.Geometry g, com.vividsolutions.jts.geom.Geometry itemToRemove)
           
 com.vividsolutions.jts.geom.Geometry removeRepeatedPoints(com.vividsolutions.jts.geom.Geometry geometry)
          The input and output Geometries may share some Coordinate arrays.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryEditor

public GeometryEditor()
Method Detail

edit

public com.vividsolutions.jts.geom.Geometry edit(com.vividsolutions.jts.geom.Geometry geometry,
                                                 GeometryEditor.GeometryEditorOperation operation)

removeRepeatedPoints

public com.vividsolutions.jts.geom.Geometry removeRepeatedPoints(com.vividsolutions.jts.geom.Geometry geometry)
The input and output Geometries may share some Coordinate arrays.


remove

public com.vividsolutions.jts.geom.Geometry remove(com.vividsolutions.jts.geom.Geometry g,
                                                   com.vividsolutions.jts.geom.Geometry itemToRemove)
Returns:
null if parent == itemToRemove

insertVertex

public com.vividsolutions.jts.geom.Geometry insertVertex(com.vividsolutions.jts.geom.Geometry geometry,
                                                         com.vividsolutions.jts.geom.Coordinate target,
                                                         com.vividsolutions.jts.geom.Geometry ignoreSegmentsOutside)
The vertex will be inserted at the point closest to the target.


insertVertex

public com.vividsolutions.jts.geom.Geometry insertVertex(com.vividsolutions.jts.geom.Geometry geometry,
                                                         com.vividsolutions.jts.geom.Coordinate existing1,
                                                         com.vividsolutions.jts.geom.Coordinate existing2,
                                                         com.vividsolutions.jts.geom.Coordinate v)
Inserts v on the line segment with endpoints equal to existing1 and existing2


deleteVertices

public com.vividsolutions.jts.geom.Geometry deleteVertices(com.vividsolutions.jts.geom.Geometry geometry,
                                                           java.util.Collection vertices)
Deletes the given vertices (matched using ==, not #equals).


containsReference

public boolean containsReference(java.util.Collection collection,
                                 java.lang.Object o)