All Packages Class Hierarchy This Package Previous Next Index
Class CH.ifa.draw.figures.LabelledConnection
CH.ifa.draw.standard.AbstractFigure
|
+----CH.ifa.draw.figures.PolyLineFigure
|
+----CH.ifa.draw.figures.LineConnection
|
+----CH.ifa.draw.figures.LabelledConnection
- public class LabelledConnection
- extends LineConnection
A LabelledConnection is a LineConnection that maintains a list of
LabelledSegments in addition to the list of points. A segment is a holder
for Labels objects (CompartmentPanel figures) that hold the labels.
A LabelledConnection forwards
the selection and the drop target finding events to the Labels.
The segment list is kept consistent with the point list. When segments are
removed, the Labels of the removed segment are merged with a nearby segment.
The creation of the first segment is delayed until the connection is 'made'
(handleConnect()) for the first time. This is to ensure that the connection
has been properly set up (added to the drawing etc.) before creating the
segment object and its label holder figures.
-
LabelledConnection()
-
-
addConnected(Figure)
- Deprecated.
-
addPoint(int, int)
- Adds a node to the list of points and the corresponding segment.
-
connectedTextLocator(Figure)
- Returns the locator used to locate connected text.
-
createSegment(int)
- A hook for creating the a segment object.
-
findDropTarget(int, int, Figure)
- Check first the labels of the segments and then do the default
check.
-
findSelectable(int, int)
- Check first the labels of the segments and then do the default
find.
-
getLabels()
- Deprecated.
-
getSegments()
- Returns the segments of this.
-
handleConnect(Figure, Figure)
- Creates the first segment, if segments do not yet exists.
-
insertPointAt(Point, int)
- Insert a node at the given point and create the corresponding segment.
-
parent(Figure)
- Set the parent of this.
-
removeConnected(Figure)
- Deprecated.
-
removePointAt(int)
- Remove a point and the corresponding segment.
-
setParent(Figure)
- Just set the parent without informing listeners about the change.
LabelledConnection
public LabelledConnection()
parent
public void parent(Figure aFigure)
- Set the parent of this. Inform listeners about the change. Also invoke
ancestorChanged to inform a change in ancestry.
- Overrides:
- parent in class AbstractFigure
setParent
public void setParent(Figure aFigure)
- Just set the parent without informing listeners about the change.
This is needed for de-serialization.
- Overrides:
- setParent in class AbstractFigure
addConnected
public Figure addConnected(Figure figure)
- Deprecated. No need to use this method.
removeConnected
public Figure removeConnected(Figure figure)
- Deprecated. No need to use this method.
getLabels
public Vector getLabels()
- Deprecated. No need to use this method.
getSegments
public Vector getSegments()
- Returns the segments of this.
connectedTextLocator
public Locator connectedTextLocator(Figure text)
- Returns the locator used to locate connected text. Deprecated?
- Overrides:
- connectedTextLocator in class AbstractFigure
addPoint
public void addPoint(int x,
int y)
- Adds a node to the list of points and the corresponding segment.
- Overrides:
- addPoint in class PolyLineFigure
handleConnect
protected void handleConnect(Figure start,
Figure end)
- Creates the first segment, if segments do not yet exists.
- Overrides:
- handleConnect in class LineConnection
findDropTarget
public Figure findDropTarget(int x,
int y,
Figure dragTarget)
- Check first the labels of the segments and then do the default
check.
- Overrides:
- findDropTarget in class AbstractFigure
findSelectable
public Figure findSelectable(int x,
int y)
- Check first the labels of the segments and then do the default
find.
- Overrides:
- findSelectable in class AbstractFigure
insertPointAt
public void insertPointAt(Point p,
int i)
- Insert a node at the given point and create the corresponding segment.
- Overrides:
- insertPointAt in class LineConnection
removePointAt
public void removePointAt(int i)
- Remove a point and the corresponding segment. Merge the labels
of the removed segment with the next segment.
- Overrides:
- removePointAt in class LineConnection
createSegment
protected LabelledSegment createSegment(int segmentIndex)
- A hook for creating the a segment object. The default is to create
a Segment which a local class.
All Packages Class Hierarchy This Package Previous Next Index