public class IlvEnhancedPolylineLinkImage extends IlvCrossingAwareLinkImage
This link is suitable to be use with graph layout. If orthogonal mode, it is required that the link is connected to free link connectors or clipping link connectors.
Internally, the link utilizes link shape policies to ensure the desired
link shape. If the orthogonal mode is switched on, the link installs
automatically an orthogonal link shape policy
(IlvOrthogonalLinkShapePolicy).
If the crossing mode is switched on, the link installs automatically
a crossing link shape policy (IlvCrossingLinkShapePolicy).
If the multi link bundle mode is switched on, the link installs automatically
a bundle link shape policy (IlvBundleLinkShapePolicy).
IlvPolicyAwareLinkImage.getLinkShapePolicy(),
IlvFreeLinkConnector,
IlvClippingLinkConnector,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
BRIDGE_CROSSINGS
Crossing mode: crossings are displayed with a bridge shape.
|
static int |
NO_CROSSINGS
Crossing mode: crossings are not displayed in any particular way.
|
static int |
TUNNEL_CROSSINGS
Crossing mode: crossings are displayed with a tunnel shape.
|
| Constructor and Description |
|---|
IlvEnhancedPolylineLinkImage(IlvEnhancedPolylineLinkImage source)
Creates and initializes a new
IlvEnhancedPolylineLinkImage by
copying an existing one. |
IlvEnhancedPolylineLinkImage(IlvGraphic from,
IlvGraphic to,
boolean backoriented,
boolean oriented,
IlvPoint[] points)
Creates and initializes a new
IlvEnhancedPolylineLinkImage. |
IlvEnhancedPolylineLinkImage(IlvGraphic from,
IlvGraphic to,
boolean oriented,
IlvPoint[] points)
Creates and initializes a new
IlvEnhancedPolylineLinkImage. |
IlvEnhancedPolylineLinkImage(IlvInputStream stream)
Reads the object from an
IlvInputStream. |
| Modifier and Type | Method and Description |
|---|---|
IlvGraphic |
copy()
Copies the object.
|
protected IlvGraphic |
createCrossingGraphic(int mode)
Creates the appropriate crossing graphic.
|
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object.
|
protected void |
drawCore(Graphics2D dst,
IlvTransformer t)
Draws the object.
|
float |
getAlpha()
Returns the alpha value of this object.
|
int |
getCrossingMode()
Returns the crossing mode of the link.
|
protected IlvLinkShapePolicy |
getDefaultLinkShapePolicy(IlvGraphicBag bag)
Returns the default link shape policy of the link.
|
boolean |
isAlphaBufferEnabled()
Returns
true if an additional buffer is used to draw the
object when the alpha composition value is not 1.0. |
boolean |
isBackOriented()
Returns
true if the link is backward oriented,
and false otherwise. |
boolean |
isMultiLinkBundled()
Returns
true if the automatic bundling of multi links
is enabled, and false otherwise. |
boolean |
isOrthogonal()
Returns
true if the orthogonal mode of the link is enabled,
and false otherwise. |
void |
setAlpha(float alpha)
Changes the alpha value of this object.
|
void |
setAlphaBufferEnabled(boolean enable)
Sets whether an additional buffer is used to draw the object when
the alpha composition value is not 1.0.
|
void |
setBackOriented(boolean oriented)
Sets whether the link is backward oriented.
|
void |
setCrossingMode(int mode)
Sets the crossing mode of the link.
|
void |
setForeground(Color c)
Changes the foreground color of the object.
|
void |
setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the object.
|
void |
setLineWidth(double lineWidth)
Changes the line width of the object.
|
void |
setMaximumLineWidth(double maximumLineWidth)
Changes the maximum line width of the link.
|
void |
setMultiLinkBundled(boolean bundled)
Enables the automatic bundling of multi links.
|
void |
setOrthogonal(boolean orthogonal)
Enables the orthogonal mode of the link.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream. |
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, setCrossingEnabled, setCrossingGraphic, setCrossingGraphic, setEndCap, setGap, setGapZoomable, setIntermediateLinkPoints, setLayerOfCrossingGraphic, setLineJoin, setOriented, zoomablegetLinkPoints, getLinkShapePolicy, getPointAt, setLinkShapePolicyallowsPointInsertion, allowsPointRemoval, getPointsCardinalallowsPointMove, 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, setLineStyle, setLinkPoints, setToaddActionListener, 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, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemovedpublic static final int NO_CROSSINGS
setCrossingMode(int),
Constant Field Valuespublic static final int TUNNEL_CROSSINGS
setCrossingMode(int),
Constant Field Valuespublic static final int BRIDGE_CROSSINGS
setCrossingMode(int),
Constant Field Valuespublic IlvEnhancedPolylineLinkImage(IlvGraphic from, IlvGraphic to, boolean oriented, IlvPoint[] points)
IlvEnhancedPolylineLinkImage.
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 IlvEnhancedPolylineLinkImage(IlvGraphic from, IlvGraphic to, boolean backoriented, boolean oriented, IlvPoint[] points)
IlvEnhancedPolylineLinkImage.
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 IlvEnhancedPolylineLinkImage(IlvEnhancedPolylineLinkImage source)
IlvEnhancedPolylineLinkImage by
copying an existing one.
source - The copied object.public IlvEnhancedPolylineLinkImage(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 IlvPersistentObjectwrite in class IlvCrossingAwareLinkImagestream - The output stream.IOException - thrown when an exception occurs during
the write operation for this object.public IlvGraphic copy()
copy in class IlvCrossingAwareLinkImageIlvGraphic instance.IlvGraphicpublic void setLineWidth(double lineWidth)
setLineWidth in class IlvCrossingAwareLinkImagelineWidth - The new line width.IlvLinkImage.getLineWidth()public void setMaximumLineWidth(double maximumLineWidth)
setMaximumLineWidth in class IlvCrossingAwareLinkImagemaximumLineWidth - The maximum line width, or 0 to indicate no limit.IlvLinkImage.getMaximumLineWidth()public void setAlpha(float alpha)
alpha - The new transparency level in the range [0.0, 1.0].getAlpha()public float getAlpha()
setAlpha(float)public void setAlphaBufferEnabled(boolean enable)
enable - Whether the alpha buffer is enabled.getAlpha(),
isAlphaBufferEnabled()public boolean isAlphaBufferEnabled()
true if an additional buffer is used to draw the
object when the alpha composition value is not 1.0.getAlpha(),
setAlphaBufferEnabled(boolean)public void setOrthogonal(boolean orthogonal)
The orthogonal mode is disabled by default.
isOrthogonal(),
setMultiLinkBundled(boolean)public final boolean isOrthogonal()
true if the orthogonal mode of the link is enabled,
and false otherwise.
setOrthogonal(boolean)public void setMultiLinkBundled(boolean bundled)
If the multi link bundling is enabled, nodes should have link connectors
of type IlvClippingLinkConnector.
It bundles only those links that are straight, because these links would
otherwise overlap. It bundles only self links that have less than 4 bends,
because these self links would otherwise be hidden by the nodes.
This mode does not work well when the orthogonal mode is enabled,
because the orthogonal mode creates bends automatically, hence the
links are not straight and don't stay bundled.
The automatic bundling of multi links is disabled by default. You can set this mode before inserting the link into the grapher. You should not change this mode while the link is in the grapher.
isMultiLinkBundled(),
setOrthogonal(boolean)public final boolean isMultiLinkBundled()
true if the automatic bundling of multi links
is enabled, and false otherwise.
setMultiLinkBundled(boolean)public void setCrossingMode(int mode)
NO_CROSSINGS -
crossings are not displayed in any particular way.
TUNNEL_CROSSINGS -
crossings are displayed with a tunnel shape.
BRIDGE_CROSSINGS -
crossings are displayed with a bridge shape.
NO_CROSSINGS
getCrossingMode()public final int getCrossingMode()
setCrossingMode(int)protected IlvLinkShapePolicy getDefaultLinkShapePolicy(IlvGraphicBag bag)
IlvPolicyAwareLinkImage.setLinkShapePolicy(ilog.views.graphic.linkpolicy.IlvLinkShapePolicy), these modes won't work anymore.
Therefore it is recommended to avoid calling IlvPolicyAwareLinkImage.setLinkShapePolicy(ilog.views.graphic.linkpolicy.IlvLinkShapePolicy)
directly.
If you want to install your own link shape policy in addition to
the predefined link shape policies, you should derive your link shape
policy from
IlvAbstractLinkShapePolicy
and override this method in the following way:
protected IlvLinkShapePolicy getDefaultLinkShapePolicy(IlvGraphicBag bag)
{
IlvAbstractLinkShapePolicy p = ... your code ...
p.setChildPolicy(super.getDefaultLinkShapePolicy(bag));
return p;
}
Your link shape policy is automatically installed in this way, when
the link is inserted into a grapher, when the crossing mode, orthogonal
mode, or link bundling mode changes, or when you explicitly call:
setLinkShapePolicy(getDefaultLinkShapePolicy(bag));
setCrossingMode(int),
setOrthogonal(boolean),
setMultiLinkBundled(boolean)protected IlvGraphic createCrossingGraphic(int mode)
public void setGraphicBag(IlvGraphicBag bag)
setGraphicBag in class IlvCrossingAwareLinkImagebag - The graphic bag.IlvGraphicpublic void setBackOriented(boolean oriented)
setBackOriented in class IlvCrossingAwareLinkImageisBackOriented()public boolean isBackOriented()
true if the link is backward oriented,
and false otherwise.
A backward oriented link has an arrow drawn at the origin.isBackOriented in class IlvCrossingAwareLinkImagesetBackOriented(boolean)public void setForeground(Color c)
IlvBlinkingColor.setForeground in class IlvLinkImagec - The new color.IlvLinkImage.getForeground()public void draw(Graphics dst, IlvTransformer t)
draw in class IlvCrossingAwareLinkImagedst - The destination Graphics.t - The transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicprotected void drawCore(Graphics2D dst, IlvTransformer t)
draw(java.awt.Graphics, ilog.views.IlvTransformer) after processing the
alpha transparency. It can be overridden in subclasses.dst - The destination Graphics.t - The transformation used to draw the object.setAlpha(float)© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.