All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.standard.ConnectionHandle

java.lang.Object
   |
   +----CH.ifa.draw.standard.AbstractHandle
           |
           +----CH.ifa.draw.standard.LocatorHandle
                   |
                   +----CH.ifa.draw.standard.ConnectionHandle

public class ConnectionHandle
extends LocatorHandle
A handle to connect figures. The connection object to be created is specified by a prototype.
Design Patterns

 o Prototype
ConnectionHandle creates the connection by cloning a prototype.


See Also:
ConnectionFigure, clone

Constructor Index

 o ConnectionHandle(Figure, Locator, ConnectionFigure)
Constructs a handle with the given owner, locator, and connection prototype

Method Index

 o createConnection()
Creates the ConnectionFigure.
 o draw(Graphics)
Draws the connection handle, by default the outline of a blue circle.
 o findConnectionTarget(int, int, Drawing)
Finds a connection end figure.
 o findConnector(int, int, Figure)
 o invokeEnd(int, int, int, int, DrawingView)
Connects the figures if the mouse is released over another figure.
 o invokeStart(int, int, DrawingView)
Creates the connection
 o invokeStep(int, int, int, int, DrawingView)
Tracks the connection.

Constructors

 o ConnectionHandle
 public ConnectionHandle(Figure owner,
                         Locator l,
                         ConnectionFigure prototype)
Constructs a handle with the given owner, locator, and connection prototype

Methods

 o invokeStart
 public void invokeStart(int x,
                         int y,
                         DrawingView view)
Creates the connection

Overrides:
invokeStart in class AbstractHandle
 o invokeStep
 public void invokeStep(int x,
                        int y,
                        int anchorX,
                        int anchorY,
                        DrawingView view)
Tracks the connection.

Overrides:
invokeStep in class AbstractHandle
 o 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.

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

 o findConnectionTarget
 protected Connector findConnectionTarget(int x,
                                          int y,
                                          Drawing drawing)
Finds a connection end figure.

 o findConnector
 protected Connector findConnector(int x,
                                   int y,
                                   Figure f)
 o draw
 public void draw(Graphics g)
Draws the connection handle, by default the outline of a blue circle.

Overrides:
draw in class AbstractHandle

All Packages  Class Hierarchy  This Package  Previous  Next  Index