|
||||||||||
| 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.graphic.IlvLine
ilog.views.graphic.IlvArrowLine
public class IlvArrowLine
IlvArrowLine represents a custom graphic object that shows a
straight line between two given points with a small arrow head on the line
trajectory.
The default values for an IlvArrowLine instance are as
follows:
Color.black00 100100to point
The following code example shows how to use an IlvArrowLine in a
simple Java application:
IlvManager manager = new IlvManager(); IlvArrowLine myLine = new IlvArrowLine(); myLine.setFrom(new IlvPoint(20,20)); myLine.setTo(new IlvPoint(200,150)); myLine.setForeground(Color.green); myLine.setLineWidth(4); myLine.setArrowPosition(0.6f); manager.addObject(myLine, true);
The following image shows the graphic object created in the code example:
IlvArrowLine 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,
Serialized Form| Constructor Summary | |
|---|---|
IlvArrowLine()
Creates a new arrow line starting at 0, 0 and ending at 100, 100. |
|
IlvArrowLine(float fromx,
float fromy,
float tox,
float toy,
float atpos)
Creates a new arrow line starting at fromx, fromy and ending at tox, toy. |
|
IlvArrowLine(IlvArrowLine source)
Creates a new line by copying an existing one. |
|
IlvArrowLine(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
| Method Summary | |
|---|---|
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object. |
IlvGraphic |
copy()
Copies the object. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object. |
float |
getArrowPosition()
Returns the position of the arrow. |
protected float |
getArrowSize(float lineWidth,
IlvTransformer t)
Returns the size of the arrow for the corresponding IlvTransformer. |
void |
setArrowPosition(float p)
Changes the position of the arrow. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
| Methods inherited from class ilog.views.graphic.IlvLine |
|---|
allowsPointInsertion, allowsPointMove, allowsPointRemoval, applyTransform, contains, finalize, getEndCap, getForeground, getFrom, getLineStyle, getLineWidth, getLineWidth, getMaximumLineWidth, getPointAt, getPointsCardinal, getTo, insertPoint, makeSelection, movePoint, pointsInBBox, removePoint, setEndCap, setForeground, setFrom, setLineStyle, setLineWidth, setMaximumLineWidth, setTo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvArrowLine()
(100, 100).
IlvArrowLine(float, float, float, float, float)
public IlvArrowLine(float fromx,
float fromy,
float tox,
float toy,
float atpos)
public IlvArrowLine(IlvArrowLine source)
public IlvArrowLine(IlvInputStream stream)
throws IlvReadFileException
stream - the input stream.
IlvReadFileException - if the format is not correct.| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvLineIlvGraphicpublic void setArrowPosition(float p)
p - the new position of the arrow. The value
must be in the range of [0.,1.]public float getArrowPosition()
public void draw(Graphics dst,
IlvTransformer t)
draw in class IlvLinedst - The destination Graphics.t - The transformation used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphic
protected float getArrowSize(float lineWidth,
IlvTransformer t)
IlvTransformer.
By redefining this method the subclass can change the default size of the arrow
which by default is proportional to the link line width.
If this method returns a size that is no longer proportional to the transformer
zoom factor, this may change the zoom capability of this object and the
IlvGraphic.zoomable() method may also have to return something different.
lineWidth - The actual line width used to draw the object in manager
coordinates.t - The transformer used to draw the object.IlvLine.getLineWidth()public IlvRect boundingBox(IlvTransformer t)
boundingBox in interface IlvPolyPointsInterfaceboundingBox in class IlvLinet - The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphic
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 IlvLinestream - 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 | |||||||||