|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TextLayoutManager
The aim of this interface is to define functionality for the layout of strings and their rendering on the screen. The string to be rendered may contain besides its actual content also meta information e.g. about font, color, style and text formatting. It is out of scope of this interface though to force appropriate functionality for this. An implementing default text layout manager could implement just the render method as requested by this interface, while more sophisticated layout managers could add many methods in order to process meta information, e.g.
DefaultTextLayoutManager
,
SophisticatedTextLayoutManager
Method Summary | |
---|---|
Dimension |
getMaximumSize(ViewOnlyComponent component,
String text)
Provides the maximum size required to render the provided text content in the specified ViewOnlyComponent . |
Dimension |
getMaximumSize(ViewOnlyComponent component,
String text,
Insets insets)
Provides the maximum size required to render the provided text content in the specified ViewOnlyComponent . |
Dimension |
getMinimumSize(ViewOnlyComponent component,
String text)
Provides the minimum size required to render the provided text content in the specified ViewOnlyComponent . |
Dimension |
getMinimumSize(ViewOnlyComponent component,
String text,
Insets insets)
Provides the minimum size required to render the provided text content in the specified ViewOnlyComponent . |
Dimension |
getPreferredSize(ViewOnlyComponent component,
String text)
Provides the preferred size required to render the provided text content in the specified ViewOnlyComponent . |
Dimension |
getPreferredSize(ViewOnlyComponent component,
String text,
Insets insets)
Provides the preferred size required to render the provided text content in the specified ViewOnlyComponent . |
void |
render(String text,
Graphics g,
ViewOnlyComponent component,
Insets insets)
Render a string. |
Method Detail |
---|
Dimension getMinimumSize(ViewOnlyComponent component, String text)
ViewOnlyComponent
.
In this version of the method, it is assumed that the
ViewOnlyComponent
parameter defines
the borders by its bounds.
component
- the ViewOnlyComponent
to look attext
- the provided text to be rendered
Dimension getMinimumSize(ViewOnlyComponent component, String text, Insets insets)
ViewOnlyComponent
.
component
- the ViewOnlyComponent
to look attext
- the provided text to be renderedinsets
- the insets to define the area in which the text should be
laid out
Dimension getMaximumSize(ViewOnlyComponent component, String text)
ViewOnlyComponent
.
In this version of the method, it is assumed that the
ViewOnlyComponent
parameter defines
the borders by its bounds.
component
- the ViewOnlyComponent
to look attext
- the provided text to be rendered
Dimension getMaximumSize(ViewOnlyComponent component, String text, Insets insets)
ViewOnlyComponent
.
component
- the ViewOnlyComponent
to look attext
- the provided text to be renderedinsets
- the insets to define the area in which the text should be
laid out
Dimension getPreferredSize(ViewOnlyComponent component, String text)
ViewOnlyComponent
.
In this version of the method, it is assumed that the
ViewOnlyComponent
parameter defines
the borders by its bounds.
component
- the ViewOnlyComponent
to look attext
- the provided text to be rendered
Dimension getPreferredSize(ViewOnlyComponent component, String text, Insets insets)
ViewOnlyComponent
.
component
- the ViewOnlyComponent
to look attext
- the provided text to be renderedinsets
- the insets to define the area in which the text should be
laid out
void render(String text, Graphics g, ViewOnlyComponent component, Insets insets)
ViewOnlyComponent
can be used to determine any additional information
needed in order to render the string properly (e.g. Font, Color etc.),
if the TextLayoutManagerClass implementing this interface does not
provide additional information for that.
The ViewOnlyComponent
also
defines the layout area by its bounds, while of course the provided
insets have also to be taken into account if not null. The clipping
rectangle of the Graphics
object should not be subject
of change by the TextLayoutManager, though.
text
- the string to be renderedg
- the graphics context. This includes of course also a clipping
rectangle, which should be respected as borders within which the
rendering is permitted. An insets parameter not equal to null must be
additionally taken into account.component
- the ViewOnlyComponent
into which to render.insets
- the insets to define the area in which the text should be
laid out. This parameter can also be null
: in this case the
ViewOnlyComponent
parameter
defines the borders by its bounds.
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |