ilog.views.sdm.graphic
Class IlvSimpleLink

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.IlvLinkImage
          extended by ilog.views.graphic.IlvPolylineLinkImage
              extended by ilog.views.graphic.linkpolicy.IlvPolicyAwareLinkImage
                  extended by ilog.views.graphic.linkpolicy.IlvCrossingAwareLinkImage
                      extended by ilog.views.graphic.IlvEnhancedPolylineLinkImage
                          extended by ilog.views.sdm.graphic.IlvSimpleLink
All Implemented Interfaces:
IlvPolyPointsInterface, IlvPersistentObject, Transferable, Serializable
Direct Known Subclasses:
IlvGeneralLink

public class IlvSimpleLink
extends IlvEnhancedPolylineLinkImage

A link between two nodes of a grapher with several points. This link is functionally equivalent to 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.

Since:
JViews 6.0
See Also:
IlvEnhancedPolylineLinkImage, IlvSDMFreeLinkConnector, IlvClippingLinkConnector, Serialized Form

Field Summary
 
Fields inherited from class ilog.views.graphic.IlvEnhancedPolylineLinkImage
BRIDGE_CROSSINGS, NO_CROSSINGS, TUNNEL_CROSSINGS
 
Constructor Summary
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.
 
Method Summary
 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(float 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(float lineWidth)
          Changes the line width of the link.
 void setMaximumLineWidth(float 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.
 
Methods inherited from class ilog.views.graphic.IlvEnhancedPolylineLinkImage
createCrossingGraphic, draw, drawCore, getAlpha, getCrossingMode, getDefaultLinkShapePolicy, isAlphaBufferEnabled, isBackOriented, isMultiLinkBundled, isOrthogonal, setAlpha, setAlphaBufferEnabled, setGraphicBag, setMultiLinkBundled
 
Methods inherited from class ilog.views.graphic.linkpolicy.IlvCrossingAwareLinkImage
applyTransform, arrowBBox, backArrowBBox, boundingBox, boundingBoxCacheContains, boundingBoxCrossingGraphic, calcBoundingBox, contains, containsAtCrossingGraphic, drawBackArrow, drawCrossingGraphic, drawPolyline, getBackArrowSize, getBoundingBoxCacheSize, getCrossingGraphic, getCrossingPolicy, getDrawingLinkPoints, getGap, getLayerOfCrossingGraphic, getSimpleShape, getStrokeShape, hasCrossings, insertPoint, invalidateBoundingBoxCache, isCrossingEnabled, isGapZoomable, mergeCrossings, movePoint, removePoint, setBoundingBoxCacheSize, setCrossingGraphic, setCrossingGraphic, setIntermediateLinkPoints, setLayerOfCrossingGraphic
 
Methods inherited from class ilog.views.graphic.linkpolicy.IlvPolicyAwareLinkImage
getLinkPoints, getLinkShapePolicy, getPointAt, setLinkShapePolicy
 
Methods inherited from class ilog.views.graphic.IlvPolylineLinkImage
allowsPointInsertion, allowsPointRemoval, getPointsCardinal
 
Methods inherited from class ilog.views.IlvLinkImage
allowsPointMove, drawArrow, finalize, getArrowSize, getConnectionPoints, getConnectionReferencePoint, getEndCap, getForeground, getFrom, getFromBoundingBox, getFromTransformer, getLineJoin, getLineStyle, getLineWidth, getLineWidth, getLinkConnectorConnectionPoint, getLocalTransformerOf, getMaximumLineWidth, getOpposite, getTo, getToBoundingBox, getToTransformer, getVisibleFrom, getVisibleTo, isOriented, isPersistent, isSpline, makeSelection, pointsInBBox, setFrom, setTo, zoomable
 
Methods inherited from class ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, getAndAssociateObjectInteractor, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isSelectable, isVisible, move, move, moveResize, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setEditable, setFillOn, setInApplyToObject, setMovable, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setVisible, toString, translate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvSimpleLink

public IlvSimpleLink()
Bean constructor. You should not use this constructor.


IlvSimpleLink

public IlvSimpleLink(IlvGraphic from,
                     IlvGraphic to,
                     boolean oriented,
                     IlvPoint[] points)
Creates and initializes a new IlvSimpleLink.

Parameters:
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.

IlvSimpleLink

public IlvSimpleLink(IlvGraphic from,
                     IlvGraphic to,
                     boolean backoriented,
                     boolean oriented,
                     IlvPoint[] points)
Creates and initializes a new IlvSimpleLink.

Parameters:
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.

IlvSimpleLink

public IlvSimpleLink(IlvSimpleLink source)
Creates and initializes a new IlvSimpleLink by copying an existing one.

Parameters:
source - The copied object.

IlvSimpleLink

public IlvSimpleLink(IlvInputStream stream)
              throws IlvReadFileException
Reads the object from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if the format is not correct.
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the object to an IlvOutputStream. You should not call this method directly; instead, you should use the write methods of the manager.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvEnhancedPolylineLinkImage
Parameters:
stream - The output stream.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

copy

public IlvGraphic copy()
Copies the object.

Overrides:
copy in class IlvEnhancedPolylineLinkImage
Returns:
A copy of this IlvGraphic instance.
See Also:
IlvGraphic

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener on property modification.

Parameters:
listener - The property change listener.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener on property modification.

Parameters:
listener - The property change listener.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Fires a property change event if the input objects are not equal.

See Also:
PropertyChangeSupport.firePropertyChange(String, Object, Object), addPropertyChangeListener(java.beans.PropertyChangeListener)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  int oldValue,
                                  int newValue)
Fires an integer property change event if the input integer values are not equal.

See Also:
PropertyChangeSupport.firePropertyChange(String, int, int), addPropertyChangeListener(java.beans.PropertyChangeListener)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  boolean oldValue,
                                  boolean newValue)
