javax.media
Interface CachingControl

All Known Subinterfaces:
ExtendedCachingControl

public interface CachingControl
extends Control

CachingControl is an interface supported by Players that are capable of reporting download progress. Typically, this control is accessed through the Controller.getControls method. A Controller that supports this control will post CachingControlEvents often enough to support the implementation of custom progress GUIs.

See Also:
Controller, ControllerListener, CachingControlEvent, Player

Field Summary
static long LENGTH_UNKNOWN
          Use to indicate that the CachingControl doesn't know how long the content is.
 
Method Summary
 long getContentLength()
          Get the total number of bytes in the media being downloaded.
 long getContentProgress()
          Get the total number of bytes of media data that have been downloaded so far.
 java.awt.Component getControlComponent()
          Get a Component that provides additional download control.
 java.awt.Component getProgressBarComponent()
          Get a Component for displaying the download progress.
 boolean isDownloading()
          Check whether or not media is being downloaded.
 

Field Detail

LENGTH_UNKNOWN

public static final long LENGTH_UNKNOWN
Use to indicate that the CachingControl doesn't know how long the content is.

The definition is: LENGTH_UNKNOWN == Long.MAX_VALUE

Method Detail

isDownloading

public boolean isDownloading()
Check whether or not media is being downloaded.
Returns:
Returns true if media is being downloaded; otherwise returns false.

getContentLength

public long getContentLength()
Get the total number of bytes in the media being downloaded. Returns LENGTH_UNKNOWN if this information is not available.
Returns:
The media length in bytes, or LENGTH_UNKNOWN.

getContentProgress

public long getContentProgress()
Get the total number of bytes of media data that have been downloaded so far.
Returns:
The number of bytes downloaded.

getProgressBarComponent

public java.awt.Component getProgressBarComponent()
Get a Component for displaying the download progress.
Returns:
Progress bar GUI.

getControlComponent

public java.awt.Component getControlComponent()
Get a Component that provides additional download control. Returns null if only a progress bar is provided.
Specified by:
getControlComponent in interface Control
Returns:
Download control GUI.


Submit a bug or feature
Copyright 1994-2004 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.