public class IlvGraphicHandleBag extends IlvGraphicHandle implements IlvGraphicBag, GraphicBagHierarchyEventReceiver, ManagerViewsHierarchyEventReceiver
IlvGraphicHandleBag
object is a graphic handle that is
at the same time a graphic bag for the contained object.
This means, the method IlvGraphic.getGraphicBag()
applied on the
referenced object returns the handle.
You can consider it as graphic set that contains only one element.Modifier | Constructor and Description |
---|---|
|
IlvGraphicHandleBag(IlvGraphic object)
Creates a new
IlvGraphicHandleBag . |
protected |
IlvGraphicHandleBag(IlvGraphic object,
boolean delegateMoveResize)
Creates a new
IlvGraphicHandleBag . |
|
IlvGraphicHandleBag(IlvGraphicHandleBag source)
Creates a new
IlvGraphicHandleBag by copying an existing one. |
|
IlvGraphicHandleBag(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
addGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
Adds the specified listener to receive events from the ancestor
managers and ancestor graphic sets and from this handle when the
hierarchy of graphic bags has changed.
|
void |
addManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
Adds the specified listener to receive events from the owning manager
of this object and from its ancestors when a manager view was added or
removed.
|
void |
addObject(IlvGraphic graphic,
boolean redraw)
Adds a graphic object to the bag.
|
void |
applyToObject(IlvGraphic graphic,
IlvApplyObject f,
Object arg,
boolean redraw)
Applies a method to a graphic object of the bag.
|
void |
baseTextDirectionChanged(int oldBaseTextDirection,
int newBaseTextDirection)
Called when the object is base text direction sensitive and the
resolved base text direction has changed.
|
void |
componentOrientationChanged(ComponentOrientation oldOri,
ComponentOrientation newOri)
Called when the object is component orientation sensitive and the
component orientation has changed.
|
IlvGraphic |
copy()
Copies the object.
|
void |
enableGraphicBagHierarchyEventForwarding()
Enables forwarding of
GraphicBagHierarchyEvent events, since
the objects contained in this graphic handle bag need to receive the events. |
void |
enableManagerViewsHierarchyEventForwarding()
Enables forwarding of
ManagerViewsChangedEvent events through the nesting hierarchy,
since the objects contained in this graphic handle bag need to receive the
events. |
void |
fireGraphicBagHierarchyEvent(GraphicBagHierarchyEvent event)
Fires a graphic bag hierarchy event to this graphic handle bag and all
contained objects.
|
void |
fireManagerViewsHierarchyEvent(ManagerViewsChangedEvent event)
Fires a
ManagerViewsChangedEvent event to all listeners
installed via addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener) on this graphic
set or contained objects. |
IlvGraphic |
getObject(String name)
Returns the graphic object with that name if it exists in the bag,
otherwise returns
null . |
IlvGraphicEnumeration |
getObjects()
Returns the objects of the bag.
|
int |
getResolvedBaseTextDirection()
Returns the resolved base text direction.
|
boolean |
isDelegateObjectInteractor(IlvObjectInteractor inter)
Tests whether the input object interactor is the delegate interactor
suitable for this class.
|
boolean |
isOwner()
Returns the ownership property of the object.
|
void |
localeChanged(ULocale oldLocale,
ULocale newLocale)
Called when the object is locale sensitive and the
locale has changed.
|
void |
moveObject(IlvGraphic graphic,
double x,
double y,
boolean redraw)
Changes the location of a graphic object.
|
boolean |
needsGraphicBagHierarchyEvent()
Returns whether this object needs to receive
GraphicBagHierarchyEvent events, either from itself or from its
ancestors. |
boolean |
needsManagerViewsHierarchyEvent()
Returns whether the graphic handle bag needs to receive
ManagerViewsChangedEvent events, either from its owning manager
or from its ancestors. |
protected void |
notifyObjectInteractorToManager(IlvObjectInteractor interactor)
Notifies the manager that the object interactor has changed.
|
void |
reDrawObj(IlvGraphic graphic)
Redraws a graphic object located in the bag.
|
void |
reDrawRegion(IlvRegion region)
Redraws a region of the bag.
|
void |
removeGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
Removes the specified listener so that it no longer
receives events from ancestor manager and ancestor graphic sets and
from this handle when the hierarchy of graphic bags has changed.
|
void |
removeManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
Removes the specified listener so that it no longer receives events from
the owning manager of this object and from its ancestors when a manager
view was added or removed.
|
void |
removeObject(IlvGraphic graphic,
boolean redraw)
Removes a graphic object from the bag.
|
void |
reshapeObject(IlvGraphic graphic,
IlvRect newrect,
boolean redraw)
Changes the size of a graphic object.
|
protected void |
setDelegateMoveResize(boolean delegateMoveResize)
Sets whether operations that change the position of the object are
directly delegated to the referenced object.
|
void |
setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the object.
|
void |
setObject(IlvGraphic object)
Changes the referenced object.
|
boolean |
setObjectName(IlvGraphic graphic,
String name)
Changes the name of a graphic object.
|
applyTransform, boundingBox, contains, draw, getBaseTextDirection, getIntersectionWithOutline, getObject, getOriginalPopupMenu, getPopupMenu, getToolTipText, inside, intersects, isBaseTextDirectionSensitive, isPersistent, move, move, moveResize, resize, rotate, scale, setBackground, setBaseTextDirection, setForeground, setOwner, translate, usesBidiMarkers, write, zoomable
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, makeSelection, 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 IlvGraphicHandleBag(IlvGraphic object)
IlvGraphicHandleBag
.object
- The referenced object.protected IlvGraphicHandleBag(IlvGraphic object, boolean delegateMoveResize)
IlvGraphicHandleBag
.
This constructor is mainly useful when creating subclasses of this class.object
- The referenced object.delegateMoveResize
- If true
, operations that change
the position of the object are directly delegated to the referenced object.public IlvGraphicHandleBag(IlvGraphicHandleBag source)
IlvGraphicHandleBag
by copying an existing one.public IlvGraphicHandleBag(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.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.setObject
in class IlvGraphicHandle
public boolean isOwner()
This implementation always returns true
.
isOwner
in class IlvGraphicHandle
IlvGraphicHandle.setOwner(boolean)
protected void setDelegateMoveResize(boolean delegateMoveResize)
setDelegateMoveResize
in class IlvGraphicHandle
public IlvGraphic copy()
null
if the contained object cannot be copied.copy
in class IlvGraphicHandle
isOwner()
protected void notifyObjectInteractorToManager(IlvObjectInteractor interactor)
notifyObjectInteractorToManager
in class IlvGraphic
public boolean isDelegateObjectInteractor(IlvObjectInteractor inter)
public void setGraphicBag(IlvGraphicBag bag)
Note: do not call this method directly unless you are creating a custom graphic bag.
setGraphicBag
in class IlvGraphic
bag
- The graphic bag to contain this graphic object.IlvGraphic
public void addObject(IlvGraphic graphic, boolean redraw)
IlvGraphicBag
interface.
Since the graphic handle bag can contain only one object,
you can add only an object if the currently referenced object is
null
. The passed object becomes the new
currently referenced object.
If the graphic handle bag is in a graphic bag, it automatically
calls applyToObject
on its graphic bag while adding
the object.
addObject
in interface IlvGraphicBag
graphic
- The graphic object.redraw
- If true
the object is redrawn.public void removeObject(IlvGraphic graphic, boolean redraw)
IlvGraphicBag
interface.
Since the graphic handle bag can contain only one object,
you can remove only the currently referenced object.
If the graphic handle bag is in a graphic bag, it automatically
calls applyToObject
on its graphic bag while removing
the object.
removeObject
in interface IlvGraphicBag
graphic
- The graphic object.redraw
- If true
the object is redrawn.public IlvGraphicEnumeration getObjects()
IlvGraphicBag
interface.
This returns an enumeration with one object: the referenced object.getObjects
in interface IlvGraphicBag
IlvGraphic
objects, or
null
.public void reDrawObj(IlvGraphic graphic)
IlvGraphicBag
interface.
If this graphic handle bag is inside a graphic bag, it redraws this
graphic handle bag.reDrawObj
in interface IlvGraphicBag
graphic
- The graphic object.public void reDrawRegion(IlvRegion region)
IlvGraphicBag
interface.
If this graphic handle bag is inside a graphic bag, it redraws this
graphic handle bag.reDrawRegion
in interface IlvGraphicBag
region
- The region to redraw.public void reshapeObject(IlvGraphic graphic, IlvRect newrect, boolean redraw)
IlvGraphicBag
interface.
Since the graphic handle bag can contain only one object,
you can reshape only the currently referenced object.
If the graphic handle bag is in a graphic bag, it automatically
calls applyToObject
on its graphic bag while reshaping
the object.
reshapeObject
in interface IlvGraphicBag
graphic
- The graphic object.newrect
- The new desired bounding rectangle.redraw
- If true
the object is redrawn.public void moveObject(IlvGraphic graphic, double x, double y, boolean redraw)
IlvGraphicBag
interface.
Since the graphic handle bag can contain only one object,
you can move only the currently referenced object.
If the graphic handle bag is in a graphic bag, it automatically
calls applyToObject
on its graphic bag while moving
the object.
moveObject
in interface IlvGraphicBag
graphic
- The graphic object.x
- The new desired x position.y
- The new desired y position.redraw
- If true
the object is redrawn.public void applyToObject(IlvGraphic graphic, IlvApplyObject f, Object arg, boolean redraw)
IlvGraphicBag
interface.
If the graphic handle bag is in a graphic bag, it automatically
calls applyToObject
on its graphic bag while applying
the object.
applyToObject
in interface IlvGraphicBag
graphic
- The graphic object.f
- The method to apply.arg
- The arguments passed to the method f
.redraw
- If true
the object is redrawn.public boolean setObjectName(IlvGraphic graphic, String name)
IlvGraphicBag
interface.
Since the graphic handle bag can contain only one object,
you can only change the name of the currently referenced object.
setObjectName
in interface IlvGraphicBag
graphic
- The graphic object.name
- The new name.true
if the name can be changed.public IlvGraphic getObject(String name)
null
.
Since the graphic handle bag can contain only one object,
it returns currently referenced object if this matches the input name,
and null
otherwise.getObject
in interface IlvGraphicBag
name
- The graphic object name.public int getResolvedBaseTextDirection()
This method is similar to IlvGraphicHandle.getBaseTextDirection()
but determines
the value when it is inherited from a parent component
(IlvBidiUtil.INHERITED_DIRECTION
) or dependent on
the component orientation (IlvBidiUtil.COMPONENT_DIRECTION
).
Hence, there are only 3 possible return values:
IlvBidiUtil.LEFT_TO_RIGHT
:
the base text direction is left-to-right.
IlvBidiUtil.RIGHT_TO_LEFT
:
the base text direction is right-to-left.
IlvBidiUtil.CONTEXTUAL_DIRECTION
:
the base test direction is determined from the text
that is displayed according to the standard Bidi
algorithm, if the text contains at least one character
with a strong left-to-right or right-to-left direction.
If the text doesn't contain any character with a strong
direction, the real text direction is determined from
the current component orientation of the object.
getResolvedBaseTextDirection
in interface IlvBaseTextDirectionInterface
getResolvedBaseTextDirection
in class IlvGraphicHandle
public void baseTextDirectionChanged(int oldBaseTextDirection, int newBaseTextDirection)
baseTextDirectionChanged
in class IlvGraphicHandle
oldBaseTextDirection
- Resolved base text direction of this object before the change.newBaseTextDirection
- Resolved base text direction of this object after the change.IlvGraphicHandle.isBaseTextDirectionSensitive()
public void componentOrientationChanged(ComponentOrientation oldOri, ComponentOrientation newOri)
componentOrientationChanged
in class IlvGraphicHandle
oldOri
- Orientation of this object before the orientation change.newOri
- Orientation of this object after the orientation change.IlvGraphic.isComponentOrientationSensitive()
public void localeChanged(ULocale oldLocale, ULocale newLocale)
localeChanged
in class IlvGraphicHandle
oldLocale
- Locale of this object before the locale change.newLocale
- Locale of this object after the locale change.IlvGraphic.isLocaleSensitive()
public void addGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
addGraphicBagHierarchyListener
in interface GraphicBagHierarchyEventReceiver
listener
- The listener.removeGraphicBagHierarchyListener(ilog.views.event.GraphicBagHierarchyListener)
public void removeGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
removeGraphicBagHierarchyListener
in interface GraphicBagHierarchyEventReceiver
listener
- The listener.addGraphicBagHierarchyListener(ilog.views.event.GraphicBagHierarchyListener)
public void enableGraphicBagHierarchyEventForwarding()
GraphicBagHierarchyEvent
events, since
the objects contained in this graphic handle bag need to receive the events.enableGraphicBagHierarchyEventForwarding
in interface GraphicBagHierarchyEventReceiver
public boolean needsGraphicBagHierarchyEvent()
GraphicBagHierarchyEvent
events, either from itself or from its
ancestors.needsGraphicBagHierarchyEvent
in interface GraphicBagHierarchyEventReceiver
public void fireGraphicBagHierarchyEvent(GraphicBagHierarchyEvent event)
fireGraphicBagHierarchyEvent
in interface GraphicBagHierarchyEventReceiver
public void addManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
The hierarchy event mechanism is comparable to
java.awt.event.HierarchyEvent
on swing components.
The view changed event is generated by a manager when a view is added
or removed, and passed down the nesting hierarchy.
The event is dispatched to every graphic handle bag that is contained in the
manager whose view has changed.
addManagerViewsHierarchyListener
in interface ManagerViewsHierarchyEventReceiver
listener
- The listener.removeManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener)
public void removeManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
removeManagerViewsHierarchyListener
in interface ManagerViewsHierarchyEventReceiver
listener
- The listener.addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener)
public void enableManagerViewsHierarchyEventForwarding()
ManagerViewsChangedEvent
events through the nesting hierarchy,
since the objects contained in this graphic handle bag need to receive the
events.enableManagerViewsHierarchyEventForwarding
in interface ManagerViewsHierarchyEventReceiver
public boolean needsManagerViewsHierarchyEvent()
ManagerViewsChangedEvent
events, either from its owning manager
or from its ancestors. It returns true
, if a listener was installed through
addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener)
on this graphic handle bag or on
any object contained in this graphic handle bag.needsManagerViewsHierarchyEvent
in interface ManagerViewsHierarchyEventReceiver
public void fireManagerViewsHierarchyEvent(ManagerViewsChangedEvent event)
ManagerViewsChangedEvent
event to all listeners
installed via addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener)
on this graphic
set or contained objects.fireManagerViewsHierarchyEvent
in interface ManagerViewsHierarchyEventReceiver
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.