mediaframe.mpeg1.controlpanel
Class ControlButton

java.lang.Object
  |
  +--java.awt.Component
        |
        +--mediaframe.mpeg1.controlpanel.ControlButton
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public final class ControlButton
extends java.awt.Component

The ControlButton class represents a button of the ControlPanel. This class responds for downloading button's images and for painting them on the screen.

Version:
1.0 26.07.2002
Author:
Konstantin Belous
See Also:
Serialized Form

Field Summary
private  java.awt.Image disabledImage
          The image of the disabled button.
private  java.awt.Image enabledImage
          The image of the enabled Button.
private  java.awt.Image hiddenImage
          The image of the hidden button.
static java.lang.String IMAGE_PATH
          The path to the images.
private  MPEG1 player
          The reference to the applet.
private  int x
          The x coord of the component.
private  int y
          The y coord of the component.
 
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
ControlButton(MPEG1 player, java.lang.String[] ImagesFileNames)
          The constructor of the button.
 
Method Summary
 void loadHidden(java.lang.String hidden)
          Loads the hidden image.
 void paint(java.awt.Graphics g)
          Paints the button.
 void rotateHidden()
          Rotates enabled and hidden images.
 void setBounds(int x, int y)
          Sets the x and y coords of the button.
 void setVolumeDisabled()
          Sets the speaker button to disabled state.
 void setVolumeEnabled()
          Sets the speaker button to enabled state.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IMAGE_PATH

public static java.lang.String IMAGE_PATH
The path to the images.


player

private MPEG1 player
The reference to the applet.


enabledImage

private java.awt.Image enabledImage
The image of the enabled Button.


disabledImage

private java.awt.Image disabledImage
The image of the disabled button.


hiddenImage

private java.awt.Image hiddenImage
The image of the hidden button.


x

private int x
The x coord of the component.


y

private int y
The y coord of the component.

Constructor Detail

ControlButton

public ControlButton(MPEG1 player,
                     java.lang.String[] ImagesFileNames)
The constructor of the button. Constructor responds for retrieval of the button's images and for variables initialization.

Parameters:
player - the reference to the applet.
ImagesFileNames - an array of the enable/disable 2 image file names.
Method Detail

loadHidden

public final void loadHidden(java.lang.String hidden)
Loads the hidden image.

Parameters:
hidden - the name of the hidden image

rotateHidden

public final void rotateHidden()
Rotates enabled and hidden images.


paint

public final void paint(java.awt.Graphics g)
Paints the button.

Overrides:
paint in class java.awt.Component
Parameters:
g - the graphics context.

setBounds

public final void setBounds(int x,
                            int y)
Sets the x and y coords of the button.

Parameters:
x - the x coord to set.
y - the y coord to set.

setVolumeDisabled

public final void setVolumeDisabled()
Sets the speaker button to disabled state.


setVolumeEnabled

public final void setVolumeEnabled()
Sets the speaker button to enabled state.