|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.rolemodelsoft.drawlet.basics.AbstractPaintable
|
+--com.rolemodelsoft.drawlet.basics.AbstractFigure
|
+--com.rolemodelsoft.drawlet.shapes.AbstractShape
|
+--com.rolemodelsoft.drawlet.shapes.lines.LinearShape
|
+--com.rolemodelsoft.drawlet.shapes.lines.Line
|
+--com.rolemodelsoft.drawlet.shapes.lines.ConnectingLine
This provides a basic implementation of Lines that can connect to other figures. Note that there can be any number of Locators that make up a Line and that those Locators may be tied to Figures. When they are, the Line will become a dependent of the Figure and will assume it is moved when the Figure is moved/reshaped in any way.
| Field Summary | |
protected boolean |
mustConnect
A boolean defining whether this line must be connected. |
| Fields inherited from class com.rolemodelsoft.drawlet.shapes.lines.Line |
points,
polygon |
| Fields inherited from class com.rolemodelsoft.drawlet.shapes.lines.LinearShape |
lineColor |
| Fields inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
listeners,
locationListeners |
| Constructor Summary | |
ConnectingLine(int beginX,
int beginY,
int endX,
int endY)
Constructs and initializes a new instance of a connecting line. |
|
ConnectingLine(int beginX,
int beginY,
int endX,
int endY,
boolean mustConnect)
Constructs and initializes a new instance of a connecting line. |
|
ConnectingLine(Locator begin,
Locator end)
Constructs and initializes a new instance of a connecting line. |
|
ConnectingLine(Locator begin,
Locator end,
boolean mustConnect)
Constructs and initializes a new instance of a connecting line. |
|
| Method Summary | |
protected void |
basicSetLocator(int index,
Locator locator)
Set the locator at the appropriate position. |
protected boolean |
defaultConnectState()
Answer the default state for connectedness. |
void |
disconnect()
Clean up as appropriate if the receiver is no longer valid. |
protected void |
freeFromFigure(Figure figure)
Remove any dependence on the figure. |
Handle[] |
getHandles()
Answer the handles associated with the receiver. |
protected boolean |
isListening(Figure figure)
Answers whether the receiver is listening to the figure directly or indirectly (via chain of listeners) |
boolean |
isObsolete()
Answers whether the receiver is obsolete. |
void |
locationChanged(java.beans.PropertyChangeEvent event)
Update because the location of something we depend on has changed. |
void |
relationChanged(java.beans.PropertyChangeEvent event)
Update because the relationship of something we depend on has changed. |
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 |
shapeChanged(java.beans.PropertyChangeEvent event)
Update because the shape of something we depend on has changed. |
void |
sizeChanged(java.beans.PropertyChangeEvent event)
Update because the size of something we depend on has changed. |
protected void |
updateShape()
Assume our location has changed due to some movement/reshaping of something we depend on. |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.lines.Line |
basicAddLocator,
basicRemoveLocator,
basicReshape,
basicTranslate,
contains,
duplicateIn,
estimatedDuplicateSize,
getBounds,
getLocator,
getNumberOfPoints,
getPolygon,
intersects,
paint,
postDuplicate,
resetBoundsCache,
resetLocationCache,
resetSizeCache |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.lines.LinearShape |
addLocator,
addLocator,
defaultLineColor,
getLineColor,
getStyle,
insideSegment,
insideTolerance,
insideTolerance,
locatorAt,
removeLocator,
setLineColor,
setLocator,
setStyle |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.AbstractShape |
basicResize,
reshapedPolygon,
reshapedPolygon,
setBounds,
setSize |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
addPropertyChangeListener,
addRelatedLocationListener,
basicMove,
changedLocation,
changedShape,
changedSize,
contains,
contains,
deleteLocationListeners,
duplicate,
editTool,
figureFromLocator,
fireLocationChange,
firePropertyChange,
firePropertyChange,
fireRelationChange,
fireShapeChange,
fireSizeChange,
getLocation,
getLocator,
intersects,
isWithin,
isWithin,
move,
move,
relatedLocationListeners,
removePropertyChangeListener,
removeRelatedLocationListener,
setSize,
translate |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractPaintable |
getBottom,
getHeight,
getLeft,
getRight,
getSize,
getTop,
getWidth |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected boolean mustConnect
| Constructor Detail |
public ConnectingLine(int beginX,
int beginY,
int endX,
int endY)
beginX - the x coordinate for the first point defining the linebeginY - the y coordinate for the first point defining the lineendX - the x coordinate for the second point defining the lineendY - the y coordinate for the second point defining the line
public ConnectingLine(int beginX,
int beginY,
int endX,
int endY,
boolean mustConnect)
beginX - the x coordinate for the first point defining the linebeginY - the y coordinate for the first point defining the lineendX - the x coordinate for the second point defining the lineendY - the y coordinate for the second point defining the linemustConnect - specifies whether this line has to be connected in order to exist
public ConnectingLine(Locator begin,
Locator end)
begin - the locator which is the first point defining the lineend - the locator which is the second point defining the line
public ConnectingLine(Locator begin,
Locator end,
boolean mustConnect)
begin - the locator which is the first point defining the lineend - the locator which is the second point defining the linemustConnect - specifies whether this line has to be connected in order to exist| Method Detail |
protected void basicSetLocator(int index,
Locator locator)
index - the index of the locator desired.locator - the new Locator.protected boolean defaultConnectState()
public void disconnect()
protected void freeFromFigure(Figure figure)
figure - the Figure to disassociate from.public Handle[] getHandles()
protected boolean isListening(Figure figure)
figure - the Figure to testtrue if the receiver is listening
to the figure directly or indirectly;
false otherwise.public boolean isObsolete()
true if both ends
are not connected to a figure;
false otherwise.public void locationChanged(java.beans.PropertyChangeEvent event)
event - PropertyChangeEventpublic void relationChanged(java.beans.PropertyChangeEvent event)
event - PropertyChangeEvent
public Locator requestConnection(Figure requestor,
int x,
int y)
requestor - the figure requesting the connectionx - the x coordinate of the requested locatory - the y coordinate of the requested locatorpublic void shapeChanged(java.beans.PropertyChangeEvent event)
event - PropertyChangeEventpublic void sizeChanged(java.beans.PropertyChangeEvent event)
event - PropertyChangeEventprotected void updateShape()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||