Kagetaka

net.hizlab.kagetaka.awt.image
クラス OffscreenObserver

java.lang.Object
  拡張net.hizlab.kagetaka.awt.image.OffscreenObserver
すべての実装インタフェース:
ImageObserver

public class OffscreenObserver
extends Object
implements ImageObserver

オフスクリーンに対する更新を、コンポーネントに通知するためのクラスです。

Graphics.drawImage(Image, int, int, ImageObserver) 等の呼び出しに利用できます。 drawImage の戻り値が false の場合、 このクラスのインスタンスが、指定したコンポーネントに対して 随時、再描画を行います。もし true が帰った場合は、 このクラスのインスタンスは利用されないので、他への利用が可能です。

バージョン:
$Revision: 1.1 $

フィールドの概要
 Image original
          オリジナルイメージ
 boolean usePartialUpdate
          部分描画を許可する場合は true に設定する。
 int x
          描画する x 座標
 int y
          描画する y 座標
 
インタフェース java.awt.image.ImageObserver から継承したフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
OffscreenObserver(Component c, Graphics g)
          左上に描画するインスタンスを作成します。
OffscreenObserver(Component c, Graphics g, int x, int y)
          指定した位置に描画するインスタンスを作成します。
OffscreenObserver(Component c, Graphics g, int x, int y, Image original)
          オリジナルイメージを描画してから、 指定した位置に描画するインスタンスを作成します。
 
メソッドの概要
 void dispose()
          すべてのリソースを解放します。
 boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
          イメージの通知に対して描画を行います。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

original

public Image original
オリジナルイメージ


usePartialUpdate

public boolean usePartialUpdate
部分描画を許可する場合は true に設定する。


x

public int x
描画する x 座標


y

public int y
描画する y 座標

コンストラクタの詳細

OffscreenObserver

public OffscreenObserver(Component c,
                         Graphics g)
左上に描画するインスタンスを作成します。

パラメータ:
c - コンポーネント
g - グラフィックス

OffscreenObserver

public OffscreenObserver(Component c,
                         Graphics g,
                         int x,
                         int y)
指定した位置に描画するインスタンスを作成します。

パラメータ:
c - コンポーネント
g - グラフィックス
x - x 座標
y - y 座標

OffscreenObserver

public OffscreenObserver(Component c,
                         Graphics g,
                         int x,
                         int y,
                         Image original)
オリジナルイメージを描画してから、 指定した位置に描画するインスタンスを作成します。

透明色のあるアニメーションイメージなどの場合、 コマ毎にオリジナルイメージで上書きしてから描画しないと、 絵が重なってしまう場合に利用します。

パラメータ:
c - コンポーネント
g - グラフィックス
x - x 座標
y - y 座標
original - オリジナルイメージ
メソッドの詳細

dispose

public void dispose()
すべてのリソースを解放します。 アニメーションイメージなどの更新を停止するために呼び出す必要があります。


imageUpdate

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)

Kagetaka

Copyright (c) 2002-2003 The Kagetaka Project 'September 12, 2003'