public class IlvFullZoomingGraphic extends IlvGraphicHandleBag
IlvFullZoomingGraphic
is a wrapper class
that is used to make a nonzoomable graphic object fully zoomable.
This can be considered as the inverse effect of
IlvFixedSizeGraphic
.
The IlvFixedSizeGraphic
wraps an object so that the size of
the object does not follow the zoom level but remains constant.
The IlvFullZoomingGraphic
wraps an object whose size does
not follow the zoom level so that now the size follows the zoom level.
Of course, it makes sense to wrap only nonzooming objects such as
IlvMarker
, IlvLabel
, IlvCircularScale
,
or IlvRectangularScale
into IlvFullZoomingGraphic
.
Note that you should not wrap a graphic object into several instances
of IlvGraphicHandle
or its subclasses
(IlvFullZoomingGraphic
, IlvHalfZoomingGraphic
,
IlvFixedSizeGraphic
).
An additional feature is the alpha transparency support. If the alpha value is set below 1, the wrapped object is drawn in a transparent way even if the colors of the wrapped object are not set to transparent colors. This is useful if you want to add transparency to the entire wrapped object without changing all individual foreground, background and stroke colors of the wrapped object.
Limitations:
IlvLinkImager
) or a manager
(IlvManager
) into a full zooming graphic, since they will
no longer behave like a link or a manager.
Modifier and Type | Field and Description |
---|---|
static IlvObjectInteractor |
DELEGATE_INTERACTOR
The delegate interactor for
IlvFullZoomingGraphic
objects. |
Constructor and Description |
---|
IlvFullZoomingGraphic(IlvFullZoomingGraphic source)
Creates a new
IlvFullZoomingGraphic by copying an existing
one. |
IlvFullZoomingGraphic(IlvGraphic object)
Creates a new full-zooming object.
|
IlvFullZoomingGraphic(IlvGraphic object,
double zoomFactor)
Creates a new full-zooming object.
|
IlvFullZoomingGraphic(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
applyTransform(IlvTransformer t)
Applies a transformation to 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.
|
float |
getAlpha()
Returns the alpha value of this object.
|
IlvPoint |
getCenter(IlvTransformer t)
Returns the center point of the graphic object.
|
double |
getInitialZoom()
Returns the initial zoom level.
|
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.
|
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.
|
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.
|
IlvTransformer |
getTransformer()
Returns the internal transformer that allows you to make the wrapped object
fully zoomable.
|
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 |
isAlphaBufferEnabled()
Returns
true if an additional buffer is used to draw the
object when the alpha composition value is not 1.0. |
boolean |
isDelegateObjectInteractor(IlvObjectInteractor inter)
Tests whether the input object interactor is the delegate interactor
suitable for this class.
|
IlvSelection |
makeSelection()
Creates the selection object for this class.
|
protected void |
notifyObjectInteractorToManager(IlvObjectInteractor interactor)
Notifies the manager that the object interactor has changed.
|
void |
setAlpha(float alpha)
Changes the alpha value of this object.
|
void |
setAlphaBufferEnabled(boolean enable)
Sets whether an additional buffer is used to draw the object when
the alpha composition value is not 1.0.
|
void |
setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the object.
|
void |
setInitialZoom(double initialZoom)
Sets the initial zoom level.
|
void |
setTransformer(IlvTransformer t)
Sets the internal transformer that allows you to make the wrapped object
fully zoomable.
|
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, isOwner, localeChanged, moveObject, needsGraphicBagHierarchyEvent, needsManagerViewsHierarchyEvent, reDrawObj, reDrawRegion, removeGraphicBagHierarchyListener, removeManagerViewsHierarchyListener, removeObject, reshapeObject, setDelegateMoveResize, setObject, setObjectName
getBaseTextDirection, getObject, getOriginalPopupMenu, isBaseTextDirectionSensitive, isPersistent, move, move, moveResize, resize, rotate, scale, setBackground, setBaseTextDirection, setForeground, setOwner, translate, usesBidiMarkers
addActionListener, addNamedPropertyListener, allViewsRemoved, blinkingStateOn, boundingBox, callDraw, getAndAssociateObjectInteractor, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, 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 static final IlvObjectInteractor DELEGATE_INTERACTOR
IlvFullZoomingGraphic
objects. Use this interactor as object interactor of the full-zooming
object if the wrapped object has an object interactor. The delegate
interactor forwards all events to the object interactor of the wrapped
object.
The delegate interactor is always installed by default when an
instance of IlvFullZoomingGraphic
is allocated.
You can call IlvGraphic.setObjectInteractor(ilog.views.IlvObjectInteractor)
to install a different
object interactor (use a null
argument to avoid the
delegation to the object interactor of the child).
IlvGraphic.setObjectInteractor(ilog.views.IlvObjectInteractor)
public IlvFullZoomingGraphic(IlvGraphic object)
object
- The referenced object.public IlvFullZoomingGraphic(IlvGraphic object, double zoomFactor)
object
- The referenced object.zoomFactor
- The initial zoom factor applied to the wrapped object.public IlvFullZoomingGraphic(IlvFullZoomingGraphic source)
IlvFullZoomingGraphic
by copying an existing
one.source
- The source object to copy.public IlvFullZoomingGraphic(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 (full-zooming graphic) it returns true
.zoomable
in class IlvGraphicHandle
IlvGraphic
,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvManager
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.public void setGraphicBag(IlvGraphicBag bag)
IlvGraphicBag
such as an
IlvManager
.
You should not call this method directly unless you are
creating a new type of bag.setGraphicBag
in class IlvGraphicHandleBag
bag
- The graphic bag.IlvGraphic
public double getInitialZoom()
setInitialZoom(double)
public void setInitialZoom(double initialZoom)
initialZoom
- Specifies the initial zoom level. It cannot
be 0
.getInitialZoom()
public void setAlpha(float alpha)
alpha
- The new transparency level in the range [0.0, 1.0].getAlpha()
public float getAlpha()
setAlpha(float)
public void setAlphaBufferEnabled(boolean enable)
enable
- Whether the alpha buffer is enabled.getAlpha()
,
isAlphaBufferEnabled()
public boolean isAlphaBufferEnabled()
true
if an additional buffer is used to draw the
object when the alpha composition value is not 1.0.getAlpha()
,
setAlphaBufferEnabled(boolean)
public IlvTransformer getTransformer()
public void setTransformer(IlvTransformer t)
null
is like changing the position and size of the object to its original
position and size.public boolean isDelegateObjectInteractor(IlvObjectInteractor inter)
isDelegateObjectInteractor
in class IlvGraphicHandleBag
protected void notifyObjectInteractorToManager(IlvObjectInteractor interactor)
notifyObjectInteractorToManager
in class IlvGraphicHandleBag
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 IlvPoint getCenter(IlvTransformer t)
getCenter
in class IlvGraphic
t
- The transformer used to draw the object. The value
null
can be used for the identity transformer.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 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
,
IlvPopupMenuManager.registerView(ilog.views.IlvManagerView)
,
IlvGraphic.getPopupMenu()
public IlvSelection makeSelection()
IlvSplineSelection
.makeSelection
in class IlvGraphic
IlvSplineSelection
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.