net.refractions.udig.tools.edit.support
Class EditGeom

java.lang.Object
  extended by net.refractions.udig.tools.edit.support.EditGeom
All Implemented Interfaces:
java.lang.Iterable<PrimitiveShape>

public class EditGeom
extends java.lang.Object
implements java.lang.Iterable<PrimitiveShape>

Models a geometry as required by the PixelCoordMap.

Since:
1.1.0
Author:
jones

Constructor Summary
EditGeom(EditBlackboard owner, java.lang.String featureId2)
          It is recommended to use constructor with bounds.
EditGeom(EditBlackboard owner, java.lang.String featureId, Envelope featureBounds)
           
EditGeom(EditGeom geom)
           
 
Method Summary
 void assertValid()
           
 Selection createSelection()
           
 ClosestEdge getClosestEdge(Point point, boolean treatUnknownAsPolygon)
          gets the closest edge in the geometry to the point.
 EditBlackboard getEditBlackboard()
           
 Envelope getFeatureEnvelope()
          Returns an old bounding box of the feature whose geometry is wrapped by EditGeom before any editing.
 java.util.concurrent.atomic.AtomicReference<java.lang.String> getFeatureIDRef()
           
 java.util.List<PrimitiveShape> getHoles()
          User is expected to add holes as needed.
 ShapeType getShapeType()
           
 PrimitiveShape getShell()
           
 boolean hasVertex(Point point)
           
 boolean isChanged()
          Indicates that this geometry has been modified since it has been in the blackboard.
 java.util.Iterator<PrimitiveShape> iterator()
           
 PrimitiveShape newHole()
           
 Point overVertex(Point point, int radius)
           
 void setChanged(boolean changed)
          This method signals the in-memory state of EditGeom with respect to the actual feature in datastore.
 void setShapeType(ShapeType shapeType)
          This is a thread-safe method
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditGeom

public EditGeom(EditBlackboard owner,
                java.lang.String featureId2)
It is recommended to use constructor with bounds.

Parameters:
owner -
featureId2 -

EditGeom

public EditGeom(EditBlackboard owner,
                java.lang.String featureId,
                Envelope featureBounds)
Parameters:
owner -
featureId -
featureBounds -

EditGeom

public EditGeom(EditGeom geom)
Method Detail

getShell

public PrimitiveShape getShell()

getHoles

public java.util.List<PrimitiveShape> getHoles()
User is expected to add holes as needed.

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

newHole

public PrimitiveShape newHole()

getFeatureIDRef

public java.util.concurrent.atomic.AtomicReference<java.lang.String> getFeatureIDRef()
Returns:
Returns the featureID.

getShapeType

public ShapeType getShapeType()
Returns:
Returns the shape type.

setShapeType

public void setShapeType(ShapeType shapeType)
This is a thread-safe method

Parameters:
type - The new shape type.

iterator

public java.util.Iterator<PrimitiveShape> iterator()
Specified by:
iterator in interface java.lang.Iterable<PrimitiveShape>

getEditBlackboard

public EditBlackboard getEditBlackboard()
Returns:
Returns the owner.

getFeatureEnvelope

public Envelope getFeatureEnvelope()
Returns an old bounding box of the feature whose geometry is wrapped by EditGeom before any editing.

Returns:
Returns an old bounding box of the feature

isChanged

public boolean isChanged()
Indicates that this geometry has been modified since it has been in the blackboard.

Returns:
true if the geometry has been modified while on the blackboard.

setChanged

public void setChanged(boolean changed)
This method signals the in-memory state of EditGeom with respect to the actual feature in datastore.

  • true value means that the geometry is changed but not up-to-date with datastore's feature geometry.
  • false value means that the geometry is up-to-date with datastore's feature geometry.

    Parameters:
    changed -

  • createSelection

    public Selection createSelection()

    assertValid

    public void assertValid()

    hasVertex

    public boolean hasVertex(Point point)

    getClosestEdge

    public ClosestEdge getClosestEdge(Point point,
                                      boolean treatUnknownAsPolygon)
    gets the closest edge in the geometry to the point.

    Parameters:
    point - reference point
    treatUnknownAsPolygon - declares whether to treat geometries of type UNKNOWN as a polygon
    Returns:

    overVertex

    public Point overVertex(Point point,
                            int radius)