public abstract class AbstractConnectionHandle extends AbstractHandle
Handle
the start or end point of a ConnectionFigure
.
XXX - Undo/Redo is not implemented yet.Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<Connector> |
connectors
All connectors of the connectable Figure.
|
listenerList, view
Modifier | Constructor and Description |
---|---|
protected |
AbstractConnectionHandle(ConnectionFigure owner)
Initializes the change connection handle.
|
Modifier and Type | Method and Description |
---|---|
protected java.awt.Rectangle |
basicGetBounds() |
protected abstract boolean |
canConnect(Connector existingEnd,
Connector targetEnd) |
protected abstract void |
connect(Connector c)
Connect the connection with the given figure.
|
java.util.Collection<Handle> |
createSecondaryHandles()
Creates secondary handles.
|
protected abstract void |
disconnect()
Disconnects the connection.
|
void |
draw(java.awt.Graphics2D g)
Draws this handle.
|
protected Connector |
findConnector(java.awt.geom.Point2D.Double p,
Figure f,
ConnectionFigure prototype) |
protected BezierFigure |
getBezierFigure() |
protected BezierPath.Node |
getBezierNode() |
protected abstract int |
getBezierNodeIndex() |
protected abstract java.awt.geom.Point2D.Double |
getLocation()
Returns the start point of the connection.
|
ConnectionFigure |
getOwner()
Returns the owner of this handle.
|
protected Connector |
getSource()
Gets the side of the connection that is unaffected by
the change.
|
protected abstract Connector |
getTarget()
Returns the connector of the change.
|
java.lang.String |
getToolTipText(java.awt.Point p)
Returns a tooltip for the specified location.
|
boolean |
isCombinableWith(Handle handle)
Returns true, if the given handle is an instance of the same
class or of a subclass of this handle,.
|
void |
repaintConnectors()
Updates the list of connectors that we draw when the user
moves or drags the mouse over a figure to which can connect.
|
protected abstract void |
setLocation(java.awt.geom.Point2D.Double p)
Sets the location of the connectableConnector point.
|
protected void |
setPotentialTarget(Connector newTarget) |
void |
trackEnd(java.awt.Point anchor,
java.awt.Point lead,
int modifiersEx)
Connects the figure to the new connectableConnector.
|
void |
trackStart(java.awt.Point anchor,
int modifiersEx)
Disconnects the connection.
|
void |
trackStep(java.awt.Point anchor,
java.awt.Point lead,
int modifiersEx)
Finds a new connectableConnector of the connection.
|
addHandleListener, areaInvalidated, attributeChanged, contains, dispose, drawCircle, drawDiamond, drawRectangle, figureAdded, figureChanged, figureHandlesChanged, figureRemoved, figureRequestRemove, fireAreaInvalidated, fireHandleRequestRemove, fireHandleRequestSecondaryHandles, fireUndoableEditHappened, getBounds, getCursor, getDrawingArea, getEditor, getHandlesize, getView, invalidate, keyPressed, keyReleased, keyTyped, removeHandleListener, setToolTipText, setView, trackDoubleClick, updateBounds, viewTransformChanged
protected java.util.Collection<Connector> connectors
protected AbstractConnectionHandle(ConnectionFigure owner)
public ConnectionFigure getOwner()
Handle
getOwner
in interface Handle
getOwner
in class AbstractHandle
public boolean isCombinableWith(Handle handle)
AbstractHandle
isCombinableWith
in interface Handle
isCombinableWith
in class AbstractHandle
protected abstract Connector getTarget()
protected abstract void disconnect()
protected abstract void connect(Connector c)
protected abstract void setLocation(java.awt.geom.Point2D.Double p)
protected abstract java.awt.geom.Point2D.Double getLocation()
protected Connector getSource()
public void trackStart(java.awt.Point anchor, int modifiersEx)
anchor
- the position where the interaction startedpublic void trackStep(java.awt.Point anchor, java.awt.Point lead, int modifiersEx)
anchor
- the position where the interaction startedlead
- the current positionpublic void trackEnd(java.awt.Point anchor, java.awt.Point lead, int modifiersEx)
anchor
- the position where the interaction startedlead
- the current positionprotected Connector findConnector(java.awt.geom.Point2D.Double p, Figure f, ConnectionFigure prototype)
public void draw(java.awt.Graphics2D g)
draw
in interface Handle
draw
in class AbstractHandle
protected void setPotentialTarget(Connector newTarget)
protected java.awt.Rectangle basicGetBounds()
basicGetBounds
in class AbstractHandle
protected BezierFigure getBezierFigure()
protected abstract int getBezierNodeIndex()
public final java.util.Collection<Handle> createSecondaryHandles()
Handle
createSecondaryHandles
in interface Handle
createSecondaryHandles
in class AbstractHandle
protected BezierPath.Node getBezierNode()
public java.lang.String getToolTipText(java.awt.Point p)
AbstractHandle
getToolTipText
in interface Handle
getToolTipText
in class AbstractHandle
public void repaintConnectors()