|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.DrawTextParam
public final class DrawTextParam
Parameters used to control the drawing and measurement of text.
Nested Class Summary | ||
---|---|---|
static class |
DrawTextParam.AdvancedDrawTextParam
Advanced text drawing parameters. |
Field Summary | ||
---|---|---|
static int |
ALREADY_REVERSED
Value for iReverse : draws text without reversing. |
|
static int |
BIDI_REORDER
Value for iReverse : performs bidirectional reordering on the text before
drawing. |
|
static int |
NO_REVERSE
Value for iReverse : draws text without reversing. |
|
static int |
NO_TRUNCATE_WITH_ELLIPSIS
Value for iTruncateWithEllipsis : does not perform truncation with ellipsis. |
|
static int |
REVERSE
Value for iReverse : reverses the text before drawing. |
|
static int |
TRUNCATE_WITH_ELLIPSIS_AT_END
Value for iTruncateWithEllipsis : if the text would exceed iMaxAdvance ,
truncates it at the end and inserts an ellipsis. |
|
static int |
TRUNCATE_WITH_ELLIPSIS_AT_START
Value for iTruncateWithEllipsis : if the text would exceed iMaxAdvance ,
truncates it at the start and inserts an ellipsis. |
|
static int |
TRUNCATE_WITH_NO_ELLIPSIS_AT_START
Value for iTruncateWithEllipsis: if the text would exceed iMaxAdvance ,
truncates it at the start but does not insert an ellipsis. |
|
DrawTextParam.AdvancedDrawTextParam |
iAdvancedParam
If non-null, parameters used for advanced features including drawing text on a path. |
|
int |
iAlignment
Alignment flags. |
|
boolean |
iDrawNonPrintableCharacters
Draws non-printable characters, defined as all characters with Unicode general categories Zl, Zp, Cc, Cf, Cs. |
|
int |
iEndOffset
The end offset of the text to draw, within the supplied text. |
|
int |
iMaxAdvance
Truncates the text if its advance width or the width of its inked area would exceed this value. |
|
int |
iMaxCharacters
Truncates the text if it would exceed this number of characters. |
|
boolean |
iPasswordMode
Replaces all characters with the current password character. |
|
int |
iReverse
Whether the text is to be drawn normally, is to be reversed or has already been reversed. |
|
boolean |
iShaping
Enables shaping (contextual glyph choice, diacritic placement and ligature building). |
|
int |
iStartOffset
The start offset of the text to draw, within the supplied text. |
|
int |
iTracking
Tracking is the amount of space, in pixels, defined as a 16.16 fixed-point number, added to the advance of each character. |
|
int |
iTruncateWithEllipsis
Whether the text is to be truncated with an ellipsis, and if so, at the start or end. |
|
boolean |
iUnderlineToBounds
When underlining, if iUnderlineToBounds is set, underlines as far as the left and right edges of the bounds of the inked pixels only. |
Constructor Summary | ||
---|---|---|
DrawTextParam()
Creates a DrawTextParam object with default values. |
||
DrawTextParam(int aMaxAdvance)
Creates a DrawTextParam object with a specified maximum advance. |
Method Summary | ||
---|---|---|
int |
getEndOffset()
Deprecated. Use the data member iEndOffset directly. |
|
int |
getStartOffset()
Deprecated. Use the data member iStartOffset directly. |
|
void |
reset()
Sets all parameters to their default values. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_REVERSE
iReverse
: draws text without reversing.
public static final int REVERSE
iReverse
: reverses the text before drawing.
public static final int ALREADY_REVERSED
iReverse
: draws text without reversing.
This setting is used for right-to-left runs where bidirectional re-ordering has
already been done and the text has already been reversed. It differs from
NO_REVERSE
in the way truncation is done, if specified; the left end of the
text is truncated instead of the right.
public static final int BIDI_REORDER
iReverse
: performs bidirectional reordering on the text before
drawing.
This is the default setting. Code that has already done bidirectional reordering
should use NO_REVERSE
for left-to-right runs and REVERSE
for right-to-left runs.
public static final int NO_TRUNCATE_WITH_ELLIPSIS
iTruncateWithEllipsis
: does not perform truncation with ellipsis.
Truncation still happens if iMaxAdvance
or iMaxCharacters
would
be exceeded, but no ellipsis is used.
public static final int TRUNCATE_WITH_ELLIPSIS_AT_START
iTruncateWithEllipsis
: if the text would exceed iMaxAdvance
,
truncates it at the start and inserts an ellipsis.
public static final int TRUNCATE_WITH_ELLIPSIS_AT_END
iTruncateWithEllipsis
: if the text would exceed iMaxAdvance
,
truncates it at the end and inserts an ellipsis.
public static final int TRUNCATE_WITH_NO_ELLIPSIS_AT_START
iMaxAdvance
,
truncates it at the start but does not insert an ellipsis.
This is a convenience feature that is equivalent to using ETruncateWithEllipsisAtStart with the ellipsis character set to U+FFFF.
public int iMaxAdvance
This parameter is scaled by the transform applied to the font used to draw the text.
public int iMaxCharacters
public int iTracking
public int iReverse
public int iTruncateWithEllipsis
public int iStartOffset
The purpose of this parameter is to allow substrings of the same string to be drawn or measured, and to supply context for contextual shaping (e.g. for Arabic). If the start offset is greater than 0, text is drawn starting at this offset, and the characters preceding iStartOffset are taken into account when doing contextual glyph substitution.
public int iEndOffset
Integer.MAX_VALUE
, meaning the whole of the text will be drawn.
The purpose of this parameter is to allow substrings of the same string to be drawn or measured, and to supply context for contextual shaping (e.g. for Arabic). If the end offset is less than the length of the text, text is drawn ending at this offset, and the characters following iEndOffset are taken into account when doing contextual glyph substitution.
public int iAlignment
DrawStyle
(the truncation flags
are obselete in this interface; use iTruncateWithEllipsis
instead).
public DrawTextParam.AdvancedDrawTextParam iAdvancedParam
public boolean iDrawNonPrintableCharacters
true
.
public boolean iUnderlineToBounds
true
.
public boolean iShaping
true
.
public boolean iPasswordMode
Constructor Detail |
---|
public DrawTextParam(int aMaxAdvance)
aMaxAdvance
- the maximum advance, in pixels.public DrawTextParam()
Method Detail |
---|
public void reset()
public int getStartOffset()
iStartOffset
directly.
public int getEndOffset()
iEndOffset
directly.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal