FileDocCategorySizeDatePackage
ControllerAdapter.javaAPI DocJMF 2.1.1e5704Mon May 12 12:20:36 BST 2003javax.media

ControllerAdapter

public class ControllerAdapter extends Object implements EventListener, ControllerListener
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
ControllerListener
see
Controller#addControllerListener(ControllerListener)
version
1.3, 98/11/06

Fields Summary
Constructors Summary
Methods Summary
public voidaudioDeviceUnavailable(javax.media.AudioDeviceUnavailableEvent e)

public voidcachingControl(javax.media.CachingControlEvent e)

public voidconfigureComplete(javax.media.ConfigureCompleteEvent e)

public voidconnectionError(javax.media.ConnectionErrorEvent e)

public voidcontrollerClosed(javax.media.ControllerClosedEvent e)

public voidcontrollerError(javax.media.ControllerErrorEvent e)

public voidcontrollerUpdate(javax.media.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

	if (e instanceof FormatChangeEvent){
	    formatChange((FormatChangeEvent)e);
	    
	} else if (e instanceof CachingControlEvent) {
	    cachingControl((CachingControlEvent)e);
	    
	} else if (e instanceof ControllerErrorEvent) {
	    controllerError((ControllerErrorEvent)e);
	    
	    if (e instanceof DataLostErrorEvent) {
		dataLostError((DataLostErrorEvent)e);
		
	    } else if (e instanceof InternalErrorEvent) {
		internalError((InternalErrorEvent)e);

	    } else if (e instanceof ResourceUnavailableEvent) {
		resourceUnavailable((ResourceUnavailableEvent)e);

	    } else if (e instanceof ConnectionErrorEvent) {
		connectionError((ConnectionErrorEvent)e);
	    }

	} else if (e instanceof DurationUpdateEvent) {
	    durationUpdate((DurationUpdateEvent)e);

	} else if (e instanceof MediaTimeSetEvent) {
	    mediaTimeSet((MediaTimeSetEvent)e);

	} else if (e instanceof RateChangeEvent) {
	    rateChange((RateChangeEvent)e);

	} else if (e instanceof StopTimeChangeEvent) {
	    stopTimeChange((StopTimeChangeEvent)e);

	} else if (e instanceof AudioDeviceUnavailableEvent) {
	    audioDeviceUnavailable((AudioDeviceUnavailableEvent)e);

	} else if (e instanceof ControllerClosedEvent) {
	    controllerClosed((ControllerClosedEvent)e);

	} else if (e instanceof SizeChangeEvent) {
	    sizeChange((SizeChangeEvent)e);

	} else if (e instanceof TransitionEvent) {
	    transition((TransitionEvent)e);

	    if (e instanceof ConfigureCompleteEvent) {
		configureComplete((ConfigureCompleteEvent)e);

	    } else if (e instanceof PrefetchCompleteEvent) {
		prefetchComplete((PrefetchCompleteEvent)e);

	    } else if (e instanceof RealizeCompleteEvent) {
		realizeComplete((RealizeCompleteEvent)e);
		
	    } else if (e instanceof StartEvent) {
		start((StartEvent)e);

	    } else if (e instanceof StopEvent) {
		stop((StopEvent)e);
		
		if (e instanceof DeallocateEvent) {
		    deallocate((DeallocateEvent)e);
		
		} else if (e instanceof EndOfMediaEvent) {
		    endOfMedia((EndOfMediaEvent)e);
		    
		} else if (e instanceof RestartingEvent) {
		    restarting((RestartingEvent)e);
		    
		} else if (e instanceof StopAtTimeEvent) {
		    stopAtTime((StopAtTimeEvent)e);
		    
		} else if (e instanceof StopByRequestEvent) {
		    stopByRequest((StopByRequestEvent)e);

		} else if (e instanceof DataStarvedEvent) {
		    dataStarved((DataStarvedEvent)e);
		}
	    }
	} else if (e.getClass().getName().equals("com.ibm.media.ReplaceURLEvent")) {
	    // Specialized event for HotMedia playback.
	    replaceURL(e);
	} else if (e.getClass().getName().equals("com.ibm.media.ShowDocumentEvent"))	{
	    // Specialized event for HotMedia playback.
	    showDocument(e);
   }
    
public voiddataLostError(javax.media.DataLostErrorEvent e)

public voiddataStarved(javax.media.DataStarvedEvent e)

public voiddeallocate(javax.media.DeallocateEvent e)

public voiddurationUpdate(javax.media.DurationUpdateEvent e)

public voidendOfMedia(javax.media.EndOfMediaEvent e)

public voidformatChange(javax.media.format.FormatChangeEvent e)

public voidinternalError(javax.media.InternalErrorEvent e)

public voidmediaTimeSet(javax.media.MediaTimeSetEvent e)

public voidprefetchComplete(javax.media.PrefetchCompleteEvent e)

public voidrateChange(javax.media.RateChangeEvent e)

public voidrealizeComplete(javax.media.RealizeCompleteEvent e)

public voidreplaceURL(java.lang.Object e)

public voidresourceUnavailable(javax.media.ResourceUnavailableEvent e)

public voidrestarting(javax.media.RestartingEvent e)

public voidshowDocument(java.lang.Object e)

public voidsizeChange(javax.media.SizeChangeEvent e)

public voidstart(javax.media.StartEvent e)

public voidstop(javax.media.StopEvent e)

public voidstopAtTime(javax.media.StopAtTimeEvent e)

public voidstopByRequest(javax.media.StopByRequestEvent e)

public voidstopTimeChange(javax.media.StopTimeChangeEvent e)

public voidtransition(javax.media.TransitionEvent e)