javazoom.jlGui
Class Player

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--javazoom.jlGui.Player
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, BasicPlayerListener, java.awt.dnd.DropTargetListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.awt.event.WindowListener

public class Player
extends java.awt.Window
implements java.awt.event.ActionListener, BasicPlayerListener, java.awt.dnd.DropTargetListener, java.awt.event.WindowListener

See Also:
Serialized Form

Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int INIT
           
static int OPEN
           
static int PAUSE
           
static int PLAY
           
static int STOP
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Player(java.lang.String Skin, int loglevel, java.lang.String logfile, java.awt.Frame top)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Manages events.
 void dragEnter(java.awt.dnd.DropTargetDragEvent e)
          DnD : dragEnter implementation.
 void dragExit(java.awt.dnd.DropTargetEvent e)
          DnD : dragExit implementation.
 void dragOver(java.awt.dnd.DropTargetDragEvent e)
          DnD : dragOver implementation.
 void drop(java.awt.dnd.DropTargetDropEvent e)
          DnD : Drop implementation.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent e)
          DnD : dropActionChanged implementation.
 void exit(int status)
          Kills the player.
protected  int getPlayerState()
          Returns Player state.
 Playlist getPlaylist()
          Returns Playlist instance.
 boolean loadPlaylist(java.lang.String playlistName)
          Loads a new playlist.
 void loadSkin(java.io.InputStream skinStream)
          Loads a new skin from any input stream.
 void loadSkin(java.lang.String skinName)
          Loads a new skin from local file system.
static void main(java.lang.String[] args)
          Entry point.
 void paint(java.awt.Graphics g)
           
 void pressEject()
          Simulates "Eject" selection.
 void pressNext()
          Simulates "Next" selection.
 void pressPrevious()
          Simulates "Previous" selection.
 void pressStart()
          Simulates "Play" selection.
 void pressStop()
          Simulates "Stop" selection.
 void setCurrentSong(PlaylistItem pli)
          Sets the current song to play and start playing if needed.
 void setSkin(java.lang.String sk)
          Sets skin filename.
 void update(java.awt.Graphics g)
           
 void updateCursor(int secondsAmount, int total)
          BasicPlayerListener implementation.
 void updateMediaData(byte[] data)
          BasicPlayerListener implementation.
 void updateMediaState(java.lang.String state)
          BasicPlayerListener implementation.
 void windowActivated(java.awt.event.WindowEvent e)
          Invoked when the window is set to be the user's active window, which means the window (or one of its subcomponents) will receive keyboard events.
 void windowClosed(java.awt.event.WindowEvent e)
          Invoked when a window has been closed as the result of calling dispose on the window
 void windowClosing(java.awt.event.WindowEvent e)
          Invoked when the user attempts to close the window from the window's system menu.
 void windowDeactivated(java.awt.event.WindowEvent e)
          Invoked when a window is no longer the user's active window, which means that keyboard events will no longer be delivered to the window or its subcomponents
 void windowDeiconified(java.awt.event.WindowEvent e)
          Invoked when a window is changed from a minimized to a normal state.
 void windowIconified(java.awt.event.WindowEvent e)
          Invoked when a window is changed from a normal to a minimized state.
 void windowOpened(java.awt.event.WindowEvent e)
          Invoked the first time a window is made visible.
 
Methods inherited from class java.awt.Window
addNotify, addWindowListener, applyResourceBundle, applyResourceBundle, dispose, finalize, getAccessibleContext, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, setCursor, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INIT

public static final int INIT

OPEN

public static final int OPEN

PLAY

public static final int PLAY

PAUSE

public static final int PAUSE

STOP

public static final int STOP
Constructor Detail

Player

public Player(java.lang.String Skin,
              int loglevel,
              java.lang.String logfile,
              java.awt.Frame top)
Constructor.
Method Detail

loadPlaylist

public boolean loadPlaylist(java.lang.String playlistName)
Loads a new playlist.

loadSkin

public void loadSkin(java.lang.String skinName)
Loads a new skin from local file system.

loadSkin

public void loadSkin(java.io.InputStream skinStream)
Loads a new skin from any input stream.

setCurrentSong

public void setCurrentSong(PlaylistItem pli)
Sets the current song to play and start playing if needed.

updateCursor

public void updateCursor(int secondsAmount,
                         int total)
BasicPlayerListener implementation. It manages "elapsed time" event.
Specified by:
updateCursor in interface BasicPlayerListener

updateMediaState

public void updateMediaState(java.lang.String state)
BasicPlayerListener implementation. It manages End Of Media event.
Specified by:
updateMediaState in interface BasicPlayerListener

updateMediaData

public void updateMediaData(byte[] data)
BasicPlayerListener implementation.
Specified by:
updateMediaData in interface BasicPlayerListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Manages events.
Specified by:
actionPerformed in interface java.awt.event.ActionListener

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Container

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Invoked when the window is set to be the user's active window, which means the window (or one of its subcomponents) will receive keyboard events.
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Invoked when a window has been closed as the result of calling dispose on the window
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Invoked when the user attempts to close the window from the window's system menu.
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Invoked when a window is no longer the user's active window, which means that keyboard events will no longer be delivered to the window or its subcomponents
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Invoked when a window is changed from a minimized to a normal state.
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Invoked when a window is changed from a normal to a minimized state.
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Invoked the first time a window is made visible.
Specified by:
windowOpened in interface java.awt.event.WindowListener

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent e)
DnD : dragEnter implementation.
Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent e)
DnD : dragOver implementation.
Specified by:
dragOver in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent e)
DnD : dragExit implementation.
Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent e)
DnD : dropActionChanged implementation.
Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener

drop

public void drop(java.awt.dnd.DropTargetDropEvent e)
DnD : Drop implementation. Adds all dropped files to the playlist.
Specified by:
drop in interface java.awt.dnd.DropTargetListener

setSkin

public void setSkin(java.lang.String sk)
Sets skin filename.

getPlaylist

public Playlist getPlaylist()
Returns Playlist instance.

getPlayerState

protected int getPlayerState()
Returns Player state.

exit

public void exit(int status)
Kills the player.

pressStart

public void pressStart()
Simulates "Play" selection.

pressStop

public void pressStop()
Simulates "Stop" selection.

pressNext

public void pressNext()
Simulates "Next" selection.

pressPrevious

public void pressPrevious()
Simulates "Previous" selection.

pressEject

public void pressEject()
Simulates "Eject" selection.

main

public static void main(java.lang.String[] args)
Entry point.


JavaZOOM 1999-2002