Java DTV API 1.3
18-Nov-2009

com.sun.dtv.lwuit
Class MediaComponent

java.lang.Object
  extended by com.sun.dtv.lwuit.Component
      extended by com.sun.dtv.lwuit.MediaComponent
All Implemented Interfaces:
Animation, StyleListener, Animated

public class MediaComponent
extends Component

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


Field Summary
 
Fields inherited from class com.sun.dtv.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
 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.
 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.dtv.lwuit.Component
addFocusListener, animate, calcPreferredSize, contains, deinitialize, getAbsoluteX, getAbsoluteY, getAnimationMode, getBaseline, getBaselineResizeBehavior, 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, initialize, isEnabled, isFocusable, isFocusPainted, isInitialized, isRunning, isScrollableX, isScrollableY, isScrollVisible, isSmoothScrolling, isVisible, jumpTo, keyPressed, keyReleased, keyRepeated, longKeyPress, paintComponent, paintComponent, pointerDragged, pointerPressed, pointerReleased, putClientProperty, 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, setUIID, 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

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 Animation
Overrides:
paint 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

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.dtv.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.dtv.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.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.