public class PolylineConnection extends Polyline implements Connection, AnchorListener
Connection based on Polyline. PolylineConnection
adds the following additional features:
ConnectionRouter may be provided which will be used to determine
the connections points.
DelegatingLayout is set as the default layout. A delegating layout
allows children to position themselves via Locators.
Figure.FigureIterator, Figure.IdentitySearchIFigure.NoInsetsbgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipPROPERTY_CONNECTION_ROUTER, PROPERTY_POINTSMAX_DIMENSION, MIN_DIMENSION, NO_INSETS| Constructor and Description |
|---|
PolylineConnection() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotify()
Hooks the source and target anchors.
|
void |
addRoutingListener(RoutingListener listener)
Appends the given routing listener to the list of listeners.
|
void |
anchorMoved(ConnectionAnchor anchor)
Called by the anchors of this connection when they have moved,
revalidating this polyline connection.
|
Rectangle |
getBounds()
Returns the bounds which holds all the points in this polyline
connection.
|
ConnectionRouter |
getConnectionRouter()
Returns the
ConnectionRouter used to layout this connection. |
java.lang.Object |
getRoutingConstraint()
Returns this connection's routing constraint from its connection router.
|
ConnectionAnchor |
getSourceAnchor()
Returns the ConnectionAnchor at the source end of this Connection.
|
protected RotatableDecoration |
getSourceDecoration() |
ConnectionAnchor |
getTargetAnchor()
Returns the ConnectionAnchor at the target end of this Connection.
|
protected RotatableDecoration |
getTargetDecoration() |
void |
layout()
Layouts this polyline.
|
void |
removeNotify()
Called just before the receiver is being removed from its parent.
|
void |
removeRoutingListener(RoutingListener listener)
Removes the first occurence of the given listener.
|
void |
revalidate()
Invalidates this figure and revalidates() its parent.
|
void |
setConnectionRouter(ConnectionRouter cr)
Sets the connection router which handles the layout of this polyline.
|
void |
setRoutingConstraint(java.lang.Object cons)
Sets the routing constraint for this connection.
|
void |
setSourceAnchor(ConnectionAnchor anchor)
Sets the anchor to be used at the start of this polyline connection.
|
void |
setSourceDecoration(RotatableDecoration dec)
Sets the decoration to be used at the start of the
Connection. |
void |
setTargetAnchor(ConnectionAnchor anchor)
Sets the anchor to be used at the end of the polyline connection.
|
void |
setTargetDecoration(RotatableDecoration dec)
Sets the decoration to be used at the end of the
Connection. |
containsPoint, fillShape, isOpaque, outlineShape, primTranslate, removeAllPoints, repaint, setLineWidth, setPoints, setTolerance, shapeContainsPointaddPoint, childrenContainsPoint, getEnd, getPoints, getStart, insertPoint, removePoint, setEnd, setEndpoints, setPoint, setStartgetAlpha, 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, setXORadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, 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, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, paint, paintBorder, paintChildren, paintClientArea, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, 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, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPoints, setPointsadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, 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, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, 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, validatepublic void addNotify()
addNotify in interface IFigureaddNotify in class FigureFigure.addNotify()public void addRoutingListener(RoutingListener listener)
listener - the routing listenerpublic void anchorMoved(ConnectionAnchor anchor)
anchorMoved in interface AnchorListeneranchor - the anchor that movedpublic Rectangle getBounds()
getBounds in interface IFiguregetBounds in class PolylineIFigure.getBounds()public ConnectionRouter getConnectionRouter()
ConnectionRouter used to layout this connection.
Will not return null.getConnectionRouter in interface Connectionpublic java.lang.Object getRoutingConstraint()
null.getRoutingConstraint in interface Connectionpublic ConnectionAnchor getSourceAnchor()
ConnectiongetSourceAnchor in interface Connectionprotected RotatableDecoration getSourceDecoration()
public ConnectionAnchor getTargetAnchor()
ConnectiongetTargetAnchor in interface Connectionprotected RotatableDecoration getTargetDecoration()
public void layout()
public void removeNotify()
removeNotify in interface IFigureremoveNotify in class Figurepublic void removeRoutingListener(RoutingListener listener)
listener - the listener being removedpublic void revalidate()
IFigurerevalidate in interface IFigurerevalidate in class FigureIFigure.revalidate()public void setConnectionRouter(ConnectionRouter cr)
setConnectionRouter in interface Connectioncr - the connection routerpublic void setRoutingConstraint(java.lang.Object cons)
setRoutingConstraint in interface Connectioncons - the constraintpublic void setSourceAnchor(ConnectionAnchor anchor)
setSourceAnchor in interface Connectionanchor - the new source anchorpublic void setSourceDecoration(RotatableDecoration dec)
Connection.dec - the new source decorationpublic void setTargetAnchor(ConnectionAnchor anchor)
setTargetAnchor in interface Connectionanchor - the new target anchorpublic void setTargetDecoration(RotatableDecoration dec)
Connection.dec - the new target decorationCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.