public abstract class IlvBidiGraphic extends IlvGraphic
IlvBidiGraphic
is an abstract base class for graphic
objects that has a base text direction.
Besides the storage for the base text direction, it provides cached
access to locale and component orientation.
IlvBidiGraphic
is a base class for custom graphic objects,
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.
Constructor and Description |
---|
IlvBidiGraphic()
Creates a new
IlvBidiGraphic . |
IlvBidiGraphic(IlvBidiGraphic source)
Creates a new
IlvBidiGraphic by copying an existing one. |
IlvBidiGraphic(IlvInputStream stream)
Reads a graphic object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
protected int |
calcResolvedBaseTextDirection()
Calculates the resolved base text direction when it is not cached.
|
int |
getBaseTextDirection()
Returns the base direction of the text.
|
ComponentOrientation |
getComponentOrientation()
Returns the component orientation of this object.
|
int |
getResolvedBaseTextDirection()
Returns the resolved base text direction.
|
com.ibm.icu.util.ULocale |
getULocale()
Returns the locale of this object.
|
protected void |
invalidateBidiCache()
Mark internal caches for locale, component orientation and base
text direction invalid.
|
void |
setBaseTextDirection(int baseTextDirection)
Changes the base direction of the text.
|
void |
setBaseTextDirection(int baseTextDirection,
boolean redraw)
Changes the base direction of the text.
|
protected void |
setBaseTextDirectionDuringConstruction(int baseTextDirection)
Changes the base direction of the text.
|
addActionListener, addNamedPropertyListener, allViewsRemoved, applyTransform, baseTextDirectionChanged, blinkingStateOn, boundingBox, boundingBox, callDraw, componentOrientationChanged, contains, copy, draw, getAndAssociateObjectInteractor, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, isVisible, localeChanged, makeSelection, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved, write, zoomable
public IlvBidiGraphic()
IlvBidiGraphic
.public IlvBidiGraphic(IlvBidiGraphic source)
IlvBidiGraphic
by copying an existing one.source
- The graphic object to be copied.public IlvBidiGraphic(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.IlvReadFileException
public com.ibm.icu.util.ULocale getULocale()
IlvGraphic.isLocaleSensitive()
if the bounding box depends on the locale.
Note: Most predefined graphic objects are independent of locale.
If this object is contained in a graphic bag that has a locale,
it returns the locale of that graphic bag. Otherwise it returns
IlvLocaleUtil.getCurrentULocale()
.
Typically a graphic object is in a manager that is displayed in a manager
view, and the returned value is the locale of the first manager view
that displays the graphic.
getULocale
in class IlvGraphic
IlvGraphic.localeChanged(com.ibm.icu.util.ULocale, com.ibm.icu.util.ULocale)
,
IlvManager.getULocale()
,
IlvLocaleUtil.getCurrentULocale()
public ComponentOrientation getComponentOrientation()
IlvGraphic.isComponentOrientationSensitive()
if the bounding box depends
on the component orientation.
Note: Most predefined graphic objects are independent of component orientation.
If this object is contained in a graphic bag that has a component
orientation, it returns the component orientation of that graphic bag.
Otherwise it returns ComponentOrientation.UNKNOWN
.
Typically a graphic object is in a manager that is displayed in a manager view, and the returned value is the component orientation of the first manager view that displays the graphic.
getComponentOrientation
in class IlvGraphic
IlvGraphic.componentOrientationChanged(java.awt.ComponentOrientation, java.awt.ComponentOrientation)
,
IlvManager.getComponentOrientation()
public void setBaseTextDirection(int baseTextDirection)
IlvBidiUtil.INHERITED_DIRECTION
:
the base text direction is inherited from the
graphic bag that contains this object.
If this object is not contained in a graphic bag,
the base text direction is calculated from the
component orientation.
IlvBidiUtil.COMPONENT_DIRECTION
:
the base text direction is calculated from the
component orientation.
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.
setBaseTextDirection
in interface IlvBaseTextDirectionInterface
setBaseTextDirection
in class IlvGraphic
baseTextDirection
- The base text directionIlvGraphic.baseTextDirectionChanged(int, int)
public void setBaseTextDirection(int baseTextDirection, boolean redraw)
setBaseTextDirection(int)
.baseTextDirection
- The base text directionredraw
- Whether to redraw the object after the change.protected void setBaseTextDirectionDuringConstruction(int baseTextDirection)
setBaseTextDirectionDuringConstruction
in class IlvGraphic
baseTextDirection
- The base text directionpublic int getBaseTextDirection()
IlvBidiUtil.INHERITED_DIRECTION
:
the base text direction is inherited from the
graphic bag that contains this object.
If this object is not contained in a graphic bag,
the base text direction is calculated from the
component orientation.
IlvBidiUtil.COMPONENT_DIRECTION
:
the base text direction is calculated from the
component orientation.
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.
getBaseTextDirection
in interface IlvBaseTextDirectionInterface
getBaseTextDirection
in class IlvGraphic
public int getResolvedBaseTextDirection()
This method is similar to 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 IlvGraphic
protected int calcResolvedBaseTextDirection()
protected void invalidateBidiCache()
invalidateBidiCache
in class IlvGraphic
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.