GEF v2.0

org.eclipse.gef.handles
Class AbstractHandle

java.lang.Object
  |
  +--org.eclipse.draw2d.Figure
        |
        +--org.eclipse.gef.handles.AbstractHandle
All Implemented Interfaces:
AncestorListener, Handle, IFigure
Direct Known Subclasses:
MoveHandle, SquareHandle

public abstract class AbstractHandle
extends Figure
implements Handle, AncestorListener

Base class for handles.


Inner classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator
 
Inner classes inherited from class org.eclipse.draw2d.AncestorListener
AncestorListener.Stub
 
Inner classes inherited from class org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
AbstractHandle()
           
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.
 
Method Summary
 void addNotify()
          Adds this as a FigureListener to the owner's Figure.
 void ancestorAdded(IFigure ancestor)
           
 void ancestorMoved(IFigure ancestor)
           
 void ancestorRemoved(IFigure ancestor)
           
protected abstract  DragTracker createDragTracker()
           
 Point getAccessibleLocation()
           
 Cursor getDragCursor()
          Returns the Cursor that appears over the handle.
 DragTracker getDragTracker()
          Returns the handle tracker to use when dragging this handle.
 Locator getLocator()
          Returns the Locator associated with this handle.
protected  GraphicalEditPart getOwner()
          Returns the GraphicalEditPart associated with this handle.
protected  IFigure getOwnerFigure()
           
 void removeNotify()
           
 void setDragCursor(Cursor c)
          Sets the Cursor for the handle.
 void setDragTracker(DragTracker t)
           
protected  void setLocator(Locator locator)
           
protected  void setOwner(GraphicalEditPart editpart)
           
 void validate()
           
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocation, getMaximumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, isEnabled, isFocusTraversable, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, removeListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setUpdateManager, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHandle

public AbstractHandle()

AbstractHandle

public AbstractHandle(GraphicalEditPart owner,
                      Locator loc)
Creates a handle for the given GraphicalEditPart using the given Locator.
Parameters:
owner - The GraphicalEditPart this handle is attached to.
loc - The Locator that places the handle.

AbstractHandle

public AbstractHandle(GraphicalEditPart owner,
                      Locator loc,
                      Cursor c)
Creates a handle for the given GraphicalEditPart using the given Locator and Cursor.
Parameters:
owner - The GraphicalEditPart this handle is attached to.
loc - The Locator that places the handle.
c - The Cursor that will appear over the handle.
Method Detail

addNotify

public void addNotify()
Adds this as a FigureListener to the owner's Figure.
Overrides:
addNotify in class Figure

ancestorMoved

public void ancestorMoved(IFigure ancestor)
Specified by:
ancestorMoved in interface AncestorListener

ancestorAdded

public void ancestorAdded(IFigure ancestor)
Specified by:
ancestorAdded in interface AncestorListener

ancestorRemoved

public void ancestorRemoved(IFigure ancestor)
Specified by:
ancestorRemoved in interface AncestorListener

createDragTracker

protected abstract DragTracker createDragTracker()

getAccessibleLocation

public Point getAccessibleLocation()
Specified by:
getAccessibleLocation in interface Handle

getDragCursor

public Cursor getDragCursor()
Returns the Cursor that appears over the handle.

getDragTracker

public DragTracker getDragTracker()
Returns the handle tracker to use when dragging this handle.
Specified by:
getDragTracker in interface Handle

getLocator

public Locator getLocator()
Returns the Locator associated with this handle.

getOwner

protected GraphicalEditPart getOwner()
Returns the GraphicalEditPart associated with this handle.

getOwnerFigure

protected IFigure getOwnerFigure()

removeNotify

public void removeNotify()
Overrides:
removeNotify in class Figure

setDragCursor

public void setDragCursor(Cursor c)
                   throws Exception
Sets the Cursor for the handle.

setDragTracker

public void setDragTracker(DragTracker t)

setLocator

protected void setLocator(Locator locator)

setOwner

protected void setOwner(GraphicalEditPart editpart)

validate

public void validate()
Overrides:
validate in class Figure

GEF v2.0