Java DTV API 1.0
12-Dec-2008

com.sun.lwuit
Class MediaComponent

java.lang.Object
  extended bycom.sun.lwuit.Component
      extended bycom.sun.lwuit.MediaComponent
All Implemented Interfaces:
Animated, StyleListener

public class MediaComponent
extends Component

A component allowing us to embed and control rich media content.


Field Summary
 
Fields inherited from class com.sun.lwuit.Component
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
 
Fields inherited from interface com.sun.dtv.ui.Animated
ALTERNATING, LOOP, REPEATING
 
Constructor Summary
MediaComponent(Player player)
          Creates a new instance of MediaComponent.
 
Method Summary
protected  Dimension calcPreferredSize()
          Calculates the preferred size based on component content.
protected  void deinitialize()
          Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy.
protected  void initComponent()
          Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state.
 void paint(Graphics g)
          This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.
protected  void paintBackground(Graphics g)
          Paints the background of the component, invoked with the clipping region and appropriate scroll translation.
 void paintBackgrounds(Graphics g)
          This method paints all the parents Components Background.
 void setHeight(int height)
          Sets the Component height, this method is exposed for the purpose of external layout managers and should not be invoked directly.
 void setVisible(boolean visible)
          Display the embedded media component.
 void setWidth(int width)
          Sets the Component width, this method is exposed for the purpose of external layout managers and should not be invoked directly.
 void setX(int x)
          Sets the Component x location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.
 void setY(int y)
          Sets the Component y location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.
 void startMedia()
          Start media playback implicitly setting the component to visible.
 void stopMedia()
          Stop media playback.
 
Methods inherited from class com.sun.lwuit.Component
addFocusListener, animate, contains, fireClicked, getAbsoluteX, getAbsoluteY, getAnimationMode, getBaseline, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getClientProperty, getComponentForm, getDelay, getHeight, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPosition, getPreferredSize, getRepetitionMode, getScrollAnimationSpeed, getScrollX, getScrollY, getSideGap, getStyle, getUIID, getWidth, getX, getY, handlesInput, hasFocus, isEnabled, isFocusable, isFocusPainted, isInitialized, isRunning, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSelectableInteraction, isSmoothScrolling, isVisible, jumpTo, keyPressed, keyReleased, keyRepeated, longKeyPress, paintBorder, paintComponent, paintComponent, paintScrollbars, paintScrollbarX, paintScrollbarY, paramString, pointerDragged, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, setAnimationMode, setCellRenderer, setDelay, setEnabled, setFocus, setFocusable, setFocusPainted, setHandlesInput, setInitialized, setIsScrollVisible, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredSize, setRepetitionMode, setScrollAnimationSpeed, setScrollX, setScrollY, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setStyle, start, stop, styleChanged, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MediaComponent

public MediaComponent(Player player)
Creates a new instance of MediaComponent.

Parameters:
player - the media player
Method Detail

initComponent

protected void initComponent()
Description copied from class: Component
Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state.

Overrides:
initComponent in class Component

deinitialize

protected void deinitialize()
Description copied from class: Component
Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. This allows the component to deregister animators and cleanup after itself. This method is the opposite of the initComponent() method.

Overrides:
deinitialize in class Component

paint

public void paint(Graphics g)
Description copied from class: Component
This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.

Specified by:
paint in interface Animated
Overrides:
paint in class Component
Parameters:
g - the component graphics

paintBackground

protected void paintBackground(Graphics g)
Description copied from class: Component
Paints the background of the component, invoked with the clipping region and appropriate scroll translation.

Overrides:
paintBackground in class Component
Parameters:
g - the component graphics

paintBackgrounds

public void paintBackgrounds(Graphics g)
Description copied from class: Component
This method paints all the parents Components Background.

Overrides:
paintBackgrounds in class Component
Parameters:
g - the graphics object

calcPreferredSize

protected Dimension calcPreferredSize()
Description copied from class: Component
Calculates the preferred size based on component content. This method is invoked lazily by getPreferred size.

Overrides:
calcPreferredSize in class Component
Returns:
the calculated preferred size based on component content

setX

public void setX(int x)
Description copied from class: Component
Sets the Component x location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.

Overrides:
setX in class Component
Parameters:
x - the current x coordinate of the components origin
See Also:
Component.getX()

setY

public void setY(int y)
Description copied from class: Component
Sets the Component y location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.

Overrides:
setY in class Component
Parameters:
y - the current y coordinate of the components origin
See Also:
Component.getY()

setWidth

public void setWidth(int width)
Description copied from class: Component
Sets the Component width, this method is exposed for the purpose of external layout managers and should not be invoked directly.
If a user wishes to effect the component size setPreferredSize should be used.

Overrides:
setWidth in class Component
Parameters:
width - the width of the component
See Also:
Component.getWidth(), Component.setPreferredSize(com.sun.lwuit.geom.Dimension)

setHeight

public void setHeight(int height)
Description copied from class: Component
Sets the Component height, this method is exposed for the purpose of external layout managers and should not be invoked directly.
If a user wishes to effect the component size setPreferredSize should be used.

Overrides:
setHeight in class Component
Parameters:
height - the height of the component
See Also:
Component.getHeight(), Component.setPreferredSize(com.sun.lwuit.geom.Dimension)

setVisible

public void setVisible(boolean visible)
Display the embedded media component.

Overrides:
setVisible in class Component
Parameters:
visible - true to display, false to hide

startMedia

public void startMedia()
                throws MediaException
Start media playback implicitly setting the component to visible.

Throws:
MediaException - if starting media fails

stopMedia

public void stopMedia()
               throws MediaException
Stop media playback.

Throws:
MediaException - if stopping media fails

Java DTV API 1.0
12-Dec-2008

Copyright © 2008 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.