|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.awt.MediaTracker
public class MediaTracker
MediaTracker
Ŭ·¡½º´Â ¸î°³ÀÇ ¹Ìµð¾î °´Ã¼ »óŸ¦ °¨½ÃÇÏ´Â À¯Æ¿¸®Æ¼ Ŭ·¡½ºÀÔ´Ï´Ù. ¹Ìµð¾î °´Ã¼¿¡´Â À̹ÌÁö¿Í ¿Àµð¿À Ŭ¸³ÀÌ Æ÷ÇԵ˴ϴÙ. ´Ù¸¸, ÇöÀç·Î¼´Â À̹ÌÁö¸¸ÀÌ Áö¿øµÇ°í ÀÖ½À´Ï´Ù.
¸Þµð¾ÆÆ®¶ôÄ«¸¦ »ç¿ëÇÏ·Á¸é,
°¨½ÃÇÏ´Â À̹ÌÁö ¸¶´Ù MediaTracker
ÀνºÅϽº¸¦ »ý¼ºÇÏ°í ³ª¼ addImage
¸¦ È£ÃâÇÕ´Ï´Ù. ¶Ç, °¢°¢ÀÇ À̹ÌÁö¿¡´Â °íÀ¯ÀÇ ½Äº°ÀÚ¸¦ ÇÒ´çÇÒ ¼ö ÀÖ½À´Ï´Ù
. ÀÌ·¯ÇÑ ½Äº°ÀÚ´Â À̹ÌÁö¸¦ ²¨³»´Â ¿ì¼± ¼øÀ§¸¦ Á¦¾îÇÕ´Ï´Ù. ¶Ç, °³º°ÀûÀ¸·Î ´ë±âÇÒ ¼ö ÀÖ´Â À̹ÌÁöÀÇ ºÎºÐÁýÇÕÀ» ½Äº°Çϱâ À§Çؼµµ »ç¿ëµË´Ï´Ù. ÀúÀ§ÀÇ ID ¹øÈ£¸¦ °¡Áö´Â À̹ÌÁö´Â °íÀ§ÀÇ ID ¹øÈ£¸¦ °¡Áö´Â À̹ÌÁöº¸´Ù ¿ì¼±ÀûÀ¸·Î ·Îµå µË´Ï´Ù.
µ¿¿µ»ó À̹ÌÁöÀÇ °¨½Ã´Â µ¿¿µ»ó À̹ÌÁöÀÇ ·Îµå ¹× ·»´õ¸µÀÇ ¸ÖƼ ÆÄÆ®ÀÇ Æ¯¼ºÀ̱⠶§¹®¿¡
Ç×»ó À¯È¿ÇÏ´Ù¶ó°í´Â ÇÑÁ¤ÇÏÁö ¾Ê½À´Ï´Ù¸¸, Áö¿øµÇ°í ÀÖ½À´Ï´Ù. MediaTracker
´Â ÃÖÃÊÀÇ ÇÁ·¹ÀÓÀÌ ¿ÏÀüÇÏ°Ô ·Îµå µÇ¾úÀ» ¶§¿¡
µ¿¿µ»ó À̹ÌÁö¸¦ ¿ÏÀüÇÏ°Ô ·Îµå µÈ °ÍÀ¸·Î¼ Ãë±ÞÇÕ´Ï´Ù. ±× ½ÃÁ¡¿¡¼ MediaTracker
´Â À̹ÌÁö°¡ ¿ÏÀüÇÏ°Ô ·Îµå µÈ °ÍÀ» ´ë±âÇÏ´Â À̹ÌÁö¿¡°Ô ÀüÇÕ´Ï´Ù. ÃÖÃÊÀÇ À̹ÌÁöÀÇ ·Îµå°¡ ¿Ï·áÇßÀ» ¶§¿¡
ImageObserver
°¡ À̹ÌÁö¸¦ °¨½ÃÇϰí ÀÖÁö ¾Ê´Â °æ¿ì, À̹ÌÁö ÀÚü°¡ Ç÷¡½Ã ÇØ, ÀÚ¿øÀÌ Àý¾àµË´Ï´Ù (Image.flush()
¸¦
ÂüÁ¶).
ÀÌÇÏ¿¡MediaTracker
¸¦ »ç¿ëÇÑ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù.
import java.applet.Applet; import java.awt.Color; import java.awt.Image; import java.awt.Graphics; import java.awt.MediaTracker; public class ImageBlaster extends Applet implements Runnable { MediaTracker tracker; Image bg; Image anim[] = new Image[5]; int index; Thread animator; // Get the images for the background (id == 0) // and the animation frames (id == 1) // and add them to the MediaTracker public void init() { tracker = new MediaTracker(this); bg = getImage(getDocumentBase(), "images/background.gif"); tracker.addImage(bg, 0); for (int i = 0; i < 5; i++) { anim[i] = getImage(getDocumentBase(), "images/anim"+i+". gif"); tracker.addImage(anim[i], 1); } } // Start the animation thread. public void start() { animator = new Thread(this); animator.start(); } // Stop the animation thread. public void stop() { animator = null; } // Run the animation thread. // First wait for the background image to fully load // and paint. Then wait for all of the animation // frames to finish loading. Finally, loop and // increment the animation frame index. public void run() { try { tracker.waitForID(0); tracker.waitForID(1); } catch (InterruptedException e) { return; } Thread me = Thread.currentThread(); while (animator == me) { try { Thread.sleep(100); } catch (InterruptedException e) { break; } synchronized (this) { index++; if (index >= anim.length) { index = 0; } } repaint(); } } // The background image fills the frame so we // don't need to clear the applet on repaints. // Just call the paint method. public void update(Graphics g) { paint(g); } // Paint a large red rectangle if there are any errors // loading the images. Otherwise always paint the // background so that it appears incrementally as it // is loading. Finally, only paint the current animation // frame if all of the frames (id == 1) are done loading, // so that we don't get partial animations. public void paint(Graphics g) { if ((tracker.statusAll(false) & MediaTracker.ERRORED) ! = 0) { g.setColor(Color.red); g.fillRect(0, 0, size(). width, size(). height); return; } g.drawImage(bg, 0, 0, this); if (tracker.statusID(1, false) == MediaTracker.COMPLETE) { g.drawImage(anim[index], 10, 10, this); } } }
ÇÊµå °³¿ä | |
---|---|
static int |
ABORTED
¹Ìµð¾îÀÇ ´Ù¿î·Îµå°¡ ÁßÁöµÈ °ÍÀ» ³ªÅ¸³»´Â Ç÷¡±×ÀÔ´Ï´Ù. |
static int |
COMPLETE
¹Ìµð¾îÀÇ ´Ù¿î·Îµå°¡ Á¤»óÀûÀ¸·Î Á¾·áÇÑ °ÍÀ» ³ªÅ¸³»´Â Ç÷¡±×ÀÔ´Ï´Ù. |
static int |
ERRORED
¹Ìµð¾îÀÇ ´Ù¿î·Îµå·Î ¿¡·¯°¡ ÀÖ´ø °ÍÀ» ³ªÅ¸³»´Â Ç÷¡±×ÀÔ´Ï´Ù. |
static int |
LOADING
¹Ìµð¾î°¡ ·ÎµåµÇ°í ÀÖ´Â °ÍÀ» ³ªÅ¸³»´Â Ç÷¡±×ÀÔ´Ï´Ù. |
»ý¼ºÀÚ °³¿ä | |
---|---|
MediaTracker (Component comp)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ À̹ÌÁö¸¦ °¨½ÃÇÏ´Â ¸Þµð¾ÆÆ®¶ôÄ«¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
void |
addImage (Image image,
int id)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ°í ÀÖ´Â ¸®½ºÆ®¿¡ À̹ÌÁö¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
addImage (Image image,
int id,
int w,
int h)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ°í ÀÖ´Â ¸®½ºÆ®¿¡ ½½Ä¶¸µ µÈ À̹ÌÁö¸¦ Ãß°¡ÇÕ´Ï´Ù. |
boolean |
checkAll ()
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½Ã ¶°³¯ ¼ö ÀÖ¾î ¸ðµç À̹ÌÁö°¡ ·Îµå¸¦ ¿Ï·áÇß´ÂÁö ¾î¶°Çß´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
boolean |
checkAll (boolean load)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½Ã ¶°³¯ ¼ö ÀÖ¾î ¸ðµç À̹ÌÁö°¡ ·Îµå¸¦ ¿Ï·áÇß´ÂÁö ¾î¶°Çß´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
boolean |
checkID (int id)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ÁöÁ¤µÈ ½Äº°ÀÚ·Î ÅÂ±× ºÙÀÌ°í µÈ ¸ðµç À̹ÌÁö°¡ ·Îµå¸¦ ¿Ï·áÇß´ÂÁö ¾î¶°Çß´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
boolean |
checkID (int id,
boolean load)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ÁöÁ¤µÈ ½Äº°ÀÚ·Î ÅÂ±× ºÙÀÌ°í µÈ ¸ðµç À̹ÌÁö°¡ ·Îµå¸¦ ¿Ï·áÇß´ÂÁö ¾î¶°Çß´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
Object [] |
getErrorsAny ()
¿¡·¯°¡ ÀÖ´ø ¸ðµç ¹Ìµð¾îÀÇ ¸®½ºÆ®¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Object [] |
getErrorsID (int id)
ÁöÁ¤µÈ ID¸¦ °¡Áö´Â ¹Ìµð¾îÁß ¿¡·¯°¡ µÈ °ÍÀÇ ¸®½ºÆ®¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isErrorAny ()
¸ðµç À̹ÌÁöÀÇ ¿¡·¯ »óŸ¦ Á¶»çÇÕ´Ï´Ù. |
boolean |
isErrorID (int id)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ÁöÁ¤µÈ ½Äº°ÀÚ¸¦ °¡Áö´Â ¸ðµç À̹ÌÁöÀÇ ¿¡·¯ »óŸ¦ Á¶»çÇÕ´Ï´Ù. |
void |
removeImage (Image image)
ÁöÁ¤µÈ À̹ÌÁö¸¦ ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeImage (Image image,
int id)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«ÀÇ ÁöÁ¤µÈ °¨½Ã ID ·ÎºÎÅÍ ÁöÁ¤µÈ À̹ÌÁö¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeImage (Image image,
int id,
int width,
int height)
ÁöÁ¤µÈ Æø, ³ôÀÌ, ID¸¦ °¡Áö´Â ÁöÁ¤µÈ À̹ÌÁö¸¦ ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
int |
statusAll (boolean load)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ¸ðµç ¹Ìµð¾î »óÅÂÀÇ ºñÆ® ´ÜÀ§ÀÇ ³í¸®ÇÕÀ» °è»êÇØ ¸®ÅÏÇÕ´Ï´Ù. |
int |
statusID (int id,
boolean load)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ÁöÁ¤µÈ ½Äº°ÀÚ¸¦ °¡Áö´Â ¸ðµç ¹Ìµð¾î »óÅÂÀÇ ºñÆ® ´ÜÀ§ÀÇ ³í¸®ÇÕÀ» °è»êÇØ ¸®ÅÏÇÕ´Ï´Ù. |
void |
waitForAll ()
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½Ã ¶°³¯ ¼ö ÀÖ¾î ¸ðµç À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù. |
boolean |
waitForAll (long ms)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ¸ðµç À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù. |
void |
waitForID (int id)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ÁöÁ¤µÈ ½Äº°ÀÚ¸¦ °¡Áö´Â ¸ðµç À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù. |
boolean |
waitForID (int id,
long ms)
ÀÌ ¸Þµð¾ÆÆ®¶ôÄ«¿¡ ÀÇÇØ °¨½ÃµÇ´Â ÁöÁ¤µÈ ½Äº°ÀÚ¸¦ °¡Áö´Â ¸ðµç À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ÇʵåÀÇ »ó¼¼ |
---|
public static final int LOADING
statusAll(boolean)
,
statusID(int, boolean)
,
Á¤¼ö Çʵ尪 public static final int ABORTED
statusAll(boolean)
,
statusID(int, boolean)
,
Á¤¼ö Çʵ尪 public static final int ERRORED
statusAll(boolean)
,
statusID(int, boolean)
,
Á¤¼ö Çʵ尪 public static final int COMPLETE
statusAll(boolean)
,
statusID(int, boolean)
,
Á¤¼ö Çʵ尪 »ý¼ºÀÚ »ó¼¼ |
---|
public MediaTracker(Component comp)
comp
- À̹ÌÁö°¡ ÃÖÁ¾ÀûÀ¸·Î ·»´õ¸µ µÇ´Â ÄÄÆÛ³ÍÆ®¸Þ¼µåÀÇ »ó¼¼ |
---|
public void addImage(Image image, int id)
image
- °¨½ÃµÇ´Â À̹ÌÁöid
- ÀÌ À̹ÌÁö¸¦ °¨½ÃÇϱâ À§Çؼ »ç¿ëÇÏ´Â ½Äº°ÀÚpublic void addImage(Image image, int id, int w, int h)
image
- °¨½ÃµÇ´Â À̹ÌÁöid
- ÀÌ À̹ÌÁö¸¦ °¨½ÃÇϱâ À§Çؼ »ç¿ëÇÏ´Â ½Äº°ÀÚw
- À̹ÌÁö°¡ ·»´õ¸µ µÇ´Â ¿µ¿ªÀÇ Æøh
- À̹ÌÁö°¡ ·»´õ¸µ µÇ´Â ¿µ¿ªÀÇ ³ôÀÌpublic boolean checkAll()
ÀÌ ¸Þ¼µå´Â À̹ÌÁö°¡ ¾ÆÁ÷ ·Îµå¾ÈÀÌ ¾Æ´Ï¸é, ±×·¯ÇÑ ·Îµå¸¦ °³½ÃÇÏÁö ¾Ê½À´Ï´Ù.
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. isErrorAny
¶Ç´Â isErrorID
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
checkAll(boolean)
,
checkID(int)
,
isErrorAny()
,
isErrorID(int)
public boolean checkAll(boolean load)
load
Ç÷¡±×ÀÇ °ªÀÌ true
ÀÎ °æ¿ì, ÀÌ ¸Þ¼µå´Â ¾ÆÁ÷ ·Îµå¾ÈÀÌ ¾Æ´Ñ À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù.
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. isErrorAny
¿Í
isErrorID
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
load
- true
ÀÎ °æ¿ì, ¾ÆÁ÷ ·Îµå°¡ ½ÃÀ۵Ǿî
ÀÖÁö ¾ÊÀº À̹ÌÁö°¡ ÀÖÀ¸¸é ·Îµå¸¦ °³½ÃÇÑ´Ù
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
checkID(int)
,
checkAll()
,
isErrorAny()
,
isErrorID(int)
public boolean isErrorAny()
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
isErrorID(int)
,
getErrorsAny()
public Object [] getErrorsAny()
null
isErrorAny()
,
getErrorsID(int)
public void waitForAll() throws InterruptedException
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. isErrorAny
¶Ç´Â isErrorID
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
InterruptedException
- º°ÀÇ thread°¡ ÀÌ thread¿¡ ³¢¾îµé¾úÀ» °æ¿ìwaitForID(int)
,
waitForAll(long)
,
isErrorAny()
,
isErrorID(int)
public boolean waitForAll(long ms) throws InterruptedException
ms
Àμö¿¡ ÀÇÇØ ¹Ð¸® ¼¼ÄÁµå ´ÜÀ§·Î ÁöÁ¤µÈ ½Ã°£ÀÌ °æ°úÇÒ ¶§±îÁö ´ë±âÇÕ´Ï´Ù.
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. isErrorAny
¶Ç´Â isErrorID
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
ms
- ·Îµå°¡ ¿Ï·áÇÒ ¶§±îÁö ´ë±âÇÏ´Â ¹Ð¸® ¼¼ÄÁµå¼ö
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
InterruptedException
- º°ÀÇ thread°¡ ÀÌ thread¿¡ ³¢¾îµé¾úÀ» °æ¿ìwaitForID(int)
,
waitForAll(long)
,
isErrorAny()
,
isErrorID(int)
public int statusAll(boolean load)
MediaTracker
Ŭ·¡½º¿¡¼ Á¤ÀǵǴ Ç÷¡±×¿¡´Â LOADING
, ABORTED
, ERRORED
¹× COMPLETE
°¡ ÀÖ½À´Ï´Ù. ·Îµå¸¦ °³½ÃÇϰí ÀÖÁö ¾Ê´Â À̹ÌÁö »óÅ´ Á¦·Î·Î ³ªÅ¸³»Áý´Ï´Ù.
load
°ªÀÌ true
ÀÎ °æ¿ì, ÀÌ ¸Þ¼µå´Â ¾ÆÁ÷ ·Îµå°¡ ½ÃÀ۵Ǿî
ÀÖÁö ¾ÊÀº À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù.
load
- true
ÀÎ °æ¿ì, ¾ÆÁ÷ ·Îµå°¡ ½ÃÀ۵Ǿî
ÀÖÁö ¾ÊÀº À̹ÌÁö°¡ ÀÖÀ¸¸é ·Îµå¸¦ °³½ÃÇÑ´Ù
statusID(int, boolean)
,
LOADING
,
ABORTED
,
ERRORED
,
COMPLETE
public boolean checkID(int id)
ÀÌ ¸Þ¼µå´Â À̹ÌÁö°¡ ¾ÆÁ÷ ·Îµå¾ÈÀÌ ¾Æ´Ï¸é, ±×·¯ÇÑ ·Îµå¸¦ °³½ÃÇÏÁö ¾Ê½À´Ï´Ù.
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. isErrorAny
¶Ç´Â isErrorID
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
id
- Á¶»çÇÏ´Â ´ë»óÀÌ µÇ´Â À̹ÌÁöÀÇ ½Äº°ÀÚ
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
checkID(int, boolean)
,
checkAll()
,
isErrorAny()
,
isErrorID(int)
public boolean checkID(int id, boolean load)
load
Ç÷¡±×ÀÇ °ªÀÌ true
ÀÎ °æ¿ì, ÀÌ ¸Þ¼µå´Â ¾ÆÁ÷ ·Îµå¾ÈÀÌ ¾Æ´Ñ À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù.
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. isErrorAny
¶Ç´Â isErrorID
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
id
- Á¶»çÇÏ´Â ´ë»óÀÌ µÇ´Â À̹ÌÁöÀÇ ½Äº°ÀÚload
- true
ÀÎ °æ¿ì, ¾ÆÁ÷ ·Îµå°¡ ½ÃÀ۵Ǿî
ÀÖÁö ¾ÊÀº À̹ÌÁö°¡ ÀÖÀ¸¸é ·Îµå¸¦ °³½ÃÇÑ´Ù
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
checkID(int, boolean)
,
checkAll()
,
isErrorAny()
,
isErrorID(int)
public boolean isErrorID(int id)
id
- Á¶»çÇÏ´Â ´ë»óÀÌ µÇ´Â À̹ÌÁöÀÇ ½Äº°ÀÚ
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
isErrorAny()
,
getErrorsID(int)
public Object [] getErrorsID(int id)
id
- Á¶»çÇÏ´Â ´ë»óÀÌ µÇ´Â À̹ÌÁöÀÇ ½Äº°ÀÚ
null
isErrorID(int)
,
isErrorAny()
,
getErrorsAny()
public void waitForID(int id) throws InterruptedException
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. isErrorAny
¿Í
isErrorID
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
id
- Á¶»çÇÏ´Â ´ë»óÀÌ µÇ´Â À̹ÌÁöÀÇ ½Äº°ÀÚ
InterruptedException
- º°ÀÇ thread°¡ ÀÌ thread¿¡ ³¢¾îµé¾úÀ» °æ¿ìwaitForAll()
,
isErrorAny()
,
isErrorID(int)
public boolean waitForID(int id, long ms) throws InterruptedException
ms
Àμö¿¡ ÀÇÇØ ¹Ð¸® ¼¼ÄÁµå ´ÜÀ§·Î ÁöÁ¤ÇÑ ½Ã°£ÀÌ °æ°úÇÒ ¶§±îÁö ´ë±âÇÕ´Ï´Ù.
À̹ÌÁöÀÇ ·Îµå ¶Ç´Â ½½Ä¶¸µÁß¿¡ ¿¡·¯°¡ ¹ß»ýÇϸé, ±× À̹ÌÁöÀÇ ·Îµå´Â ¿Ï·áÇß´Ù°í º¸¿©Áý´Ï´Ù. statusID
, isErrorID
¹× isErrorAny
¸Þ¼µå¸¦ »ç¿ëÇϸé, ¿¡·¯¸¦ Á¶»çÇÒ ¼ö ÀÖ½À´Ï´Ù.
id
- Á¶»çÇÏ´Â ´ë»óÀÌ µÇ´Â À̹ÌÁöÀÇ ½Äº°ÀÚms
- ·ÎµåÀÇ ¿Ï·á¸¦ ´ë±âÇÏ´Â ¹Ð¸® ¼¼ÄÁµå ´ÜÀ§ÀÇ ½Ã°£
InterruptedException
- º°ÀÇ thread°¡ ÀÌ thread¿¡ ³¢¾îµé¾úÀ» °æ¿ìwaitForAll()
,
waitForID(int)
,
statusID(int, boolean)
,
isErrorAny()
,
isErrorID(int)
public int statusID(int id, boolean load)
MediaTracker
Ŭ·¡½º¿¡¼ Á¤ÀǵǴ Ç÷¡±×¿¡´Â LOADING
, ABORTED
, ERRORED
¹× COMPLETE
°¡ ÀÖ½À´Ï´Ù. ·Îµå¸¦ °³½ÃÇϰí ÀÖÁö ¾Ê´Â À̹ÌÁö »óÅ´ Á¦·Î·Î ³ªÅ¸³»Áý´Ï´Ù.
load
°ªÀÌ true
ÀÎ °æ¿ì, ÀÌ ¸Þ¼µå´Â ¾ÆÁ÷ ·Îµå°¡ ½ÃÀ۵Ǿî
ÀÖÁö ¾ÊÀº À̹ÌÁöÀÇ ·Îµå¸¦ °³½ÃÇÕ´Ï´Ù.
id
- Á¶»çÇÏ´Â ´ë»óÀÌ µÇ´Â À̹ÌÁöÀÇ ½Äº°ÀÚload
- true
ÀÎ °æ¿ì, ¾ÆÁ÷ ·Îµå°¡ ½ÃÀ۵Ǿî
ÀÖÁö ¾ÊÀº À̹ÌÁö°¡ ÀÖÀ¸¸é ·Îµå¸¦ °³½ÃÇÑ´Ù
statusAll(boolean)
,
LOADING
,
ABORTED
,
ERRORED
,
COMPLETE
public void removeImage(Image image)
image
- »èÁ¦µÇ´Â À̹ÌÁöremoveImage(java.awt.Image, int)
,
removeImage(java.awt.Image, int, int, int)
public void removeImage(Image image, int id)
Image
¸ðµç ÀνºÅϽº´Â ½ºÄÉÀÏ (¿Í)´Â °ü°è¾ø´Â °ÍÀ¸·Î »èÁ¦µË´Ï´Ù.
image
- »èÁ¦µÇ´Â À̹ÌÁöid
- À̹ÌÁöÀÇ »èÁ¦¿øÀÇ °¨½Ã IDremoveImage(java.awt.Image)
,
removeImage(java.awt.Image, int, int, int)
public void removeImage(Image image, int id, int width, int height)
image
- »èÁ¦µÇ´Â À̹ÌÁöid
- À̹ÌÁöÀÇ »èÁ¦¿øÀÇ °¨½Ã IDwidth
- »èÁ¦Çϴ³ÐÀÌ (½½Ä¶¸µµÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â -1)height
- »èÁ¦ÇÏ´Â ³ôÀÌ (½½Ä¶¸µµÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â -1)removeImage(java.awt.Image)
,
removeImage(java.awt.Image, int)
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.