|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAcme.MediaTracker
public class MediaTracker
Field Summary | |
---|---|
static int |
ABORTED
Flag indicating the download of some media was aborted. |
static int |
COMPLETE
Flag indicating the download of media completed successfully. |
static int |
ERRORED
Flag indicating the download of some media encountered an error. |
static int |
LOADING
Flag indicating some media is currently being loaded. |
Constructor Summary | |
---|---|
MediaTracker(java.awt.Component comp)
Creates a Media tracker to track images for a given Component. |
|
MediaTracker(java.awt.Toolkit tk)
Creates a Media tracker to track images for a given Toolikit. |
Method Summary | |
---|---|
void |
addImage(java.awt.Image image,
int id)
Adds an image to the list of images being tracked. |
void |
addImage(java.awt.Image image,
int id,
int w,
int h)
Adds a scaled image to the list of images being tracked. |
boolean |
checkAll()
Checks to see if all images have finished loading but does not start loading the images if they are not already loading. |
boolean |
checkAll(boolean load)
Checks to see if all images have finished loading. |
boolean |
checkID(int id)
Checks to see if all images tagged with the indicated ID have finished loading, but does not start loading the images if they are not already loading. |
boolean |
checkID(int id,
boolean load)
Checks to see if all images tagged with the indicated ID have finished loading. |
java.lang.Object[] |
getErrorsAny()
Returns a list of all media that have encountered an error. |
java.lang.Object[] |
getErrorsID(int id)
Returns a list of media with the specified ID that have encountered an error. |
boolean |
isErrorAny()
Checks the error status of all of the images. |
boolean |
isErrorID(int id)
Checks the error status of all of the images with the specified ID. |
int |
statusAll(boolean load)
Returns the boolean OR of the status of all of the media being tracked. |
int |
statusID(int id,
boolean load)
Returns the boolean OR of the status of all of the media with a given ID. |
void |
waitForAll()
Starts loading all images. |
boolean |
waitForAll(long ms)
Starts loading all images. |
void |
waitForID(int id)
Starts loading all images with the specified ID and waits until they have finished loading or receive an error. |
boolean |
waitForID(int id,
long ms)
Starts loading all images with the specified ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOADING
statusAll(boolean)
,
statusID(int, boolean)
,
Constant Field Valuespublic static final int ABORTED
statusAll(boolean)
,
statusID(int, boolean)
,
Constant Field Valuespublic static final int ERRORED
statusAll(boolean)
,
statusID(int, boolean)
,
Constant Field Valuespublic static final int COMPLETE
statusAll(boolean)
,
statusID(int, boolean)
,
Constant Field ValuesConstructor Detail |
---|
public MediaTracker(java.awt.Component comp)
comp
- the component on which the images will eventually be drawnpublic MediaTracker(java.awt.Toolkit tk)
tk
- the Toolkit in which the images will eventually be drawnMethod Detail |
---|
public void addImage(java.awt.Image image, int id)
image
- the image to be trackedid
- the identifier used to later track this imagepublic void addImage(java.awt.Image image, int id, int w, int h)
image
- the image to be trackedid
- the identifier used to later track this imagew
- the width that the image will be rendered ath
- the height that the image will be rendered atpublic boolean checkAll()
checkAll(boolean)
,
checkID(int)
,
isErrorAny()
,
isErrorID(int)
public boolean checkAll(boolean load)
load
- start loading the images if this parameter is true
isErrorAny()
,
isErrorID(int)
,
checkID(int, boolean)
,
checkAll()
public boolean isErrorAny()
isErrorID(int)
,
getErrorsAny()
public java.lang.Object[] getErrorsAny()
isErrorAny()
,
getErrorsID(int)
public void waitForAll() throws java.lang.InterruptedException
java.lang.InterruptedException
- Another thread has interrupted this thread.waitForID(int)
,
waitForAll(long)
,
isErrorAny()
,
isErrorID(int)
public boolean waitForAll(long ms) throws java.lang.InterruptedException
ms
- the length of time to wait for the loading to complete
java.lang.InterruptedException
- Another thread has interrupted this thread.waitForID(int)
,
waitForAll()
,
isErrorAny()
,
isErrorID(int)
public int statusAll(boolean load)
load
- specifies whether to start the media loadingstatusID(int, boolean)
,
LOADING
,
ABORTED
,
ERRORED
,
COMPLETE
public boolean checkID(int id)
id
- the identifier used to determine which images to check
checkID(int, boolean)
,
checkAll()
,
isErrorAny()
,
isErrorID(int)
public boolean checkID(int id, boolean load)
id
- the identifier used to determine which images to checkload
- start loading the images if this parameter is true
checkID(int)
,
checkAll()
,
isErrorAny()
,
isErrorID(int)
public boolean isErrorID(int id)
id
- the identifier used to determine which images to check
isErrorAny()
,
getErrorsID(int)
public java.lang.Object[] getErrorsID(int id)
id
- the identifier used to determine which images to return
isErrorID(int)
,
getErrorsAny()
public void waitForID(int id) throws java.lang.InterruptedException
id
- the identifier used to determine which images to wait for
java.lang.InterruptedException
- Another thread has interrupted this thread.waitForAll()
,
waitForID(int, long)
,
isErrorAny()
,
isErrorID(int)
public boolean waitForID(int id, long ms) throws java.lang.InterruptedException
id
- the identifier used to determine which images to wait forms
- the length of time to wait for the loading to complete
java.lang.InterruptedException
- Another thread has interrupted this thread.waitForAll()
,
waitForID(int)
,
isErrorAny()
,
isErrorID(int)
public int statusID(int id, boolean load)
id
- the identifier used to determine which images to checkload
- specifies whether to start the media loadingstatusAll(boolean)
,
LOADING
,
ABORTED
,
ERRORED
,
COMPLETE
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |