Java DTV API 1.3
18-Nov-2009

com.sun.dtv.ui
Interface ViewOnlyComponent

All Superinterfaces:
MatteEnabled
All Known Implementing Classes:
Button, CheckBox, ComboBox, DefaultListCellRenderer, Label, List, RadioButton

public interface ViewOnlyComponent
extends MatteEnabled

This interface represents any type of non-interactive component in the system and provides them with a pluggable look and feel.


Field Summary
static int HORIZONTAL_ALIGN_CENTER
          Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent.
static int HORIZONTAL_ALIGN_JUSTIFIED
          Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent.
static int HORIZONTAL_ALIGN_LEFT
          Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent.
static int HORIZONTAL_ALIGN_RIGHT
          Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent.
static int SCALE_ASPECT_PROOF
          Constant to be used with the setScalingMode method of ViewOnlyComponent.
static int SCALE_NO
          Constant to be used with the setScalingMode method of ViewOnlyComponent.
static int SCALE_NO_ASPECT_PROOF
          Constant to be used with the setScalingMode method of ViewOnlyComponent.
static int STATE_DISABLED
          Constant to be used with several methods of ViewOnlyComponent requiring a state parameter.
static int STATE_ENABLED
          Constant to be used with several methods of ViewOnlyComponent requiring a state parameter.
static int VERTICAL_ALIGN_BOTTOM
          Constant to be used with the setVerticalAlignment method of ViewOnlyComponent.
static int VERTICAL_ALIGN_CENTER
          Constant to be used with the setVerticalAlignment method of ViewOnlyComponent.
static int VERTICAL_ALIGN_JUSTIFIED
          Constant to be used with the setVerticalAlignment method of ViewOnlyComponent.
static int VERTICAL_ALIGN_TOP
          Constant to be used with the setVerticalAlignment method of ViewOnlyComponent.
 
Method Summary
 Image[] getAnimateContent(int state)
          Returns the animated content for this component, depending on the current state.
 Image getGraphicContent(int state)
          Returns the graphical content for this component, depending on the current state.
 int getHorizontalAlignment()
          Retrieve the horizontal alignment for any state-based content in this component.
 int getInteractionState()
          Return the current interaction state of the component.
 int getScalingMode()
          Retrieve the scaling mode for this component.
 String getTextContent(int state)
          Returns the text content for this component, depending on the current state.
 TextLayoutManager getTextLayoutManager()
          Gets the text layout manager that is currently in use for text layout in this component.
 int getVerticalAlignment()
          Retrieve the vertical alignment for any state-based content in this component.
 boolean isDoubleBuffered()
          Returns true if double buffering is available and activated.
 boolean isOpaque()
          Returns true if the whole area of the Component (as returned by the com.sun.dtv.lwuit.Component#getBounds method, is opaque.
 void paint(Graphics g)
          Method to paint the component.
 void processEvent(AWTEvent event)
          Handle the specified AWTEvent.
 void setAnimateContent(Image[] images, int state)
          Assigns an array of graphical content to be used for animation to this component which is state-dependent.
 void setGraphicContent(Image image, int state)
          Assigns graphical content to this component which is state-dependent.
 void setHorizontalAlignment(int alignment)
          Set the horizontal alignment for any state-based content in this component.
 void setInteractionState(int state)
          Set the current state of the component with respect to interaction.
 void setScalingMode(int scaling)
          Set the scaling mode for this component.
 void setTextContent(String text, int state)
          Assigns text content to this component which is state-dependent.
 void setTextLayoutManager(TextLayoutManager manager)
          Sets the text layout manager that should be used for text layout in this component.
 void setVerticalAlignment(int alignment)
          Set the vertical alignment for any state-based content in this component.
 
Methods inherited from interface com.sun.dtv.ui.MatteEnabled
getMatte, setMatte
 

Field Detail

HORIZONTAL_ALIGN_LEFT

static final int HORIZONTAL_ALIGN_LEFT
Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent. It indicates that all content will be left aligned.

See Also:
Constant Field Values

HORIZONTAL_ALIGN_CENTER

static final int HORIZONTAL_ALIGN_CENTER
Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent. It indicates that all content will be centered horizontally.

See Also:
Constant Field Values

HORIZONTAL_ALIGN_RIGHT

static final int HORIZONTAL_ALIGN_RIGHT
Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent. It indicates that all content will be right aligned.

See Also:
Constant Field Values

HORIZONTAL_ALIGN_JUSTIFIED

static final int HORIZONTAL_ALIGN_JUSTIFIED
Constant to be used with the setHorizontalAlignment method of ViewOnlyComponent. It indicates that all content will be justified horizontally.

See Also:
Constant Field Values

VERTICAL_ALIGN_TOP

static final int VERTICAL_ALIGN_TOP
Constant to be used with the setVerticalAlignment method of ViewOnlyComponent. It indicates that all content will be top aligned.

See Also:
Constant Field Values

VERTICAL_ALIGN_CENTER

static final int VERTICAL_ALIGN_CENTER
Constant to be used with the setVerticalAlignment method of ViewOnlyComponent. It indicates that all content will be centered vertically.

See Also:
Constant Field Values

VERTICAL_ALIGN_BOTTOM

static final int VERTICAL_ALIGN_BOTTOM
Constant to be used with the setVerticalAlignment method of ViewOnlyComponent. It indicates that all content will be bottom aligned.

See Also:
Constant Field Values

VERTICAL_ALIGN_JUSTIFIED

static final int VERTICAL_ALIGN_JUSTIFIED
Constant to be used with the setVerticalAlignment method of ViewOnlyComponent. It indicates that all content will be justified vertically.

See Also:
Constant Field Values

SCALE_NO

static final int SCALE_NO
Constant to be used with the setScalingMode method of ViewOnlyComponent. It indicates that nothing of the content will be scaled to fit the component.

See Also:
Constant Field Values

SCALE_ASPECT_PROOF

static final int SCALE_ASPECT_PROOF
Constant to be used with the setScalingMode method of ViewOnlyComponent. It indicates that all content will be scaled in a way preserving the aspect ratio.

See Also:
Constant Field Values

SCALE_NO_ASPECT_PROOF

static final int SCALE_NO_ASPECT_PROOF
Constant to be used with the setScalingMode method of ViewOnlyComponent. It indicates that all content will be scaled in a way not necessarily preserving the aspect ratio.

See Also:
Constant Field Values

STATE_ENABLED

static final int STATE_ENABLED
Constant to be used with several methods of ViewOnlyComponent requiring a state parameter. It indicates that the operation performed in the related method is done with respect to the enabled state of the component.

See Also:
Constant Field Values

STATE_DISABLED

static final int STATE_DISABLED
Constant to be used with several methods of ViewOnlyComponent requiring a state parameter. It indicates that the operation performed in the related method is done with respect to the disabled state of the component.

See Also:
Constant Field Values
Method Detail

paint

void paint(Graphics g)
Method to paint the component.

Parameters:
g - the graphics context to use for painting.

setTextContent

void setTextContent(String text,
                    int state)
                    throws IllegalArgumentException
Assigns text content to this component which is state-dependent.

Parameters:
text - the text content, or null (removes text content which had been assigned before)
state - the state of the component for which this content should be displayed, one of STATE_ENABLED or STATE_DISABLED
Throws:
IllegalArgumentException - if the state parameter does not represent a state
See Also:
getTextContent(int)

setGraphicContent

void setGraphicContent(Image image,
                       int state)
                       throws IllegalArgumentException
Assigns graphical content to this component which is state-dependent.

Parameters:
image - the graphical content, or null (removes graphical content which had been assigned before)
state - the state of the component for which this content should be displayed, one of STATE_ENABLED or STATE_DISABLED
Throws:
IllegalArgumentException - if the state parameter does not represent a state
See Also:
getGraphicContent(int)

setAnimateContent

void setAnimateContent(Image[] images,
                       int state)
                       throws IllegalArgumentException
Assigns an array of graphical content to be used for animation to this component which is state-dependent.

Parameters:
images - the graphical content array, or null (removes any graphical content which had been assigned before)
state - the state of the component for which this content should be displayed, one of STATE_ENABLED or STATE_DISABLED
Throws:
IllegalArgumentException - if the state parameter does not represent a state
See Also:
getAnimateContent(int)

getTextContent

String getTextContent(int state)
                      throws IllegalArgumentException
Returns the text content for this component, depending on the current state.

Parameters:
state - the state of the component for which this content is to be retrieved, one of STATE_ENABLED or STATE_DISABLED
Returns:
The text content associated with the specified state, or null if there is none.
Throws:
IllegalArgumentException - if the state parameter does not represent a state
See Also:
setTextContent(java.lang.String, int)

getGraphicContent

Image getGraphicContent(int state)
                        throws IllegalArgumentException
Returns the graphical content for this component, depending on the current state.

Parameters:
state - the state of the component for which this content is to be retrieved, one of STATE_ENABLED or STATE_DISABLED
Returns:
The graphical content associated with the specified state, or null if there is none.
Throws:
IllegalArgumentException - if the state parameter does not represent a state
See Also:
setGraphicContent(com.sun.dtv.lwuit.Image, int)

getAnimateContent

Image[] getAnimateContent(int state)
                          throws IllegalArgumentException
Returns the animated content for this component, depending on the current state.

Parameters:
state - the state of the component for which this content is to be retrieved, one of STATE_ENABLED or STATE_DISABLED
Returns:
The graphical content associated with the specified state, or null if there is none.
Throws:
IllegalArgumentException - if the state parameter does not represent a state
See Also:
setAnimateContent(com.sun.dtv.lwuit.Image[], int)

setInteractionState

void setInteractionState(int state)
                         throws IllegalArgumentException
Set the current state of the component with respect to interaction.

Parameters:
state - the interaction state for this content, one of STATE_ENABLED or STATE_DISABLED
Throws:
IllegalArgumentException - if the state parameter does not represent a state
See Also:
getInteractionState()

getInteractionState

int getInteractionState()
Return the current interaction state of the component.

Returns:
the current interaction state of the component.
See Also:
setInteractionState(int)

setTextLayoutManager

void setTextLayoutManager(TextLayoutManager manager)
Sets the text layout manager that should be used for text layout in this component.

Parameters:
manager - the TextLayoutManager
See Also:
getTextLayoutManager()

getTextLayoutManager

TextLayoutManager getTextLayoutManager()
Gets the text layout manager that is currently in use for text layout in this component.

Returns:
the TextLayoutManager
See Also:
setTextLayoutManager(com.sun.dtv.ui.TextLayoutManager)

setHorizontalAlignment

void setHorizontalAlignment(int alignment)
Set the horizontal alignment for any state-based content in this component.

Parameters:
alignment - the horizontal alignment mode, one of HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_CENTER, HORIZONTAL_ALIGN_RIGHT or HORIZONTAL_ALIGN_JUSTIFIED.
See Also:
getHorizontalAlignment()

setVerticalAlignment

void setVerticalAlignment(int alignment)
Set the vertical alignment for any state-based content in this component.

Parameters:
alignment - the vertical alignment mode, one of VERTICAL_ALIGN_TOP, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_BOTTOM or VERTICAL_ALIGN_JUSTIFIED.
See Also:
getVerticalAlignment()

getHorizontalAlignment

int getHorizontalAlignment()
Retrieve the horizontal alignment for any state-based content in this component.

Returns:
the current horizontal alignment mode, one of HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_CENTER, HORIZONTAL_ALIGN_RIGHT or HORIZONTAL_ALIGN_JUSTIFIED.
See Also:
setHorizontalAlignment(int)

getVerticalAlignment

int getVerticalAlignment()
Retrieve the vertical alignment for any state-based content in this component.

Returns:
the current horizontal alignment mode, one of VERTICAL_ALIGN_TOP, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_BOTTOM or VERTICAL_ALIGN_JUSTIFIED.
See Also:
setVerticalAlignment(int)

setScalingMode

void setScalingMode(int scaling)
Set the scaling mode for this component.

Parameters:
scaling - the scaling mode, one of SCALE_NO, SCALE_NO_ASPECT_PROOF or SCALE_ASPECT_PROOF.
See Also:
getScalingMode()

getScalingMode

int getScalingMode()
Retrieve the scaling mode for this component.

Returns:
the current scaling mode, one of SCALE_NO, SCALE_NO_ASPECT_PROOF or SCALE_ASPECT_PROOF.
See Also:
setScalingMode(int)

isDoubleBuffered

boolean isDoubleBuffered()
Returns true if double buffering is available and activated.

Returns:
true if double buffering is available and activated, and false otherwise

isOpaque

boolean isOpaque()
Returns true if the whole area of the Component (as returned by the com.sun.dtv.lwuit.Component#getBounds method, is opaque.

Returns:
true if all the pixels within the area defined by the com.sun.dtv.lwuit.Component#getBounds method are opaque, i.e. all pixels are painted in an opaque color, false otherwise.

processEvent

void processEvent(AWTEvent event)
Handle the specified AWTEvent.

Parameters:
event - a java.awt.AWTEvent to handle.

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.