public class ControllerAdapter extends Object implements ControllerListener, EventListener
ControllerEvents and
dispatches them to an appropriate stub-method. Classes that extend
this adapter can easily replace only the message handlers they are
interested in.
For example, the following code extends a ControllerAdapter with a JDK
1.1 anonymous inner-class to make a self-contained player that
resets itself back to the beginning and deallocates itself when the
player reaches the end of the media:
player.addControllerListener(new ControllerAdapter() {
public void endOfMedia(EndOfMediaEvent e) {
Controller controller = e.getSource();
controller.stop();
controller.setMediaTime(0);
controller.deallocate();
}
});
ControllerListener,
Controller.addControllerListener(ControllerListener)| Constructor and Description |
|---|
ControllerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
cachingControl(CachingControlEvent e) |
void |
controllerError(ControllerErrorEvent e) |
void |
controllerUpdate(ControllerEvent e)
Main dispatching function.
|
void |
dataLostError(DataStarvedEvent e) |
void |
deallocate(DeallocateEvent e) |
void |
durationUpdate(DurationUpdateEvent e) |
void |
endOfMedia(EndOfMediaEvent e) |
void |
internalError(InternalErrorEvent e) |
void |
mediaTimeSet(MediaTimeSetEvent e) |
void |
prefetchComplete(PrefetchCompleteEvent e) |
void |
rateChange(RateChangeEvent e) |
void |
realizeComplete(RealizeCompleteEvent e) |
void |
resourceUnavailable(ResourceUnavailableEvent e) |
void |
restarting(RestartingEvent e) |
void |
start(StartEvent e) |
void |
stop(StopEvent e) |
void |
stopAtTime(StopAtTimeEvent e) |
void |
stopByRequest(StopByRequestEvent e) |
void |
stopTimeChange(StopTimeChangeEvent e) |
void |
transition(TransitionEvent e) |
public void cachingControl(CachingControlEvent e)
public void controllerError(ControllerErrorEvent e)
public void dataLostError(DataStarvedEvent e)
public void internalError(InternalErrorEvent e)
public void resourceUnavailable(ResourceUnavailableEvent e)
public void durationUpdate(DurationUpdateEvent e)
public void mediaTimeSet(MediaTimeSetEvent e)
public void rateChange(RateChangeEvent e)
public void stopTimeChange(StopTimeChangeEvent e)
public void transition(TransitionEvent e)
public void prefetchComplete(PrefetchCompleteEvent e)
public void realizeComplete(RealizeCompleteEvent e)
public void start(StartEvent e)
public void stop(StopEvent e)
public void deallocate(DeallocateEvent e)
public void endOfMedia(EndOfMediaEvent e)
public void restarting(RestartingEvent e)
public void stopAtTime(StopAtTimeEvent e)
public void stopByRequest(StopByRequestEvent e)
public void controllerUpdate(ControllerEvent e)
controllerUpdate in interface ControllerListenere - The event generated.Copyright © 2012 code4tv.com. All Rights Reserved.