All Packages Class Hierarchy This Package Previous Next Index
Class CH.ifa.draw.standard.ConnectionTool
java.lang.Object
|
+----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
-
ConnectionTool(DrawingView, ConnectionFigure)
-
-
createConnection()
- Creates the ConnectionFigure.
-
createdFigure()
- Gets the currently created figure
-
deactivate()
- Deactivates the tool.
-
findConnection(int, int, Drawing)
- Finds an existing connection figure.
-
findConnectionStart(int, int, Drawing)
- Finds a connection start 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)
-
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)
findConnectionStart
protected Figure findConnectionStart(int x,
int y,
Drawing drawing)
- Finds a connection start figure.
getStartConnector
protected Connector getStartConnector()
getEndConnector
protected Connector getEndConnector()
getTarget
protected Connector getTarget()
All Packages Class Hierarchy This Package Previous Next Index