Runtime

## org.eclipse.gmf.runtime.diagram.ui.handles
Class ConnectionHandle

    java.lang.Object
      org.eclipse.draw2d.Figure
          org.eclipse.gef.handles.AbstractHandle
              org.eclipse.gmf.runtime.diagram.ui.handles.ConnectionHandle

All Implemented Interfaces:
  AncestorListener, Handle, IFigure

public class ConnectionHandle
extends AbstractHandle

This is the handle figure used to represent a connection handle.

Nested Class Summary
`static class` `ConnectionHandle.HandleDirection` An enumeration of connection directions.

Nested classes inherited from class org.eclipse.draw2d.Figure
`Figure.FigureIterator, Figure.IdentitySearch`

Nested classes inherited from class org.eclipse.draw2d.AncestorListener
`AncestorListener.Stub`

Nested classes inherited from class org.eclipse.draw2d.IFigure
`IFigure.NoInsets`

Field Summary

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
`ConnectionHandle(IGraphicalEditPart ownerEditPart, ConnectionHandle.HandleDirection relationshipDirection, java.lang.String tooltip)` Creates a new `ConnectionHandle`.

Method Summary
`void` `addErrorIcon()` Superimposes an error icon on this connection handle.
`protected DragTracker` `createDragTracker()`
`IFigure` `findFigureAt(int x, int y, TreeSearch search)`
`protected Image` `getImage(int side)` Gets the image to be used for the connection handle given the side of the shape where the connection handle will appear.
`GraphicalEditPart` `getOwner()` Make public.
`boolean` `isIncoming()` Is this for incoming relationships?
`void` `removeErrorIcon()` Removes the error icon if it is being displayed.
`void` `setLocator(Locator locator)` Make public.
`protected void` `setRelationshipDirection(ConnectionHandle.HandleDirection direction)` Sets the direction that the relationship is to be created.
`void` `validate()` Updates the images used for the handles, based on the side they will appear on.

Methods inherited from class org.eclipse.gef.handles.AbstractHandle
`addNotify, ancestorAdded, ancestorMoved, ancestorRemoved, getAccessibleLocation, getDragCursor, getDragTracker, getLocator, getOwnerFigure, removeNotify, setDragCursor, setDragTracker, setOwner`

Methods inherited from class org.eclipse.draw2d.Figure

`add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, 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, 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`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConnectionHandle

    public ConnectionHandle(IGraphicalEditPart ownerEditPart,
                            ConnectionHandle.HandleDirection relationshipDirection,
                            java.lang.String tooltip)

  Creates a new `ConnectionHandle`.

Parameters:
  `ownerEditPart` - the editpart for which the handle belongs
  `relationshipDirection` - direction that the relationship is to be created
  `tooltip` - the tooltip

Method Detail

### createDragTracker

    protected DragTracker createDragTracker()

  See Also:
    `AbstractHandle.createDragTracker()`

### findFigureAt

    public IFigure findFigureAt(int x,
                                int y,
                                TreeSearch search)

  See Also:
    `IFigure.findFigureAt(int, int, org.eclipse.draw2d.TreeSearch)`

### setLocator

    public void setLocator(Locator locator)

  Make public.

  See Also:
    `AbstractHandle.setLocator(org.eclipse.draw2d.Locator)`

### getOwner

    public GraphicalEditPart getOwner()

  Make public.

  See Also:
    `AbstractHandle.getOwner()`

### setRelationshipDirection

    protected void setRelationshipDirection(ConnectionHandle.HandleDirection direction)

  Sets the direction that the relationship is to be created.

  Parameters:
    `direction` - the `HandleDirection` that the relationship is to be created

### isIncoming

    public boolean isIncoming()

  Is this for incoming relationships?

  Returns:
    true if this is for incoming relationships, false otherwise

### addErrorIcon

    public void addErrorIcon()

  Superimposes an error icon on this connection handle.

### removeErrorIcon

    public void removeErrorIcon()

  Removes the error icon if it is being displayed.

### validate

    public void validate()

  Updates the images used for the handles, based on the side they will appear on. Sets the location of the handles using the locator.

  See Also:
    `IFigure.validate()`

### getImage

    protected Image getImage(int side)

  Gets the image to be used for the connection handle given the side of the shape where the connection handle will appear. A call to `isIncoming()` will reveal the direction of the handle.

  Parameters:
    `side` - the side of the shape where the connection handle will appear, a value in PositionConstants
  Returns:
    the image to be used for the connection handle

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.