public abstract class AbstractHandle extends Figure implements Handle, AncestorListener
AncestorListener
to the owner's figure, and will automatically
revalidate this handle whenever the owner's figure moves.Figure.FigureIterator, Figure.IdentitySearch
AncestorListener.Stub
IFigure.NoInsets
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
Constructor and Description |
---|
AbstractHandle()
Null constructor
|
AbstractHandle(GraphicalEditPart owner,
Locator loc)
Creates a handle for the given
GraphicalEditPart using the
given Locator . |
AbstractHandle(GraphicalEditPart owner,
Locator loc,
Cursor c)
Creates a handle for the given
GraphicalEditPart using the
given Locator and Cursor . |
Modifier and Type | Method and Description |
---|---|
void |
addNotify()
Adds this as an
AncestorListener to the owner's Figure . |
void |
ancestorAdded(IFigure ancestor) |
void |
ancestorMoved(IFigure ancestor) |
void |
ancestorRemoved(IFigure ancestor) |
protected abstract DragTracker |
createDragTracker()
Creates a new drag tracker to be returned by getDragTracker().
|
Point |
getAccessibleLocation()
By default, the center of the handle is returned.
|
Cursor |
getDragCursor()
Deprecated.
use getCursor()
|
DragTracker |
getDragTracker()
Returns the drag tracker to use when the user clicks on this handle.
|
Locator |
getLocator()
Returns the
Locator used to position this handle. |
protected GraphicalEditPart |
getOwner()
Returns the
GraphicalEditPart associated with this handle. |
protected IFigure |
getOwnerFigure()
Convenience method to return the owner's figure.
|
void |
removeNotify() |
void |
setDragCursor(Cursor c)
Deprecated.
use setCursor()
|
void |
setDragTracker(DragTracker t)
Sets the drag tracker for this handle.
|
protected void |
setLocator(Locator locator)
Sets the locator which position this handle.
|
protected void |
setOwner(GraphicalEditPart editpart)
Sets the owner editpart associated with this handle.
|
void |
validate()
Extends validate() to place the handle using its locator.
|
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates
public AbstractHandle()
public AbstractHandle(GraphicalEditPart owner, Locator loc)
GraphicalEditPart
using the
given Locator
.owner
- The editpart which provided this handleloc
- The locator to position the handlepublic AbstractHandle(GraphicalEditPart owner, Locator loc, Cursor c)
GraphicalEditPart
using the
given Locator
and Cursor
.owner
- The editpart which provided this handleloc
- The locator to position the handlec
- The cursor to display when the mouse is over the handlepublic void addNotify()
AncestorListener
to the owner's Figure
.public void ancestorMoved(IFigure ancestor)
ancestorMoved
in interface AncestorListener
AncestorListener.ancestorMoved(org.eclipse.draw2d.IFigure)
public void ancestorAdded(IFigure ancestor)
ancestorAdded
in interface AncestorListener
AncestorListener.ancestorAdded(org.eclipse.draw2d.IFigure)
public void ancestorRemoved(IFigure ancestor)
ancestorRemoved
in interface AncestorListener
AncestorListener.ancestorRemoved(org.eclipse.draw2d.IFigure)
protected abstract DragTracker createDragTracker()
public Point getAccessibleLocation()
getAccessibleLocation
in interface Handle
null
or the absolute locationHandle.getAccessibleLocation()
public Cursor getDragCursor()
public DragTracker getDragTracker()
createDragTracker()
.getDragTracker
in interface Handle
public Locator getLocator()
Locator
used to position this handle.protected GraphicalEditPart getOwner()
GraphicalEditPart
associated with this handle.protected IFigure getOwnerFigure()
public void removeNotify()
removeNotify
in interface IFigure
removeNotify
in class Figure
IFigure.removeNotify()
public void setDragCursor(Cursor c) throws java.lang.Exception
c
- the cursorjava.lang.Exception
- a bogus excpetion declarationpublic void setDragTracker(DragTracker t)
t
- the drag trackerprotected void setLocator(Locator locator)
locator
- the new locatorprotected void setOwner(GraphicalEditPart editpart)
editpart
- the ownerpublic void validate()
validate
in interface IFigure
validate
in class Figure
IFigure.validate()
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.