net.sf.fmj.ejmf.toolkit.gui.controlpanel
Class StandardControlPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by net.sf.fmj.ejmf.toolkit.gui.controlpanel.AbstractControlPanel
                      extended by net.sf.fmj.ejmf.toolkit.gui.controlpanel.StandardControlPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class StandardControlPanel
extends AbstractControlPanel

StandardControlPanel extends JPanel and arranges the standard controls in a left-to-right fashion using FlowLayout and add(Component, index) Setters are defined that allow the user to change the visual component associated with any control. A version of these setters allows for the definition of a new listener. Two constructors are defined. The first builds all the default controls into the control panel. The second takes a flag which defines the controls to be built and displayed by the control panel. The flag values are defined by public static values provided by the class. These values can be OR'd together to set a flag value.

See Also:
AbstractControlPanel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class net.sf.fmj.ejmf.toolkit.gui.controlpanel.AbstractControlPanel
skin, USE_FF_CONTROL, USE_GAIN_CONTROL, USE_GAINMETER_CONTROL, USE_PAUSE_CONTROL, USE_PROGRESS_CONTROL, USE_REVERSE_CONTROL, USE_START_CONTROL, USE_STOP_CONTROL
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
StandardControlPanel(Player p)
          Build a StandardControlPanel with all of the default controls.
StandardControlPanel(Player p, int buttonFlags)
          Build a StandardControlPanel designating which controls are desired.
StandardControlPanel(Skin skin, Player p)
           
StandardControlPanel(Skin skin, Player p, int buttonFlags)
           
 
Method Summary
 void addComponents(int flags)
          Does the work of building the control components and adding them to the layout.
protected  net.sf.fmj.ejmf.toolkit.gui.controlpanel.AbstractControls createControls(Player player)
          Creates Controls associated with this Control Panel.
 javax.swing.AbstractButton getFastForwardButton()
          Get the fast forward button control
 AbstractGainButtonPanel getGainButtonPanel()
          Get the gain button panel
 javax.swing.AbstractButton getGainMeterButton()
          Get the gain meter button control
 javax.swing.AbstractButton getPauseControl()
          Get the pause button control
 ProgressSlider getProgressComponent()
          Get the progress control
 javax.swing.AbstractButton getReverseButton()
          Get the reverse button control
 javax.swing.AbstractButton getStartButton()
          Get the start button control
 javax.swing.AbstractButton getStopButton()
          Get the stop button control
 void setFastForwardButton(javax.swing.AbstractButton c)
          Set the control button for fast forwarding the player associated with this control panel.
 void setFastForwardButton(javax.swing.AbstractButton c, java.awt.event.MouseListener l)
          Set the control button for fast forwarding the player associated with this control panel.
 void setGainButtonPanel(AbstractGainButtonPanel c)
          Set the control component for gain Control
 void setGainButtonPanel(AbstractGainButtonPanel c, java.awt.event.ActionListener l)
          Set the control component and listener semantics for gain Control
 void setGainMeterButton(javax.swing.AbstractButton c)
          Set the control component for gain meter Control
 void setGainMeterButton(javax.swing.AbstractButton c, java.awt.event.ActionListener l)
          Set the control component and listener semantics for gain meter Control
 void setPauseButton(javax.swing.AbstractButton c)
          Set the control button for pausing the player associated with this control panel.
 void setPauseButton(javax.swing.AbstractButton c, java.awt.event.ActionListener l)
          Set the pause button with use-supplied semantics.
 void setProgressSlider(ProgressSlider c)
          Set the control component for progress bar associated with this control panel.
 void setProgressSlider(ProgressSlider c, javax.swing.event.ChangeListener l)
          Set the control component for displaying the player progress slider associated with this control panel.
 void setReverseButton(javax.swing.AbstractButton c)
          Set the control button for reversing the player associated with this control panel.
 void setReverseButton(javax.swing.AbstractButton c, java.awt.event.MouseListener l)
          Set the control button for reversing the player associated with this control panel.
 void setStartButton(javax.swing.AbstractButton c)
          Set the control button for starting the player associated with this control panel.
 void setStartButton(javax.swing.AbstractButton c, java.awt.event.ActionListener l)
          Set the control button for starting the player associated with this control panel.
 void setStopButton(javax.swing.AbstractButton c)
          Set the control button for stopping the player associated with this control panel.
 void setStopButton(javax.swing.AbstractButton c, java.awt.event.ActionListener l)
          Set the control button for stopping the player associated with this control panel.
 
Methods inherited from class net.sf.fmj.ejmf.toolkit.gui.controlpanel.AbstractControlPanel
getControl, getControls, removeControlComponents, replaceControlComponent, replaceControlComponent, setControlPanelBorder, setControlPanelLayout
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardControlPanel

public StandardControlPanel(Player p)
Build a StandardControlPanel with all of the default controls.

Parameters:
p - A player with which control panel is associated.
See Also:
Player

StandardControlPanel

public StandardControlPanel(Player p,
                            int buttonFlags)
Build a StandardControlPanel designating which controls are desired.

Parameters:
p - A player with which control panel is associated.
buttonFlags - Control values OR'd together which determine the controls that are displayed.
See Also:
Player

StandardControlPanel

public StandardControlPanel(Skin skin,
                            Player p)

StandardControlPanel

public StandardControlPanel(Skin skin,
                            Player p,
                            int buttonFlags)
Method Detail

