|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectnet.hizlab.kagetaka.awt.image.SyncObserver
イメージの更新を同期するためのクラスです。
SyncObserver so = new SyncObserver(); synchronized (so) { so.init(g, x, y, width, height); if (!g.drawImage(image, x, y, width, height, so)) { try { so.wait(10000); } catch (InterruptedException e) { Debug.out.println("wait to draw a image"); } } }
このようにすることで、実際に描画されるのを同期することが出来ます。
フィールドの概要 |
インタフェース java.awt.image.ImageObserver から継承したフィールド |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
コンストラクタの概要 | |
SyncObserver()
同期するオブザーバを作成します。 |
メソッドの概要 | |
static boolean |
drawImage(Graphics g,
Image image,
int x,
int y,
int width,
int height,
long wait)
イメージを必ず描画するようにします。 |
boolean |
imageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
イメージの通知に対して描画を行います。 |
void |
init(Graphics g,
int x,
int y,
int width,
int height)
初期値を設定します。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
public SyncObserver()
メソッドの詳細 |
public static boolean drawImage(Graphics g, Image image, int x, int y, int width, int height, long wait)
g
- グラフィックimage
- イメージx
- Xy
- Ywidth
- 幅height
- 高さwait
- 描画するまで最大で待機する時間
true
、
タイムアウトした場合は false
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
ImageObserver
内の imageUpdate
ImageObserver.imageUpdate(Image, int, int, int, int, int)
public void init(Graphics g, int x, int y, int width, int height)
g
- グラフィックスx
- Xy
- Ywidth
- 幅height
- 高さ
|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Copyright (c) 2002-2004 The Kagetaka Project 'November 20, 2004'