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

java.lang.Object
  extended by net.refractions.udig.tools.edit.support.AbstractPathIterator
      extended by net.refractions.udig.tools.edit.support.EditGeomPathIterator
          extended by net.refractions.udig.tools.edit.support.CurrentEditGeomPathIterator
All Implemented Interfaces:
java.awt.geom.PathIterator

public class CurrentEditGeomPathIterator
extends EditGeomPathIterator

Extends EditGeomPathIterator so that

Since:
1.1.0
Author:
jones

Field Summary
 
Fields inherited from class net.refractions.udig.tools.edit.support.EditGeomPathIterator
isPolygon
 
Fields inherited from class net.refractions.udig.tools.edit.support.AbstractPathIterator
currentPoint, currentShape, geom, nextPoint, points
 
Fields inherited from interface java.awt.geom.PathIterator
SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO
 
Constructor Summary
protected CurrentEditGeomPathIterator(EditGeom shape)
           
 
Method Summary
protected  java.awt.Shape createPoint()
          Called if there is only a single point in the geom.
protected  Path createPointPath(Device device)
           
 int currentSegment(float[] coords)
           
 Point getLocation()
           
static CurrentEditGeomPathIterator getPathIterator(EditGeom geom)
           
 boolean isDone()
           
 void next()
           
 void setLocation(Point location, PrimitiveShape shape)
           
 Path toPath(Device device)
           
 java.awt.Shape toShape()
          Returns a shape that can be draw.
 
Methods inherited from class net.refractions.udig.tools.edit.support.EditGeomPathIterator
dispose, isClosed, isPolygon, setPolygon
 
Methods inherited from class net.refractions.udig.tools.edit.support.AbstractPathIterator
currentSegment, getWindingRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentEditGeomPathIterator

protected CurrentEditGeomPathIterator(EditGeom shape)
Method Detail

getPathIterator

public static CurrentEditGeomPathIterator getPathIterator(EditGeom geom)

isDone

public boolean isDone()
Specified by:
isDone in interface java.awt.geom.PathIterator
Overrides:
isDone in class AbstractPathIterator

toShape

public java.awt.Shape toShape()
Description copied from class: AbstractPathIterator
Returns a shape that can be draw.

It is recommended to call getShape() every time a draw is needed because the shape does not update if the EditGeom is updated between draws. getShape is guaranteed to get a shape that is representative of the current state of geom.

Overrides:
toShape in class AbstractPathIterator
Returns:

toPath

public Path toPath(Device device)
Overrides:
toPath in class AbstractPathIterator

createPoint

protected java.awt.Shape createPoint()
Description copied from class: AbstractPathIterator
Called if there is only a single point in the geom. Default behaviour is to return a small square. If null is returned then this PathIterator will be used to create a geometry.

Overrides:
createPoint in class AbstractPathIterator
Returns:
a shape to draw or null if PathIterator should be used to create a shape.

createPointPath

protected Path createPointPath(Device device)
Overrides:
createPointPath in class AbstractPathIterator

next

public void next()
Specified by:
next in interface java.awt.geom.PathIterator
Overrides:
next in class AbstractPathIterator

currentSegment

public int currentSegment(float[] coords)
Specified by:
currentSegment in interface java.awt.geom.PathIterator
Overrides:
currentSegment in class EditGeomPathIterator

getLocation

public Point getLocation()
Returns:
Returns the location.

setLocation

public void setLocation(Point location,
                        PrimitiveShape shape)
Parameters:
location - The location to set.
shape - if null then