Java DTV API 1.3
18-Nov-2009

com.sun.dtv.ui
Interface TextLayoutManager

All Known Implementing Classes:
DefaultTextLayoutManager, SophisticatedTextLayoutManager

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.

See Also:
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

getMinimumSize

Dimension getMinimumSize(ViewOnlyComponent component,
                         String text)
Provides the minimum size required to render the provided text content in the specified ViewOnlyComponent. In this version of the method, it is assumed that the ViewOnlyComponent parameter defines the borders by its bounds.

Parameters:
component - the ViewOnlyComponent to look at
text - the provided text to be rendered
Returns:
the minimum size as com.sun.dtv.lwuit.geom.Dimension object

getMinimumSize

Dimension getMinimumSize(ViewOnlyComponent component,
                         String text,
                         Insets insets)
Provides the minimum size required to render the provided text content in the specified ViewOnlyComponent.

Parameters:
component - the ViewOnlyComponent to look at
text - the provided text to be rendered
insets - the insets to define the area in which the text should be laid out
Returns:
the minimum size as com.sun.dtv.lwuit.geom.Dimension object

getMaximumSize

Dimension getMaximumSize(ViewOnlyComponent component,
                         String text)
Provides the maximum size required to render the provided text content in the specified ViewOnlyComponent. In this version of the method, it is assumed that the ViewOnlyComponent parameter defines the borders by its bounds.

Parameters:
component - the ViewOnlyComponent to look at
text - the provided text to be rendered
Returns:
the maximum size as com.sun.dtv.lwuit.geom.Dimension object

getMaximumSize

Dimension getMaximumSize(ViewOnlyComponent component,
                         String text,
                         Insets insets)
Provides the maximum size required to render the provided text content in the specified ViewOnlyComponent.

Parameters:
component - the ViewOnlyComponent to look at
text - the provided text to be rendered
insets - the insets to define the area in which the text should be laid out
Returns:
the maximum size as com.sun.dtv.lwuit.geom.Dimension object

getPreferredSize

Dimension getPreferredSize(ViewOnlyComponent component,
                           String text)
Provides the preferred size required to render the provided text content in the specified ViewOnlyComponent. In this version of the method, it is assumed that the ViewOnlyComponent parameter defines the borders by its bounds.

Parameters:
component - the ViewOnlyComponent to look at
text - the provided text to be rendered
Returns:
the preferred size as com.sun.dtv.lwuit.Dimension object

getPreferredSize

Dimension getPreferredSize(ViewOnlyComponent component,
                           String text,
                           Insets insets)
Provides the preferred size required to render the provided text content in the specified ViewOnlyComponent.

Parameters:
component - the ViewOnlyComponent to look at
text - the provided text to be rendered
insets - the insets to define the area in which the text should be laid out
Returns:
the preferred size as com.sun.dtv.lwuit.Dimension object

render

void render(String text,
            Graphics g,
            ViewOnlyComponent component,
            Insets insets)
Render a string. The passed 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.

Parameters:
text - the string to be rendered
g - 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

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.