|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
javax.swing.JWindow
public class JWindow
JWindow は、ユーザーのデスクトップ上のどこにでも表示できるコンテナです。タイトルバー、ウィンドウ管理ボタン、または JFrame に関連したほかの装飾を持ちませんが、それでもユーザーのデスクトップの「最上級のメンバー」であり、そのどこにでも表示できます。
JWindow コンポーネントには、JRootPane が唯一の子として格納されます。contentPane は JWindow のすべての子の親になる必要があります。便宜上、add とその派生メソッド、remove および setLayout は、必要に応じて contentPane に転送されるようにオーバーライドされています。つまり、次のように記述できます。
window.add(child);
子は contentPane に追加されます。contentPane は常に null 以外の値になります。null に設定しようとすると、JWindow が例外をスローします。デフォルトの contentPane には、BorderLayout マネージャーが設定されます。JWindow の LayoutManager の追加、削除、および設定の詳細については、RootPaneContainer を参照してください。
contentPane、glassPane、および layeredPane コンポーネントの詳細については、JRootPane の説明を参照してください。
マルチスクリーン環境の場合には、異なったスクリーンデバイス上で JWindow を生成できます。詳細は、Window を参照してください。
警告: Swing はスレッドに対して安全ではありません。詳細は、「Swing's Threading Policy」を参照してください。
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。JDK Version 1.4 以降、すべての JavaBeans™ の長期間の運用サポートは、java.beans パッケージに追加されています。詳細は、XMLEncoder を参照してください。
JRootPane| 入れ子のクラスの概要 | |
|---|---|
protected class |
JWindow.AccessibleJWindow
このクラスは JWindow クラス用のアクセシビリティーサポートを実装しています。 |
| クラス java.awt.Window から継承された入れ子のクラス/インタフェース |
|---|
Window.AccessibleAWTWindow |
| クラス java.awt.Container から継承された入れ子のクラス/インタフェース |
|---|
Container.AccessibleAWTContainer |
| クラス java.awt.Component から継承された入れ子のクラス/インタフェース |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| フィールドの概要 | |
|---|---|
protected AccessibleContext |
accessibleContext
アクセシビリティー対応のコンテキストプロパティーです。 |
protected JRootPane |
rootPane
glassPane だけでなく、このフレームの contentPane およびオプションの menuBar を管理する JRootPane のインスタンスです。 |
protected boolean |
rootPaneCheckingEnabled
true の場合は、 add および setLayout の呼び出しが contentPane に転送されます。 |
| クラス java.awt.Component から継承されたフィールド |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| インタフェース java.awt.image.ImageObserver から継承されたフィールド |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| コンストラクタの概要 | |
|---|---|
JWindow()
オーナの指定されていないウィンドウを作成します。 |
|
JWindow(Frame owner)
指定したオーナフレームを持ったウィンドウを作成します。 |
|
JWindow(GraphicsConfiguration gc)
ウィンドウを、画面デバイスの指定された GraphicsConfiguration にタイトルなしで作成します。 |
|
JWindow(Window owner)
オーナウィンドウを指定してウィンドウを作成します。 |
|
JWindow(Window owner,
GraphicsConfiguration gc)
オーナウィンドウとスクリーンデバイスの GraphicsConfiguration を指定してウィンドウを作成します。 |
|
| メソッドの概要 | |
|---|---|
protected void |
addImpl(Component comp,
Object constraints,
int index)
指定された子 Component を追加します。 |
protected JRootPane |
createRootPane()
コンストラクタメソッドによって呼び出され、デフォルトの rootPane を作成します。 |
AccessibleContext |
getAccessibleContext()
この JWindow に関連した AccessibleContext を返します。 |
Container |
getContentPane()
このウィンドウの contentPane である Container を返します。 |
Component |
getGlassPane()
このウィンドウの glassPane Component を返します。 |
Graphics |
getGraphics()
このコンポーネントのグラフィックスコンテキストを作成します。 |
JLayeredPane |
getLayeredPane()
このウィンドウの layeredPane オブジェクトを返します。 |
JRootPane |
getRootPane()
このウィンドウの rootPane オブジェクトを返します。 |
TransferHandler |
getTransferHandler()
transferHandler プロパティーを返します。 |
protected boolean |
isRootPaneCheckingEnabled()
add および setLayout の呼び出しが contentPane に転送されるかどうかを返します。 |
protected String |
paramString()
この JWindow の文字列表現を返します。 |
void |
remove(Component comp)
指定されたコンポーネントをコンテナから削除します。 |
void |
repaint(long time,
int x,
int y,
int width,
int height)
このコンポーネントの指定された矩形領域を time ミリ秒以内に再描画します。 |
void |
setContentPane(Container contentPane)
このウィンドウの contentPane プロパティーを設定します。 |
void |
setGlassPane(Component glassPane)
glassPane プロパティーを設定します。 |
void |
setLayeredPane(JLayeredPane layeredPane)
layeredPane プロパティーを設定します。 |
void |
setLayout(LayoutManager manager)
LayoutManager を設定します。 |
protected void |
setRootPane(JRootPane root)
このウィンドウの新しい rootPane オブジェクトを設定します。 |
protected void |
setRootPaneCheckingEnabled(boolean enabled)
add および setLayout の呼び出しが contentPane に転送されるかどうかを設定します。 |
void |
setTransferHandler(TransferHandler newHandler)
このコンポーネントへのデータ転送をサポートする機構である、 transferHandler プロパティーを設定します。 |
void |
update(Graphics g)
paint(g) を呼び出します。 |
protected void |
windowInit()
JWindow を適切に初期化するためにコンストラクタによって呼び出されます。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
|---|
protected JRootPane rootPane
glassPane だけでなく、このフレームの contentPane およびオプションの menuBar を管理する JRootPane のインスタンスです。
getRootPane(),
setRootPane(javax.swing.JRootPane)protected boolean rootPaneCheckingEnabled
add および setLayout の呼び出しが contentPane に転送されます。最初は false ですが、JWindow が構築されると、true に設定されます。
isRootPaneCheckingEnabled(),
setRootPaneCheckingEnabled(boolean),
RootPaneContainerprotected AccessibleContext accessibleContext
| コンストラクタの詳細 |
|---|
public JWindow()
このコンストラクタはコンポーネントのローカルプロパティーを JComponent.getDefaultLocale によって返された値に設定します。
HeadlessException - GraphicsEnvironment.isHeadless() が true を返す場合GraphicsEnvironment.isHeadless(),
Window.isFocusableWindow(),
JComponent.getDefaultLocale()public JWindow(GraphicsConfiguration gc)
GraphicsConfiguration にタイトルなしで作成します。このウィンドウには、フォーカスが設定されません。
このコンストラクタはコンポーネントのローカルプロパティーを JComponent.getDefaultLocale によって返された値に設定します。
gc - 新しいウィンドウを構築するために使用する GraphicsConfiguration。gc が null の場合、システムのデフォルトは、GraphicsConfiguration と考えられる
HeadlessException - GraphicsEnvironment.isHeadless() が true を返す場合
IllegalArgumentException - gc がスクリーンデバイスのものではない場合。GraphicsEnvironment.isHeadless(),
Window.isFocusableWindow(),
JComponent.getDefaultLocale()public JWindow(Frame owner)
owner が null の場合は、共有所有者が使用され、このウィンドウにはフォーカスが設定されません。また、所有者が画面に表示されないかぎり、このウィンドウにはフォーカスが設定されません。
このコンストラクタはコンポーネントのローカルプロパティーを JComponent.getDefaultLocale によって返された値に設定します。
owner - ウィンドウを表示するフレーム
HeadlessException - GraphicsEnvironment.isHeadless() が true を返す場合GraphicsEnvironment.isHeadless(),
Window.isFocusableWindow(),
JComponent.getDefaultLocale()public JWindow(Window owner)
owner が null の場合は、共有所有者が使用され、このウィンドウにはフォーカスが設定されません。
このコンストラクタはコンポーネントのローカルプロパティーを JComponent.getDefaultLocale によって返された値に設定します。
owner - ウィンドウを表示するウィンドウ
HeadlessException - GraphicsEnvironment.isHeadless() が true を返す場合GraphicsEnvironment.isHeadless(),
Window.isFocusableWindow(),
JComponent.getDefaultLocale()
public JWindow(Window owner,
GraphicsConfiguration gc)
GraphicsConfiguration を指定してウィンドウを作成します。owner が null の場合は、共有所有者が使用され、このウィンドウにはフォーカスが設定されません。
このコンストラクタはコンポーネントのローカルプロパティーを JComponent.getDefaultLocale によって返された値に設定します。
owner - ウィンドウを表示するウィンドウgc - 新しいウィンドウの構築に使用する GraphicsConfiguration。gc が null の場合、システムデフォルトの GraphicsConfiguration が使われる。ただし、owner も null の場合は、共有オーナフレームの GraphicsConfiguration が使われる
HeadlessException - GraphicsEnvironment.isHeadless() が true を返す場合
IllegalArgumentException - gc がスクリーンデバイスのものではない場合。GraphicsEnvironment.isHeadless(),
Window.isFocusableWindow(),
JComponent.getDefaultLocale()| メソッドの詳細 |
|---|
protected void windowInit()
JWindow を適切に初期化するためにコンストラクタによって呼び出されます。
protected JRootPane createRootPane()
rootPane を作成します。
protected boolean isRootPaneCheckingEnabled()
add および setLayout の呼び出しが contentPane に転送されるかどうかを返します。
add および setLayout が転送される場合は true、そうでない場合は falseaddImpl(java.awt.Component, java.lang.Object, int),
setLayout(java.awt.LayoutManager),
setRootPaneCheckingEnabled(boolean),
RootPaneContainerpublic void setTransferHandler(TransferHandler newHandler)
transferHandler プロパティーを設定します。コンポーネントがデータ転送操作をサポートしない場合、null を使用します。
システムプロパティー suppressSwingDropSupport が false (デフォルト) であり、このコンポーネント上の現在のドロップターゲットが null であるか、ユーザー設定のドロップターゲットでない場合、このメソッドはドロップターゲットを次のように変更します。newHandler が null の場合、ドロップターゲットを消去します。null でない場合は、新しい DropTarget をインストールします。
注:JWindow と組み合わせて使用した場合、TransferHandler はデータのインポート機能しか提供しません。これは、データのエクスポート関連のメソッドが現在 JComponent 型になっているためです。
詳細は、「The Java Tutorial」の「How to Use Drag and Drop and Data Transfer」を参照してください。
newHandler - 新しい TransferHandlerTransferHandler,
getTransferHandler(),
Component.setDropTarget(java.awt.dnd.DropTarget)public TransferHandler getTransferHandler()
transferHandler プロパティーを返します。
transferHandler プロパティーの値TransferHandler,
setTransferHandler(javax.swing.TransferHandler)public void update(Graphics g)
paint(g) を呼び出します。このメソッドは、バックグラウンドをクリアする不必要な呼び出しが行われないようにするためにオーバーライドされました。
Container 内の updateg - ペイント対象の Graphics コンテキストComponent.update(Graphics)protected void setRootPaneCheckingEnabled(boolean enabled)
add および setLayout の呼び出しが contentPane に転送されるかどうかを設定します。
enabled - add および setLayout が転送される場合は true、JWindow で直接実行する必要がある場合は falseaddImpl(java.awt.Component, java.lang.Object, int),
setLayout(java.awt.LayoutManager),
isRootPaneCheckingEnabled(),
RootPaneContainer
protected void addImpl(Component comp,
Object constraints,
int index)
Component を追加します。このメソッドをオーバーライドすると、呼び出しが条件付きで contentPane に転送されます。デフォルトでは、子はフレームではなく contentPane に追加されます。詳細については、RootPaneContainer を参照してください。
Container 内の addImplcomp - 拡張されるコンポーネントconstraints - 遵守されるべき制約index - インデックス
IllegalArgumentException - index が無効な場合
IllegalArgumentException - コンテナの親をそのコンテナ自体に追加しようとしている場合
IllegalArgumentException - ウィンドウをコンテナに追加しようとしている場合setRootPaneCheckingEnabled(boolean),
RootPaneContainerpublic void remove(Component comp)
comp が rootPane でない場合は、呼び出しが contentPane に転送されます。comp が JWindow または contentPane の子でない場合は、何も行われません。
Container 内の removecomp - 削除されるコンポーネント
NullPointerException - comp が null の場合Container.add(java.awt.Component),
RootPaneContainerpublic void setLayout(LayoutManager manager)
LayoutManager を設定します。このメソッドをオーバーライドすると、呼び出しが条件付きで contentPane に転送されます。詳細については、RootPaneContainer を参照してください。
Container 内の setLayoutmanager - LayoutManagersetRootPaneCheckingEnabled(boolean),
RootPaneContainerpublic JRootPane getRootPane()
rootPane オブジェクトを返します。
RootPaneContainer 内の getRootPanerootPane プロパティーsetRootPane(javax.swing.JRootPane),
RootPaneContainer.getRootPane()protected void setRootPane(JRootPane root)
rootPane オブジェクトを設定します。このメソッドはコンストラクタによって呼び出されます。
root - 新しい rootPane プロパティーgetRootPane()public Container getContentPane()
contentPane である Container を返します。
RootPaneContainer 内の getContentPanecontentPane プロパティーsetContentPane(java.awt.Container),
RootPaneContainer.getContentPane()public void setContentPane(Container contentPane)
contentPane プロパティーを設定します。このメソッドはコンストラクタによって呼び出されます。
RootPaneContainer 内の setContentPanecontentPane - 新しい contentPane
IllegalComponentStateException - コンテンツ区画パラメータが null の場合 (実行時例外)getContentPane(),
RootPaneContainer.setContentPane(java.awt.Container)public JLayeredPane getLayeredPane()
layeredPane オブジェクトを返します。
RootPaneContainer 内の getLayeredPanelayeredPane プロパティーsetLayeredPane(javax.swing.JLayeredPane),
RootPaneContainer.getLayeredPane()public void setLayeredPane(JLayeredPane layeredPane)
layeredPane プロパティーを設定します。このメソッドはコンストラクタによって呼び出されます。
RootPaneContainer 内の setLayeredPanelayeredPane - 新しい layeredPane オブジェクト
IllegalComponentStateException - コンテンツ区画パラメータが null の場合 (実行時例外)getLayeredPane(),
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)public Component getGlassPane()
glassPane Component を返します。
RootPaneContainer 内の getGlassPaneglassPane プロパティーsetGlassPane(java.awt.Component),
RootPaneContainer.getGlassPane()public void setGlassPane(Component glassPane)
glassPane プロパティーを設定します。このメソッドはコンストラクタによって呼び出されます。
RootPaneContainer 内の setGlassPaneglassPane - このウィンドウ glassPane オブジェクトgetGlassPane(),
RootPaneContainer.setGlassPane(java.awt.Component)public Graphics getGraphics()
null を返します。
Component 内の getGraphicsnullComponent.paint(java.awt.Graphics)
public void repaint(long time,
int x,
int y,
int width,
int height)
time ミリ秒以内に再描画します。再ペイントの方法の詳細は、RepaintManager を参照してください。
Component 内の repainttime - 更新までの最大時間 (ミリ秒)x - x 座標y - y 座標width - 幅height - 高さRepaintManagerprotected String paramString()
JWindow の文字列表現を返します。このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。返される文字列は空の場合がありますが、null にはなりません。
Container 内の paramStringJWindow 文字列表現public AccessibleContext getAccessibleContext()
Accessible 内の getAccessibleContextWindow 内の getAccessibleContext
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。