mediaframe.mpeg1.controlpanel
Class ControlPanel

java.lang.Object
  |
  +--mediaframe.mpeg1.controlpanel.ControlPanel
All Implemented Interfaces:
java.util.EventListener, IControlPanel, java.awt.event.MouseListener

public class ControlPanel
extends java.lang.Object
implements java.awt.event.MouseListener, IControlPanel

The ControlPanel responds for painting of the control panel (play/pause, mute on/mute off, stop buttons).

Version:
1.0 26.07.2002
Author:
Konstantin Belous
See Also:
IControlPanel

Field Summary
private static int DISABLED
          The "disabled" video player state.
(package private)  boolean mute
          The mute flag.
private static int PAUSED
          The "paused" video player state.
private  ControlButton play
          The play button of the control panel.
private static int PLAYED
          The "played" video player state.
private  MPEG1 player
          The reference to the video player applet.
private  java.awt.Panel screen
          The reference to the video screen.
private  ControlButton speaker
          The mute button of the control panel.
private  int state
          The state of the video player.
private  ControlButton stop
          The stop button of the control panel.
private static int STOPPED
          The "stopped" video player state.
 
Constructor Summary
ControlPanel()
           
 
Method Summary
 void disablePanel()
          Implements "disable" action of the control panel.
 void endPlay()
          Implements "end play" action of the control panel.
 boolean getMute()
          Gets mute value.
 void initPanel(MPEG1 player, int heigth)
          Initialization of the control panel.
 void mouseClicked(java.awt.event.MouseEvent e)
          Stub for the MouseListener interface (does nothing).
 void mouseEntered(java.awt.event.MouseEvent e)
          Stub for the MouseListener interface (does nothing).
 void mouseExited(java.awt.event.MouseEvent e)
          Stub for the MouseListener interface (does nothing).
 void mousePressed(java.awt.event.MouseEvent e)
          The mouse is pressed on the button (Mouse Listener event).
 void mouseReleased(java.awt.event.MouseEvent e)
          Stub for the MouseListener interface (does nothing).
 void paint(java.awt.Graphics g)
          Paints the control panel.
 void pause()
          Implements "pause" action of the control panel.
 void play()
          Implements "play" action of the control panel.
 void setMute(boolean mute)
          Sets the mute value.
 void stop()
          Implements "stop" action of the control panel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

player

private MPEG1 player
The reference to the video player applet.


screen

private java.awt.Panel screen
The reference to the video screen.


play

private ControlButton play
The play button of the control panel.


stop

private ControlButton stop
The stop button of the control panel.


speaker

private ControlButton speaker
The mute button of the control panel.


PLAYED

private static final int PLAYED
The "played" video player state.

See Also:
Constant Field Values

PAUSED

private static final int PAUSED
The "paused" video player state.

See Also:
Constant Field Values

STOPPED

private static final int STOPPED
The "stopped" video player state.

See Also:
Constant Field Values

DISABLED

private static final int DISABLED
The "disabled" video player state.

See Also:
Constant Field Values

state

private int state
The state of the video player.


mute

boolean mute
The mute flag.

Constructor Detail

ControlPanel

public ControlPanel()
Method Detail

initPanel

public void initPanel(MPEG1 player,
                      int heigth)
Initialization of the control panel. Constructs the buttons (play/pause, mute on/mute off, stop). Disables the control panel after initialization.

Specified by:
initPanel in interface IControlPanel
Parameters:
player - the reference to the called applet.
heigth - height of the control panel.

paint

public void paint(java.awt.Graphics g)
Paints the control panel.

Specified by:
paint in interface IControlPanel
Parameters:
g - the graphics context of the video player.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
The mouse is pressed on the button (Mouse Listener event). The method calls the player's logic to perform required action.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - the event state information.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Stub for the MouseListener interface (does nothing).

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Stub for the MouseListener interface (does nothing).

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Stub for the MouseListener interface (does nothing).

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Stub for the MouseListener interface (does nothing).

Specified by:
mouseClicked in interface java.awt.event.MouseListener

setMute

public void setMute(boolean mute)
Sets the mute value.

Specified by:
setMute in interface IControlPanel
Parameters:
mute - the mute value.

getMute

public boolean getMute()
Gets mute value.

Specified by:
getMute in interface IControlPanel
Returns:
the mute value.

play

public void play()
Implements "play" action of the control panel.

Specified by:
play in interface IControlPanel

stop

public void stop()
Implements "stop" action of the control panel.

Specified by:
stop in interface IControlPanel

endPlay

public void endPlay()
Implements "end play" action of the control panel.

Specified by:
endPlay in interface IControlPanel

pause

public void pause()
Implements "pause" action of the control panel.

Specified by:
pause in interface IControlPanel

disablePanel

public void disablePanel()
Implements "disable" action of the control panel.

Specified by:
disablePanel in interface IControlPanel