|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.rolemodelsoft.drawlet.basics.AbstractLocator
|
+--com.rolemodelsoft.drawlet.basics.FigureRelativePoint
This class implements Locator by providing x and y coordinates that are relative to a Figure. Although it is assumed that the normal use will have these locators within the bounds of the Figure, that is not necessary.
| Field Summary | |
protected Figure |
figure
The figure from which we derive our coordinates |
protected int |
offsetX
The x offset from the purely relative position. |
protected int |
offsetY
The y offset from the purely relative position. |
protected double |
relativeX
The relative x position from the top-left to bottom-right from which to derive our coordinates. |
protected double |
relativeY
The relative y position from the top-left to bottom-right from which to derive our coordinates. |
| Constructor Summary | |
FigureRelativePoint(Figure figure)
Constructs and initializes a new instance of a locator which is relative to a figure |
|
FigureRelativePoint(Figure figure,
double relativeX,
double relativeY)
Constructs and initializes a new instance of a locator which is relative to a figure |
|
FigureRelativePoint(Figure figure,
double relativeX,
double relativeY,
int offsetX,
int offsetY)
Constructs and initializes a new instance of a locator which is relative to a figure |
|
FigureRelativePoint(Figure figure,
int offsetX,
int offsetY)
Constructs and initializes a new instance of a locator which is relative to a figure |
|
| Method Summary | |
protected int |
defaultOffsetX()
Answer the default/initial value of offsetX. |
protected int |
defaultOffsetY()
Answer the default/initial value of offsetY. |
protected double |
defaultRelativeX()
Answer the default/initial value of relativeX. |
protected double |
defaultRelativeY()
Answer the default/initial value of relativeY. |
java.lang.Object |
duplicate()
Duplicates the receiver. |
java.lang.Object |
duplicateIn(java.util.Hashtable duplicates)
Duplicates the receiver in the given Hashtable. |
Figure |
getFigure()
Answer the figure to which the receiver is relative. |
void |
postDuplicate(java.util.Hashtable duplicates)
After a series of Objects are duplicated, this can be sent to each of the duplicates to resolve any changes it might like to reconcile. |
void |
setFigure(Figure figure)
Set the figure the receiver is holding. |
int |
x()
Answer the x coordinate. |
int |
y()
Answer the y coordinate. |
| 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 |
protected Figure figure
protected double relativeX
protected double relativeY
protected int offsetX
protected int offsetY
| Constructor Detail |
public FigureRelativePoint(Figure figure)
figure - the figure to which the instance will be relativedefaultRelativeX(),
defaultRelativeY(),
defaultOffsetX(),
defaultOffsetY()
public FigureRelativePoint(Figure figure,
double relativeX,
double relativeY)
figure - the figure to which the instance will be relativerelativeX - the percentage of the width of the figure to determine XrelativeY - the percentage of the height of the figure to determine YdefaultOffsetX(),
defaultOffsetY()
public FigureRelativePoint(Figure figure,
double relativeX,
double relativeY,
int offsetX,
int offsetY)
figure - the figure to which the instance will be relativerelativeX - the percentage of the width of the figure to determine XrelativeY - the percentage of the height of the figure to determine YoffsetX - the offset (added to relative X) in the x directionoffsetY - the offset (added to relative Y) in the y direction
public FigureRelativePoint(Figure figure,
int offsetX,
int offsetY)
figure - the figure to which the instance will be relativeoffsetX - the offset (added to relative X) in the x directionoffsetY - the offset (added to relative Y) in the y directiondefaultRelativeX(),
defaultRelativeY()| Method Detail |
protected int defaultOffsetX()
protected int defaultOffsetY()
protected double defaultRelativeX()
protected double defaultRelativeY()
public java.lang.Object duplicate()
public java.lang.Object duplicateIn(java.util.Hashtable duplicates)
Hashtable.duplicates - the Hashtable to put the new duplicate inpublic Figure getFigure()
public void postDuplicate(java.util.Hashtable duplicates)
duplicates - a Hashtable where originals as keys and duplicates as elementspublic void setFigure(Figure figure)
figure - the Figure to holdpublic int x()
public int y()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||