|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.fmj.ejmf.toolkit.media.BasicCachingControl
public class BasicCachingControl
This class provides a CachingControl for the AbstractController class. It provides a progress bar to monitor the media download. Its control Component is simply a button that stops the media download. Whenever there is a change in this BasicCachingControl, a CachingControlEvent is posted automatically. From the book: Essential JMF, Gordon, Talley (ISBN 0130801046). Used with permission.
AbstractController
Field Summary |
---|
Fields inherited from interface javax.media.CachingControl |
---|
LENGTH_UNKNOWN |
Constructor Summary | |
---|---|
BasicCachingControl(AbstractController c,
long length)
Constructs a BasicCachingControl for the given AbstractController. |
Method Summary | |
---|---|
void |
addToProgress(long toAdd)
Adds an amount of bytes to the media already downloaded. |
void |
blockWhilePaused()
Blocks the current thread until the download is not paused. |
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. |
boolean |
isPaused()
Tells whether the media download is paused or not. |
void |
reset(long length)
Resets this BasicCachingControl. |
void |
setContentLength(long length)
Set the length of the media without reinitializing the progress bar. |
void |
setContentProgress(long progress)
Set the current progress of the media download. |
void |
setDone()
Indicates that the media is fully downloaded. |
void |
setDownLoading(boolean isDownloading)
Sets whether the AbstractController is downloading or not. |
protected void |
setPaused(boolean isPaused)
Sets whether the AbstractController is paused or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicCachingControl(AbstractController c, long length)
c
- The AbstractController from which
CachingControlEvents are posted whenever the
status of this BasicCachingControl changes.length
- The length of the media to be downloaded.Method Detail |
---|
protected void setPaused(boolean isPaused)
isPaused
- boolean indicating whether the media is
paused.public boolean isPaused()
public void blockWhilePaused()
public void setDownLoading(boolean isDownloading)
isDownloading
- boolean indicating whether the media is
downloading.public void reset(long length)
length
- The length of the media.public void setContentLength(long length)
length
- The length of the media.public void setContentProgress(long progress)
progress
- Number of bytes that have been downloaded.public void addToProgress(long toAdd)
toAdd
- Number of bytes that have been downloaded
since the last time this method or
setContentProgress have been called.public void setDone()
public boolean isDownloading()
isDownloading
in interface CachingControl
public long getContentLength()
getContentLength
in interface CachingControl
public long getContentProgress()
getContentProgress
in interface CachingControl
public java.awt.Component getProgressBarComponent()
getProgressBarComponent
in interface CachingControl
public java.awt.Component getControlComponent()
getControlComponent
in interface CachingControl
getControlComponent
in interface Control
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |