dlife.vision
Class VideoSourceGUI
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
dlife.gui.GUIPanel
dlife.robot.gui.DeviceDisplay
dlife.vision.VideoSourceGUI
- All Implemented Interfaces:
- ImageObserver, MenuContainer, Serializable, Observer, Accessible
public class VideoSourceGUI
- extends DeviceDisplay
- implements Observer
This class provides GUI components for controlling a VideoSource (e.g.
play/rewind etc...). Each VideoSource implementation will create a
VideoPlayerGUI that can control it. The Camera will use that VideoSourceGUI
to allow the user to control the video.
- Version:
- Jun 27, 2009
- Author:
- Grant Braught, Dickinson College
- See Also:
- Serialized Form
|
Field Summary |
static byte |
ALL_CONTROLS
Convenience flag that indicates that all of the controls should be
displayed, enabled or disabled. |
static byte |
LOOP_CONTROL
Flag indicating that the "loop video" control should be displayed,
enabled or disabled. |
static byte |
NO_CONTROLS
Convenience flag that indicates that none of the controls should be
displayed, enabled or disabled. |
static byte |
PLAY_BUTTON
Flag indicating that the play button should be displayed, enabled or
disabled. |
static byte |
REWIND_BUTTON
Flag indicating that the rewind button should be displayed, enabled or
disabled. |
static byte |
SEEK_BAR
Flag indicating that the seek bar should be displayed, enabled or
disabled. |
static byte |
STEP_BACK_BUTTON
Flag indicating that the step back button should be displayed, enabled or
disabled. |
static byte |
STEP_FORWARD_BUTTON
Flag indicating that the step forward button should be displayed, enabled
or disabled. |
|
Constructor Summary |
VideoSourceGUI(VideoSource mySource,
byte buttonMask)
Construct a new VideoSourceGUI for the specified VideoSource. |
|
Method Summary |
protected void |
buildGUI()
Build the GUI for the VideoPlayer. |
protected void |
disableGUI()
Disable the seek bar, all of the buttons and the loop control. |
protected void |
enableGUI()
Enable the seek bar, buttons and loop control as appropriate given the
current state of the VisionSource associated with this VideoSourceGUI. |
String |
getGUIName()
Return "Video Controls" as the name of this GUI. |
static void |
main(String[] args)
Pop a VideoSourceGUI up in a window. |
void |
update(Observable o,
Object arg)
Adjust the seek location, button states and icons as appropriate given
the current state of the VideoSource associated with this VideoSourceGUI. |
protected void |
updateGUIFromDevice()
Does nothing. |
| 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, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, 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 |
PLAY_BUTTON
public static byte PLAY_BUTTON
- Flag indicating that the play button should be displayed, enabled or
disabled.
STEP_BACK_BUTTON
public static byte STEP_BACK_BUTTON
- Flag indicating that the step back button should be displayed, enabled or
disabled.
STEP_FORWARD_BUTTON
public static byte STEP_FORWARD_BUTTON
- Flag indicating that the step forward button should be displayed, enabled
or disabled.
REWIND_BUTTON
public static byte REWIND_BUTTON
- Flag indicating that the rewind button should be displayed, enabled or
disabled.
SEEK_BAR
public static byte SEEK_BAR
- Flag indicating that the seek bar should be displayed, enabled or
disabled.
LOOP_CONTROL
public static byte LOOP_CONTROL
- Flag indicating that the "loop video" control should be displayed,
enabled or disabled.
ALL_CONTROLS
public static byte ALL_CONTROLS
- Convenience flag that indicates that all of the controls should be
displayed, enabled or disabled.
NO_CONTROLS
public static byte NO_CONTROLS
- Convenience flag that indicates that none of the controls should be
displayed, enabled or disabled.
VideoSourceGUI
public VideoSourceGUI(VideoSource mySource,
byte buttonMask)
- Construct a new VideoSourceGUI for the specified VideoSource.
- Parameters:
mySource - The VideoSource to control with this VideoSourceGUI.buttonMask - an ORed combination of the flags indicating which
buttons should be displayed in this VideoPlayerGUI. E.g.
PLAY_BUTTON | REWIND_BUTTON will display a play and rewind
button but neither step button nor the seek bar.
buildGUI
protected void buildGUI()
- Build the GUI for the VideoPlayer.
- Specified by:
buildGUI in class GUIPanel
disableGUI
protected void disableGUI()
- Disable the seek bar, all of the buttons and the loop control.
- Specified by:
disableGUI in class DeviceDisplay
enableGUI
protected void enableGUI()
- Enable the seek bar, buttons and loop control as appropriate given the
current state of the VisionSource associated with this VideoSourceGUI.
- Specified by:
enableGUI in class DeviceDisplay
updateGUIFromDevice
protected void updateGUIFromDevice()
- Does nothing. The updates here are done only when notified by the
VideoSource that the state has changed. See update below.
- Specified by:
updateGUIFromDevice in class DeviceDisplay
getGUIName
public String getGUIName()
- Return "Video Controls" as the name of this GUI.
- Specified by:
getGUIName in class DeviceDisplay
- Returns:
- "Video Controls"
update
public void update(Observable o,
Object arg)
- Adjust the seek location, button states and icons as appropriate given
the current state of the VideoSource associated with this VideoSourceGUI.
- Specified by:
update in interface Observer- Overrides:
update in class DeviceDisplay
main
public static void main(String[] args)
- Pop a VideoSourceGUI up in a window. The player does not actually control
anything. It is simply displayed for checking the layout.
- Parameters:
args - none