public class PlayAction
extends org.eclipse.jface.action.Action
implements org.eclipse.jface.action.IMenuCreator
This class is an Action that employs a Timer to display the next item in a ICEResourceView on a fixed time delay. After activation, this class changes roles to act as a pause for the play loop.
Constructor and Description |
---|
PlayAction(PlayableViewPart parent)
The constructor
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose the menu.
|
org.eclipse.swt.widgets.Menu |
getMenu(org.eclipse.swt.widgets.Control parent)
Refresh the menu field.
|
org.eclipse.swt.widgets.Menu |
getMenu(org.eclipse.swt.widgets.Menu parent)
(non-Javadoc)
|
boolean |
isInPlayState()
Public access to the state of this Action.
|
void |
run()
The function called whenever the button is clicked.
|
void |
setDelay(int frameRate)
Public means for modifying the delay field.
|
void |
stop()
This function stops the timer and switches the button from a pause button
to a play button.
|
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
addPropertyChangeListener, removePropertyChangeListener
public PlayAction(PlayableViewPart parent)
The constructor
parent
- The PlayableViewPart to whom the object of this class belongs.
public void run()
The function called whenever the button is clicked.
run
in interface org.eclipse.jface.action.IAction
run
in class org.eclipse.jface.action.Action
public void stop()
This function stops the timer and switches the button from a pause button to a play button.
public void setDelay(int frameRate)
Public means for modifying the delay field. Convert input frame rate to delay in milliseconds.
frameRate
- An integer frame rate to be converted to a truncated millisecond delay.
public boolean isInPlayState()
Public access to the state of this Action.
public void dispose()
Dispose the menu.
dispose
in interface org.eclipse.jface.action.IMenuCreator
IMenuCreator.dispose()
public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Menu parent)
getMenu
in interface org.eclipse.jface.action.IMenuCreator
IMenuCreator.getMenu(Menu)
public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Control parent)
Refresh the menu field.
getMenu
in interface org.eclipse.jface.action.IMenuCreator
IMenuCreator.getMenu(Control)