org.jhotdraw.draw.locator
Class BezierLabelLocator
- java.lang.Object
-
- org.jhotdraw.draw.locator.BezierLabelLocator
-
- All Implemented Interfaces:
- Locator, DOMStorable
public class BezierLabelLocator extends java.lang.Object implements Locator, DOMStorable
ALocatorwhich can be used to place a label on the path of aBezierFigure.The point is located at a distance and an angle relative to the total length of the bezier path.
XXX - The angle should be perpendicular to the path.
-
-
Constructor Summary
Constructors Constructor and Description BezierLabelLocator()Creates a new instance.BezierLabelLocator(double relativePosition, double angle, double distance)Creates a new locator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.geom.Point2D.DoublegetRelativeLabelPoint(BezierFigure owner, Figure label)Returns a Point2D.Double on the polyline that is at the provided relative position.java.awt.geom.Point2D.DoublegetRelativePoint(BezierFigure owner)Returns the coordinates of the relative point on the path of the specified bezier figure.java.awt.geom.Point2D.Doublelocate(Figure owner)Locates a position on the provided figure.java.awt.geom.Point2D.Doublelocate(Figure owner, Figure label)Locates a position on the provided figure relative to the dependent figure.voidread(DOMInput in)voidwrite(DOMOutput out)
-
-
-
Constructor Detail
-
BezierLabelLocator
public BezierLabelLocator()
Creates a new instance. This constructor is for use by DOMStorable only.
-
BezierLabelLocator
public BezierLabelLocator(double relativePosition, double angle, double distance)Creates a new locator.- Parameters:
relativePosition- The relative position of the label on the polyline. 0.0 specifies the start of the bezier path, 1.0 the end of the polyline. Values between 0.0 and 1.0 are relative positions on the bezier path.angle- The angle of the distance vector.distance- The length of the distance vector.
-
-
Method Detail
-
locate
public java.awt.geom.Point2D.Double locate(Figure owner)
Description copied from interface:LocatorLocates a position on the provided figure.
-
locate
public java.awt.geom.Point2D.Double locate(Figure owner, Figure label)
Description copied from interface:LocatorLocates a position on the provided figure relative to the dependent figure.
-
getRelativePoint
public java.awt.geom.Point2D.Double getRelativePoint(BezierFigure owner)
Returns the coordinates of the relative point on the path of the specified bezier figure.
-
getRelativeLabelPoint
public java.awt.geom.Point2D.Double getRelativeLabelPoint(BezierFigure owner, Figure label)
Returns a Point2D.Double on the polyline that is at the provided relative position. XXX - Implement this and move it to BezierPath
-
read
public void read(DOMInput in)
- Specified by:
readin interfaceDOMStorable
-
write
public void write(DOMOutput out)
- Specified by:
writein interfaceDOMStorable
-
-
DataMelt 3.0 © DataMelt by jWork.ORG