All Packages Class Hierarchy This Package Previous Next Index
Class CH.ifa.draw.standard.ConnectionTool
CH.ifa.draw.standard.AbstractTool
|
+----CH.ifa.draw.standard.ConnectionTool
- public class ConnectionTool
- extends AbstractTool
A tool that can be used to connect figures, to split
connections, and to join two segments of a connection.
ConnectionTools turns the visibility of the Connectors
on when it enters a figure.
The connection object to be created is specified by a prototype.
Design Patterns
Prototype
ConnectionTools creates the connection by cloning a prototype.
- See Also:
- ConnectionFigure, clone
-
fConnection
- the currently created figure
-
fConnectorTarget
-
-
fEditedConnection
- the currently edited connection
-
fEndConnector
-
-
fPrototype
- the prototypical figure that is used to create new
connections.
-
fSplitPoint
- the currently manipulated connection point
-
fStartConnector
- the anchor point of the interaction
-
fTarget
-
-
ConnectionTool(DrawingView, ConnectionFigure)
-
-
createConnection()
- Creates the ConnectionFigure.
-
createdFigure()
- Gets the currently created figure
-
deactivate()
- Deactivates the tool.
-
findConnectableFigure(int, int, Drawing)
-
-
findConnection(int, int, Drawing)
- Finds an existing connection figure.
-
findConnectionStart(int, int, Drawing)
- Finds a connection start figure.
-
findConnector(int, int, Figure)
-
-
findSource(int, int, Drawing)
- Finds a connectable figure target.
-
findTarget(int, int, Drawing)
- Finds a connectable figure target.
-
getEndConnector()
-
-
getStartConnector()
-
-
getTarget()
-
-
mouseDown(MouseEvent, int, int)
- Manipulates connections in a context dependent way.
-
mouseDrag(MouseEvent, int, int)
- Adjust the created connection or split segment.
-
mouseMove(MouseEvent, int, int)
- Handles mouse move events in the drawing view.
-
mouseUp(MouseEvent, int, int)
- Connects the figures if the mouse is released over another
figure.
-
trackConnectors(MouseEvent, int, int)
-
fStartConnector
protected Connector fStartConnector
- the anchor point of the interaction
fEndConnector
protected Connector fEndConnector
fConnectorTarget
protected Connector fConnectorTarget
fTarget
protected Figure fTarget
fConnection
protected ConnectionFigure fConnection
- the currently created figure
fSplitPoint
protected int fSplitPoint
- the currently manipulated connection point
fEditedConnection
protected ConnectionFigure fEditedConnection
- the currently edited connection
fPrototype
protected ConnectionFigure fPrototype
- the prototypical figure that is used to create new
connections.
ConnectionTool
public ConnectionTool(DrawingView view,
ConnectionFigure prototype)
mouseMove
public void mouseMove(MouseEvent e,
int x,
int y)
- Handles mouse move events in the drawing view.
- Overrides:
- mouseMove in class AbstractTool
mouseDown
public void mouseDown(MouseEvent e,
int x,
int y)
- Manipulates connections in a context dependent way. If the
mouse down hits a figure start a new connection. If the mousedown
hits a connection split a segment or join two segments.
- Overrides:
- mouseDown in class AbstractTool
mouseDrag
public void mouseDrag(MouseEvent e,
int x,
int y)
- Adjust the created connection or split segment.
- Overrides:
- mouseDrag in class AbstractTool
mouseUp
public void mouseUp(MouseEvent e,
int x,
int y)
- Connects the figures if the mouse is released over another
figure.
- Overrides:
- mouseUp in class AbstractTool
deactivate
public void deactivate()
- Deactivates the tool.
- Overrides:
- deactivate in class AbstractTool
createConnection
protected ConnectionFigure createConnection()
- Creates the ConnectionFigure. By default the figure prototype is
cloned.
findSource
protected Figure findSource(int x,
int y,
Drawing drawing)
- Finds a connectable figure target.
findTarget
protected Figure findTarget(int x,
int y,
Drawing drawing)
- Finds a connectable figure target.
findConnection
protected ConnectionFigure findConnection(int x,
int y,
Drawing drawing)
- Finds an existing connection figure.
createdFigure
protected ConnectionFigure createdFigure()
- Gets the currently created figure
trackConnectors
protected void trackConnectors(MouseEvent e,
int x,
int y)
findConnector
protected Connector findConnector(int x,
int y,
Figure f)
findConnectionStart
protected Figure findConnectionStart(int x,
int y,
Drawing drawing)
- Finds a connection start figure.
findConnectableFigure
protected Figure findConnectableFigure(int x,
int y,
Drawing drawing)
getStartConnector
protected Connector getStartConnector()
getEndConnector
protected Connector getEndConnector()
getTarget
protected Connector getTarget()
All Packages Class Hierarchy This Package Previous Next Index