public class IlvSimpleLink extends IlvEnhancedPolylineLinkImage
IlvEnhancedPolylineLinkImage
.
Additionally, it allows the registering of property change listeners on the
link. These listeners get notified whenever a property of the link changes.
The link can have a forward arrow and a backward arrow. The link has various options that control the link shape. The link can automatically stay orthogonal, that is, with a shape comprising a sequence of horizontal and vertical segments. The link can also show crossings between orthogonal segments of other links of the same type by a tunnel or bridge shape. These crossing shapes are particularly appropriate if the line style is solid, but may be aesthetically less pleasing if the line style of the link is dashed.
This link is suitable for use with graph layout. Orthogonal links must be connected to free link connectors or clipping link connectors.
IlvEnhancedPolylineLinkImage
,
IlvSDMFreeLinkConnector
,
IlvClippingLinkConnector
,
Serialized FormBRIDGE_CROSSINGS, NO_CROSSINGS, TUNNEL_CROSSINGS
Constructor and Description |
---|
IlvSimpleLink()
Bean constructor.
|
IlvSimpleLink(IlvGraphic from,
IlvGraphic to,
boolean backoriented,
boolean oriented,
IlvPoint[] points)
Creates and initializes a new
IlvSimpleLink . |
IlvSimpleLink(IlvGraphic from,
IlvGraphic to,
boolean oriented,
IlvPoint[] points)
Creates and initializes a new
IlvSimpleLink . |
IlvSimpleLink(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
IlvSimpleLink(IlvSimpleLink source)
Creates and initializes a new
IlvSimpleLink by
copying an existing one. |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener on property modification.
|
IlvGraphic |
copy()
Copies the object.
|
protected void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
Fires a boolean property change event if the input boolean values are
not equal.
|
protected void |
firePropertyChange(String propertyName,
float oldValue,
float newValue)
Fires a float property change event if the input float values are
not equal.
|
protected void |
firePropertyChange(String propertyName,
int oldValue,
int newValue)
Fires an integer property change event if the input integer values are
not equal.
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Fires a property change event if the input objects are not equal.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener on property modification.
|
void |
setBackOriented(boolean oriented)
Sets whether the link is backward-oriented.
|
void |
setCrossingEnabled(boolean flag)
Sets whether crossings are shown on the link.
|
void |
setCrossingMode(int mode)
Sets the crossing mode of the link.
|
void |
setEndCap(int endCap)
Changes the decoration applied at the end of the polyline.
|
void |
setForeground(Color c)
Sets the color of the link.
|
void |
setGap(double gap)
Sets the gap width of the link crossings.
|
void |
setGapZoomable(boolean zoomable)
Sets whether the gap of the link crossings is zoomable.
|
void |
setLineJoin(int lineJoin)
Changes the decoration applied when two segments are joined.
|
void |
setLineStyle(float[] lineStyle)
Changes the array representing the lengths of the dash segments.
|
void |
setLineWidth(double lineWidth)
Changes the line width of the link.
|
void |
setMaximumLineWidth(double maximumLineWidth)
Changes the maximum line width of the link.
|
void |
setName(String name)
Sets the name of the link.
|
void |
setOriented(boolean oriented)
Sets whether the link is oriented.
|
void |
setOrthogonal(boolean orthogonal)
Enables the orthogonal mode of the link.
|
void |
setToolTipText(String text)
Sets the text to display in the tooltip of this object.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
createCrossingGraphic, draw, drawCore, getAlpha, getCrossingMode, getDefaultLinkShapePolicy, isAlphaBufferEnabled, isBackOriented, isMultiLinkBundled, isOrthogonal, setAlpha, setAlphaBufferEnabled, setGraphicBag, setMultiLinkBundled
applyTransform, arrowBBox, backArrowBBox, boundingBox, boundingBoxCacheContains, boundingBoxCrossingGraphic, calcBoundingBox, contains, containsAtCrossingGraphic, drawBackArrow, drawCrossingGraphic, drawPolyline, getBackArrowSize, getBoundingBoxCacheSize, getCrossingGraphic, getCrossingPolicy, getDrawingLinkPoints, getGap, getLayerOfCrossingGraphic, getSimpleShape, getStrokeShape, hasCrossings, insertPoint, invalidateBBoxCache, invalidateBoundingBoxCache, isCrossingEnabled, isGapZoomable, mergeCrossings, movePoint, removePoint, setBoundingBoxCacheSize, setCrossingGraphic, setCrossingGraphic, setIntermediateLinkPoints, setLayerOfCrossingGraphic, shouldOptimizeCache, zoomable
getLinkPoints, getLinkShapePolicy, getPointAt, setLinkShapePolicy
allowsPointInsertion, allowsPointRemoval, getPointsCardinal
allowsPointMove, arrowContains, drawArrow, finalize, getArrowSize, getConnectionPoints, getConnectionReferencePoint, getEndCap, getForeground, getFrom, getFromBoundingBox, getFromTransformer, getLineJoin, getLineStyle, getLineWidth, getLineWidth, getLinkConnectorConnectionPoint, getLinkPoints, getLocalTransformerOf, getMaximumLineWidth, getOpposite, getTo, getToBoundingBox, getToTransformer, getVisibleFrom, getVisibleTo, isOriented, isPersistent, isSpline, makeSelection, pointsInBBox, setFrom, setLinkPoints, setTo
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isSelectable, isVisible, localeChanged, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setInApplyToObject, setMovable, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
public IlvSimpleLink()
public IlvSimpleLink(IlvGraphic from, IlvGraphic to, boolean oriented, IlvPoint[] points)
IlvSimpleLink
.from
- The origin object.to
- The destination object.oriented
- Specifies whether an arrow is drawn at the end of the
link or not.points
- The intermediate points of the polylink.public IlvSimpleLink(IlvGraphic from, IlvGraphic to, boolean backoriented, boolean oriented, IlvPoint[] points)
IlvSimpleLink
.from
- The origin object.to
- The destination object.backoriented
- Specifies whether an arrow is drawn at the start of
the link or not.oriented
- Specifies whether an arrow is drawn at the end of the
link or not.points
- The intermediate points of the polylink.public IlvSimpleLink(IlvSimpleLink source)
IlvSimpleLink
by
copying an existing one.source
- The copied object.public IlvSimpleLink(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
You should not call this
method directly; instead, you should use the write
methods of the manager.write
in interface IlvPersistentObject
write
in class IlvEnhancedPolylineLinkImage
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public IlvGraphic copy()
copy
in class IlvEnhancedPolylineLinkImage
IlvGraphic
instance.IlvGraphic
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The property change listener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The property change listener.addPropertyChangeListener(java.beans.PropertyChangeListener)
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
protected void firePropertyChange(String propertyName, int oldValue, int newValue)
protected void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
protected void firePropertyChange(String propertyName, float oldValue, float newValue)
public void setOrthogonal(boolean orthogonal)
The orthogonal mode is disabled by default. The method fires events when this property changes.
setOrthogonal
in class IlvEnhancedPolylineLinkImage
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setCrossingMode(int mode)
IlvEnhancedPolylineLinkImage.NO_CROSSINGS
-
crossings are not displayed in any particular way.IlvEnhancedPolylineLinkImage.TUNNEL_CROSSINGS
-
crossings are displayed with a tunnel shape.IlvEnhancedPolylineLinkImage.BRIDGE_CROSSINGS
-
crossings are displayed with a bridge shape.IlvEnhancedPolylineLinkImage.NO_CROSSINGS
The method fires events when this property changes.setCrossingMode
in class IlvEnhancedPolylineLinkImage
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setCrossingEnabled(boolean flag)
The method fires events when this property changes.
setCrossingEnabled
in class IlvCrossingAwareLinkImage
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setGap(double gap)
The default value is 2. The method fires events when this property changes.
setGap
in class IlvCrossingAwareLinkImage
setCrossingMode(int)
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setGapZoomable(boolean zoomable)
The option is enabled by default. The method fires events when this property changes.
setGapZoomable
in class IlvCrossingAwareLinkImage
setCrossingMode(int)
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setOriented(boolean oriented)
setOriented
in class IlvCrossingAwareLinkImage
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setBackOriented(boolean oriented)
setBackOriented
in class IlvEnhancedPolylineLinkImage
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setForeground(Color c)
IlvBlinkingColor
.
The method fires events when this property changes.setForeground
in class IlvEnhancedPolylineLinkImage
c
- The new color.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setEndCap(int endCap)
setEndCap
in class IlvCrossingAwareLinkImage
endCap
- The new decoration style. The values
are defined in the class IlvStroke
.
The default value is IlvStroke.CAP_SQUARE
.IlvStroke
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setLineJoin(int lineJoin)
setLineJoin
in class IlvCrossingAwareLinkImage
lineJoin
- The new decoration style. The values are defined
in the class IlvStroke
.
The default value is IlvStroke.JOIN_MITER
.IlvStroke
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setLineWidth(double lineWidth)
setLineWidth
in class IlvEnhancedPolylineLinkImage
lineWidth
- The new line width.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setMaximumLineWidth(double maximumLineWidth)
setMaximumLineWidth
in class IlvEnhancedPolylineLinkImage
maximumLineWidth
- The maximum line width, or 0 to indicate no limit.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setLineStyle(float[] lineStyle)
setLineStyle
in class IlvLinkImage
lineStyle
- The new line style.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setName(String name)
IlvManager
does not allow two objects to
have the same name.
The method fires events when this property changes.setName
in class IlvGraphic
name
- The name of the object.IlvManager.setObjectName(ilog.views.IlvGraphic, java.lang.String)
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setToolTipText(String text)
Tooltips for Perforce JViews graphic objects will work only
if your manager view is contained in a hierarchy of Swing components.
In addition, you must enable the tooltip mechanism for the manager view
by calling the static method
IlvToolTipManager.registerView(ilog.views.IlvManagerView)
.
The method fires events when this property changes.
setToolTipText
in class IlvGraphic
text
- The tooltip string to display. If text
is
null
, the tooltip is turned off for this graphic
object.IlvToolTipManager
,
addPropertyChangeListener(java.beans.PropertyChangeListener)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.