ilog.views.graphic
Class IlvDoubleSplineLinkImage

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.IlvLinkImage
          extended by ilog.views.graphic.IlvDoubleLinkImage
              extended by ilog.views.graphic.IlvDoubleSplineLinkImage
All Implemented Interfaces:
IlvPolyPointsInterface, IlvPersistentObject, Transferable, Serializable

public class IlvDoubleSplineLinkImage
extends IlvDoubleLinkImage

IlvDoubleSplineLinkImage represents the connection between two nodes in a grapher; the link is displayed as a spline with two curves. For more information about specialized link objects, see IlvLinkImage.

The default values for an IlvDoubleSplineLinkImage instance are as follows:

Example

The following code example shows how to use an IlvDoubleSplineLinkImage in a simple Java application:

   IlvGraphic node1, node2;
   IlvGrapher grapher = new IlvGrapher();
   IlvDoubleSplineLinkImage link;
   
   //Create new ellipse node and add it to the grapher.
   node1 = new IlvEllipse(new IlvRect(30,10,50,50), true, false);
   grapher.addNode(node1,false);
   
   //Add a new rectangular node to the grapher.
   node2 = new IlvRectangle(new IlvRect(220,90,50,50), false, true);
   grapher.addNode(node2, 2, true);
   
   //Link the two nodes and add them to a grapher.
   link = new IlvDoubleSplineLinkImage(
              node1, 
              node2,
              IlvDoubleLinkImage.VerticalLink, 
              true);
   grapher.addLink(link,true);
 

The following image shows the graphic object created in the code example:

About Graphic Objects

IlvDoubleSplineLinkImage is a custom graphic object, that is, a subclass of IlvGraphic. Graphic objects are controlled using an IlvManager instance and displayed using one or more IlvManagerView instances in a Java Swing application. For information about generic features for graphic objects, see IlvGraphic.

See Also:
IlvPoint, IlvManager, IlvManagerView, IlvStroke, Serialized Form

Field Summary
 
Fields inherited from class ilog.views.graphic.IlvDoubleLinkImage
HorizontalLink, VerticalLink
 
Constructor Summary
IlvDoubleSplineLinkImage(IlvDoubleSplineLinkImage source)
          Create a new IlvDoubleSplineLinkImage by copying the specified one.
IlvDoubleSplineLinkImage(IlvGraphic from, IlvGraphic to, boolean oriented)
          Creates a new link image.
IlvDoubleSplineLinkImage(IlvGraphic from, IlvGraphic to, int orientation, boolean oriented)
          Creates a new link image.
IlvDoubleSplineLinkImage(IlvInputStream stream)
          Reads the object from an IlvInputStream.
 
Method Summary
 IlvRect boundingBox(IlvTransformer t)
          Returns the bounding rectangle of the object.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the link.
 IlvGraphic copy()
          Copies the object.
 void draw(Graphics dst, IlvTransformer t)
          Draws the object.
 
Methods inherited from class ilog.views.graphic.IlvDoubleLinkImage
getConnectionPoints, getConnectionReferencePoint, getLinkPoints, getOrientation, getPointAt, getPointsCardinal, setOrientation, write
 
Methods inherited from class ilog.views.IlvLinkImage
allowsPointInsertion, allowsPointMove, allowsPointRemoval, applyTransform, arrowBBox, drawArrow, finalize, getArrowSize, getEndCap, getForeground, getFrom, getFromBoundingBox, getFromTransformer, getLineJoin, getLineStyle, getLineWidth, getLineWidth, getLinkConnectorConnectionPoint, getLocalTransformerOf, getMaximumLineWidth, getOpposite, getTo, getToBoundingBox, getToTransformer, getVisibleFrom, getVisibleTo, insertPoint, isOriented, isPersistent, isSpline, makeSelection, movePoint, pointsInBBox, removePoint, setEndCap, setForeground, setFrom, setIntermediateLinkPoints, setLineJoin, setLineStyle, setLineWidth, setMaximumLineWidth, setOriented, 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, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipText, setVisible, toString, translate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvDoubleSplineLinkImage

public IlvDoubleSplineLinkImage(IlvGraphic from,
                                IlvGraphic to,
                                boolean oriented)
Creates a new link image.

Parameters:
from - the origin object.
to - the destination object.
oriented - if oriented is true then an arrow is drawn at the destination point.

IlvDoubleSplineLinkImage

public IlvDoubleSplineLinkImage(IlvGraphic from,
                                IlvGraphic to,
                                int orientation,
                                boolean oriented)
Creates a new link image.

Parameters:
from - the origin object.
to - the destination object.
orientation - the valid values for this may be IlvDoubleLinkImage.VerticalLink or IlvDoubleLinkImage.HorizontalLink. It specifies the direction the link takes upon leaving the from node.
oriented - if oriented is true then an arrow is drawn at the destination point.

IlvDoubleSplineLinkImage

public IlvDoubleSplineLinkImage(IlvDoubleSplineLinkImage source)
Create a new IlvDoubleSplineLinkImage by copying the specified one.


IlvDoubleSplineLinkImage

public IlvDoubleSplineLinkImage(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

copy

public IlvGraphic copy()
Copies the object.

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

draw

public void draw(Graphics dst,
                 IlvTransformer t)
Draws the object.

Overrides:
draw in class IlvLinkImage
Parameters:
dst - The destination Graphics.
t - The transformation used to draw the object.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

contains

public boolean contains(IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Tests if a point lies within the outline of the link.

Overrides:
contains in class IlvLinkImage
Parameters:
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation that was applied to the object when it was drawn.
Returns:
true if the point lies inside this graphic object.
See Also:
IlvGraphic

boundingBox

public IlvRect boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object.

Specified by:
boundingBox in interface IlvPolyPointsInterface
Overrides:
boundingBox in class IlvLinkImage
Parameters:
t - The transformer used to draw the object.
See Also:
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic


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