public class IlvFixedSizeGraphic extends IlvGraphicHandleBag
IlvFixedSizeGraphic
class derives from the base graphic
handle class IlvGraphicHandle
. It implements a handle that
references an object of the class IlvGraphic
.
An instance of this class is drawn by applying a graphic transformation to
the referenced object so that the visible size of this object is not modified
by the zoom level. The transformation is internally computed. Note
that you should not have several instances of this class reference the same
object.Constructor and Description |
---|
IlvFixedSizeGraphic(IlvFixedSizeGraphic source)
Creates a new
IlvFixedSizeGraphic by copying an existing one. |
IlvFixedSizeGraphic(IlvGraphic object,
IlvPoint point)
Creates a new
IlvFixedSizeGraphic . |
IlvFixedSizeGraphic(IlvGraphic object,
int position)
Creates a new
IlvFixedSizeGraphic . |
IlvFixedSizeGraphic(IlvGraphic object,
int position,
IlvPoint point)
Creates a new
IlvFixedSizeGraphic . |
IlvFixedSizeGraphic(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
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.
|
IlvPoint |
getPoint()
Returns the point that remains fixed.
|
JPopupMenu |
getPopupMenu(IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
Returns the Swing pop-up menu to display when the pop-up is triggered
while the mouse pointer is at a specified location inside the graphic
object.
|
int |
getPosition()
Returns the position of the point that remains fixed.
|
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.
|
IlvSelection |
makeSelection()
Creates a selection object for this graphic object.
|
void |
resize(double neww,
double newh)
Resizes the object.
|
void |
rotate(IlvPoint center,
double angle)
Rotates the object.
|
void |
setPoint(IlvPoint p)
Changes the point that remains fixed.
|
void |
setPosition(int position)
Changes the position of the point that remains fixed.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
boolean |
zoomable()
Returns
true if the object is zoomable. |
addGraphicBagHierarchyListener, addManagerViewsHierarchyListener, addObject, applyToObject, baseTextDirectionChanged, componentOrientationChanged, enableGraphicBagHierarchyEventForwarding, enableManagerViewsHierarchyEventForwarding, fireGraphicBagHierarchyEvent, fireManagerViewsHierarchyEvent, getObject, getObjects, getResolvedBaseTextDirection, isDelegateObjectInteractor, isOwner, localeChanged, moveObject, needsGraphicBagHierarchyEvent, needsManagerViewsHierarchyEvent, notifyObjectInteractorToManager, reDrawObj, reDrawRegion, removeGraphicBagHierarchyListener, removeManagerViewsHierarchyListener, removeObject, reshapeObject, setDelegateMoveResize, setGraphicBag, setObject, setObjectName
getBaseTextDirection, getObject, getOriginalPopupMenu, isBaseTextDirectionSensitive, isPersistent, move, move, moveResize, scale, setBackground, setBaseTextDirection, setForeground, setOwner, translate, usesBidiMarkers
addActionListener, addNamedPropertyListener, allViewsRemoved, blinkingStateOn, boundingBox, callDraw, getAndAssociateObjectInteractor, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenuName, getProperty, getToolTipBaseTextDirection, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, invalidateBBoxCache, invalidateBidiCache, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isSelectable, isVisible, needsViewNotification, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, updateNeedsViewNotification, viewAddedOrRemoved
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGraphicBag
public IlvFixedSizeGraphic(IlvGraphic object, int position, IlvPoint point)
IlvFixedSizeGraphic
.object
- The referenced object.position
- Indicates the point in the referenced object (for example,
its center or the top-left corner of its bounding box) that must remain at
the same position when the object is zoomed in or out. See the class
IlvConstants
for the valid values of this parameter.point
- If non-null
then it will be used to specify the
position of a fixed point when the object is zoomed in or out.
The position
parameter is not taken into account if this
parameter is non-null
.public IlvFixedSizeGraphic(IlvGraphic object, IlvPoint point)
IlvFixedSizeGraphic
.object
- The referenced object.point
- Specifies the
position of a fixed point when the object is zoomed in or out.public IlvFixedSizeGraphic(IlvGraphic object, int position)
IlvFixedSizeGraphic
.object
- The referenced object.position
- Indicates the point in the referenced object (for example,
its center or the top-left corner of its bounding box) that must remain at
the same position when the object is zoomed in or out. See the class
IlvConstants
for the valid values of this parameter.public IlvFixedSizeGraphic(IlvFixedSizeGraphic source)
IlvFixedSizeGraphic
by copying an existing one.public IlvFixedSizeGraphic(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public IlvGraphic copy()
copy
in class IlvGraphicHandleBag
IlvGraphicHandleBag.isOwner()
public boolean zoomable()
true
if the object is zoomable.
In this case (fixed-size graphic) it returns false
.zoomable
in class IlvGraphicHandle
IlvGraphic
,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvManager
public final int getPosition()
IlvConstants
for the
return value of this method.setPosition(int)
,
IlvConstants
public void setPosition(int position)
position
- See the class IlvConstants
for the
valid values of this parameter.getPosition()
,
IlvConstants
public final IlvPoint getPoint()
setPoint(ilog.views.IlvPoint)
public void setPoint(IlvPoint p)
p
- The point.getPoint()
public void draw(Graphics dst, IlvTransformer t)
draw
in class IlvGraphicHandle
dst
- The destination Graphics.t
- The transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public IlvRect boundingBox(IlvTransformer t)
boundingBox
on the referenced object.boundingBox
in class IlvGraphicHandle
t
- The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public void applyTransform(IlvTransformer t)
applyTransform
in class IlvGraphicHandle
t
- The transformer to be applied.IlvGraphic
public boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
contains
on the referenced object.contains
in class IlvGraphicHandle
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.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 IlvGraphicHandle
rect
- The rectangle to be tested.trect
- The rectangle rect
transformed by the
transformer t
.t
- The transformation 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 IlvGraphicHandle
rect
- 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 IlvGraphicHandle
innerPoint
- 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 rotate(IlvPoint center, double angle)
applyTransform
method.rotate
in class IlvGraphicHandle
center
- The center of the rotation.angle
- The rotation angle in degrees.IlvGraphic
,
IlvGraphic.applyTransform(IlvTransformer)
public void resize(double neww, double newh)
applyTransform
method.resize
in class IlvGraphicHandle
neww
- The new horizontal width.newh
- The new horizontal height.IlvGraphic
,
IlvGraphic.applyTransform(IlvTransformer)
public IlvSelection makeSelection()
IlvUnresizeableDrawSelection
.makeSelection
in class IlvGraphic
IlvDrawSelection
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 IlvGraphicHandle
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).p
for transformation
t
, or null
if no tooltip 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 pop-up menu mechanism for the manager view
by calling the static method
IlvPopupMenuManager.registerView(ilog.views.IlvManagerView)
.
getPopupMenu
in class IlvGraphicHandle
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 pop-up menu.popupManager
- The pop-up menu manager.null
.IlvGraphic.getPopupMenu(IlvPoint, IlvTransformer, IlvManagerView, IlvPopupMenuManager)
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvGraphicHandle
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.