public class Player
extends javax.swing.JPanel
implements java.awt.event.ActionListener
+----+ |Init| +----+ V ----->+----+ / >|Stop| \ / / +----+< \ / / \ V | +-----+ ---> +----+ | |Pause| |Play| | +-----+ <--- +----+ \ A / A \ \+----+< / ------|Buff| / +----+
Modifier and Type | Class and Description |
---|---|
protected class |
Player.Playback
Playback thread
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.net.URL |
audioFile |
protected java.lang.String |
audioFilename |
protected int |
audioLength |
static java.lang.String |
BUILD
Build Number
|
protected int |
oldstate
Previous State of the Finite State Machine
|
protected javax.swing.JButton |
pauseButton
Pause Button
|
protected Player.Playback |
playback |
protected javax.swing.JButton |
playButton
Play Button
|
protected javax.swing.JPanel |
playerButtonPane
The Players Button Panel
|
protected javax.swing.JPanel |
playerScrollPane
The Players Scroll Panel
|
protected javax.swing.JSlider |
progressBar
Progress Bar
|
static java.lang.String |
REVISION
Revision Number
|
protected int |
state
Current State of the Finite State Machine
|
protected static int |
STATE_BUFFERING
Finite State Machine State: Buffering
|
protected static int |
STATE_ERROR
Finite State Machine State: Error
|
protected static int |
STATE_INIT
Finite State Machine State: Initialised
|
protected static int |
STATE_PAUSED
Finite State Machine State: Paused
|
protected static int |
STATE_PLAYING
Finite State Machine State: Playing
|
protected static int |
STATE_STOPPED
Finite State Machine State: Stopped
|
protected javax.swing.JButton |
stopButton
Stop Button
|
protected javax.swing.Timer |
timer |
static java.lang.String |
VERSION
Version Number
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Player(java.lang.String file)
Build a Player.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Process Actions when button are pressed.
|
protected static javax.swing.JButton |
buildButton(java.lang.String actionCommand,
java.lang.String toolTip,
java.lang.String pathIconDefault,
java.lang.String pathIconDisabled,
java.lang.String pathIconRollover,
java.awt.event.ActionListener listener)
Build a Button.
|
protected void |
createButtonPanel()
Create the ButtonPanel for the player.
|
protected void |
createGUI()
Create GUI for the player.
|
protected static javax.swing.ImageIcon |
createImageIcon(java.lang.String path)
Returns an ImageIcon, or null if the path was invalid.
|
protected void |
createScrollPanel()
Create the ScrollPanel for the player.
|
protected java.io.InputStream |
getAudioStream()
Returns an InputSteam containing the Audio to playback.
|
protected int |
getProgress()
Return the progress of the playback.
|
void |
init()
Initialize the Player Component.
|
static void |
main(java.lang.String[] args)
Command Line entrance.
|
void |
pauseIt()
Pause
|
void |
playIt() |
void |
start()
Start the Player Component.
|
void |
stop()
Stop the Player Component.
|
void |
stopIt() |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String BUILD
public static final java.lang.String VERSION
public static final java.lang.String REVISION
protected static final int STATE_INIT
protected static final int STATE_STOPPED
protected static final int STATE_PLAYING
protected static final int STATE_PAUSED
protected static final int STATE_BUFFERING
protected static final int STATE_ERROR
protected javax.swing.JPanel playerScrollPane
protected javax.swing.JPanel playerButtonPane
protected javax.swing.JButton playButton
protected javax.swing.JButton pauseButton
protected javax.swing.JButton stopButton
protected javax.swing.JSlider progressBar
protected javax.swing.Timer timer
protected int state
protected int oldstate
protected java.lang.String audioFilename
protected java.net.URL audioFile
protected int audioLength
protected Player.Playback playback
public static void main(java.lang.String[] args)
args
- public void init()
public void start()
public void stop()
protected java.io.InputStream getAudioStream() throws java.io.IOException
java.io.IOException
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- public void stopIt()
public void playIt()
public void pauseIt()
protected int getProgress()
protected void createGUI()
+-----------------------+ | ----|-------------- | Scroll Panel +-----------------------+ | +----+ +-----+ +----+ | | |play| |pause| |stop| | Button Panel | +----+ +-----+ +----+ | +-----------------------+
protected void createScrollPanel()
+-----------------------+ | ----|-------------- | Scroll Panel +-----------------------+
protected void createButtonPanel()
+-----------------------+ | +----+ +-----+ +----+ | | |play| |pause| |stop| | Button Panel | +----+ +-----+ +----+ | +-----------------------+
protected static javax.swing.JButton buildButton(java.lang.String actionCommand, java.lang.String toolTip, java.lang.String pathIconDefault, java.lang.String pathIconDisabled, java.lang.String pathIconRollover, java.awt.event.ActionListener listener)
actionCommand
- toolTip
- pathIconDefault
- pathIconDisabled
- pathIconRollover
- listener
- protected static javax.swing.ImageIcon createImageIcon(java.lang.String path)
path
- Copyright © 1999-2004 Wimba S.A. All Rights Reserved.