|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This interface defines a generic Figure that can be drawn on and potentially manipulated on a DrawingCanvas (or elsewhere).
| Field Summary | |
static java.lang.String |
FILL_COLOR_PROPERTY
The fill color property selector. |
static java.lang.String |
LINE_COLOR_PROPERTY
The line color property selector. |
static java.lang.String |
LOCATION_PROPERTY
The location property selector. |
static java.lang.String |
RELATION_PROPERTY
The relation property selector. |
static java.lang.String |
SHAPE_PROPERTY
The shape property selector. |
static java.lang.String |
SIZE_PROPERTY
The size property selector. |
static java.lang.String |
STRING_PROPERTY
The string property selector. |
static java.lang.String |
STYLE_PROPERTY
The style property selector. |
static java.lang.String |
TEXT_COLOR_PROPERTY
The text color property selector. |
| Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void |
addRelatedLocationListener(RelatedLocationListener listener)
Add a RelatedLocationListener to the listener list. |
boolean |
contains(Figure figure)
Checks whether a specified Figure is completely "inside" this Figure, where the figures share the same coordinate system. |
boolean |
contains(int x,
int y)
Checks whether a specified x,y location is "inside" this Figure, where x and y are defined to be relative to the coordinate system of this figure. |
boolean |
contains(java.awt.Rectangle box)
Checks whether a specified Rectangle is "inside" this Figure, where the Rectangle and this Figure are in the same coordinate system |
void |
disconnect()
Clean up as appropriate if the figure is no longer connected to others. |
Handle |
editTool(int x,
int y)
Answers a Handle that will provide editing capabilities on the receiver, or null. |
Handle[] |
getHandles()
Answer the handles associated with the receiver. |
Locator |
getLocator()
Returns the current locator of this figure. |
DrawingStyle |
getStyle()
Answer the style which defines how to paint the figure. |
boolean |
intersects(Figure anotherFigure)
Answers whether the receiver intersects another figure. |
boolean |
intersects(java.awt.Rectangle box)
Answers whether the receiver intersects a Rectangular area. |
boolean |
isObsolete()
Answers whether the receiver is obsolete. |
boolean |
isWithin(Figure anotherFigure)
Answers whether the receiver is fully within another Figure. |
boolean |
isWithin(java.awt.Rectangle box)
Answers whether the receiver is fully within a Rectangular area. |
Locator |
locatorAt(int x,
int y)
Answers a locator corresponding to a significant point on the receiver. |
void |
move(int x,
int y)
Moves the Figure to a new location. |
void |
move(Locator locator)
Moves the Figure to a new location. |
java.util.Enumeration |
relatedLocationListeners()
Answer with an Enumeration over the RelatedLocationListeners. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
removeRelatedLocationListener(RelatedLocationListener listener)
Remove a RelatedLocationListener from the listener list. |
Locator |
requestConnection(Figure requestor,
int x,
int y)
Answers a Locator corresponding to a significant point on the receiver that will serve as a connection to the other Figure. |
void |
setBounds(int x,
int y,
int width,
int height)
Reshapes the Figure to the specified bounding box. |
void |
setSize(java.awt.Dimension d)
Resizes the Figure to the specified dimension. |
void |
setSize(int width,
int height)
Resizes the Figure to the specified width and height. |
void |
setStyle(DrawingStyle style)
Set the style defining how to paint the Figure. |
void |
translate(int x,
int y)
Moves the Figure in the x and y direction. |
| Methods inherited from interface com.rolemodelsoft.drawlet.Paintable |
getBottom,
getBounds,
getHeight,
getLeft,
getRight,
getSize,
getTop,
getWidth,
paint |
| Methods inherited from interface com.rolemodelsoft.drawlet.util.Duplicatable |
duplicate,
duplicateIn,
postDuplicate |
| Field Detail |
public static final java.lang.String SHAPE_PROPERTY
public static final java.lang.String SIZE_PROPERTY
public static final java.lang.String LOCATION_PROPERTY
public static final java.lang.String STYLE_PROPERTY
public static final java.lang.String FILL_COLOR_PROPERTY
public static final java.lang.String LINE_COLOR_PROPERTY
public static final java.lang.String TEXT_COLOR_PROPERTY
public static final java.lang.String STRING_PROPERTY
public static final java.lang.String RELATION_PROPERTY
| Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener to be addedpublic void addRelatedLocationListener(RelatedLocationListener listener)
listener - The RelatedLocationListener to be added
public boolean contains(int x,
int y)
x - the x coordinatey - the y coordinatetrue if x and y are "inside" this Figure;
false otherwise.public boolean contains(Figure figure)
figure - the Figure to test for inclusiontrue if the specified Figure is completely "inside" this Figure
false otherwise.public boolean contains(java.awt.Rectangle box)
box - the rectangle to test for inclusiontrue if the specified Rectangle is "inside" this Figure;
false otherwise.public void disconnect()
public Handle editTool(int x,
int y)
x - the x coordinate to potentially begin editingy - the y coordinate to potentially begin editingpublic Handle[] getHandles()
public Locator getLocator()
public DrawingStyle getStyle()
public boolean intersects(Figure anotherFigure)
anotherFigure - the figure the receiver is potentially intersecting.true if the receiver intersects another figure;
false otherwise.public boolean intersects(java.awt.Rectangle box)
box - the Rectangular areatrue if the receiver intersects the Rectangular area;
false otherwise.public boolean isObsolete()
true if some event has happened
that makes this a meaningless object;
false otherwise.public boolean isWithin(Figure anotherFigure)
anotherFigure - the figure the receiver is potentially inside.true if the receiver is fully within another Figure;
false otherwise.public boolean isWithin(java.awt.Rectangle box)
box - the Rectangular areatrue if the receiver is fully within a Rectangular area;
false otherwise.
public Locator locatorAt(int x,
int y)
x - the x coordinate of the requested locatory - the y coordinate of the requested locator
public void move(int x,
int y)
x - the x coordinatey - the y coordinate#location,
#reshapepublic void move(Locator locator)
locator - the Locator which identifies the desired x, y coordinates.#locationpublic java.util.Enumeration relatedLocationListeners()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener to be removedpublic void removeRelatedLocationListener(RelatedLocationListener listener)
listener - The RelatedLocationListener to be removed
public Locator requestConnection(Figure requestor,
int x,
int y)
requestor - the Figure requesting a connectionx - the x coordinate of the requested locatory - the y coordinate of the requested locator
public void setBounds(int x,
int y,
int width,
int height)
x - the x coordinatey - the y coordinatewidth - the width of the figureheight - the height of the figure#bounds,
move(int, int),
#resize
public void setSize(int width,
int height)
width - the width of the figureheight - the height of the figure#size,
#reshapepublic void setSize(java.awt.Dimension d)
d - the figure dimension#size,
#reshapepublic void setStyle(DrawingStyle style)
style - the specified DrawingStyle
public void translate(int x,
int y)
x - amount to move in the x directiony - amount to move in the y direction#location,
#reshape
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||