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.
-
mediaBorder
-
-
PlayerPanel(MediaLocator)
- Constructs a PlayerPanel for the given MediaLocator.
-
addControlComponent()
- Adds the Player's control component to this PlayerPanel.
-
addControlComponent(Component)
- Adds a given component to the part of this PlayerPanel
reserved for its Player's control component.
-
addMediaPanel()
-
-
addVisualComponent()
- Adds the Player's visual component to this PlayerPanel.
-
addVisualComponent(Component)
- Adds a given component to the part of this PlayerPanel
reserved for its Player's visual component.
-
getMediaPanel()
- Get the media panel component
-
getPlayer()
- Gets the Player for this PlayerPanel.
-
removeLoadingLabel()
- Removes the initial "loading" label that appears while the
media is loading.
mediaBorder
public TitledBorder mediaBorder
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.
getPlayer
public Player getPlayer()
- Gets the Player for this PlayerPanel.
getMediaPanel
public JPanel getMediaPanel()
- Get the media panel component
removeLoadingLabel
public void removeLoadingLabel()
- Removes the initial "loading" label that appears while the
media is loading.
addMediaPanel
public void addMediaPanel()
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.
addVisualComponent
public Component addVisualComponent()
- Adds the Player's visual component to this PlayerPanel.
- Returns:
- The Component added.
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:
-
addControlComponent
public Component addControlComponent()
- Adds the Player's control component to this PlayerPanel.
- Returns:
-
All Packages Class Hierarchy This Package Previous Next Index