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.IdentitySearch
IFigure.NoInsets
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
PROPERTY_CONNECTION_ROUTER, PROPERTY_POINTS
MAX_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, shapeContainsPoint
addPoint, childrenContainsPoint, getEnd, getPoints, getStart, insertPoint, removePoint, setEnd, setEndpoints, setPoint, setStart
getAlpha, 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, setXOR
add, 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, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPoints, setPoints
add, 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, validate
public void addNotify()
addNotify
in interface IFigure
addNotify
in class Figure
Figure.addNotify()
public void addRoutingListener(RoutingListener listener)
listener
- the routing listenerpublic void anchorMoved(ConnectionAnchor anchor)
anchorMoved
in interface AnchorListener
anchor
- the anchor that movedpublic Rectangle getBounds()
getBounds
in interface IFigure
getBounds
in class Polyline
IFigure.getBounds()
public ConnectionRouter getConnectionRouter()
ConnectionRouter
used to layout this connection.
Will not return null
.getConnectionRouter
in interface Connection
public java.lang.Object getRoutingConstraint()
null
.getRoutingConstraint
in interface Connection
public ConnectionAnchor getSourceAnchor()
Connection
getSourceAnchor
in interface Connection
protected RotatableDecoration getSourceDecoration()
public ConnectionAnchor getTargetAnchor()
Connection
getTargetAnchor
in interface Connection
protected RotatableDecoration getTargetDecoration()
public void layout()
public void removeNotify()
removeNotify
in interface IFigure
removeNotify
in class Figure
public void removeRoutingListener(RoutingListener listener)
listener
- the listener being removedpublic void revalidate()
IFigure
revalidate
in interface IFigure
revalidate
in class Figure
IFigure.revalidate()
public void setConnectionRouter(ConnectionRouter cr)
setConnectionRouter
in interface Connection
cr
- the connection routerpublic void setRoutingConstraint(java.lang.Object cons)
setRoutingConstraint
in interface Connection
cons
- the constraintpublic void setSourceAnchor(ConnectionAnchor anchor)
setSourceAnchor
in interface Connection
anchor
- the new source anchorpublic void setSourceDecoration(RotatableDecoration dec)
Connection
.dec
- the new source decorationpublic void setTargetAnchor(ConnectionAnchor anchor)
setTargetAnchor
in interface Connection
anchor
- the new target anchorpublic void setTargetDecoration(RotatableDecoration dec)
Connection
.dec
- the new target decorationCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.