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

 o Prototype
ConnectionTools creates the connection by cloning a prototype.


See Also:
ConnectionFigure, clone

Constructor Index

 o ConnectionTool(DrawingView, ConnectionFigure)

Method Index

 o createConnection()
Creates the ConnectionFigure.
 o createdFigure()
Gets the currently created figure
 o deactivate()
Deactivates the tool.
 o findConnection(int, int, Drawing)
Finds an existing connection figure.
 o findConnectionStart(int, int, Drawing)
Finds a connection start figure.
 o findSource(int, int, Drawing)
Finds a connectable figure target.
 o findTarget(int, int, Drawing)
Finds a connectable figure target.
 o getEndConnector()
 o getStartConnector()
 o getTarget()
 o mouseDown(MouseEvent, int, int)
Manipulates connections in a context dependent way.
 o mouseDrag(MouseEvent, int, int)
Adjust the created connection or split segment.
 o mouseMove(MouseEvent, int, int)
Handles mouse move events in the drawing view.
 o mouseUp(MouseEvent, int, int)
Connects the figures if the mouse is released over another figure.
 o trackConnectors(MouseEvent, int, int)

Constructors

 o ConnectionTool
 public ConnectionTool(DrawingView view,
                       ConnectionFigure prototype)

Methods

 o mouseMove
 public void mouseMove(MouseEvent e,
                       int x,
                       int y)
Handles mouse move events in the drawing view.

Overrides:
mouseMove in class AbstractTool
 o 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
 o mouseDrag
 public void mouseDrag(MouseEvent e,
                       int x,
                       int y)
Adjust the created connection or split segment.

Overrides:
mouseDrag in class AbstractTool
 o 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
 o deactivate
 public void deactivate()
Deactivates the tool.

Overrides:
deactivate in class AbstractTool
 o createConnection
 protected ConnectionFigure createConnection()
Creates the ConnectionFigure. By default the figure prototype is cloned.

 o findSource
 protected Figure findSource(int x,
                             int y,
                             Drawing drawing)
Finds a connectable figure target.

 o findTarget
 protected Figure findTarget(int x,
                             int y,
                             Drawing drawing)
Finds a connectable figure target.

 o findConnection
 protected ConnectionFigure findConnection(int x,
                                           int y,
                                           Drawing drawing)
Finds an existing connection figure.

 o createdFigure
 protected ConnectionFigure createdFigure()
Gets the currently created figure

 o trackConnectors
 protected void trackConnectors(MouseEvent e,
                                int x,
                                int y)
 o findConnectionStart
 protected Figure findConnectionStart(int x,
                                      int y,
                                      Drawing drawing)
Finds a connection start figure.

 o getStartConnector
 protected Connector getStartConnector()
 o getEndConnector
 protected Connector getEndConnector()
 o getTarget
 protected Connector getTarget()

All Packages  Class Hierarchy  This Package  Previous  Next  Index