Package org.eclipse.draw2d
Class PolylineConnection
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.Shape
org.eclipse.draw2d.AbstractPointListShape
org.eclipse.draw2d.Polyline
org.eclipse.draw2d.PolylineConnection
- All Implemented Interfaces:
- AnchorListener,- Connection,- IFigure
An implementation of 
Connection based on Polyline. PolylineConnection
 adds the following additional features:
 - A ConnectionRoutermay be provided which will be used to determine the connections points.
- Children may be added. The bounds calculation is extended such that the bounds is the smallest Rectangle which is large enough to display the Polyline and all of its children figures.
- A DelegatingLayoutis set as the default layout. A delegating layout allows children to position themselves viaLocators.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.draw2d.FigureFigure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigureIFigure.NoInsets
- 
Field SummaryFields inherited from class org.eclipse.draw2d.FigurebgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.ConnectionPROPERTY_CONNECTION_ROUTER, PROPERTY_POINTSFields inherited from interface org.eclipse.draw2d.IFigureMAX_DIMENSION, MIN_DIMENSION, NO_INSETS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidHooks the source and target anchors.voidaddRoutingListener(RoutingListener listener) Appends the given routing listener to the list of listeners.voidanchorMoved(ConnectionAnchor anchor) Called by the anchors of this connection when they have moved, revalidating this polyline connection.Returns the bounds which holds all the points in this polyline connection.Returns theConnectionRouterused to layout this connection.Returns this connection's routing constraint from its connection router.Returns the ConnectionAnchor at the source end of this Connection.protected RotatableDecorationReturns the ConnectionAnchor at the target end of this Connection.protected RotatableDecorationvoidlayout()Layouts this polyline.voidCalled just before the receiver is being removed from its parent.voidremoveRoutingListener(RoutingListener listener) Removes the first occurence of the given listener.voidInvalidates this figure and revalidates() its parent.voidSets the connection router which handles the layout of this polyline.voidsetRoutingConstraint(Object cons) Sets the routing constraint for this connection.voidsetSourceAnchor(ConnectionAnchor anchor) Sets the anchor to be used at the start of this polyline connection.voidSets the decoration to be used at the start of theConnection.voidsetTargetAnchor(ConnectionAnchor anchor) Sets the anchor to be used at the end of the polyline connection.voidSets the decoration to be used at the end of theConnection.Methods inherited from class org.eclipse.draw2d.PolylinecontainsPoint, fillShape, isOpaque, outlineShape, primTranslate, removeAllPoints, repaint, setLineWidth, setPoints, setTolerance, shapeContainsPointMethods inherited from class org.eclipse.draw2d.AbstractPointListShapeaddPoint, childrenContainsPoint, getEnd, getPoints, getStart, insertPoint, removePoint, setEnd, setEndpoints, setPoint, setStartMethods inherited from class org.eclipse.draw2d.ShapegetAlpha, getAntialias, getLineAttributes, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, paintFigure, setAlpha, setAlpha, setAntialias, setAntialias, setFill, setFillXOR, setLineAttributes, setLineCap, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidthFloat, setOutline, setOutlineXOR, setXORMethods inherited from class org.eclipse.draw2d.Figureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, 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, handleMouseWheelScrolled, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, requestFocus, 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, validateMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.ConnectiongetPoints, setPointsMethods inherited from interface org.eclipse.draw2d.IFigureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, handleMouseWheelScrolled, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, setBackgroundColor, setBorder, setBounds, setClippingStrategy, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
- 
Constructor Details- 
PolylineConnectionpublic PolylineConnection()
 
- 
- 
Method Details- 
addNotifypublic void addNotify()Hooks the source and target anchors.
- 
addRoutingListenerAppends the given routing listener to the list of listeners.- Parameters:
- listener- the routing listener
- Since:
- 3.2
 
- 
anchorMovedCalled by the anchors of this connection when they have moved, revalidating this polyline connection.- Specified by:
- anchorMovedin interface- AnchorListener
- Parameters:
- anchor- the anchor that moved
 
- 
getBoundsReturns the bounds which holds all the points in this polyline connection. Returns any previously existing bounds, else calculates by unioning all the children's dimensions.
- 
getConnectionRouterReturns theConnectionRouterused to layout this connection. Will not returnnull.- Specified by:
- getConnectionRouterin interface- Connection
- Returns:
- this connection's router
 
- 
getRoutingConstraintReturns this connection's routing constraint from its connection router. May returnnull.- Specified by:
- getRoutingConstraintin interface- Connection
- Returns:
- the connection's routing constraint
 
- 
getSourceAnchorDescription copied from interface:ConnectionReturns the ConnectionAnchor at the source end of this Connection.- Specified by:
- getSourceAnchorin interface- Connection
- Returns:
- the anchor at the start of this polyline connection (may be null)
 
- 
getSourceDecoration- Returns:
- the source decoration (may be null)
 
- 
getTargetAnchorDescription copied from interface:ConnectionReturns the ConnectionAnchor at the target end of this Connection.- Specified by:
- getTargetAnchorin interface- Connection
- Returns:
- the anchor at the end of this polyline connection (may be null)
 
- 
getTargetDecoration- Returns:
- the target decoration (may be null)
- Since:
- 2.0
 
- 
layoutpublic void layout()Layouts this polyline. If the start and end anchors are present, the connection router is used to route this, after which it is laid out. It also fires a moved method.
- 
removeNotifypublic void removeNotify()Called just before the receiver is being removed from its parent. Results in removing itself from the connection router.- Specified by:
- removeNotifyin interface- IFigure
- Overrides:
- removeNotifyin class- Figure
- Since:
- 2.0
 
- 
removeRoutingListenerRemoves the first occurence of the given listener.- Parameters:
- listener- the listener being removed
- Since:
- 3.2
 
- 
revalidatepublic void revalidate()Description copied from interface:IFigureInvalidates this figure and revalidates() its parent. If a figure does not have a parent, it will request a validation from it UpdateManager. Calling this method does not guarantee that a repaint will occur.- Specified by:
- revalidatein interface- IFigure
- Overrides:
- revalidatein class- Figure
- See Also:
 
- 
setConnectionRouterSets the connection router which handles the layout of this polyline. Generally set by the parent handling the polyline connection.- Specified by:
- setConnectionRouterin interface- Connection
- Parameters:
- cr- the connection router
 
- 
setRoutingConstraintSets the routing constraint for this connection.- Specified by:
- setRoutingConstraintin interface- Connection
- Parameters:
- cons- the constraint
 
- 
setSourceAnchorSets the anchor to be used at the start of this polyline connection.- Specified by:
- setSourceAnchorin interface- Connection
- Parameters:
- anchor- the new source anchor
 
- 
setSourceDecorationSets the decoration to be used at the start of theConnection.- Parameters:
- dec- the new source decoration
- Since:
- 2.0
 
- 
setTargetAnchorSets the anchor to be used at the end of the polyline connection. Removes this listener from the old anchor and adds it to the new anchor.- Specified by:
- setTargetAnchorin interface- Connection
- Parameters:
- anchor- the new target anchor
 
- 
setTargetDecorationSets the decoration to be used at the end of theConnection.- Parameters:
- dec- the new target decoration
 
 
-