diva.canvas.interactor
Class PathGeometry.CloseSegment

java.lang.Object
  extended by diva.canvas.AbstractSite
      extended by diva.canvas.interactor.PathGeometry.Vertex
          extended by diva.canvas.interactor.PathGeometry.CloseSegment
All Implemented Interfaces:
Site
Enclosing class:
PathGeometry

public class PathGeometry.CloseSegment
extends PathGeometry.Vertex

CloseSegment is a special type of Vertex, that closes a sub-path. CloseSegments will be returned in the iterators over vertices, but clients must be aware of this, and not (for example) create grab-handles on them. The coordinates returned by a CloseSegment will be the coordinates of the first vertex in that subpath, but generally this should not be used as it is inefficient.


Field Summary
 
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
 
Constructor Summary
PathGeometry.CloseSegment(int id)
          Create a new close segment with the given ID
 
Method Summary
 double getX()
          Get the x-coordinate of the site, in the local coordinates of the containing pane
 double getY()
          Get the y-coordinate of the site, in the local coordinates of the containing pane.
 void setPoint(java.awt.geom.Point2D point)
          Set the point location of the site
 void translate(double x, double y)
          Translate the site by the indicated distance.
 
Methods inherited from class diva.canvas.interactor.PathGeometry.Vertex
getControlPoint, getFigure, getID, toString
 
Methods inherited from class diva.canvas.AbstractSite
getNormal, getPoint, getPoint, getPoint, getPoint, getTransformContext, hasNormal, isNormal, setNormal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathGeometry.CloseSegment

PathGeometry.CloseSegment(int id)
Create a new close segment with the given ID

Method Detail

getX

public double getX()
Get the x-coordinate of the site, in the local coordinates of the containing pane

Specified by:
getX in interface Site
Overrides:
getX in class PathGeometry.Vertex

getY

public double getY()
Get the y-coordinate of the site, in the local coordinates of the containing pane.

Specified by:
getY in interface Site
Overrides:
getY in class PathGeometry.Vertex

setPoint

public void setPoint(java.awt.geom.Point2D point)
Set the point location of the site

Overrides:
setPoint in class PathGeometry.Vertex

translate

public void translate(double x,
                      double y)
Translate the site by the indicated distance. This is an illegal operation for close segments and throws an exception.

Specified by:
translate in interface Site
Overrides:
translate in class PathGeometry.Vertex