|
Modifier and Type |
Method and Description |
|
addImage |
void addImage(Image image,
int id)
Adds an image to the list of images being tracked by this media
tracker.
public void addImage( Image image,
int id)
-
Adds an image to the list of images being tracked by this media
tracker. The image will eventually be rendered at its default
(unscaled) size.
- Parameters:
image - the image to be trackedid - an identifier used to track this image
|
|
addImage |
void addImage(Image image,
int id,
int w,
int h)
Adds a scaled image to the list of images being tracked
by this media tracker.
public void addImage( Image image,
int id,
int w,
int h)
-
Adds a scaled image to the list of images being tracked
by this media tracker. The image will eventually be
rendered at the indicated width and height.
- Parameters:
image - the image to be trackedid - an identifier that can be used to track this imagew - the width at which the image is renderedh - the height at which the image is rendered
|
|
checkAll |
boolean checkAll()
Checks to see if all images being tracked by this media tracker
have finished loading.
public boolean checkAll()
-
Checks to see if all images being tracked by this media tracker
have finished loading.
This method does not start loading the images if they are not
already loading.
If there is an error while loading or scaling an image, then that
image is considered to have finished loading. Use the
isErrorAny or isErrorID methods to
check for errors.
- Returns:
true if all images have finished loading,
have been aborted, or have encountered
an error; false otherwise- See Also:
checkAll(boolean) ,
checkID(int) ,
isErrorAny() ,
isErrorID(int)
|
|
checkAll |
boolean checkAll(boolean load)
Checks to see if all images being tracked by this media tracker
have finished loading.
public boolean checkAll(boolean load)
-
Checks to see if all images being tracked by this media tracker
have finished loading.
If the value of the load flag is true ,
then this method starts loading any images that are not yet
being loaded.
If there is an error while loading or scaling an image, that
image is considered to have finished loading. Use the
isErrorAny and isErrorID methods to
check for errors.
- Parameters:
load - if true , start loading any
images that are not yet being loaded
- Returns:
true if all images have finished loading,
have been aborted, or have encountered
an error; false otherwise- See Also:
checkID(int) ,
checkAll() ,
isErrorAny() ,
isErrorID(int)
|
|
checkID |
boolean checkID(int id)
Checks to see if all images tracked by this media tracker that
are tagged with the specified identifier have finished loading.
public boolean checkID(int id)
-
Checks to see if all images tracked by this media tracker that
are tagged with the specified identifier have finished loading.
This method does not start loading the images if they are not
already loading.
If there is an error while loading or scaling an image, then that
image is considered to have finished loading. Use the
isErrorAny or isErrorID methods to
check for errors.
- Parameters:
id - the identifier of the images to check
- Returns:
true if all images have finished loading,
have been aborted, or have encountered
an error; false otherwise- See Also:
checkID(int, boolean) ,
checkAll() ,
isErrorAny() ,
isErrorID(int)
|
|
checkID |
boolean checkID(int id,
boolean load)
Checks to see if all images tracked by this media tracker that
are tagged with the specified identifier have finished loading.
public boolean checkID(int id,
boolean load)
-
Checks to see if all images tracked by this media tracker that
are tagged with the specified identifier have finished loading.
If the value of the load flag is true ,
then this method starts loading any images that are not yet
being loaded.
If there is an error while loading or scaling an image, then that
image is considered to have finished loading. Use the
isErrorAny or isErrorID methods to
check for errors.
- Parameters:
id - the identifier of the images to checkload - if true , start loading any
images that are not yet being loaded
- Returns:
true if all images have finished loading,
have been aborted, or have encountered
an error; false otherwise- See Also:
checkID(int, boolean) ,
checkAll() ,
isErrorAny() ,
isErrorID(int)
|
|
getErrorsAny |
java.lang.Object[] getErrorsAny()
Returns a list of all media that have encountered an error.
public java.lang.Object[] getErrorsAny()
-
Returns a list of all media that have encountered an error.
- Returns:
- an array of media objects tracked by this
media tracker that have encountered
an error, or
null if
there are none with errors - See Also:
isErrorAny() ,
getErrorsID(int)
|
|
getErrorsID |
java.lang.Object[] getErrorsID(int id)
Returns a list of media with the specified ID that
have encountered an error.
public java.lang.Object[] getErrorsID(int id)
-
Returns a list of media with the specified ID that
have encountered an error.
- Parameters:
id - the identifier of the images to check
- Returns:
- an array of media objects tracked by this media
tracker with the specified identifier
that have encountered an error, or
null if there are none with errors - See Also:
isErrorID(int) ,
isErrorAny() ,
getErrorsAny()
|
|
isErrorAny |
boolean isErrorAny()
Checks the error status of all of the images.
public boolean isErrorAny()
-
Checks the error status of all of the images.
- Returns:
true if any of the images tracked
by this media tracker had an error during
loading; false otherwise- See Also:
isErrorID(int) ,
getErrorsAny()
|
|
isErrorID |
boolean isErrorID(int id)
Checks the error status of all of the images tracked by this
media tracker with the specified identifier.
public boolean isErrorID(int id)
-
Checks the error status of all of the images tracked by this
media tracker with the specified identifier.
- Parameters:
id - the identifier of the images to check
- Returns:
true if any of the images with the
specified identifier had an error during
loading; false otherwise- See Also:
isErrorAny() ,
getErrorsID(int)
|
|
removeImage |
void removeImage(Image image)
Removes the specified image from this media tracker.
|
|
removeImage |
void removeImage(Image image,
int id)
Removes the specified image from the specified tracking
ID of this media tracker.
public void removeImage( Image image,
int id)
-
Removes the specified image from the specified tracking
ID of this media tracker.
All instances of Image being tracked
under the specified ID are removed regardless of scale.
- Parameters:
image - the image to be removedid - the tracking ID frrom which to remove the image- Since:
- JDK1.1
- See Also:
removeImage(java.awt.Image) ,
removeImage(java.awt.Image, int, int, int)
|
|
removeImage |
void removeImage(Image image,
int id,
int width,
int height)
Removes the specified image with the specified
width, height, and ID from this media tracker.
public void removeImage( Image image,
int id,
int width,
int height)
-
Removes the specified image with the specified
width, height, and ID from this media tracker.
Only the specified instance (with any duplicates) is removed.
- Parameters:
image - the image to be removedid - the tracking ID from which to remove the imagewidth - the width to remove (-1 for unscaled)height - the height to remove (-1 for unscaled)- Since:
- JDK1.1
- See Also:
removeImage(java.awt.Image) ,
removeImage(java.awt.Image, int)
|
|
statusAll |
int statusAll(boolean load)
Calculates and returns the bitwise inclusive OR of the
status of all media that are tracked by this media tracker.
public int statusAll(boolean load)
-
Calculates and returns the bitwise inclusive OR of the
status of all media that are tracked by this media tracker.
Possible flags defined by the
MediaTracker class are LOADING ,
ABORTED , ERRORED , and
COMPLETE . An image that hasn't started
loading has zero as its status.
If the value of load is true , then
this method starts loading any images that are not yet being loaded.
- Parameters:
load - if true , start loading
any images that are not yet being loaded
- Returns:
- the bitwise inclusive OR of the status of
all of the media being tracked
- See Also:
statusID(int, boolean) ,
LOADING ,
ABORTED ,
ERRORED ,
COMPLETE
|
|
statusID |
int statusID(int id,
boolean load)
Calculates and returns the bitwise inclusive OR of the
status of all media with the specified identifier that are
tracked by this media tracker.
public int statusID(int id,
boolean load)
-
Calculates and returns the bitwise inclusive OR of the
status of all media with the specified identifier that are
tracked by this media tracker.
Possible flags defined by the
MediaTracker class are LOADING ,
ABORTED , ERRORED , and
COMPLETE . An image that hasn't started
loading has zero as its status.
If the value of load is true , then
this method starts loading any images that are not yet being loaded.
- Parameters:
id - the identifier of the images to checkload - if true , start loading
any images that are not yet being loaded
- Returns:
- the bitwise inclusive OR of the status of
all of the media with the specified
identifier that are being tracked
- See Also:
statusAll(boolean) ,
LOADING ,
ABORTED ,
ERRORED ,
COMPLETE
|
|
waitForAll |
void waitForAll()
Starts loading all images tracked by this media tracker.
public void waitForAll()
throws java.lang.InterruptedException
-
Starts loading all images tracked by this media tracker. This
method waits until all the images being tracked have finished
loading.
If there is an error while loading or scaling an image, then that
image is considered to have finished loading. Use the
isErrorAny or isErrorID methods to
check for errors.
- Throws:
java.lang.InterruptedException - if any thread has
interrupted this thread- See Also:
waitForID(int) ,
waitForAll(long) ,
isErrorAny() ,
isErrorID(int)
|
|
waitForAll |
boolean waitForAll(long ms)
Starts loading all images tracked by this media tracker.
public boolean waitForAll(long ms)
throws java.lang.InterruptedException
-
Starts loading all images tracked by this media tracker. This
method waits until all the images being tracked have finished
loading, or until the length of time specified in milliseconds
by the ms argument has passed.
If there is an error while loading or scaling an image, then
that image is considered to have finished loading. Use the
isErrorAny or isErrorID methods to
check for errors.
- Parameters:
ms - the number of milliseconds to wait
for the loading to complete
- Returns:
true if all images were successfully
loaded; false otherwise
- Throws:
java.lang.InterruptedException - if any thread has
interrupted this thread.- See Also:
waitForID(int) ,
waitForAll(long) ,
isErrorAny() ,
isErrorID(int)
|
|
waitForID |
void waitForID(int id)
Starts loading all images tracked by this media tracker with the
specified identifier.
public void waitForID(int id)
throws java.lang.InterruptedException
-
Starts loading all images tracked by this media tracker with the
specified identifier. This method waits until all the images with
the specified identifier have finished loading.
If there is an error while loading or scaling an image, then that
image is considered to have finished loading. Use the
isErrorAny and isErrorID methods to
check for errors.
- Parameters:
id - the identifier of the images to check
- Throws:
java.lang.InterruptedException - if any thread has
interrupted this thread.- See Also:
waitForAll() ,
isErrorAny() ,
isErrorID(int)
|
|
waitForID |
boolean waitForID(int id,
long ms)
Starts loading all images tracked by this media tracker with the
specified identifier.
public boolean waitForID(int id,
long ms)
throws java.lang.InterruptedException
-
Starts loading all images tracked by this media tracker with the
specified identifier. This method waits until all the images with
the specified identifier have finished loading, or until the
length of time specified in milliseconds by the ms
argument has passed.
If there is an error while loading or scaling an image, then that
image is considered to have finished loading. Use the
statusID , isErrorID , and
isErrorAny methods to check for errors.
- Parameters:
id - the identifier of the images to checkms - the length of time, in milliseconds, to wait
for the loading to complete
- Throws:
java.lang.InterruptedException - if any thread has
interrupted this thread.- See Also:
waitForAll() ,
waitForID(int) ,
statusID(int, boolean) ,
isErrorAny() ,
isErrorID(int)
|