public class IlvDefaultManagerFrame extends Object implements IlvResizableManagerFrame, Serializable, IlvBaseTextDirectionInterface, IlvPersistentObject
IlvManager
.
The IlvDefaultManagerFrame
class defines
the default frame that is drawn around an IlvManager
when
this manager is added into another manager. This class
defines the margin that will be added around the manager.
A title can be drawn on the top and you can specify the alignment of the
title. By default the title is the name of the manager.
You can change the horizontal alignment of the title. The default is left aligned. Since JViews 8.0, you can specify the vertical alignment of the title. The default is top aligned, if you have not specified the vertical alignment. This allows you to keep the compatibility with previous versions.
IlvManager.setFrame(ilog.views.IlvManagerFrame)
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
BOTTOM
Defines the BOTTOM alignment for the title.
|
static int |
CENTER
Defines the CENTER alignment for the title.
|
static int |
LEFT
Defines the LEFT alignment for the title.
|
static int |
RIGHT
Defines the RIGHT alignment for the title.
|
static int |
TOP
Defines the TOP alignment for the title.
|
static int |
WRAPPED
Indicates that the title can be wrapped.
|
Constructor and Description |
---|
IlvDefaultManagerFrame()
Creates a default manager frame.
|
IlvDefaultManagerFrame(IlvDefaultManagerFrame source)
Creates an
IlvDefaultManagerFrame
by copying the specified one. |
IlvDefaultManagerFrame(IlvInputStream stream)
Reads an
IlvDefaultManagerFrame from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
baseTextDirectionChanged(IlvManager manager,
int oldBaseTextDirection,
int newBaseTextDirection)
Called when the object is base text direction sensitive and the
resolved base text direction has changed.
|
IlvRect |
boundingBoxExpandCollapseIcon(IlvManager manager,
IlvRect bbox,
IlvTransformer t)
Returns the bounding box of the expand/collapse icon for a given
manager.
|
protected double |
checkZoomFactor(IlvTransformer t)
This utility function checks the zoom factor of the given transformer.
|
void |
componentOrientationChanged(IlvManager manager,
ComponentOrientation oldOri,
ComponentOrientation newOri)
Called when the object is component orientation sensitive and the
component orientation has changed.
|
boolean |
contains(IlvManager manager,
IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the outline of the frame.
|
IlvManagerFrame |
copy()
Creates an
IlvDefaultManagerFrame by copying
this one. |
void |
draw(IlvManager manager,
IlvRect bbox,
Graphics g,
IlvTransformer t)
Draws the frame.
|
protected void |
drawBackground(IlvManager manager,
IlvRect bbox,
Graphics grp,
IlvTransformer transf)
This method fills the given bounding box with the background color.
|
void |
drawExpandCollapseIcon(IlvManager manager,
IlvRect bbox,
Graphics g,
IlvTransformer t)
Draws the expand/collapse icon for a given manager.
|
protected void |
drawOutline(IlvManager manager,
IlvRect bbox,
Graphics grp,
IlvTransformer transf)
This method draws the border of the manager frame outline.
|
protected void |
drawShadow(IlvManager manager,
IlvRect bbox,
Graphics grp,
IlvTransformer transf)
This method draws the shadow of the manager frame.
|
protected void |
drawTitleBackground(IlvManager manager,
IlvRect bbox,
Graphics grp,
IlvTransformer transf)
This method fills the given bounding box with the background color.
|
protected void |
drawTitleText(IlvManager manager,
IlvRect bbox,
Graphics grp,
IlvTransformer transf)
This method draws the title text within the title area.
|
IlvPoint |
getAbsoluteExpandCollapseIconPosition()
Returns the absolute position of the icon that represents
the expand or collapse state of the frame.
|
Paint |
getBackground()
Returns the
Paint object used to draw the background of the
manager when the frame is opaque. |
int |
getBaseTextDirection()
Returns the base direction of the title text.
|
double |
getBottomMargin()
Returns the bottom margin.
|
double |
getBottomMargin(IlvManager manager,
IlvTransformer t)
Returns the margin on the bottom of the specified manager.
|
IlvGraphic |
getExpandCollapseIcon()
Returns the icon that represents the expand or collapse state of the
frame.
|
protected IlvPoint |
getExpandCollapseIconPosition(IlvManager manager,
IlvRect bbox,
IlvTransformer t)
Calculates the position of the expand/collapse icon at the manager.
|
Font |
getFont()
Returns the font used to draw the text of the title.
|
Color |
getForeground()
Returns the color used to draw the frame.
|
double |
getLeftMargin()
Returns the left margin.
|
double |
getLeftMargin(IlvManager manager,
IlvTransformer t)
Returns the margin on the left of the specified manager.
|
double |
getMaxTitleZoomFactor()
Returns the maximum zoom factor for the title.
|
double |
getMinTitleZoomFactor()
Returns the minimum zoom factor for the title.
|
boolean |
getOpaque()
Returns
true if the frame is opaque meaning that
the frame is filling the background of the manager. |
IlvPoint |
getRelativeExpandCollapseIconPosition()
Returns the relative position of the icon that represents
the expand or collapse state of the frame.
|
int |
getResolvedBaseTextDirection()
Returns the resolved base text direction of the title text.
|
int |
getResolvedBaseTextDirection(IlvManager manager)
Returns the resolved base text direction of the title text
for a given manager.
|
double |
getRightMargin()
Returns the right margin.
|
double |
getRightMargin(IlvManager manager,
IlvTransformer t)
Returns the margin on the right of the specified manager.
|
Paint |
getShadowPaint()
Returns the paint of the shadow used to draw the frame.
|
int |
getShadowPosition()
Returns the position of the shadow used to draw the frame.
|
double |
getShadowThickness()
Returns the thickness of the shadow used to draw the frame.
|
String |
getTitle()
Returns the title of the frame.
|
protected String |
getTitle(IlvManager m)
Returns the title of the frame.
|
Color |
getTitleColor()
Returns the color used to draw the text of the title.
|
double |
getTitleHeight(IlvManager manager,
IlvTransformer t)
Returns the height of the frame title.
|
int |
getTitleJustification()
Returns the justification of the frame title.
|
double |
getTopMargin()
Returns the top margin.
|
double |
getTopMargin(IlvManager manager,
IlvTransformer t)
Returns the total top margin for a specified manager.
|
boolean |
isOpaque(IlvManager manager)
Returns
true if the frame is opaque meaning that
the frame is filling the background of the manager. |
boolean |
isShowingExpandCollapseIcon()
Returns whether the icon that represents the expand or collapse state
of the frame is shown.
|
boolean |
isShowingTitle()
Returns whether the title is visible or not.
|
void |
localeChanged(IlvManager manager,
ULocale oldLocale,
ULocale newLocale)
Called when the object is locale sensitive and the
locale has changed.
|
void |
managerChanged(IlvManager manager)
This function adjusts the frame in reaction to the inner
manager's change.
|
boolean |
moveResize(IlvManager manager,
IlvRect size)
This function invalidates the frame and does not handle the inner
manager's resizing.
|
void |
setAbsoluteExpandCollapseIconPosition(IlvPoint p)
Sets the absolute position of the icon that represents
the expand or collapse state of the frame.
|
void |
setBackground(Paint p)
Changes the
Paint object used to draw the background of the
manager when the frame is opaque. |
void |
setBaseTextDirection(IlvManager manager,
int baseTextDirection)
Changes the base direction of the title text.
|
void |
setBaseTextDirection(int baseTextDirection)
Changes the base direction of the title text.
|
void |
setBottomMargin(double margin)
Sets the bottom margin.
|
void |
setExpandCollapseIcon(IlvGraphic g)
Sets the icon that represents the expand or collapse state of the
frame.
|
void |
setExpandCollapseIconPosition(double relX,
double relY,
double absX,
double absY)
Sets the position of the icon that represents the expand or collapse
state of the frame.
|
void |
setFont(Font font)
Changes the font used to draw the text of the title.
|
void |
setForeground(Color color)
Changes the color used to draw the frame.
|
void |
setLeftMargin(double margin)
Sets the left margin.
|
void |
setMaxTitleZoomFactor(double maxTitleZoomFactor)
Sets the maximum title zoom factor for the title.
|
void |
setMinTitleZoomFactor(double minTitleZoomFactor)
Sets the minimum zoom factor for the title.
|
void |
setOpaque(boolean value)
Changes the opacity of the frame.
|
void |
setRelativeExpandCollapseIconPosition(IlvPoint p)
Sets the relative position of the icon that represents
the expand or collapse state of the frame.
|
void |
setRightMargin(double margin)
Sets the right margin.
|
void |
setShadowPaint(Paint paint)
Changes the paint of the shadow used to draw the frame.
|
void |
setShadowPosition(int shadowPosition)
Changes the position of the shadow used to draw the frame.
|
void |
setShadowThickness(double thickness)
Changes the thickness of the shadow used to draw the frame.
|
void |
setShowingExpandCollapseIcon(boolean show)
Sets whether the icon that represents the expand or collapse state
of the frame is shown.
|
void |
setShowingTitle(boolean set)
Shows or hides the title.
|
void |
setTitle(String title)
Sets the title of the frame.
|
void |
setTitleColor(Color color)
Changes the color used to draw the text of the title.
|
void |
setTitleJustification(int value)
Changes the justification of the frame title.
|
void |
setTopMargin(double margin)
Sets the top margin.
|
void |
write(IlvOutputStream stream)
Writes the frame to an
IlvOutputStream . |
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
public static final int WRAPPED
public IlvDefaultManagerFrame()
public IlvDefaultManagerFrame(IlvDefaultManagerFrame source)
IlvDefaultManagerFrame
by copying the specified one.source
- the origin of the copy.copy()
public IlvDefaultManagerFrame(IlvInputStream stream) throws IOException, IlvReadFileException
IlvDefaultManagerFrame
from an
IlvInputStream
.stream
- The input stream.IOException
IlvReadFileException
public IlvManagerFrame copy()
IlvDefaultManagerFrame
by copying
this one.copy
in interface IlvManagerFrame
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public void setExpandCollapseIcon(IlvGraphic g)
public IlvGraphic getExpandCollapseIcon()
public boolean isShowingExpandCollapseIcon()
public void setShowingExpandCollapseIcon(boolean show)
setExpandCollapseIcon(ilog.views.IlvGraphic)
to install or deinstall the icon.public void setExpandCollapseIconPosition(double relX, double relY, double absX, double absY)
relX
- The relative x position.relY
- The relative y position.absX
- The absolute x position.absY
- The absolute y position.public final IlvPoint getRelativeExpandCollapseIconPosition()
setExpandCollapseIconPosition(double, double, double, double)
public void setRelativeExpandCollapseIconPosition(IlvPoint p)
setExpandCollapseIconPosition(double, double, double, double)
public final IlvPoint getAbsoluteExpandCollapseIconPosition()
setExpandCollapseIconPosition(double, double, double, double)
public void setAbsoluteExpandCollapseIconPosition(IlvPoint p)
setExpandCollapseIconPosition(double, double, double, double)
public double getTopMargin(IlvManager manager, IlvTransformer t)
The total top margin is the sum of the height of the title plus the top margin, if the title is top aligned.
getTopMargin
in interface IlvManagerFrame
manager
- The inner manager.t
- The transformer used to draw the manager and the frame.getTitleHeight(IlvManager, IlvTransformer)
,
getTopMargin()
public boolean moveResize(IlvManager manager, IlvRect size)
moveResize
in interface IlvResizableManagerFrame
manager
- The submanager to be transformed.size
- The new size of the submanager.false
.public void managerChanged(IlvManager manager)
afterTransform()
method of the inner manager.managerChanged
in interface IlvResizableManagerFrame
manager
- The inner manager that has been changed.protected double checkZoomFactor(IlvTransformer t)
t
- The transformer to be checked.setMaxTitleZoomFactor(double)
,
getMaxTitleZoomFactor()
,
setMinTitleZoomFactor(double)
,
getMinTitleZoomFactor()
public double getTitleHeight(IlvManager manager, IlvTransformer t)
manager
- The inner manager.t
- The transformer used to draw both the manager and the frame.0
if the frame has
no title or if isShowingTitle()
returns false
.isShowingTitle()
,
getTitle(IlvManager)
,
getMinTitleZoomFactor()
,
getMaxTitleZoomFactor()
public double getTopMargin()
public void setTopMargin(double margin)
public double getBottomMargin(IlvManager manager, IlvTransformer t)
getBottomMargin
in interface IlvManagerFrame
manager
- The inner manager.t
- The transformer used to draw the manager and the frame.public double getBottomMargin()
public void setBottomMargin(double margin)
public double getRightMargin(IlvManager manager, IlvTransformer t)
getRightMargin
in interface IlvManagerFrame
manager
- The inner manager.t
- The transformer used to draw the manager and the frame.public double getRightMargin()
public void setRightMargin(double margin)
public double getLeftMargin(IlvManager manager, IlvTransformer t)
getLeftMargin
in interface IlvManagerFrame
manager
- The inner manager.t
- The transformer used to draw the manager and the frame.public double getLeftMargin()
public void setLeftMargin(double margin)
public boolean isOpaque(IlvManager manager)
true
if the frame is opaque meaning that
the frame is filling the background of the manager.isOpaque
in interface IlvManagerFrame
manager
- The inner manager.setOpaque(boolean)
,
getOpaque()
public boolean getOpaque()
true
if the frame is opaque meaning that
the frame is filling the background of the manager.manager
- The inner manager.setOpaque(boolean)
public void setOpaque(boolean value)
value
- The new opacity.isOpaque(IlvManager)
,
getBackground()
public Color getTitleColor()
setTitleColor(java.awt.Color)
public void setTitleColor(Color color)
color
- The new color.getTitleColor()
public Font getFont()
setTitleColor(java.awt.Color)
public void setFont(Font font)
font
- The new font.getFont()
public Paint getBackground()
Paint
object used to draw the background of the
manager when the frame is opaque.setBackground(java.awt.Paint)
,
setOpaque(boolean)
public void setBackground(Paint p)
Paint
object used to draw the background of the
manager when the frame is opaque.getBackground()
,
setOpaque(boolean)
public Color getForeground()
setForeground(java.awt.Color)
public void setForeground(Color color)
color
- The new color.getForeground()
public boolean isShowingTitle()
public void setShowingTitle(boolean set)
set
- The new value.isShowingTitle()
,
getTitle()
,
getTitleColor()
,
getFont()
,
getTitleJustification()
public void setTitleJustification(int value)
value
- The new justification can be a combination from the next 3 groups:
Examples: LEFT, LEFT|BOTTOM, CENTER|BOTTOM|WRAPPEDsetTitleJustification(int)
,
isShowingTitle()
public int getTitleJustification()
setTitleJustification(int)
for possible values.setTitleJustification(int)
,
isShowingTitle()
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
baseTextDirection
- The base text directionpublic void setBaseTextDirection(IlvManager manager, int baseTextDirection)
setBaseTextDirection(int)
for details.manager
- The affected manager. Can be null
.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
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
public int getResolvedBaseTextDirection(IlvManager manager)
getResolvedBaseTextDirection()
for details.manager
- The managerpublic void baseTextDirectionChanged(IlvManager manager, int oldBaseTextDirection, int newBaseTextDirection)
manager
- The affected manager. Can be null
.oldBaseTextDirection
- Resolved base text direction of this object before the change.newBaseTextDirection
- Resolved base text direction of this object after the change.public void componentOrientationChanged(IlvManager manager, ComponentOrientation oldOri, ComponentOrientation newOri)
manager
- The affected manager. Can be null
.oldOri
- Orientation of this object before the orientation change.newOri
- Orientation of this object after the orientation change.public void localeChanged(IlvManager manager, ULocale oldLocale, ULocale newLocale)
manager
- The affected manager. Can be null
.oldLocale
- Locale of this object before the locale change.newLocale
- Locale of this object after the locale change.public void draw(IlvManager manager, IlvRect bbox, Graphics g, IlvTransformer t)
draw
in interface IlvManagerFrame
manager
- The inner manager.bbox
- The bounding box of the manager in view coordinates.g
- The Graphics used to draw the frame.t
- The transformer used to draw the frame.protected void drawTitleText(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
draw
method
(draw(IlvManager, IlvRect, Graphics, IlvTransformer)
).
If needed, sublcasses can override this method.
manager
- The inner manager.bbox
- The bounding box of the title area in view coordinates.grp
- The Graphics used to draw the text.transf
- The transformer used to draw the title.protected void drawTitleBackground(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
draw
method
(draw(IlvManager, IlvRect, Graphics, IlvTransformer)
)
to handle the drawing of the background of the text area.
If needed, subclasses can override this method.
manager
- The inner manager.bbox
- The bounding box of the title area in view coordinates.grp
- The Graphics used to draw the text.transf
- The transformer used to draw the title.protected void drawBackground(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
draw
method
(draw(IlvManager, IlvRect, Graphics, IlvTransformer)
)
to handle the drawing of the background of the frame (excluding the
title area).
If needed, subclasses can override this method.
manager
- The inner manager.bbox
- The bounding box of the background area in view coordinates.grp
- The Graphics used to draw the background.transf
- The transformer used to draw the background.protected void drawOutline(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
draw
method
(draw(IlvManager, IlvRect, Graphics, IlvTransformer)
)
to handle the drawing of the outline of the frame (including the
text area).
If needed, subclasses can override this method.
manager
- The inner manager.bbox
- The bounding box of the outline in view coordinates.grp
- The Graphics used to draw the outline.transf
- The transformer used to draw the outline.protected void drawShadow(IlvManager manager, IlvRect bbox, Graphics grp, IlvTransformer transf)
draw
method
(draw(IlvManager, IlvRect, Graphics, IlvTransformer)
)
to handle the drawing of the shadow of the frame.
If needed, subclasses can override this method.
manager
- The inner manager.bbox
- The bounding box of manager frame.grp
- The Graphics used to draw frame.transf
- The transformer used to draw the frame.public void drawExpandCollapseIcon(IlvManager manager, IlvRect bbox, Graphics g, IlvTransformer t)
manager
- The inner manager.bbox
- The bounding box of the manager in view coordinates.g
- The Graphics used to draw the frame.t
- The transformer used to draw the frame.public IlvRect boundingBoxExpandCollapseIcon(IlvManager manager, IlvRect bbox, IlvTransformer t)
null
if there is not
expand/collapse icon.manager
- The inner manager.bbox
- The bounding box of the manager in view coordinates.t
- The transformer used to draw the frame.protected IlvPoint getExpandCollapseIconPosition(IlvManager manager, IlvRect bbox, IlvTransformer t)
manager
- The inner manager.bbox
- The bounding box of the manager in view coordinates.t
- The transformer used to draw the frame.public boolean contains(IlvManager manager, IlvPoint p, IlvPoint tp, IlvTransformer t)
contains
in interface IlvManagerFrame
manager
- The inner manager.p
- The point to be tested.tp
- The point p
transformed by the transformer t
.t
- The transformation that is used to draw the frame.protected String getTitle(IlvManager m)
setTitle(java.lang.String)
was called with a
non-null
title string, this string is returned.
Otherwise, this method returns the name of the manager
(IlvGraphic.getName()
). If the manager has no name, it
returns the string 'Untitled'.public void setTitle(String title)
title
- The new title of the frame.getTitle(ilog.views.IlvManager)
public String getTitle()
setTitle(java.lang.String)
,
getTitle(ilog.views.IlvManager)
public double getMinTitleZoomFactor()
public void setMinTitleZoomFactor(double minTitleZoomFactor)
minTitleZoomFactor
- The new minimum zoom factor.public double getMaxTitleZoomFactor()
public void setMaxTitleZoomFactor(double maxTitleZoomFactor)
maxTitleZoomFactor
- The new zoom factor for the title.public double getShadowThickness()
setShadowThickness(double)
public void setShadowThickness(double thickness)
thickness
- The shadow thickness.getShadowThickness()
public int getShadowPosition()
IlvConstants.TOP_LEFT
,
IlvConstants.BOTTOM_LEFT
,
IlvConstants.TOP_RIGHT
, or
IlvConstants.BOTTOM_RIGHT
.setShadowPosition(int)
public void setShadowPosition(int shadowPosition)
shadowPosition
- The new position of the shadow. Valid values are
IlvConstants.TOP_LEFT
,
IlvConstants.BOTTOM_LEFT
,
IlvConstants.TOP_RIGHT
, or
IlvConstants.BOTTOM_RIGHT
.getShadowPosition()
public Paint getShadowPaint()
setShadowPaint(java.awt.Paint)
public void setShadowPaint(Paint paint)
paint
- The shadow paint.getShadowPaint()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.