mhframework.media
Class MHMediaTracker
java.lang.Object
java.awt.MediaTracker
mhframework.media.MHMediaTracker
- All Implemented Interfaces:
- java.io.Serializable
public class MHMediaTracker
- extends java.awt.MediaTracker
- See Also:
- Serialized Form
Fields inherited from class java.awt.MediaTracker |
ABORTED, COMPLETE, ERRORED, LOADING |
Methods inherited from class java.awt.MediaTracker |
checkAll, checkAll, checkID, checkID, getErrorsAny, getErrorsID, isErrorAny, isErrorID, removeImage, removeImage, removeImage, statusAll, statusID, waitForAll, waitForAll, waitForID, waitForID |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getInstance
public static MHMediaTracker getInstance()
- Returns:
- A handle to the singleton MHMediaTracker instance.
reset
public static void reset()
countLoadedImages
public int countLoadedImages()
- This method counts the number of
images that have finished loading. Useful for calculating
how much of the application has finished loading at the
point in time when the method is called.
- Returns:
- The number of images that have finished loading.
doneLoading
public boolean doneLoading()
- Returns true when all requested images have finished loading.
- Returns:
- True if all images have finished loading, false
otherwise.
getImageCount
public int getImageCount()
- Returns the number of images for which loading has been
requested.
Each time an image is added to the media tracker, a private
variable is incremented. This method returns the current
value of that variable.
- Returns:
- The number of images that have been added to the
MHMediaTracker.
getPctLoaded
public int getPctLoaded()
addImage
public void addImage(java.awt.Image image,
int id,
int w,
int h)
- Overrides:
addImage
in class java.awt.MediaTracker
addImage
public void addImage(java.awt.Image image,
int id)
- Overrides:
addImage
in class java.awt.MediaTracker