com.rolemodelsoft.drawlet.shapes.lines
Class LineFigureRelativePoint

java.lang.Object
  |
  +--com.rolemodelsoft.drawlet.basics.AbstractLocator
        |
        +--com.rolemodelsoft.drawlet.basics.FigureRelativePoint
              |
              +--com.rolemodelsoft.drawlet.shapes.lines.LineFigureRelativePoint

public class LineFigureRelativePoint
extends FigureRelativePoint

This class implements Locator by providing x and y coordinates that are relative to a point on a segment of LineFigure. Although it is assumed that the normal use will have these locators on the LineFigure, that is not necessary.

See Also:
Serialized Form

Field Summary
protected  int segment
          The 1-based index of the segment within the figure from which we will define our relative position.
 
Fields inherited from class com.rolemodelsoft.drawlet.basics.FigureRelativePoint
figure, offsetX, offsetY, relativeX, relativeY
 
Constructor Summary
LineFigureRelativePoint(LineFigure figure)
          Constructs and initializes a new instance of a locator which is relative to a point on a line
LineFigureRelativePoint(LineFigure figure, double relativeX, double relativeY)
          Constructs and initializes a new instance of a locator which is relative to a point on a line
LineFigureRelativePoint(LineFigure figure, double relativeX, double relativeY, int offsetX, int offsetY)
          Constructs and initializes a new instance of a locator which is relative to a point on a line
LineFigureRelativePoint(LineFigure figure, int segment, double relativeX, double relativeY)
          Constructs and initializes a new instance of a locator which is relative to a point on a line
LineFigureRelativePoint(LineFigure figure, int segment, double relativeX, double relativeY, int offsetX, int offsetY)
          Constructs and initializes a new instance of a locator which is relative to a point on a line
LineFigureRelativePoint(LineFigure figure, int offsetX, int offsetY)
          Constructs and initializes a new instance of a locator which is relative to a point on a line
LineFigureRelativePoint(LineFigure figure, int segment, int offsetX, int offsetY)
          Constructs and initializes a new instance of a locator which is relative to a point on a line
 
Method Summary
protected  double defaultRelativeX()
          Answer the default/initial value of relativeX.
protected  double defaultRelativeY()
          Answer the default/initial value of relativeY.
 int x()
          Answer the x coordinate.
 int y()
          Answer the y coordinate.
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.FigureRelativePoint
defaultOffsetX, defaultOffsetY, duplicate, duplicateIn, getFigure, postDuplicate, setFigure
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractLocator
r, theta, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

segment

protected int segment
The 1-based index of the segment within the figure from which we will define our relative position.
Constructor Detail

LineFigureRelativePoint

public LineFigureRelativePoint(LineFigure figure)
Constructs and initializes a new instance of a locator which is relative to a point on a line
Parameters:
figure - the figure to which the instance will be relative

LineFigureRelativePoint

public LineFigureRelativePoint(LineFigure figure,
                               double relativeX,
                               double relativeY)
Constructs and initializes a new instance of a locator which is relative to a point on a line
Parameters:
figure - the figure to which the instance will be relative
relativeX - the percentage of the length of the default segment at which to determine X
relativeY - the percentage of the length of the default segment at which to determine Y

LineFigureRelativePoint

public LineFigureRelativePoint(LineFigure figure,
                               double relativeX,
                               double relativeY,
                               int offsetX,
                               int offsetY)
Constructs and initializes a new instance of a locator which is relative to a point on a line
Parameters:
figure - the figure to which the instance will be relative
relativeX - the percentage of the length of the default segment at which to determine X
relativeY - the percentage of the length of the default segment at which to determine Y
offsetX - the offset (added to relative X) in the x direction
offsetY - the offset (added to relative Y) in the y direction

LineFigureRelativePoint

public LineFigureRelativePoint(LineFigure figure,
                               int segment,
                               double relativeX,
                               double relativeY)
Constructs and initializes a new instance of a locator which is relative to a point on a line
Parameters:
figure - the figure to which the instance will be relative
segment - the 1-based index of the specific segment which will be the basis of our relative location
relativeX - the percentage of the length of the segment at which to determine X
relativeY - the percentage of the length of the segment at which to determine Y

LineFigureRelativePoint

public LineFigureRelativePoint(LineFigure figure,
                               int segment,
                               double relativeX,
                               double relativeY,
                               int offsetX,
                               int offsetY)
Constructs and initializes a new instance of a locator which is relative to a point on a line
Parameters:
figure - the figure to which the instance will be relative
segment - the 1-based index of the specific segment which will be the basis of our relative location
relativeX - the percentage of the length of the segment at which to determine X
relativeY - the percentage of the length of the segment at which to determine Y
offsetX - the offset (added to relative X) in the x direction
offsetY - the offset (added to relative Y) in the y direction

LineFigureRelativePoint

public LineFigureRelativePoint(LineFigure figure,
                               int offsetX,
                               int offsetY)
Constructs and initializes a new instance of a locator which is relative to a point on a line
Parameters:
figure - the figure to which the instance will be relative
offsetX - the offset (added to default relative X) in the x direction
offsetY - the offset (added to default relative Y) in the y direction

LineFigureRelativePoint

public LineFigureRelativePoint(LineFigure figure,
                               int segment,
                               int offsetX,
                               int offsetY)
Constructs and initializes a new instance of a locator which is relative to a point on a line
Parameters:
figure - the figure to which the instance will be relative
segment - the 1-based index of the specific segment which will be the basis of our relative location
offsetX - the offset (added to default relative X) in the x direction
offsetY - the offset (added to default relative Y) in the y direction
Method Detail

defaultRelativeX

protected double defaultRelativeX()
Answer the default/initial value of relativeX.
Overrides:
defaultRelativeX in class FigureRelativePoint
Returns:
a double representing the default/initial value of relativeX

defaultRelativeY

protected double defaultRelativeY()
Answer the default/initial value of relativeY.
Overrides:
defaultRelativeY in class FigureRelativePoint
Returns:
a double representing the default/initial value of relativeY

x

public int x()
Answer the x coordinate.
Overrides:
x in class FigureRelativePoint
Returns:
an integer representing the x coordinate

y

public int y()
Answer the y coordinate.
Overrides:
y in class FigureRelativePoint
Returns:
an integer representing the y coordinate