All Packages Class Hierarchy This Package Previous Next Index
Interface CH.ifa.draw.framework.ConnectionFigure
- public interface interface ConnectionFigure
- extends Figure, FigureChangeListener
Figures to connect Connectors provided by Figures.
A ConnectionFigure knows its start and end Connector.
It uses the Connectors to locate its connection points.
A ConnectionFigure can have multiple segments. It provides
operations to split and join segments.
Design Patterns
Strategy
Strategy is used encapsulate the algorithm to locate the connection point.
ConnectionFigure is the Strategy context and Connector is the Strategy.
Observer
Observer is used to track changes of the connected figures. A connection
figure registers itself as listeners or observers of the source and
target connector.
- See Also:
- Connector
-
canConnect(Figure, Figure)
- Checks if two figures can be connected.
-
connectEnd(Connector)
- Sets the end Connector of the connection.
-
connectsSame(ConnectionFigure)
- Checks if the ConnectionFigure connects the same figures.
-
connectStart(Connector)
- Sets the start Connector of the connection.
-
disconnectEnd()
- Disconnects the end figure from the dependent figure
-
disconnectStart()
- Disconnects the start figure from the dependent figure
-
end()
- Gets the end Connector.
-
endPoint()
- Gets the end point.
-
endPoint(int, int)
- Sets the end point.
-
joinSegments(int, int)
- Joins the hit segments.
-
pointAt(int)
- Gets the Point at the given position
-
pointCount()
- Gets the number of points or nodes of the connection
-
setPointAt(Point, int)
- Sets the position of the point at the given position
-
splitSegment(int, int)
- Splits the hit segment.
-
start()
- Gets the start Connector
-
startPoint()
- Gets the start point.
-
startPoint(int, int)
- Sets the start point.
-
updateConnection()
- Updates the connection
connectStart
public abstract void connectStart(Connector start)
- Sets the start Connector of the connection.
- Parameters:
- figure - the start figure of the connection
connectEnd
public abstract void connectEnd(Connector end)
- Sets the end Connector of the connection.
- Parameters:
- figure - the end figure of the connection
updateConnection
public abstract void updateConnection()
- Updates the connection
disconnectStart
public abstract void disconnectStart()
- Disconnects the start figure from the dependent figure
disconnectEnd
public abstract void disconnectEnd()
- Disconnects the end figure from the dependent figure
start
public abstract Connector start()
- Gets the start Connector
end
public abstract Connector end()
- Gets the end Connector.
canConnect
public abstract boolean canConnect(Figure start,
Figure end)
- Checks if two figures can be connected. Implement this method
to constrain the allowed connections between figures.
connectsSame
public abstract boolean connectsSame(ConnectionFigure other)
- Checks if the ConnectionFigure connects the same figures.
startPoint
public abstract void startPoint(int x,
int y)
- Sets the start point.
endPoint
public abstract void endPoint(int x,
int y)
- Sets the end point.
startPoint
public abstract Point startPoint()
- Gets the start point.
endPoint
public abstract Point endPoint()
- Gets the end point.
setPointAt
public abstract void setPointAt(Point p,
int index)
- Sets the position of the point at the given position
pointAt
public abstract Point pointAt(int index)
- Gets the Point at the given position
pointCount
public abstract int pointCount()
- Gets the number of points or nodes of the connection
splitSegment
public abstract int splitSegment(int x,
int y)
- Splits the hit segment.
- Parameters:
- x, - y the position where the figure should be split
- Returns:
- the index of the splitting point
joinSegments
public abstract boolean joinSegments(int x,
int y)
- Joins the hit segments.
- Parameters:
- x, - y the position where the figure should be joined.
- Returns:
- whether the segment was joined
All Packages Class Hierarchy This Package Previous Next Index