All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.controls.TimeDisplayControl

java.lang.Object
   |
   +----ejmf.toolkit.controls.TimeDisplayControl

public class TimeDisplayControl
extends Object
implements Control, SourcedTimerListener, TimeSource, ControllerListener
A read-only Control that displays media time.

Creates a SourcedTimer to generate ticks that trigger Control to look at media time, convert it to a string and display it.

Registers as SourcedTimerListener and ControllerListener. As ControllerListener, TimerDisplayControl listens for start/restart and stop events to correctly turn SourcedTimer on and off.

See Also:
SourcedTimer, SourcedTimerListener, TimerSource

Constructor Index

 o TimeDisplayControl(Controller)
Create a TimeDisplayControl for displaying the current media time of the Controller passed as an argument.
 o TimeDisplayControl(Controller, SourcedTimer)
Create a TimeDisplayControl for displaying the current media time of the Controller passed as an argument.

Method Index

 o controllerUpdate(ControllerEvent)
Listen for start/stop events and start/stop SourceTimer in response.
 o getControlComponent()
Return the control component.
 o getConversionDivisor()
Report value such that getTime()/number equals seconds.
 o getTime()
Report media time from associated Controller.
 o timerUpdate(SourcedTimerEvent)
Respond to 'tick' from SourcedTimer.

Constructors

 o TimeDisplayControl
 public TimeDisplayControl(Controller controller)
Create a TimeDisplayControl for displaying the current media time of the Controller passed as an argument.

Parameters:
controller - The Controller with which to associate control.
 o TimeDisplayControl
 public TimeDisplayControl(Controller controller,
                           SourcedTimer timer)
Create a TimeDisplayControl for displaying the current media time of the Controller passed as an argument.

The timer is used as the SourcedTimer. This form of the constructor allows reuse of an existing SourcedTimer.

Parameters:
controller - javax.media.Controller
timer - ejmf.toolkit.util.SourcedTimer
See Also:
SourcedTimer

Methods

 o getControlComponent
 public Component getControlComponent()
Return the control component.

Returns:
java.awt.Component
 o timerUpdate
 public void timerUpdate(SourcedTimerEvent e)
Respond to 'tick' from SourcedTimer.

Parameters:
e - a SourcedTimerEvent containing TimeSource that generated tick.
 o controllerUpdate
 public void controllerUpdate(ControllerEvent e)
Listen for start/stop events and start/stop SourceTimer in response.

Parameters:
e - A controller event used to determine start/stop state of timer.
 o getTime
 public long getTime()
Report media time from associated Controller.

Returns:
media time in nanoseconds
 o getConversionDivisor
 public long getConversionDivisor()
Report value such that getTime()/number equals seconds.

Returns:
a long such that getTime()/number equals seconds.

All Packages  Class Hierarchy  This Package  Previous  Next  Index