Fires a boolean property change event if the input boolean values are not equal.

See Also:
PropertyChangeSupport.firePropertyChange(String, boolean, boolean), addPropertyChangeListener(java.beans.PropertyChangeListener)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  float oldValue,
                                  float newValue)
Fires a float property change event if the input float values are not equal.

See Also:
PropertyChangeSupport.firePropertyChange(String, Object, Object), addPropertyChangeListener(java.beans.PropertyChangeListener)

setOrthogonal

public void setOrthogonal(boolean orthogonal)
Enables the orthogonal mode of the link. In orthogonal mode, the bend points of the link can no longer be moved arbitrarily; instead they are always moved in such a way that the link segments remain orthogonal.

The orthogonal mode is disabled by default. The method fires events when this property changes.

Overrides:
setOrthogonal in class IlvEnhancedPolylineLinkImage
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setCrossingMode

public void setCrossingMode(int mode)
Sets the crossing mode of the link. The options are: The default value is IlvEnhancedPolylineLinkImage.NO_CROSSINGS The method fires events when this property changes.

Overrides:
setCrossingMode in class IlvEnhancedPolylineLinkImage
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setCrossingEnabled

public void setCrossingEnabled(boolean flag)
Sets whether crossings are shown on the link. This method can temporarily disable crossings without changing the crossing mode.

The method fires events when this property changes.

Overrides:
setCrossingEnabled in class IlvCrossingAwareLinkImage
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setGap

public void setGap(float gap)
Sets the gap width of the link crossings. This is used only when the crossings are displayed.

The default value is 2. The method fires events when this property changes.

Overrides:
setGap in class IlvCrossingAwareLinkImage
See Also:
setCrossingMode(int), addPropertyChangeListener(java.beans.PropertyChangeListener)

setGapZoomable

