All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.figures.LineConnection

java.lang.Object
   |
   +----CH.ifa.draw.standard.AbstractFigure
           |
           +----CH.ifa.draw.figures.PolyLineFigure
                   |
                   +----CH.ifa.draw.figures.LineConnection

public class LineConnection
extends PolyLineFigure
implements ConnectionFigure
A LineConnection is a standard implementation of the ConnectionFigure interface. The interface is implemented with PolyLineFigure.

See Also:
ConnectionFigure

Variable Index

 o fEnd
 o fStart

Constructor Index

 o LineConnection()
Constructs a LineConnection.

Method Index

 o basicMoveBy(int, int)
Ensures that a connection is updated if the connection was moved.
 o canConnect()
Tests whether a figure can be a connection target.
 o canConnect(Figure, Figure)
Tests whether two figures can be connected.
 o connectEnd(Connector)
Sets the end figure of the connection.
 o connectsSame(ConnectionFigure)
Tests whether a connection connects the same figures as another ConnectionFigure.
 o connectStart(Connector)
Sets the start figure of the connection.
 o disconnectEnd()
Disconnects the end figure.
 o disconnectStart()
Disconnects the start figure.
 o end()
Gets the end figure of the connection.
 o endFigure()
Gets the end figure of the connection.
 o endPoint()
Gets the end point.
 o endPoint(int, int)
Sets the end point.
 o figureChanged(FigureChangeEvent)
 o figureInvalidated(FigureChangeEvent)
 o figureRemoved(FigureChangeEvent)
 o figureRequestRemove(FigureChangeEvent)
 o figureRequestUpdate(FigureChangeEvent)
 o handleConnect(Figure, Figure)
Handles the connection of a connection.
 o handleDisconnect(Figure, Figure)
Handles the disconnection of a connection.
 o handles()
Gets the handles of the figure.
 o insertPointAt(Point, int)
Inserts the point and updates the connection.
 o layoutConnection()
Lays out the connection.
 o read(StorableInput)
Reads the Figure from a StorableInput.
 o release()
A figure is released from the drawing.
 o removePointAt(int)
Removes the point and updates the connection.
 o setPointAt(Point, int)
Sets the point and updates the connection.
 o start()
Gets the start figure of the connection.
 o startFigure()
Gets the start figure of the connection.
 o startPoint()
Gets the start point.
 o startPoint(int, int)
Sets the start point.
 o updateConnection()
Updates the connection.
 o write(StorableOutput)
Stores the Figure to a StorableOutput.

Variables

 o fStart
 protected Connector fStart
 o fEnd
 protected Connector fEnd

Constructors

 o LineConnection
 public LineConnection()
Constructs a LineConnection. A connection figure has an arrow decoration at the start and end.

Methods

 o canConnect
 public boolean canConnect()
Tests whether a figure can be a connection target. ConnectionFigures cannot be connected and return false.

Overrides:
canConnect in class AbstractFigure
 o basicMoveBy
 protected void basicMoveBy(int dx,
                            int dy)
Ensures that a connection is updated if the connection was moved.

Overrides:
basicMoveBy in class PolyLineFigure
 o connectStart
 public void connectStart(Connector start)
Sets the start figure of the connection.

 o connectEnd
 public void connectEnd(Connector end)
Sets the end figure of the connection.

 o disconnectStart
 public void disconnectStart()
Disconnects the start figure.

 o disconnectEnd
 public void disconnectEnd()
Disconnects the end figure.

 o connectsSame
 public boolean connectsSame(ConnectionFigure other)
Tests whether a connection connects the same figures as another ConnectionFigure.

 o handleDisconnect
 protected void handleDisconnect(Figure start,
                                 Figure end)
Handles the disconnection of a connection. Override this method to handle this event.

 o handleConnect
 protected void handleConnect(Figure start,
                              Figure end)
Handles the connection of a connection. Override this method to handle this event.

 o startFigure
 public Figure startFigure()
Gets the start figure of the connection.

 o endFigure
 public Figure endFigure()
Gets the end figure of the connection.

 o start
 public Connector start()
Gets the start figure of the connection.

 o end
 public Connector end()
Gets the end figure of the connection.

 o canConnect
 public boolean canConnect(Figure start,
                           Figure end)
Tests whether two figures can be connected.

 o startPoint
 public void startPoint(int x,
                        int y)
Sets the start point.

 o endPoint
 public void endPoint(int x,
                      int y)
Sets the end point.

 o startPoint
 public Point startPoint()
Gets the start point.

 o endPoint
 public Point endPoint()
Gets the end point.

 o handles
 public Vector handles()
Gets the handles of the figure. It returns the normal PolyLineHandles but adds ChangeConnectionHandles at the start and end.

Overrides:
handles in class PolyLineFigure
 o setPointAt
 public void setPointAt(Point p,
                        int i)
Sets the point and updates the connection.

Overrides:
setPointAt in class PolyLineFigure
 o insertPointAt
 public void insertPointAt(Point p,
                           int i)
Inserts the point and updates the connection.

Overrides:
insertPointAt in class PolyLineFigure
 o removePointAt
 public void removePointAt(int i)
Removes the point and updates the connection.

Overrides:
removePointAt in class PolyLineFigure
 o updateConnection
 public void updateConnection()
Updates the connection.

 o layoutConnection
 public void layoutConnection()
Lays out the connection. This is called when the connection itself changes. By default the connection is recalculated

 o figureChanged
 public void figureChanged(FigureChangeEvent e)
 o figureRemoved
 public void figureRemoved(FigureChangeEvent e)
 o figureRequestRemove
 public void figureRequestRemove(FigureChangeEvent e)
 o figureInvalidated
 public void figureInvalidated(FigureChangeEvent e)
 o figureRequestUpdate
 public void figureRequestUpdate(FigureChangeEvent e)
 o release
 public void release()
A figure is released from the drawing.

Overrides:
release in class AbstractFigure
 o write
 public void write(StorableOutput dw)
Stores the Figure to a StorableOutput.

Overrides:
write in class PolyLineFigure
 o read
 public void read(StorableInput dr) throws IOException
Reads the Figure from a StorableInput.

Overrides:
read in class PolyLineFigure

All Packages  Class Hierarchy  This Package  Previous  Next  Index