CH.ifa.draw.standard
Class ConnectionTool
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractTool
-
- CH.ifa.draw.standard.ConnectionTool
-
- All Implemented Interfaces:
- Tool
- Direct Known Subclasses:
- SynapseCreationTool
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,Object.clone()
-
-
Constructor Summary
Constructors Constructor and Description ConnectionTool(DrawingView view, ConnectionFigure prototype)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddeactivate()Deactivates the tool.voidmouseDown(java.awt.event.MouseEvent e, int x, int y)Manipulates connections in a context dependent way.voidmouseDrag(java.awt.event.MouseEvent e, int x, int y)Adjust the created connection or split segment.voidmouseMove(java.awt.event.MouseEvent e, int x, int y)Handles mouse move events in the drawing view.voidmouseUp(java.awt.event.MouseEvent e, int x, int y)Connects the figures if the mouse is released over another figure.
-
-
-
Constructor Detail
-
ConnectionTool
public ConnectionTool(DrawingView view, ConnectionFigure prototype)
-
-
Method Detail
-
mouseMove
public void mouseMove(java.awt.event.MouseEvent e, int x, int y)Handles mouse move events in the drawing view.- Specified by:
mouseMovein interfaceTool- Overrides:
mouseMovein classAbstractTool
-
mouseDown
public void mouseDown(java.awt.event.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.- Specified by:
mouseDownin interfaceTool- Overrides:
mouseDownin classAbstractTool
-
mouseDrag
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)Adjust the created connection or split segment.- Specified by:
mouseDragin interfaceTool- Overrides:
mouseDragin classAbstractTool
-
mouseUp
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)Connects the figures if the mouse is released over another figure.- Specified by:
mouseUpin interfaceTool- Overrides:
mouseUpin classAbstractTool
-
deactivate
public void deactivate()
Description copied from class:AbstractToolDeactivates the tool. This method is called whenever the user switches to another tool. Use this method to do some clean-up when the tool is switched. Subclassers should always call super.deactivate.- Specified by:
deactivatein interfaceTool- Overrides:
deactivatein classAbstractTool
-
-
DataMelt 3.0 © DataMelt by jWork.ORG