public void setGapZoomable(boolean zoomable)
Sets whether the gap of the link crossings is zoomable. This is used only when the crossings are displayed. If the gap is zoomable, the gap width follows the zoom level. If the gap is not zoomable, the gap width is the same for all zoom levels. In nested graphers, where links of different graphers cross each other, it is visually more appealing if the gap is not zoomable.

The option is enabled by default. The method fires events when this property changes.

Overrides:
setGapZoomable in class IlvCrossingAwareLinkImage
See Also:
setCrossingMode(int), addPropertyChangeListener(java.beans.PropertyChangeListener)

setOriented

public void setOriented(boolean oriented)
Sets whether the link is oriented. An oriented link has an arrow drawn at the destination. The method fires events when this property changes.

Overrides:
setOriented in class IlvCrossingAwareLinkImage
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setBackOriented

public void setBackOriented(boolean oriented)
Sets whether the link is backward-oriented. A backward-oriented link has an arrow drawn at the origin. The method fires events when this property changes.

Overrides:
setBackOriented in class IlvEnhancedPolylineLinkImage
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setForeground

public void setForeground(Color c)
Sets the color of the link. The method fires events when this property changes.

Overrides:
setForeground in class IlvEnhancedPolylineLinkImage
Parameters:
c - The new color.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setEndCap

public void setEndCap(int endCap)
Changes the decoration applied at the end of the polyline. The method fires events when this property changes.

Overrides:
setEndCap in class IlvCrossingAwareLinkImage
Parameters:
endCap - The new decoration style. The values are defined in the class IlvStroke. The default value is IlvStroke.CAP_SQUARE.
See Also:
IlvStroke, addPropertyChangeListener(java.beans.PropertyChangeListener)

setLineJoin

public void setLineJoin(int lineJoin)
Changes the decoration applied when two segments are joined. The method fires events when this property changes.

Overrides:
setLineJoin in class IlvCrossingAwareLinkImage
Parameters:
lineJoin - The new decoration style. The values are defined in the class IlvStroke. The default value is IlvStroke.JOIN_MITER.
See Also:
IlvStroke, addPropertyChangeListener(java.beans.PropertyChangeListener)

setLineWidth

public void setLineWidth(float lineWidth)
Changes the line width of the link. The method fires events when this property changes.

Overrides:
setLineWidth in class IlvEnhancedPolylineLinkImage
Parameters:
lineWidth - The new line width.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setMaximumLineWidth

public void setMaximumLineWidth(float maximumLineWidth)
Changes the maximum line width of the link. If the maximum line width is specified and not equal to zero, then the width of the link will stop zooming when the maximum line width is reached. A value of zero means that there is no limit. The method fires events when this property changes.

Overrides:
setMaximumLineWidth in class IlvEnhancedPolylineLinkImage
Parameters:
maximumLineWidth - The maximum line width, or 0 to indicate no limit.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setLineStyle

public void setLineStyle(float[] lineStyle)
Changes the array representing the lengths of the dash segments. Alternate entries in the array represent the user space lengths of the opaque and transparent segments of the dashes. The method fires events when this property changes.

Overrides:
setLineStyle in class IlvLinkImage
Parameters:
lineStyle - The new line style.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setName

public void setName(String name)
Sets the name of the link. The object name might not be set, which occurs if the object is in a graphic bag that does not allow the name change. For example, the IlvManager does not allow two objects to have the same name. The method fires events when this property changes.

Overrides:
setName in class IlvGraphic
Parameters:
name - The name of the object.
See Also:
IlvManager.setObjectName(ilog.views.IlvGraphic, java.lang.String), addPropertyChangeListener(java.beans.PropertyChangeListener)

setToolTipText

public void setToolTipText(String text)
Sets the text to display in the tooltip of this object.

Tooltips for ILOG 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.

Overrides:
setToolTipText in class IlvGraphic
Parameters:
text - The tooltip string to display. If text is null, the tooltip is turned off for this graphic object.
See Also:
IlvToolTipManager, addPropertyChangeListener(java.beans.PropertyChangeListener)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.