|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.IlvLinkImage
ilog.views.graphic.IlvDoubleLinkImage
public class IlvDoubleLinkImage
IlvDoubleLinkImage represents the connection between two
nodes in a grapher; the link is displayed as
three lines containing two right angles.
For more information about specialized link graphic objects, see
IlvLinkImage.
The default values for an IlvDoubleLinkImage instance are as
follows:
Color.black0fIlvStroke.CAP_SQUARE
The following code example shows how to use an
IlvDoubleLinkImage in a simple Java application:
IlvGraphic node1, node2;
IlvGrapher grapher = new IlvGrapher();
IlvDoubleLinkImage 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 IlvDoubleLinkImage(
node1,
node2,
IlvDoubleLinkImage.VerticalLink,
true);
grapher.addLink(link,true);
The following image shows the graphic object created in the code example:
>
IlvDoubleLinkImage 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.
IlvPoint,
IlvManager,
IlvManagerView,
IlvStroke,
Serialized Form| Field Summary | |
|---|---|
static int |
HorizontalLink
HORIZONTAL orientation of the link. |
static int |
VerticalLink
Vertical orientation of the link. |
| Constructor Summary | |
|---|---|
IlvDoubleLinkImage(IlvDoubleLinkImage source)
Create a new IlvDoubleLinkImage by copying the specified one. |
|
IlvDoubleLinkImage(IlvGraphic from,
IlvGraphic to,
boolean oriented)
Creates a new double link image. |
|
IlvDoubleLinkImage(IlvGraphic from,
IlvGraphic to,
int orientation,
boolean oriented)
Creates a new double link image. |
|
IlvDoubleLinkImage(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
| Method Summary | |
|---|---|
IlvGraphic |
copy()
Copies the object. |
void |
getConnectionPoints(IlvPoint src,
IlvPoint dst,
IlvTransformer t)
Computes the origin and destination point to draw the link. |
IlvPoint |
getConnectionReferencePoint(boolean origin,
IlvTransformer t)
Returns the reference connection point. |
IlvPoint[] |
getLinkPoints(IlvTransformer t)
Returns the points that define the link. |
int |
getOrientation()
Returns the orientation of the link. |
IlvPoint |
getPointAt(int index,
IlvTransformer t)
Returns the point at a specified index. |
int |
getPointsCardinal()
Returns the number of points. |
void |
setOrientation(int orientation)
Changes the orientation of the link. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int VerticalLink
public static final int HorizontalLink
| Constructor Detail |
|---|
public IlvDoubleLinkImage(IlvGraphic from,
IlvGraphic to,
boolean oriented)
from - the origin object.to - the destination object.oriented - if oriented is true then an arrow is drawn at the
destination point.
public IlvDoubleLinkImage(IlvGraphic from,
IlvGraphic to,
int orientation,
boolean oriented)
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.public IlvDoubleLinkImage(IlvDoubleLinkImage source)
IlvDoubleLinkImage by copying the specified one.
public IlvDoubleLinkImage(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - the input stream.
IlvReadFileException - if the format is not correct.| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvLinkImageIlvGraphic instance.IlvGraphicpublic void setOrientation(int orientation)
IlvDoubleLinkImage.VerticalLink or
IlvDoubleLinkImage.HorizontalLink.
It specifies the direction the link takes upon leaving the
origin node.
public int getOrientation()
public int getPointsCardinal()
getPointsCardinal in interface IlvPolyPointsInterfacegetPointsCardinal in class IlvLinkImage
public IlvPoint getPointAt(int index,
IlvTransformer t)
index is 0 or 1 because
the object defines a polypoints of 2 points event is the
method getLinkPoints returns 4 points. The reason
is that we only want to edit the extremity points.
getPointAt in interface IlvPolyPointsInterfacegetPointAt in class IlvLinkImageindex - the index of the point.t - the transformer through which the object is drawn.
public IlvPoint getConnectionReferencePoint(boolean origin,
IlvTransformer t)
getConnectionReferencePoint in class IlvLinkImageorigin - If origin is true, then the connection
point of the origin is searched for. If origin is false then
the connection point of the destination is searched for.t - The transformer that is used to draw the node.IlvLinkConnector
public void getConnectionPoints(IlvPoint src,
IlvPoint dst,
IlvTransformer t)
getConnectionPoints in class IlvLinkImagesrc - a point to store the origin.dst - a point to store the destination.t - the transformer used to draw the link.IlvLinkConnector.getConnectionPoint(ilog.views.IlvLinkImage, boolean, ilog.views.IlvTransformer)public IlvPoint[] getLinkPoints(IlvTransformer t)
getConnectionPoints member function
and the intermediate points for the angles.
getLinkPoints in class IlvLinkImage
public void write(IlvOutputStream stream)
throws IOException
IlvOutputStream.
Note that even if this is a public method, you should not
call it directly, you should use the write
methods of the manager.
write in interface IlvPersistentObjectwrite in class IlvLinkImagestream - The output stream.
IOException - thrown when an exception occurs during
the write operation for this object.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||