All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.standard.SegmentLocator

CH.ifa.draw.standard.AbstractLocator
   |
   +----CH.ifa.draw.standard.SegmentLocator

public abstract class SegmentLocator
extends AbstractLocator
A SegmentLocator defines some basic functionality for locators that are associated to a segment of a polyline rather than just the display box of the polyline.


Variable Index

 o fAttachment
 o fSegment

Constructor Index

 o SegmentLocator(PolyLineFigure, Figure)
 o SegmentLocator(PolyLineFigure, Figure, int)

Method Index

 o findLocation(Point, Point)
 o findSegment(PolyLineFigure, Figure)
return the segment of pLine that is closest to the figure attachment.
 o getLocatedFigure()
Returns the located figure.
 o locate(Figure)
Find a location for the located figure relative to the figure owner.
 o updateSegment(PolyLineFigure)
Make sure that fSegment is in range [0,pointCount()-2].

Variables

 o fSegment
 protected int fSegment
 o fAttachment
 protected Figure fAttachment

Constructors

 o SegmentLocator
 public SegmentLocator(PolyLineFigure pLine,
                       Figure attachment)
 o SegmentLocator
 public SegmentLocator(PolyLineFigure pLine,
                       Figure attachment,
                       int segment)

Methods

 o findSegment
 public static int findSegment(PolyLineFigure pLine,
                               Figure attachment)
return the segment of pLine that is closest to the figure attachment.

 o updateSegment
 protected void updateSegment(PolyLineFigure pLine)
Make sure that fSegment is in range [0,pointCount()-2].

 o locate
 public Point locate(Figure owner)
Find a location for the located figure relative to the figure owner.

Overrides:
locate in class AbstractLocator
 o findLocation
 protected abstract Point findLocation(Point p1,
                                       Point p2)
 o getLocatedFigure
 public Figure getLocatedFigure()
Returns the located figure.


All Packages  Class Hierarchy  This Package  Previous  Next  Index