|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.opensourcephysics.media.core.VideoPlayer
public class VideoPlayer
This is a GUI component for playing a VideoClip. It uses a subclass of ClipControl to control the clip and updates its display based on PropertyChangeEvents it receives from the ClipControl.
| Nested Class Summary | |
|---|---|
protected class |
VideoPlayer.PlayerButton
PlayerButton inner class |
| 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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected static javax.swing.Icon |
backIcon
|
protected ClipControl |
clipControl
|
protected static javax.swing.Icon |
grayBackIcon
|
protected static javax.swing.Icon |
grayPlayIcon
|
protected static javax.swing.Icon |
grayStepIcon
|
protected int |
height
|
protected static javax.swing.Icon |
inOutIcon
|
protected static javax.swing.Icon |
loopIcon
|
protected static javax.swing.Icon |
noloopIcon
|
protected static javax.swing.Icon |
pauseIcon
|
protected static javax.swing.Icon |
playIcon
|
protected javax.swing.JButton |
readout
|
protected static javax.swing.Icon |
resetIcon
|
protected static javax.swing.Icon |
stepIcon
|
protected static javax.swing.Icon |
videoClipIcon
|
protected VideoPanel |
vidPanel
|
| 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 | |
|---|---|
VideoPlayer(VideoPanel panel)
Constructs a VideoPlayer. |
|
VideoPlayer(VideoPanel panel,
VideoClip clip)
Constructs a VideoPlayer to play the specified video clip. |
|
| Method Summary | |
|---|---|
void |
back()
Steps back one step. |
ClipControl |
getClipControl()
Gets the current clip control. |
int |
getFrameNumber()
Gets the current frame number. |
double |
getFrameTime(int frameNumber)
Gets the start time of the specified frame in milliseconds. |
double |
getMeanStepDuration()
Gets the mean step duration in milliseconds for the current video clip. |
double |
getRate()
Gets the play rate. |
int |
getStepNumber()
Gets the step number. |
double |
getStepTime(int stepNumber)
Gets the start time of the specified step in milliseconds. |
double |
getTime()
Gets the current time in milliseconds. |
VideoClip |
getVideoClip()
Gets the video clip. |
boolean |
isLooping()
Gets the looping status. |
void |
play()
Plays the clip. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. |
void |
refresh()
Refreshes the GUI. |
void |
setEnabled(boolean enabled)
Enables and disables this component. |
void |
setInspectorButtonVisible(boolean visible)
Shows or hides the inspector button. |
void |
setLooping(boolean looping)
Turns on/off looping. |
void |
setLoopingButtonVisible(boolean visible)
Shows or hides the looping button. |
void |
setRate(double rate)
Sets the play rate. |
void |
setReadoutType(java.lang.String type)
Sets the type of data displayed in the readout. |
void |
setReadoutTypes(java.lang.String types,
java.lang.String typeToSelect)
Sets the readout data types made available to the user. |
void |
setStepNumber(int n)
Sets the step number. |
void |
setVideoClip(VideoClip clip)
Sets the video clip. |
void |
step()
Steps forward one step. |
void |
stop()
Stops at the next step. |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUI |
| 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 |
| Field Detail |
|---|
protected static javax.swing.Icon inOutIcon
protected static javax.swing.Icon playIcon
protected static javax.swing.Icon grayPlayIcon
protected static javax.swing.Icon pauseIcon
protected static javax.swing.Icon resetIcon
protected static javax.swing.Icon loopIcon
protected static javax.swing.Icon noloopIcon
protected static javax.swing.Icon videoClipIcon
protected static javax.swing.Icon stepIcon
protected static javax.swing.Icon grayStepIcon
protected static javax.swing.Icon backIcon
protected static javax.swing.Icon grayBackIcon
protected VideoPanel vidPanel
protected ClipControl clipControl
protected int height
protected javax.swing.JButton readout
| Constructor Detail |
|---|
public VideoPlayer(VideoPanel panel,
VideoClip clip)
panel - the video panelclip - the video clippublic VideoPlayer(VideoPanel panel)
panel - the video panel| Method Detail |
|---|
public void setVideoClip(VideoClip clip)
clip - the video clippublic VideoClip getVideoClip()
public ClipControl getClipControl()
public void setReadoutTypes(java.lang.String types,
java.lang.String typeToSelect)
types - a list of data types. Supported types are "time",
"step", and "frame".public void setReadoutType(java.lang.String type)
type - "time", "step", or "frame"public void play()
public void stop()
public void step()
public void back()
public void setRate(double rate)
rate - the desired ratepublic double getRate()
public void setLooping(boolean looping)
looping - true to turn looping onpublic boolean isLooping()
true if looping is onpublic void setStepNumber(int n)
n - the desired step numberpublic int getStepNumber()
public int getFrameNumber()
public double getTime()
public double getStepTime(int stepNumber)
stepNumber - the step number
public double getFrameTime(int frameNumber)
frameNumber - the frame number
public double getMeanStepDuration()
public void setInspectorButtonVisible(boolean visible)
visible - true to show the inspector buttonpublic void setLoopingButtonVisible(boolean visible)
visible - true to show the looping buttonpublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - the property change eventpublic void refresh()
public void setEnabled(boolean enabled)
setEnabled in class javax.swing.JComponentenabled - true to enable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||