public class DVBTextLayoutManager extends Object implements HTextLayoutManager
The semantics of the rendering behaviour and the settings are specified in the "Text presentation" annex of the present document. The DVBTextLayoutManager renders the text according to the semantics described in that annex.
| Modifier and Type | Field and Description |
|---|---|
static int |
HORIZONTAL_CENTER
The text should be centered horizontally.
|
static int |
HORIZONTAL_END_ALIGN
The text should be horizontally
to the horizontal end side (e.g.
|
static int |
HORIZONTAL_START_ALIGN
The text should be aligned horizontally
to the horizontal start side (e.g.
|
static int |
LINE_ORIENTATION_HORIZONTAL
Horizontal line orientation.
|
static int |
LINE_ORIENTATION_VERTICAL
Vertical line orientation.
|
static int |
START_CORNER_LOWER_LEFT
Lower left text start corner.
|
static int |
START_CORNER_LOWER_RIGHT
Lower right text start corner.
|
static int |
START_CORNER_UPPER_LEFT
Upper left text start corner.
|
static int |
START_CORNER_UPPER_RIGHT
Upper right text start corner.
|
static int |
VERTICAL_CENTER
The text should be centered vertically.
|
static int |
VERTICAL_END_ALIGN
The text should be aligned vertically
to the vertical end side (e.g.
|
static int |
VERTICAL_START_ALIGN
The text should be aligned vertically
to the vertical start side (e.g.
|
| Constructor and Description |
|---|
DVBTextLayoutManager()
Constructs a DVBTextLayoutManager object with default
parameters (HORIZONTAL_START_ALIGN, VERTICAL_START_ALIGN,
LINE_ORIENTATION_HORIZONTAL,
START_CORNER_UPPER_LEFT, wrap = true,
linespace = (point size of the default font for HVisible) + 7,
letterspace = 0, horizontalTabSpace = 56)
|
DVBTextLayoutManager(int horizontalAlign,
int verticalAlign,
int lineOrientation,
int startCorner,
boolean wrap,
int linespace,
int letterspace,
int horizontalTabSpace)
Constructs a DVBTextLayoutManager object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTextOverflowListener(TextOverflowListener l)
Register a TextOverflowListener that will be notified
if the text string does not fit in the component when
rendering.
|
int |
getHorizontalAlign()
Get the horizontal alignment.
|
int |
getHorizontalTabSpacing()
Get the horizontal tabulation spacing.
|
Insets |
getInsets()
Returns the insets set by the setInsets method.
|
int |
getLetterSpace()
Get the letter space setting.
|
int |
getLineOrientation()
Get the line orientation.
|
int |
getLineSpace()
Get the line space setting.
|
int |
getStartCorner()
Get the starting corner.
|
boolean |
getTextWrapping()
Get the text wrapping setting.
|
int |
getVerticalAlign()
Get the vertical alignment.
|
void |
removeTextOverflowListener(TextOverflowListener l)
Removes a TextOverflowListener that has been registered
previously.
|
void |
render(String markedUpString,
Graphics g,
HVisible v,
Insets insets)
Render the string.
|
void |
setHorizontalAlign(int horizontalAlign)
Set the horizontal alignment.
|
void |
setHorizontalTabSpacing(int horizontalTabSpace)
Set the horizontal tabulation spacing.
|
void |
setInsets(Insets insets)
Sets the insets which shall be used by this DVBTextLayoutManager to provide a
"virtual margin".
|
void |
setLetterSpace(int letterSpace)
Set the letter space setting.
|
void |
setLineOrientation(int lineOrientation)
Set the line orientation.
|
void |
setLineSpace(int lineSpace)
Set the line space setting.
|
void |
setStartCorner(int startCorner)
Set the starting corner.
|
void |
setTextWrapping(boolean wrap)
Set the text wrapping setting.
|
void |
setVerticalAlign(int verticalAlign)
Set the vertical alignment.
|
public static final int HORIZONTAL_START_ALIGN
public static final int HORIZONTAL_END_ALIGN
public static final int HORIZONTAL_CENTER
public static final int VERTICAL_START_ALIGN
This is defined by the clause "Vertical limits" in the "Text presentation" annex of the present document.
public static final int VERTICAL_END_ALIGN
This is defined by the clause "Vertical limits" in the "Text presentation" annex of the present document.
public static final int VERTICAL_CENTER
public static final int LINE_ORIENTATION_HORIZONTAL
public static final int LINE_ORIENTATION_VERTICAL
public static final int START_CORNER_UPPER_LEFT
public static final int START_CORNER_UPPER_RIGHT
public static final int START_CORNER_LOWER_LEFT
public static final int START_CORNER_LOWER_RIGHT
public DVBTextLayoutManager()
public DVBTextLayoutManager(int horizontalAlign,
int verticalAlign,
int lineOrientation,
int startCorner,
boolean wrap,
int linespace,
int letterspace,
int horizontalTabSpace)
horizontalAlign - Horizontal alignment settingverticalAlign - Vertical alignment settinglineOrientation - Line orientation settingstartCorner - Starting corner settingwrap - Text wrapping settinglinespace - Line spacing setting expressed in pointsletterspace - Letterspacing adjustment relative to the
default letterspacing. Expressed in units of
1/256th point as the required increase in
the spacing between consecutive characters.
May be either positive or negative.horizontalTabSpace - Horizontal tabulation setting in pointspublic void render(String markedUpString, Graphics g, HVisible v, 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 shall not modify the clipping rectangle of
the Graphics object.
render in interface HTextLayoutManagermarkedUpString - 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.public void setHorizontalAlign(int horizontalAlign)
HORIZONTAL_CENTER,
HORIZONTAL_END_ALIGN or HORIZONTAL_START_ALIGN. The failure mode
if other values are used is implementation dependent.horizontalAlign - Horizontal alignment settingpublic void setVerticalAlign(int verticalAlign)
VERTICAL_CENTER,
VERTICAL_END_ALIGN or VERTICAL_START_ALIGN. The failure mode
if other values are used is implementation dependent.verticalAlign - Vertical alignment settingpublic void setLineOrientation(int lineOrientation)
LINE_ORIENTATION_VERTICAL,
LINE_ORIENTATION_HORIZONTAL. The failure mode
if other values are used is implementation dependent.lineOrientation - Line orientation settingpublic void setStartCorner(int startCorner)
START_CORNER_UPPER_LEFT,
START_CORNER_UPPER_RIGHT, START_CORNER_LOWER_LEFT or
START_CORNER_LOWER_RIGHT. The failure mode
if other values are used is implementation dependent.startCorner - Starting corner settingpublic void setTextWrapping(boolean wrap)
wrap - Text wrapping settingpublic void setLineSpace(int lineSpace)
lineSpace - line space settingpublic void setLetterSpace(int letterSpace)
letterSpace - letter space settingpublic void setHorizontalTabSpacing(int horizontalTabSpace)
horizontalTabSpace - tab spacing in pointspublic int getHorizontalAlign()
public int getVerticalAlign()
public int getLineOrientation()
public int getStartCorner()
public boolean getTextWrapping()
public int getLineSpace()
public int getLetterSpace()
public int getHorizontalTabSpacing()
public void setInsets(Insets insets)
Render
method (which are to be considered as "bounds"). If this method is not called,
the default insets are 0 at each edge.insets - Insets that should be usedpublic Insets getInsets()
render method for rendering the
text. When not previously set, zero Insets are returned.public void addTextOverflowListener(TextOverflowListener l)
l - a listener objectpublic void removeTextOverflowListener(TextOverflowListener l)
l - a listener objectCopyright © 2012 code4tv.com. All Rights Reserved.