|
JHotDraw 7.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.draw.AbstractHandle
org.jhotdraw.draw.AbstractConnectionHandle
public abstract class AbstractConnectionHandle
AbstractConnectionHandle factors the common code for handles that can be used to change the connection of a ConnectionFigure. XXX - Undo/Redo is not implemented yet.
Field Summary | |
---|---|
protected java.util.Collection<Connector> |
connectors
All connectors of the connectable Figure. |
Fields inherited from class org.jhotdraw.draw.AbstractHandle |
---|
listenerList, view |
Constructor Summary | |
---|---|
protected |
AbstractConnectionHandle(ConnectionFigure owner)
Initializes the change connection handle. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Collection<Connector> connectors
Constructor Detail |
---|
protected AbstractConnectionHandle(ConnectionFigure owner)
Method Detail |
---|
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 abstract boolean canConnect(Connector existingEnd, Connector targetEnd)
protected 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)
Handle
getToolTipText
in interface Handle
getToolTipText
in class AbstractHandle
public void repaintConnectors()
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |