|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.havi.ui.HDefaultTextLayoutManager
The HDefaultTextLayoutManager
provides the default text rendering
mechanism for the HStaticText
HText
and HTextButton
classes.
The HDefaultTextLayoutManager
handles alignment and justification of
text in both horizontal and vertical directions as specified by the
current alignment modes set on HVisible
. It does not support scaling of text content, and the
scaling mode of an associated HVisible
is ignored.
The string passed to the render
method may be
multi-line, where each line is separated by a "\n"
(0x0A). If the string does not fit in the space available, the
string shall be truncated and an ellipsis ("...")
appended to indicate the truncation.
The HDefaultTextLayoutManager
should query the HVisible
passed to its render
method to
determine the basic font to render text in. If the specified font
cannot be accessed the default behavior is to replace it with the
nearest builtin font. Each missing character is replaced with an
"!" character.
The antialiasing behavior of HDefaultTextLayoutManager
is
platform dependent.
Parameter | Description | Default value | Set method | Get method |
---|---|---|---|---|
None. |
Description | Default value | Set method | Get method |
---|
HTextLayoutManager
,
HStaticText
,
HText
,
HTextButton
,
HTextLook
,
HVisible
Constructor Summary | |
HDefaultTextLayoutManager()
Creates an HDefaultTextLayoutManager object. |
Method Summary | |
java.awt.Dimension |
getMaximumSize(HVisible hvisible)
Returns the maximum size required to render the text content in any possible interaction state of the specified HVisible component. |
java.awt.Dimension |
getMinimumSize(HVisible hvisible)
Returns the minimum size required to render the text content in any possible interaction state of the specified HVisible component. |
java.awt.Dimension |
getPreferredSize(HVisible hvisible)
Returns the preferred size to render the text content in any possible interaction state of the specified HVisible component. |
void |
render(java.lang.String markedUpString,
java.awt.Graphics g,
HVisible v,
java.awt.Insets insets)
Render the string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HDefaultTextLayoutManager()
HDefaultTextLayoutManager
object. See the class description
for details of constructor parameters and default values.
Method Detail |
public java.awt.Dimension getMinimumSize(HVisible hvisible)
HVisible
component. To achieve this, the maximum width and maximum
height of all minimum sizes are returned.
hvisible
- a component within which text will be rendered
public java.awt.Dimension getMaximumSize(HVisible hvisible)
HVisible
component. To achieve this, the maximum width and maximum
height of all maximum sizes are returned. It is a valid
implementation option to return a dimension with a width and height
of Short.MAX_VALUE.
hvisible
- a component within which text will be rendered
public java.awt.Dimension getPreferredSize(HVisible hvisible)
HVisible
component. To achieve this, the maximum width and maximum
height of all preferred sizes are returned.
hvisible
- a component within which text will be rendered
public void render(java.lang.String markedUpString, java.awt.Graphics g, HVisible v, java.awt.Insets insets)
HTextLayoutManager
should use the passed HVisible
object to determine any
additional information required to render the string,
e.g. Font
, Color
etc.
The text should be laid out in the layout area, which is
defined by the bounds of the specified HVisible
, after subtracting the
insets. If the insets are null
the full bounding
rectangle is used as the area to render text into.
The HTextLayoutManager
should not modify the clipping rectangle of
the Graphics
object.
render
in interface HTextLayoutManager
markedUpString
- the string to render.g
- the graphics context, including a clipping rectangle
which encapsulates the area within which rendering is
permitted. If a valid insets value is passed to this method then
text must only be rendered into the bounds of the widget after
the insets are subtracted. If the insets value is null
then text is rendered into the entire bounding area of the HVisible
. It is implementation specific whether
or not the renderer takes into account the intersection of the
clipping rectangle in each case for optimization purposes.v
- the HVisible
into which
to render.insets
- the insets to
determine the area in which to layout the text, or null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |