javax.media
Class ControllerAdapter

java.lang.Object
  |
  +--javax.media.ControllerAdapter

public class ControllerAdapter
extends java.lang.Object
implements ControllerListener, java.util.EventListener

The event adapter which recieves 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(); } });

See Also:
ControllerListener, Controller.addControllerListener(ControllerListener)

Constructor Summary
ControllerAdapter()
           
 
Method Summary
 void audioDeviceUnavailable(AudioDeviceUnavailableEvent e)
           
 void cachingControl(CachingControlEvent e)
           
 void configureComplete(ConfigureCompleteEvent e)
           
 void connectionError(ConnectionErrorEvent e)
           
 void controllerClosed(ControllerClosedEvent e)
           
 void controllerError(ControllerErrorEvent e)
           
 void controllerUpdate(ControllerEvent e)
          Main dispatching function.
 void dataLostError(DataLostErrorEvent e)
           
 void dataStarved(DataStarvedEvent e)
           
 void deallocate(DeallocateEvent e)
           
 void durationUpdate(DurationUpdateEvent e)
           
 void endOfMedia(EndOfMediaEvent e)
           
 void formatChange(FormatChangeEvent e)
           
 void internalError(InternalErrorEvent e)
           
 void mediaTimeSet(MediaTimeSetEvent e)
           
 void prefetchComplete(PrefetchCompleteEvent e)
           
 void rateChange(RateChangeEvent e)
           
 void realizeComplete(RealizeCompleteEvent e)
           
 void replaceURL(java.lang.Object e)
           
 void resourceUnavailable(ResourceUnavailableEvent e)
           
 void restarting(RestartingEvent e)
           
 void showDocument(java.lang.Object e)
           
 void sizeChange(SizeChangeEvent 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerAdapter

public ControllerAdapter()
Method Detail

cachingControl

public void cachingControl(CachingControlEvent e)

controllerError

public void controllerError(ControllerErrorEvent e)

dataLostError

public void dataLostError(DataLostErrorEvent e)

dataStarved

public void dataStarved(DataStarvedEvent e)

internalError

public void internalError(InternalErrorEvent e)

resourceUnavailable

public void resourceUnavailable(ResourceUnavailableEvent e)

durationUpdate

public void durationUpdate(DurationUpdateEvent e)

mediaTimeSet

public void mediaTimeSet(MediaTimeSetEvent e)

rateChange

public void rateChange(RateChangeEvent e)

stopTimeChange

public void stopTimeChange(StopTimeChangeEvent e)

transition

public void transition(TransitionEvent e)

prefetchComplete

public void prefetchComplete(PrefetchCompleteEvent e)

realizeComplete

public void realizeComplete(RealizeCompleteEvent e)

start

public void start(StartEvent e)

stop

public void stop(StopEvent e)

deallocate

public void deallocate(DeallocateEvent e)

endOfMedia

public void endOfMedia(EndOfMediaEvent e)

restarting

public void restarting(RestartingEvent e)

stopAtTime

public void stopAtTime(StopAtTimeEvent e)

stopByRequest

public void stopByRequest(StopByRequestEvent e)

audioDeviceUnavailable

public void audioDeviceUnavailable(AudioDeviceUnavailableEvent e)

configureComplete

public void configureComplete(ConfigureCompleteEvent e)

controllerClosed

public void controllerClosed(ControllerClosedEvent e)

sizeChange

public void sizeChange(SizeChangeEvent e)

connectionError

public void connectionError(ConnectionErrorEvent e)

formatChange

public void formatChange(FormatChangeEvent e)

replaceURL

public void replaceURL(java.lang.Object e)

showDocument

public void showDocument(java.lang.Object e)

controllerUpdate

public void controllerUpdate(ControllerEvent e)
Main dispatching function. Subclasses should not need to override this method, but instead subclass only the individual event methods listed above that they need
Specified by:
controllerUpdate in interface ControllerListener