All Packages Class Hierarchy This Package Previous Next Index
Class ejmf.toolkit.gui.NPlayerPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JPanel
|
+----ejmf.toolkit.gui.NPlayerPanel
- public class NPlayerPanel
- extends JPanel
Display the visual components from multiple Players
from one of the following sources:
- MultiPlayer
- MixFileData
- An array of Players
- An array of MediaLocators
- An array of Strings
- A single MediaLocator and a count of how many
times media is to be displayed.
The Player's media is displayed within a JPanel using
a GridLayout as the default. The grid is made as square as possible.
To change the layout manager, override the createLayout
method.
Each visual component is bordered by a etched and titled border.
To change the border drawn around the media, override the
createBorder
method.
-
NPlayerPanel(int, MediaLocator)
-
Create an NPlayerPanel that displays a single media
source multiple times.
-
NPlayerPanel(MediaLocator[])
-
Create an NPlayerPanel from a array of MediaLocators.
-
NPlayerPanel(MixFileData)
- Create an NPlayerPanel from a MixFileData object
For each element a Player is created and
its visual component displayed.
-
NPlayerPanel(MultiPlayer)
-
Create an NPlayerPanel from a MultiPlayer.
-
NPlayerPanel(Player[])
-
Create an NPlayerPanel from an array of Players.
-
NPlayerPanel(String[])
-
Create an NPlayerPanel from an array of media file names
For each file named in the array a MediaLocator is
constructed.
-
createBorder(MediaLocator)
- Create an etched and titled border based on a Player MediaLocator.
-
createLayout(int)
- Create the LayoutManager for the NPlayerPanel
The default layout is a GridLayout with a 10
pixel horizontal and vertical gaps.
-
getPlayers()
-
Return an array of Player references naming Players
displayed in NPlayerPanel.
NPlayerPanel
public NPlayerPanel(MediaLocator mls[]) throws NoPlayerException, IOException
- Create an NPlayerPanel from a array of MediaLocators.
The MediaLocators are used to construct the Players.
- Parameters:
- mls - An array of MediaLocators.
- Throws: NoPlayerException
- if Player can not be constructed.
- Throws: IOException
- if DataSource can not be connected to.
NPlayerPanel
public NPlayerPanel(MultiPlayer mp)
- Create an NPlayerPanel from a MultiPlayer.
In this case, Players are already constructed.
Players are moved to prefetch state.
NPlayerPanel
public NPlayerPanel(Player players[])
- Create an NPlayerPanel from an array of Players.
In this case, Players are already constructed.
Players are moved to prefetch state.
NPlayerPanel
public NPlayerPanel(MixFileData mixList) throws NoPlayerException, IOException
- Create an NPlayerPanel from a MixFileData object
For each element a Player is created and
its visual component displayed.
- Parameters:
- mixList - a MixFileData object
- Throws: NoPlayerException
- if Player can not be constructed.
- Throws: IOException
- if DataSource can not be connected to.
- See Also:
- MixTrackData, MixFileData
NPlayerPanel
public NPlayerPanel(String mediaFiles[]) throws NoPlayerException, IOException
- Create an NPlayerPanel from an array of media file names
For each file named in the array a MediaLocator is
constructed. From each MediaLocator a Player is created and
its visual component displayed.
- Parameters:
- mediaFiles - An array of Strings which
- Throws: NoPlayerException
- if Player can not be constructed.
- Throws: IOException
- if DataSource can not be connected to.
NPlayerPanel
public NPlayerPanel(int nPlayers,
MediaLocator media) throws NoPlayerException, IOException
- Create an NPlayerPanel that displays a single media
source multiple times.
- Parameters:
- nPlayers - the number of Players to create
- media - A MediaLocator.
- Throws: NoPlayerException
- if Player can not be constructed.
- Throws: IOException
- if DataSource can not be connected to.
createBorder
protected Border createBorder(MediaLocator ml)
- Create an etched and titled border based on a Player MediaLocator.
Default implementation creates an EtchedBorder with the
title displayed at top left. If no title is provided,
a simple EtchedBorder is drawn.
Subclasses should over-ride this method to create a
custom border.
- Parameters:
- ml - A javax.media.MediaLocator associated with a Player
- Returns:
- a com.sun.java.swing.border.Border
createLayout
protected LayoutManager createLayout(int n)
- Create the LayoutManager for the NPlayerPanel
The default layout is a GridLayout with a 10
pixel horizontal and vertical gaps.
Subclasses over-ride this method to provide their
layout.
- Parameters:
- n - the number of Players to be dispalyed.
- Returns:
- java.awt.LayoutManager
getPlayers
public Player[] getPlayers()
- Return an array of Player references naming Players
displayed in NPlayerPanel.
- Returns:
- An array of Players.
All Packages Class Hierarchy This Package Previous Next Index