Writing /volume1/Web/Public/dokuwiki/data/log/deprecated/2024-11-15.log failed
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
study:java:design_pattern:proxy [2021/05/12 00:20] – [Design of CD Cover viewer] banana | study:java:design_pattern:proxy [2021/05/12 00:27] (現在) – [ImageProxy Class] banana | ||
---|---|---|---|
行 103: | 行 103: | ||
ImageIcon imageIcon; | ImageIcon imageIcon; | ||
URL imageURL; | URL imageURL; | ||
- | Thread retrievalThread; | + | Thread retrievalThread; |
boolean retrieving = false; | boolean retrieving = false; | ||
行 116: | 行 116: | ||
*/ | */ | ||
public int getIconHeight() { | public int getIconHeight() { | ||
- | if(imageIcon!=null) return imageIcon.getIconHeight(); | + | if (imageIcon != null) return imageIcon.getIconHeight(); |
else return 600; | else return 600; | ||
} | } | ||
行 124: | 行 124: | ||
*/ | */ | ||
public int getIconWidth() { | public int getIconWidth() { | ||
- | if(imageIcon!=null) return imageIcon.getIconWidth(); | + | if (imageIcon != null) return imageIcon.getIconWidth(); |
else return 800; | else return 800; | ||
} | } | ||
行 132: | 行 132: | ||
*/ | */ | ||
public void paintIcon(final Component c, Graphics g, int x, int y) { | public void paintIcon(final Component c, Graphics g, int x, int y) { | ||
- | if(imageIcon!=null){ | + | if (imageIcon != null) { |
// | // | ||
imageIcon.paintIcon(c, | imageIcon.paintIcon(c, | ||
} else { | } else { | ||
- | g.drawString(" | + | g.drawString(" |
// | // | ||
- | if(!retrieving){ | + | if (!retrieving) { |
// | // | ||
//할 수 있습니다. | //할 수 있습니다. | ||
retrieving = true; | retrieving = true; | ||
- | + | ||
// | // | ||
retrievalThread = new Thread(new Runnable(){ | retrievalThread = new Thread(new Runnable(){ | ||
public void run(){ | public void run(){ | ||
try { | try { | ||
- | // | + | // |
- | //객체를 리턴합니다. | + | |
imageIcon = new ImageIcon(imageURL, | imageIcon = new ImageIcon(imageURL, | ||
// | // | ||
行 157: | 行 156: | ||
} | } | ||
}); | }); | ||
- | + | ||
retrievalThread.start(); | retrievalThread.start(); | ||
} | } |