|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--java.awt.GraphicsDevice
GraphicsDevice
クラスは、特定のグラフィックス環境で利用可能なグラフィックスデバイスを記述します。こうしたデバイスには、画面デバイスとプリンタデバイスがあります。GraphicsEnvironment
のインスタンスに、多数の画面とプリンタがある場合があります。各グラフィックスデバイスは、それに関連した 1 つ以上の GraphicsConfiguration
オブジェクトを持ちます。これらのオブジェクトは、GraphicsDevice
を使用できるさまざまな構成を指定します。
マルチスクリーン環境では、GraphicsConfiguration
オブジェクトを使って複数の画面にコンポーネントを描画できます。次のコードサンプルは、GraphicsEnvironment
の各画面デバイスで、GraphicsConfiguration
ごとに JFrame
オブジェクトを生成する方法を示したものです。
GraphicsEnvironment ge = GraphicsEnvironment. getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); for (int j = 0; j < gs.length; j++) { GraphicsDevice gd = gs[j]; GraphicsConfiguration[] gc = gd.getConfigurations(); for (int i=0; i < gc.length; i++) { JFrame f = new JFrame(gs[j].getDefaultConfiguration()); Canvas c = new Canvas(gc[i]); Rectangle gcBounds = gc[i].getBounds(); int xoffs = gcBounds.x; int yoffs = gcBounds.y; f.getContentPane().add(c); f.setLocation((i*50)+xoffs, (i*60)+yoffs); f.show(); } }
GraphicsEnvironment
,
GraphicsConfiguration
フィールドの概要 | |
static int |
TYPE_IMAGE_BUFFER
デバイスはイメージバッファです。 |
static int |
TYPE_PRINTER
デバイスはプリンタです。 |
static int |
TYPE_RASTER_SCREEN
デバイスはラスタ画面です。 |
コンストラクタの概要 | |
protected |
GraphicsDevice()
インスタンスを直接生成できない抽象クラスです。 |
メソッドの概要 | |
GraphicsConfiguration |
getBestConfiguration(GraphicsConfigTemplate gct)
GraphicsConfigTemplate で定義されている基準を渡すことのできる最適な構成を返します。 |
abstract GraphicsConfiguration[] |
getConfigurations()
この GraphicsDevice に関連したすべての GraphicsConfiguration オブジェクトを返します。 |
abstract GraphicsConfiguration |
getDefaultConfiguration()
この GraphicsDevice に関連したデフォルトの GraphicsConfiguration を返します。 |
abstract String |
getIDstring()
この GraphicsDevice に関連した ID 文字列を返します。 |
abstract int |
getType()
この GraphicsDevice のタイプを返します。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
public static final int TYPE_RASTER_SCREEN
public static final int TYPE_PRINTER
public static final int TYPE_IMAGE_BUFFER
コンストラクタの詳細 |
protected GraphicsDevice()
GraphicsEnvironment.getScreenDevices()
,
GraphicsEnvironment.getDefaultScreenDevice()
,
GraphicsConfiguration.getDevice()
メソッドの詳細 |
public abstract int getType()
GraphicsDevice
のタイプを返します。GraphicsDevice
のタイプ。TYPE_RASTER_SCREEN、TYPE_PRINTER、または TYPE_IMAGE_BUFFERTYPE_RASTER_SCREEN
,
TYPE_PRINTER
,
TYPE_IMAGE_BUFFER
public abstract String getIDstring()
GraphicsDevice
に関連した ID 文字列を返します。GraphicsDevice
の ID を表す String
public abstract GraphicsConfiguration[] getConfigurations()
GraphicsDevice
に関連したすべての GraphicsConfiguration
オブジェクトを返します。GraphicsDevice
に関連している GraphicsConfiguration
オブジェクトの配列public abstract GraphicsConfiguration getDefaultConfiguration()
GraphicsDevice
に関連したデフォルトの GraphicsConfiguration
を返します。GraphicsDevice
のデフォルトの GraphicsConfiguration
public GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate gct)
GraphicsConfigTemplate
で定義されている基準を渡すことのできる最適な構成を返します。gct
- 有効な GraphicsConfiguration
を取得するために使用される GraphicsConfigTemplate
オブジェクトGraphicsConfigTemplate
で定義されている基準を渡すことのできる GraphicsConfiguration
GraphicsConfigTemplate
|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.