|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.graphic.IlvGraphicSet
ilog.views.graphic.composite.decoration.IlvAssociation
public class IlvAssociation
An IlvAssociation contains an IlvLine that
connects to the center point of two graphic objects.
The connection point for the anchor and callout nodes can be either of
the following:
IlvGraphic instanceIlvLinkImage instance that is closest to
the center of the segment lengths.The default values for an IlvAssociation instance are as
follows:
IlvLine
IlvLine
instance in the IlvAssociation object.
IlvAssociation in a simple Java application:
IlvGrapher grapher = new IlvGrapher();
// Creates the origin and the destination nodes
IlvRectangle origin = new IlvReliefRectangle(new IlvRect(50,80,40,40));
origin.setBackground(Color.lightGray);
grapher.addNode(origin,false);
IlvRectangle dest = new IlvReliefRectangle(new IlvRect(250,80,40,40));
dest.setBackground(Color.lightGray);
grapher.addNode(dest,false);
// Creates the link between the nodes
IlvLinkImage link = new IlvPolylineLinkImage(origin,dest,false,null);
link.setLineWidth(5);
link.setForeground(Color.decode("#40BFBD"));
grapher.addLink(link,false);
// Creates a composite which groups a label and a left bracket
IlvCompositeGraphic callout = new IlvCompositeGraphic();
IlvCenteredLayout cl = new IlvCenteredLayout();
cl.setInsets(new Insets(5,5,5,5));
callout.setLayout(cl);
// Creates the bracket
IlvBracket bracket = new IlvBracket();
bracket.move(10,10);
bracket.setFillOn(true);
bracket.setBackground(Color.white);
bracket.setWidthRatio(0.5f);
callout.setChildren(0,bracket);
// Creates the text
IlvText text = new IlvText(new IlvPoint(),"This is a link annotation");
text.setFont(Font.decode("sansserif-BOLD-10"));
callout.setChildren(1,text);
grapher.addNode(callout,false);
// Creates the association which links the bracket to the link
IlvAssociation association = new IlvAssociation();
association.setAnchor(link);
association.setCallout(callout);
association.setLineWidth(1);
association.setForeground(Color.black);
association.setLineStyle(new float[]{2.0f,4.0f});
grapher.addNode(association,false);
The following image shows the graphic objects created in the code example:
>
IlvAssociation 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.
IlvCompositeGraphic,
IlvCenteredLayout,
IlvManager,
IlvManagerView,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ilog.views.graphic.IlvGraphicSet |
|---|
IlvGraphicSet.DelegateObjectInteractor |
| Field Summary |
|---|
| Fields inherited from class ilog.views.graphic.IlvGraphicSet |
|---|
list |
| Constructor Summary | |
|---|---|
IlvAssociation()
Creates an IlvAssociation with the default values. |
|
IlvAssociation(IlvAssociation source)
Creates a new IlvAssociation by copying an existing one. |
|
IlvAssociation(IlvGraphic anchor)
Creates an IlvAssociation with the supplied anchor. |
|
IlvAssociation(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
| Method Summary | |
|---|---|
void |
contentsChanged(ManagerContentChangedEvent evt)
This method is called by the manager, to notify content modifications. |
IlvGraphic |
copy()
Copies this object. |
IlvGraphic |
getAnchor()
Returns the IlvGraphic which defines the anchor point of the association. |
IlvGraphic |
getCallout()
Returns the callout of this association. |
Color |
getForeground()
Returns the color of the line. |
IlvLine |
getLine()
Returns the line that represents the association. |
float[] |
getLineStyle()
Returns the array representing the lengths of the dash segments. |
float |
getLineWidth()
Returns the line width of the object. |
float |
getMaximumLineWidth()
Returns the maximum line width of the line. |
IlvSelection |
makeSelection()
Creates a selection object for this object. |
void |
setAnchor(IlvGraphic anchor)
Sets the IlvGraphic which defines the anchor point of the association. |
void |
setCallout(IlvGraphic graphic)
Defines the callout of this association. |
void |
setForeground(Color color)
Changes the color of the line. |
void |
setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the object. |
void |
setLine(IlvLine line)
Sets the line that associates the anchor callout and the callout callout |
void |
setLineStyle(float[] lineStyle)
Changes the array representing the lengths of the dash segments. |
void |
setLineWidth(float lineWidth)
Changes the line width of the object. |
void |
setMaximumLineWidth(float maximumLineWidth)
Changes the maximum line width of the line. |
void |
write(IlvOutputStream stream)
Writes the attributes of a persistent object. |
boolean |
zoomable()
Returns always false, because this object is not zoomable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ilog.views.IlvGraphicBag |
|---|
getGraphicBag |
| Constructor Detail |
|---|
public IlvAssociation()
IlvAssociation with the default values.
public IlvAssociation(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - The input stream.
IlvReadFileException - if the format is not correct.public IlvAssociation(IlvGraphic anchor)
IlvAssociation with the supplied anchor.
public IlvAssociation(IlvAssociation source)
IlvAssociation by copying an existing one.
| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvGraphicSetIlvGraphicpublic IlvLine getLine()
public void setLine(IlvLine line)
public IlvGraphic getAnchor()
IlvGraphic which defines the anchor point of the association.
public void setAnchor(IlvGraphic anchor)
IlvGraphic which defines the anchor point of the association.
The anchor can be either:
IlvGraphic The anchor point is the center of the bounding box of the
supplied callout.
IlvLinkImage The anchor point is the middle of the segment which is the closest to the
middle of the segment lengths.
public IlvGraphic getCallout()
public void setCallout(IlvGraphic graphic)
public void setGraphicBag(IlvGraphicBag bag)
setGraphicBag in class IlvGraphicSetbag - The graphic bag to contain this graphic object.IlvGraphicpublic void contentsChanged(ManagerContentChangedEvent evt)
contentsChanged in interface ManagerContentChangedListenerevt - the "content changed" event.IlvManager.addManagerContentChangedListener(ilog.views.event.ManagerContentChangedListener),
IlvManager.removeManagerContentChangedListener(ilog.views.event.ManagerContentChangedListener),
IlvManager.addManagerTreeContentChangedListener(ilog.views.event.ManagerContentChangedListener),
IlvManager.removeManagerTreeContentChangedListener(ilog.views.event.ManagerContentChangedListener)public IlvSelection makeSelection()
IlvDrawSelection.
Override this method in your custom graphic object to use a different selection object.
You should normally not call this method directly.
makeSelection in class IlvGraphicIlvDrawSelectionpublic boolean zoomable()
false, because this object is not zoomable.
zoomable in class IlvGraphicSetIlvGraphic,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvManager
public void write(IlvOutputStream stream)
throws IOException
write in interface IlvPersistentObjectwrite in class IlvGraphicSetstream - the output stream
IOException - thrown when an exception occurs during
the write operation for this object.public float[] getLineStyle()
public void setLineStyle(float[] lineStyle)
lineStyle - The new line style.public float getLineWidth()
0.
public void setLineWidth(float lineWidth)
lineWidth - The new line width.public void setForeground(Color color)
setForeground in class IlvGraphiccolor - The new color.IlvGraphic.draw(Graphics, IlvTransformer),
IlvGraphic.setBackground(Color),
IlvGraphic.setFillOn(boolean),
IlvGraphic.setStrokeOn(boolean),
IlvGraphicpublic Color getForeground()
public float getMaximumLineWidth()
public void setMaximumLineWidth(float maximumLineWidth)
maximumLineWidth - The new maximum line width.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||