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
-
TimeDisplayControl(Controller)
-
Create a TimeDisplayControl for displaying the
current media time of the Controller passed as an
argument.
-
TimeDisplayControl(Controller, SourcedTimer)
-
Create a TimeDisplayControl for displaying the
current media time of the Controller passed as an
argument.
-
controllerUpdate(ControllerEvent)
- Listen for start/stop events and start/stop
SourceTimer in response.
-
getControlComponent()
-
Return the control component.
-
getConversionDivisor()
- Report value such that
getTime()/number
equals seconds.
-
getTime()
- Report media time from associated Controller.
-
timerUpdate(SourcedTimerEvent)
- Respond to 'tick' from SourcedTimer.
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.
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
getControlComponent
public Component getControlComponent()
- Return the control component.
- Returns:
- java.awt.Component
timerUpdate
public void timerUpdate(SourcedTimerEvent e)
- Respond to 'tick' from SourcedTimer.
- Parameters:
- e - a SourcedTimerEvent containing TimeSource
that generated tick.
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.
getTime
public long getTime()
- Report media time from associated Controller.
- Returns:
- media time in nanoseconds
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