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.


Constructor Index

 o LabelledConnection()

Method Index

 o addConnected(Figure)
Deprecated.
 o addPoint(int, int)
Adds a node to the list of points and the corresponding segment.
 o connectedTextLocator(Figure)
Returns the locator used to locate connected text.
 o createSegment(int)
A hook for creating the a segment object.
 o findDropTarget(int, int, Figure)
Check first the labels of the segments and then do the default check.
 o findSelectable(int, int)
Check first the labels of the segments and then do the default find.
 o getLabels()
Deprecated.
 o getSegments()
Returns the segments of this.
 o handleConnect(Figure, Figure)
Creates the first segment, if segments do not yet exists.
 o insertPointAt(Point, int)
Insert a node at the given point and create the corresponding segment.
 o parent(Figure)
Set the parent of this.
 o removeConnected(Figure)
Deprecated.
 o removePointAt(int)
Remove a point and the corresponding segment.
 o setParent(Figure)
Just set the parent without informing listeners about the change.

Constructors

 o LabelledConnection
 public LabelledConnection()

Methods

 o 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
 o 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
 o addConnected
 public Figure addConnected(Figure figure)
Deprecated. No need to use this method.

 o removeConnected
 public Figure removeConnected(Figure figure)
Deprecated. No need to use this method.

 o getLabels
 public Vector getLabels()
Deprecated. No need to use this method.

 o getSegments
 public Vector getSegments()
Returns the segments of this.

 o connectedTextLocator
 public Locator connectedTextLocator(Figure text)
Returns the locator used to locate connected text. Deprecated?

Overrides:
connectedTextLocator in class AbstractFigure
 o 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
 o handleConnect
 protected void handleConnect(Figure start,
                              Figure end)
Creates the first segment, if segments do not yet exists.

Overrides:
handleConnect in class LineConnection
 o 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
 o 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
 o 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
 o 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
 o 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