All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.util.PlayerPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JPanel
                                   |
                                   +----ejmf.toolkit.util.PlayerPanel

public class PlayerPanel
extends JPanel
This class is a panel that is intended to display a particular medium. It is intended that all GUI layout take place in the constructor, and that the media should begin playing when begin() is called. This will allow its parent container to complete its own layout before the media plays.

Example:

 Frame f = new Frame();
 Player player = Utility.getPlayer("/ejmf/media/xmas.avi");
 PlayerPanel p = new PlayerPanel(player);
 Label l = new Label("Media example");

// Configure display p.addControlComponent(); p.addVisualComponent(); add(p); add(l);

// Display components f.pack(); f.setvisible(true);

// Start media play p.begin();

Note that it may be worthwhile to realize() the player in the constructor of the PlayerPanel, so that when begin() is called the components do not have to resize.


Variable Index

 o mediaBorder

Constructor Index

 o PlayerPanel(MediaLocator)
Constructs a PlayerPanel for the given MediaLocator.

Method Index

 o addControlComponent()
Adds the Player's control component to this PlayerPanel.
 o addControlComponent(Component)
Adds a given component to the part of this PlayerPanel reserved for its Player's control component.
 o addMediaPanel()
 o addVisualComponent()
Adds the Player's visual component to this PlayerPanel.
 o addVisualComponent(Component)
Adds a given component to the part of this PlayerPanel reserved for its Player's visual component.
 o getMediaPanel()
Get the media panel component
 o getPlayer()
Gets the Player for this PlayerPanel.
 o removeLoadingLabel()
Removes the initial "loading" label that appears while the media is loading.

Variables

 o mediaBorder
 public TitledBorder mediaBorder

Constructors

 o PlayerPanel
 public PlayerPanel(MediaLocator locator) throws IOException, NoPlayerException
Constructs a PlayerPanel for the given MediaLocator.

Throws: IOException
If an I/O error occurs while accessing the media.
Throws: NoPlayerException
If a Player cannot be created from the given MediaLocator.

Methods

 o getPlayer
 public Player getPlayer()
Gets the Player for this PlayerPanel.

 o getMediaPanel
 public JPanel getMediaPanel()
Get the media panel component

 o removeLoadingLabel
 public void removeLoadingLabel()
Removes the initial "loading" label that appears while the media is loading.

 o addMediaPanel
 public void addMediaPanel()
 o addVisualComponent
 public Component addVisualComponent(Component cc)
Adds a given component to the part of this PlayerPanel reserved for its Player's visual component.

Parameters:
cc - The Component to add.
Returns:
The Component added.
 o addVisualComponent
 public Component addVisualComponent()
Adds the Player's visual component to this PlayerPanel.

Returns:
The Component added.
 o addControlComponent
 public Component addControlComponent(Component cc)
Adds a given component to the part of this PlayerPanel reserved for its Player's control component.

Parameters:
cc -
Returns:
 o addControlComponent
 public Component addControlComponent()
Adds the Player's control component to this PlayerPanel.

Returns:

All Packages  Class Hierarchy  This Package  Previous  Next  Index