createControls

protected net.sf.fmj.ejmf.toolkit.gui.controlpanel.AbstractControls createControls(Player player)
Creates Controls associated with this Control Panel.

Specified by:
createControls in class AbstractControlPanel
Parameters:
player - Associated Player

addComponents

public void addComponents(int flags)
Does the work of building the control components and adding them to the layout. The default behavior is simply to use the components provided by BasicControlPanel. This method may be over-ridden for a wholesale customization of the control panel.

Specified by:
addComponents in class AbstractControlPanel
Parameters:
flags - Is the bit-wise OR of some number of Control identifiers, e.g. USE_START_CONTROL. OR'd value of USE values that determine which control buttons are displayed.

getStartButton

public javax.swing.AbstractButton getStartButton()
Get the start button control

Returns:
An AbstractButton

getPauseControl

public javax.swing.AbstractButton getPauseControl()
Get the pause button control

Returns:
An AbstractButton

getFastForwardButton

public javax.swing.AbstractButton getFastForwardButton()
Get the fast forward button control

Returns:
An AbstractButton

getProgressComponent

public ProgressSlider getProgressComponent()
Get the progress control

Returns:
A ProgressSlider

getStopButton

public javax.swing.AbstractButton getStopButton()
Get the stop button control

Returns:
An AbstractButton

getReverseButton

public javax.swing.AbstractButton getReverseButton()
Get the reverse button control

Returns:
An AbstractButton

getGainButtonPanel

public AbstractGainButtonPanel getGainButtonPanel()
Get the gain button panel

Returns:
An AbstractGainButtonPanel

getGainMeterButton

public javax.swing.AbstractButton getGainMeterButton()
Get the gain meter button control

Returns:
An AbstractButton

setStartButton

public void setStartButton(javax.swing.AbstractButton c)
Set the control button for starting the player associated with this control panel.

Parameters:
c - An AbstractButton

setStartButton

public void setStartButton(javax.swing.AbstractButton c,
                           java.awt.event.ActionListener l)
Set the control button for starting the player associated with this control panel. Supply a listener to implement control semantics.

Parameters:
c - An AbstractButton
l - A MouseListener that implements button semantics.

setStopButton

public void setStopButton(javax.swing.AbstractButton c)
Set the control button for stopping the player associated with this control panel.

Parameters:
c - An AbstractButton

setStopButton

public void setStopButton(javax.swing.AbstractButton c,
                          java.awt.event.ActionListener l)
Set the control button for stopping the player associated with this control panel. Supply a listener to implement control semantics.

Parameters:
c - An AbstractButton
l - An ActionListener that implements button semantics.

setFastForwardButton

public void setFastForwardButton(javax.swing.AbstractButton c)
Set the control button for fast forwarding the player associated with this control panel.

Parameters:
c - An AbstractButton

setFastForwardButton

public void setFastForwardButton(javax.swing.AbstractButton c,
                                 java.awt.event.MouseListener l)
Set the control button for fast forwarding the player associated with this control panel. Supply a listener to implement control semantics.

Parameters:
c - An AbstractButton
l - A MouseListener that implements button semantics.

setReverseButton

public void setReverseButton(javax.swing.AbstractButton c)
Set the control button for reversing the player associated with this control panel.

Parameters:
c - An AbstractButton

setReverseButton

public void setReverseButton(javax.swing.AbstractButton c,
                             java.awt.event.MouseListener l)
Set the control button for reversing the player associated with this control panel. Supply a listener to implement control semantics.

Parameters:
c - An AbstractButton
l - A MouseListener that implements button semantics.

setPauseButton

public void setPauseButton(javax.swing.AbstractButton c)
Set the control button for pausing the player associated with this control panel.

Parameters:
c - An AbstractButton

setPauseButton

public void setPauseButton(javax.swing.AbstractButton c,
                           java.awt.event.ActionListener l)
Set the pause button with use-supplied semantics.

Parameters:
c - An AbstractButton to affect pause.
l - A ActionListener that implements button semantics.

setProgressSlider

public void setProgressSlider(ProgressSlider c)
Set the control component for progress bar associated with this control panel.

Parameters:
c - A ProgressBar
See Also:
ProgressBar

setProgressSlider

public void setProgressSlider(ProgressSlider c,
                              javax.swing.event.ChangeListener l)
Set the control component for displaying the player progress slider associated with this control panel. Supply a ChangeListener to implement control semantics.

Parameters:
c - A ProgressBar
See Also:
ProgressSlider

setGainMeterButton

public void setGainMeterButton(javax.swing.AbstractButton c)
Set the control component for gain meter Control

Parameters:
c - An AbstractButton

setGainMeterButton

public void setGainMeterButton(javax.swing.AbstractButton c,
                               java.awt.event.ActionListener l)
Set the control component and listener semantics for gain meter Control

Parameters:
c - An AbstractButton
l - An ActionListener that implements Control semantics.

setGainButtonPanel

public void setGainButtonPanel(AbstractGainButtonPanel c)
Set the control component for gain Control

Parameters:
c - an AbstractGainButtonPanel
See Also:
AbstractGainButtonPanel

setGainButtonPanel

public void setGainButtonPanel(AbstractGainButtonPanel c,
                               java.awt.event.ActionListener l)
Set the control component and listener semantics for gain Control

Parameters:
c - an AbstractGainButtonPanel
l - An ActionListener that implements Control semantics.