CH.ifa.draw.standard
Class ConnectionHandle
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractHandle
-
- CH.ifa.draw.standard.LocatorHandle
-
- CH.ifa.draw.standard.ConnectionHandle
-
- All Implemented Interfaces:
- Handle
- Direct Known Subclasses:
- SpecialConnectionHandle
public class ConnectionHandle extends LocatorHandle
A handle to connect figures. The connection object to be created is specified by a prototype.
Design Patterns
Prototype
ConnectionHandle creates the connection by cloning a prototype.- See Also:
ConnectionFigure,Object.clone()
-
-
Field Summary
-
Fields inherited from class CH.ifa.draw.standard.AbstractHandle
HANDLESIZE
-
-
Constructor Summary
Constructors Constructor and Description ConnectionHandle(Figure owner, Locator l, ConnectionFigure prototype)Constructs a handle with the given owner, locator, and connection prototype
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddraw(java.awt.Graphics g)Draws the connection handle, by default the outline of a blue circle.voidinvokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view)Connects the figures if the mouse is released over another figure.voidinvokeStart(int x, int y, DrawingView view)Creates the connectionvoidinvokeStep(int x, int y, int anchorX, int anchorY, DrawingView view)Tracks the connection.-
Methods inherited from class CH.ifa.draw.standard.LocatorHandle
locate
-
Methods inherited from class CH.ifa.draw.standard.AbstractHandle
containsPoint, displayBox, invokeEnd, invokeStart, invokeStep, owner
-
-
-
-
Constructor Detail
-
ConnectionHandle
public ConnectionHandle(Figure owner, Locator l, ConnectionFigure prototype)
Constructs a handle with the given owner, locator, and connection prototype
-
-
Method Detail
-
invokeStart
public void invokeStart(int x, int y, DrawingView view)Creates the connection- Specified by:
invokeStartin interfaceHandle- Overrides:
invokeStartin classAbstractHandle- Parameters:
x- the x position where the interaction startedy- the y position where the interaction startedview- the handles container
-
invokeStep
public void invokeStep(int x, int y, int anchorX, int anchorY, DrawingView view)Tracks the connection.- Specified by:
invokeStepin interfaceHandle- Overrides:
invokeStepin classAbstractHandle- Parameters:
x- the current x positiony- the current y positionanchorX- the x position where the interaction startedanchorY- the y position where the interaction started
-
invokeEnd
public void invokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view)Connects the figures if the mouse is released over another figure.- Specified by:
invokeEndin interfaceHandle- Overrides:
invokeEndin classAbstractHandle- Parameters:
x- the current x positiony- the current y positionanchorX- the x position where the interaction startedanchorY- the y position where the interaction started
-
draw
public void draw(java.awt.Graphics g)
Draws the connection handle, by default the outline of a blue circle.- Specified by:
drawin interfaceHandle- Overrides:
drawin classAbstractHandle
-
-
DataMelt 3.0 © DataMelt by jWork.ORG