|
||||||||||
| 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.IlvGraphicHandle
public class IlvGraphicHandle
An IlvGraphicHandle object, called a handle, is used to reference an
IlvGraphic object.
Handles make it possible to indirectly access the referenced object.
Complex graphic objects can thus be "duplicated" as many time as you like by simply
creating new handle objects which all reference the same original graphic object.
Referencing a complex graphic object instead of copying it helps you to save computing
resources. Note that two handles that reference the same object share the same bounding
rectangle, so this class is useful when
the handles are in different managers.
To put in the same manager several handles referencing the same object,
you may use the class IlvTransformedGraphic.
| Constructor Summary | |
|---|---|
|
IlvGraphicHandle(IlvGraphic object,
boolean owner)
Creates a new IlvGraphicHandle. |
protected |
IlvGraphicHandle(IlvGraphic object,
boolean owner,
boolean delegateMoveResize)
Creates a new IlvGraphicHandle. |
|
IlvGraphicHandle(IlvGraphicHandle source)
Creates a new IlvGraphicHandle by copying an existing one. |
|
IlvGraphicHandle(IlvInputStream stream)
Reads the object from an IlvInputStream. |
| Method Summary | |
|---|---|
void |
applyTransform(IlvTransformer t)
Applies a transformation to the shape of the object. |
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object. |
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests whether a point lies within the outline of the object. |
IlvGraphic |
copy()
Copies the object. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object. |
IlvPoint |
getIntersectionWithOutline(IlvPoint innerPoint,
IlvPoint outerPoint,
IlvTransformer t)
Returns the intersection of the line segment from inner point to outer point with the shape of the graphic object. |
IlvGraphic |
getObject()
Returns the referenced object. |
protected JPopupMenu |
getOriginalPopupMenu(IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
This is the original implementation of getPopupMenu
from the superclass to retrieve the popup menu. |
JPopupMenu |
getPopupMenu(IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
Returns the Swing popup menu to display when the popup is triggered while the mouse pointer is at a specified location inside the graphic object. |
String |
getToolTipText(IlvPoint p,
IlvTransformer t)
Returns the tooltip text to display when the mouse pointer is at a specified location inside the graphic object. |
boolean |
inside(IlvRect rect,
IlvRect trect,
IlvTransformer t)
Tests whether a rectangle contains the object. |
boolean |
intersects(IlvRect rect,
IlvRect trect,
IlvTransformer t)
Tests whether a rectangle overlaps the object. |
boolean |
isOwner()
Returns the ownership property of the object. |
boolean |
isPersistent()
If this method returns true the IlvGraphic
instance will be saved in IVL files. |
void |
move(float x,
float y)
Moves the object. |
void |
move(IlvPoint p)
Moves the object. |
void |
moveResize(IlvRect size)
Resizes the object. |
void |
resize(float neww,
float newh)
Resizes the object. |
void |
rotate(IlvPoint center,
double angle)
Rotates the object. |
void |
scale(double scalex,
double scaley)
Resizes the object. |
void |
setBackground(Color c)
Changes the background color of the object. |
protected void |
setDelegateMoveResize(boolean delegateMoveResize)
Sets whether operations that change the position of the object are directly delegated to the referenced object. |
void |
setForeground(Color c)
Changes the foreground color of the object. |
void |
setObject(IlvGraphic object)
Changes the referenced object. |
void |
setOwner(boolean owner)
Changes the ownership property of the object. |
void |
translate(float dx,
float dy)
Translates the object. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
boolean |
zoomable()
Returns true if the object is zoomable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvGraphicHandle(IlvGraphic object,
boolean owner)
IlvGraphicHandle.
object - the referenced object.owner - if true then the referenced object will be copied
when the handle is copied, otherwise the copy of the handle will
reference the same object.
protected IlvGraphicHandle(IlvGraphic object,
boolean owner,
boolean delegateMoveResize)
IlvGraphicHandle.
This constructor is mainly useful when creating subclasses of this class.
object - The referenced object.owner - If true, the referenced object will be copied
when the handle is copied, otherwise the copy of the handle will
refer to the same object.delegateMoveResize - If true, operations that change
the position of the object are directly delegated to the referenced object.public IlvGraphicHandle(IlvGraphicHandle source)
IlvGraphicHandle by copying an existing one.
Note that the referenced object is copied only if the origin
is owner of the reference.
public IlvGraphicHandle(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - the input stream.
IlvReadFileException - if the format is not correct.| Method Detail |
|---|
public final IlvGraphic getObject()
public void setObject(IlvGraphic object)
IlvManager, this method can be called only using the method
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean) of the manager.
public boolean isOwner()
setOwner(boolean)public void setOwner(boolean owner)
isOwner()protected void setDelegateMoveResize(boolean delegateMoveResize)
public IlvGraphic copy()
copy in class IlvGraphicisOwner()public boolean zoomable()
zoomable on the referenced object.
zoomable in class IlvGraphicIlvGraphic,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvManager
public void draw(Graphics dst,
IlvTransformer t)
draw on the referenced object.
draw in class IlvGraphicdst - the destination Graphics.t - the transformation used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic IlvRect boundingBox(IlvTransformer t)
boundingBox on the referenced object.
boundingBox in class IlvGraphict - the transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic void applyTransform(IlvTransformer t)
applyTransform on the referenced object.
applyTransform in class IlvGraphict - the transformer to be applied.IlvGraphic
public boolean contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
contains on the referenced object.
contains in class IlvGraphicp - the point to be tested.tp - the point p transformed by the transformer t.t - the transformation applied to the object when it
was drawn.
true if the point lies inside this graphic object.IlvGraphic
public boolean intersects(IlvRect rect,
IlvRect trect,
IlvTransformer t)
intersects on the referenced object.
intersects in class IlvGraphicrect - the rectangle to be tested.trect - the rectangle rect transformed by the transformer t.t - the transformation that was applied to the object when it
was drawn.
true if the rectangle overlaps this graphic object.IlvGraphic
public boolean inside(IlvRect rect,
IlvRect trect,
IlvTransformer t)
inside on the referenced object.
inside in class IlvGraphicrect - the rectangle to be tested.trect - the rectangle rect transformed by the transformer t.t - the transformation that was applied to the object when it
was drawn.IlvGraphic
public IlvPoint getIntersectionWithOutline(IlvPoint innerPoint,
IlvPoint outerPoint,
IlvTransformer t)
innerPoint is not inside the graphic object,
or if outerPoint is not outside the graphic object, it
must return a valid point. For instance, if there is no intersection,
it can return the start point.
getIntersectionWithOutline in class IlvGraphicinnerPoint - A point usually inside the graphic object, given in
manager view coordinates.outerPoint - A point usually outside of the graphic object, given in
manager view coordinates.t - The transformation used to draw the object.IlvClippingLinkConnector
public void move(float x,
float y)
move on the referenced object.
move in class IlvGraphicx - The new horizontal position.y - The new vertical position.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)public void move(IlvPoint p)
move on the referenced object.
move in class IlvGraphicp - The new position of the top-left corner.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)public void moveResize(IlvRect size)
moveResize on the referenced object.
moveResize in class IlvGraphicsize - The new bounding rectangle for this object.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)
public void translate(float dx,
float dy)
translate on the referenced object.
translate in class IlvGraphicdx - The horizontal translation factor.dy - The vertical translation factor.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)
public void rotate(IlvPoint center,
double angle)
rotate on the referenced object.
rotate in class IlvGraphiccenter - The center of the rotation.angle - The rotation angle in degrees.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)
public void scale(double scalex,
double scaley)
scale on the referenced object.
scale in class IlvGraphicscalex - The horizontal scaling factor.scaley - The vertical scaling factor.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)
public void resize(float neww,
float newh)
resize on the referenced object.
resize in class IlvGraphicneww - The new horizontal width.newh - The new horizontal height.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)public void setForeground(Color c)
setForeground on the referenced object.
setForeground in class IlvGraphicc - the new color.IlvGraphic.draw(Graphics, IlvTransformer),
IlvGraphic.setBackground(Color),
IlvGraphic.setFillOn(boolean),
IlvGraphic.setStrokeOn(boolean),
IlvGraphicpublic void setBackground(Color c)
setBackground on the referenced object.
setBackground in class IlvGraphicc - the new color.IlvGraphic.draw(Graphics, IlvTransformer),
IlvGraphic.setForeground(Color),
IlvGraphic.setFillOn(boolean),
IlvGraphic.setStrokeOn(boolean),
IlvGraphic
public String getToolTipText(IlvPoint p,
IlvTransformer t)
Note that you must enable the tooltip mechanism for the manager view
by calling the static method
IlvToolTipManager.registerView(ilog.views.IlvManagerView).
getToolTipText in class IlvGraphicp - The location of the mouse (in view coordinates).t - The transformer that converts the coordinate system of this object
(the manager coordinates) into the coordinate system of the
manager view in which the tooltip is about to be displayed
(the view coordinates).
p for transformation
t, or null if no tool tip should be displayed.IlvGraphic,
IlvGraphic.getToolTipText(),
IlvGraphic.setToolTipText(String)
public JPopupMenu getPopupMenu(IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
Note that you must enable the popup menu mechanism for the manager view
by calling the static method
IlvPopupMenuManager.registerView(ilog.views.IlvManagerView).
getPopupMenu in class IlvGraphicp - The location of the mouse (in view coordinates).t - The transformer that converts the coordinate system of this object
(the manager coordinates) into the coordinate system of the
manager view in which the tooltip is about to be displayed
(the view coordinates).view - The manager view that triggered the popup menu.popupManager - The popup menu manager.
null.IlvGraphic,
IlvPopupMenuManager.registerView(ilog.views.IlvManagerView),
IlvGraphic.getPopupMenu()
protected JPopupMenu getOriginalPopupMenu(IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
getPopupMenu
from the superclass to retrieve the popup menu.
Subclasses of this class might need access to the original implementation.
p - The location of the mouse (in view coordinates).t - The transformer that converts the coordinate system of this object
(the manager coordinates) into the coordinate system of the
manager view in which the tooltip is about to be displayed
(the view coordinates).view - The manager view that triggered the popup menu.popupManager - The popup menu manager.
public void write(IlvOutputStream stream)
throws IOException
IlvOutputStream.
write in interface IlvPersistentObjectwrite in class IlvGraphicstream - the output stream.
IOException - thrown when an exception occurs during
the write operation for this object.public boolean isPersistent()
true the IlvGraphic
instance will be saved in IVL files.
The method returns true if the referenced object
is persistent.
isPersistent in class IlvGraphic
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||