All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.controls.StandardProgressControl

java.lang.Object
   |
   +----ejmf.toolkit.controls.AbstractListenerControl
           |
           +----ejmf.toolkit.controls.ChangeListenerControl
                   |
                   +----ejmf.toolkit.controls.StandardProgressControl

public class StandardProgressControl
extends ChangeListenerControl
implements ControllerListener, TimeSource, SourcedTimerListener
Progress slider for StandardControlPanel. This control maintains an internal time which 'ticks'. At each tick, StandardProgressControl maps media time into a slider value and updates the progress slider.

The timer is provided by ejmf.toolkit.util.SourcedTimer. StandardProgressControl receieves 'ticks' by virtue of being a SourcedTimerListener.


Constructor Index

 o StandardProgressControl()
 o StandardProgressControl(Controller)

Method Index

 o controllerUpdate(ControllerEvent)
If the progress slider is operational, the controllerUpdate method starts and stops its time based on Start- and StopEvents from the Controller.
 o createControlComponent()
Create ProgressSlider
 o createControlListener()
Create ChangeListener.
 o getConversionDivisor()
This method is used as a divisor to convert getTime to seconds.
 o getTime()
As part of TimeSource interface, getTime returns the current media time in nanoseconds.
 o setControllerHook(Controller)
Augments setController by adding itself as as ControllerListener on the Controller and forcing operational state to false.
 o setValue(long)
Position slider based on mediaTime
 o timerUpdate(SourcedTimerEvent)
This method implements the SourcedTimerListener interface.

Constructors

 o StandardProgressControl
 public StandardProgressControl(Controller controller)
 o StandardProgressControl
 public StandardProgressControl()

Methods

 o createControlComponent
 protected Component createControlComponent()
Create ProgressSlider

Overrides:
createControlComponent in class AbstractListenerControl
See Also:
ProgressSlider
 o setControllerHook
 protected void setControllerHook(Controller controller)
Augments setController by adding itself as as ControllerListener on the Controller and forcing operational state to false. Availability of progress bar is determined only after Controller is prefetch and duration is determinate.

Overrides:
setControllerHook in class AbstractListenerControl
 o createControlListener
 protected EventListener createControlListener()
Create ChangeListener. Tracks user movement of progress slider and update media time accordingly.

Overrides:
createControlListener in class AbstractListenerControl
 o setValue
 public void setValue(long mediaTime)
Position slider based on mediaTime

 o controllerUpdate
 public void controllerUpdate(ControllerEvent event)
If the progress slider is operational, the controllerUpdate method starts and stops its time based on Start- and StopEvents from the Controller. If response to MediaTimeSetEvent, the value of the progress slider is explicitly set.

The controllerUpdate method is also responsible for setting the operational state of the Control based on duration value. This is done in response to first PrefetchCompleteEvent.

 o timerUpdate
 public void timerUpdate(SourcedTimerEvent e)
This method implements the SourcedTimerListener interface. Each timer tick causes slider thumbnail to move if a ProgressBar was built for this control panel.

See Also:
SourcedTimer
 o getTime
 public long getTime()
As part of TimeSource interface, getTime returns the current media time in nanoseconds.

 o getConversionDivisor
 public long getConversionDivisor()
This method is used as a divisor to convert getTime to seconds.


All Packages  Class Hierarchy  This Package  Previous  Next  Index