MediaTrackerNameMediaTracker
DescriptionThe MediaTracker class assists in the loading of multimedia objects across the network. It can be used to wait until an object (or group of objects) has been loaded completely. Tracked objects are assigned to groups; if there is more than one object in a group, you can only track the behavior of the group as a whole (i.e., it isn't possible to track an individual object unless it is the only object in its group). Currently (1.0.2 and 1.1) MediaTracker only works for Image objects; future releases may extend MediaTracker to other multi-media types. Class Definition
public abstract class java.awt.MediaTracker extends java.lang.Object implements java.io.Serializable { // Constants public static final int ABORTED; public static final int COMPLETE; public static final int ERRORED; public static final int LOADING; // Constructors public MediaTracker (Component component); // Instance Methods public void addImage (Image image, int id); public synchronized void addImage (Image image, int id, int width, int height); public boolean checkAll(); public synchronized boolean checkAll (boolean load); public boolean checkID (int id); public synchronized boolean checkID (int id, boolean load); public synchronized Object[] getErrorsAny(); public synchronized Object[] getErrorsID (int id); public synchronized boolean isErrorAny(); public synchronized boolean isErrorID (int id); public synchronized void removeImage(Image image); public synchronized void removeImage(Image image, int id); public synchronized void removeImage(Image image, int id, int width, int height); public synchronized int statusAll (boolean load); public synchronized int statusID (int id, boolean load); public void waitForAll() throws InterruptedException; public synchronized boolean waitForAll (long ms) throws InterruptedException; public void waitForID (int id) throws InterruptedException; public synchronized boolean waitForID (int id, long ms) throws InterruptedException; } ConstantsABORTEDpublic static final int ABORTEDFlag that indicates that the loading process aborted while loading a particular image. COMPLETEpublic static final int COMPLETEFlag that indicates a particular image loaded successfully. ERROREDpublic static final int ERROREDFlag that indicates an error occurred while a particular image was loading. LOADINGpublic static final int LOADINGFlag that indicates a particular image is still loading. ConstructorsMediaTrackerpublic MediaTracker (Component component)
Instance MethodsaddImagepublic void addImage (Image image, int id)
public synchronized void addImage (Image image, int id, int width, int height)
checkAllpublic boolean checkAll()
public synchronized boolean checkAll (boolean load)
checkIDpublic boolean checkID (int id)
public synchronized boolean checkID (int id, boolean load)
getErrorsAnypublic synchronized Object[] getErrorsAny()
getErrorsIDpublic synchronized Object[] getErrorsID (int id)
isErrorAnypublic synchronized boolean isErrorAny()
isErrorIDpublic synchronized boolean isErrorID (int id)
removeImagepublic synchronized void removeImage (Image image)
public synchronized void removeImage (Image image, int id)
public synchronized void removeImage (Image image, int id, int width, int height)
statusAllpublic synchronized int statusAll (boolean load)
statusIDpublic synchronized int statusID (int id, boolean load)
waitForAllpublic void waitForAll() throws InterruptedException
public synchronized boolean waitForAll (long ms) throws InterruptedException
waitForIDpublic void waitForID (int id) throws InterruptedException
public synchronized boolean waitForID (int id, long ms) throws InterruptedException
See AlsoComponent, Image, Object |
|