org.jhotdraw.draw.handle
Class AbstractConnectionHandle
- java.lang.Object
-
- org.jhotdraw.draw.handle.AbstractHandle
-
- org.jhotdraw.draw.handle.AbstractConnectionHandle
-
- All Implemented Interfaces:
- java.awt.event.KeyListener, java.util.EventListener, FigureListener, Handle
- Direct Known Subclasses:
- ConnectionEndHandle, ConnectionStartHandle
public abstract class AbstractConnectionHandle extends AbstractHandle
This abstract class can be extended to implement aHandlethe start or end point of aConnectionFigure. XXX - Undo/Redo is not implemented yet.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.Collection<Handle>createSecondaryHandles()Creates secondary handles.voiddraw(java.awt.Graphics2D g)Draws this handle.ConnectionFiguregetOwner()Returns the owner of this handle.java.lang.StringgetToolTipText(java.awt.Point p)Returns a tooltip for the specified location.booleanisCombinableWith(Handle handle)Returns true, if the given handle is an instance of the same class or of a subclass of this handle,.voidrepaintConnectors()Updates the list of connectors that we draw when the user moves or drags the mouse over a figure to which can connect.voidtrackEnd(java.awt.Point anchor, java.awt.Point lead, int modifiersEx)Connects the figure to the new connectableConnector.voidtrackStart(java.awt.Point anchor, int modifiersEx)Disconnects the connection.voidtrackStep(java.awt.Point anchor, java.awt.Point lead, int modifiersEx)Finds a new connectableConnector of the connection.-
Methods inherited from class org.jhotdraw.draw.handle.AbstractHandle
addHandleListener, areaInvalidated, attributeChanged, contains, dispose, figureAdded, figureChanged, figureHandlesChanged, figureRemoved, figureRequestRemove, getBounds, getCursor, getDrawingArea, getEditor, getView, invalidate, keyPressed, keyReleased, keyTyped, removeHandleListener, setToolTipText, setView, trackDoubleClick, viewTransformChanged
-
-
-
-
Method Detail
-
getOwner
public ConnectionFigure getOwner()
Description copied from interface:HandleReturns the owner of this handle.- Specified by:
getOwnerin interfaceHandle- Overrides:
getOwnerin classAbstractHandle
-
isCombinableWith
public boolean isCombinableWith(Handle handle)
Description copied from class:AbstractHandleReturns true, if the given handle is an instance of the same class or of a subclass of this handle,.- Specified by:
isCombinableWithin interfaceHandle- Overrides:
isCombinableWithin classAbstractHandle
-
trackStart
public void trackStart(java.awt.Point anchor, int modifiersEx)Disconnects the connection.- Parameters:
anchor- the position where the interaction started
-
trackStep
public void trackStep(java.awt.Point anchor, java.awt.Point lead, int modifiersEx)Finds a new connectableConnector of the connection.- Parameters:
anchor- the position where the interaction startedlead- the current position
-
trackEnd
public void trackEnd(java.awt.Point anchor, java.awt.Point lead, int modifiersEx)Connects the figure to the new connectableConnector. If there is no new connectableConnector the connection reverts to its original one.- Parameters:
anchor- the position where the interaction startedlead- the current position
-
draw
public void draw(java.awt.Graphics2D g)
Draws this handle.- Specified by:
drawin interfaceHandle- Overrides:
drawin classAbstractHandle
-
createSecondaryHandles
public final java.util.Collection<Handle> createSecondaryHandles()
Description copied from interface:HandleCreates secondary handles.- Specified by:
createSecondaryHandlesin interfaceHandle- Overrides:
createSecondaryHandlesin classAbstractHandle
-
getToolTipText
@Nullable public java.lang.String getToolTipText(java.awt.Point p)
Description copied from class:AbstractHandleReturns a tooltip for the specified location. By default, AbstractHandle returns null.- Specified by:
getToolTipTextin interfaceHandle- Overrides:
getToolTipTextin classAbstractHandle
-
repaintConnectors
public 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG