public class Stage extends Window
Stage
クラスは、最上位のJavaFXコンテナです。プライマリStageは、プラットフォームによって構築されます。追加のStageオブジェクトはアプリケーションによって構築できます。
Stageオブジェクトは、JavaFXアプリケーション・スレッドで構築および変更される必要があります。
多くのStage
プロパティは読取り専用となっており、これは、基礎となるプラットフォームでこれらのプロパティを外部的に変更できるためバインド可能にする必要がないからです。
スタイル
ステージには、次のいずれかのスタイルが含まれます。
StageStyle.DECORATED
- 不透明な白い背景、およびプラットフォームの装飾を持つステージ。StageStyle.UNDECORATED
- 不透明な白い背景を持ち、装飾のないステージ。StageStyle.TRANSPARENT
- 透明な背景を持ち、装飾のないステージ。StageStyle.UTILITY
- 不透明な白い背景、およびプラットフォームの最小限の装飾を持つステージ。スタイルは、ステージが表示可能になる前に初期化される必要があります。
一部のプラットフォーム上で装飾を使用できない場合があります。たとえば、一部のモバイル・デバイスや組込みデバイス上です。こうした場合、DECORATEDまたはUTILITYウィンドウのリクエストは受け入れられますが、装飾は表示されません。
所有者
ステージは、オプションで所有者ウィンドウを持つことができます。ウィンドウがステージの所有者である場合、そのウィンドウはそのステージの親と呼ばれます。親ウィンドウが閉じられると、その下位ウィンドウもすべて閉じられます。チェーン化された同じ動作が、アイコン化された親ウィンドウに適用されます。ステージは、その親ウィンドウの最前面に表示されます。所有者は、ステージが表示可能になる前に初期化される必要があります。
モダリティ
ステージには、次のいずれかのモダリティが含まれます。
Modality.NONE
- 他のウィンドウをブロックしないステージ。Modality.WINDOW_MODAL
- すべてのウィンドウ(所有者(親)からルートまで)への入力イベントの配信をブロックするステージ。ルートは、所有者のない最も近い上位ウィンドウです。Modality.APPLICATION_MODAL
- 同じアプリケーションのすべてのウィンドウ(その子階層のウィンドウは除く)への入力イベントの配信をブロックするステージ。ウィンドウがモーダル・ステージによってブロックされた場合、そのウィンドウの上位を基準にしたZオーダーは維持され、入力イベントやウィンドウ・アクティブ化イベントは受け取りませんが、引き続き正常にアニメーション化およびレンダリングされます。モーダル・ステージの表示が必ずしも呼出し元をブロックするわけではないことに注意してください。show()
メソッドは、ステージのモダリティに関係なく、すぐに戻ります。モーダル・ステージが非表示になる(閉じられる)まで呼出し元をブロックする必要がある場合は、showAndWait()
メソッドを使用します。モダリティは、ステージが表示可能になる前に初期化される必要があります。
例:
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class HelloWorld extends Application {
@Override public void start(Stage stage) {
Text text = new Text(10, 40, "Hello World!");
text.setFont(new Font(40));
Scene scene = new Scene(new Group(text));
stage.setTitle("Welcome to JavaFX!");
stage.setScene(scene);
stage.sizeToScene();
stage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}
Windowsでは次が生成されます。
Mac OSXでは次が生成されます。
Linuxでは次が生成されます。
型 | プロパティと説明 |
---|---|
ReadOnlyBooleanProperty |
alwaysOnTop
この
Stage を他のウィンドウの上に保持するかどうかを定義します。 |
ObjectProperty<String> |
fullScreenExitHint |
ObjectProperty<KeyCombination> |
fullScreenExitKey
全画面の終了キーの組合せのプロパティを取得します。
|
ReadOnlyBooleanProperty |
fullScreen
この
Stage を全画面の装飾のないウィンドウにするかどうかを指定します。 |
ReadOnlyBooleanProperty |
iconified
Stage をアイコン化するかどうかを定義します。 |
DoubleProperty |
maxHeight
この
Stage の最大高さを定義します。 |
ReadOnlyBooleanProperty |
maximized
Stage を最大化するかどうかを定義します。 |
DoubleProperty |
maxWidth
この
Stage の最大幅を定義します。 |
DoubleProperty |
minHeight
この
Stage の最小高さを定義します。 |
DoubleProperty |
minWidth
この
Stage の最小幅を定義します。 |
BooleanProperty |
resizable
ユーザーが
Stage をサイズ変更できるかどうかを定義します。 |
StringProperty |
title
Stage のタイトルを定義します。 |
コンストラクタと説明 |
---|
Stage()
装飾された
Stage の新しいインスタンスを作成します。 |
Stage(StageStyle style)
Stage の新しいインスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
ReadOnlyBooleanProperty |
alwaysOnTopProperty()
この
Stage を他のウィンドウの上に保持するかどうかを定義します。 |
void |
close()
この
Stage を閉じます。 |
ObjectProperty<String> |
fullScreenExitHintProperty() |
ObjectProperty<KeyCombination> |
fullScreenExitKeyProperty()
全画面の終了キーの組合せのプロパティを取得します。
|
ReadOnlyBooleanProperty |
fullScreenProperty()
この
Stage を全画面の装飾のないウィンドウにするかどうかを指定します。 |
String |
getFullScreenExitHint()
プロパティfullScreenExitHintの値を取得します。
|
KeyCombination |
getFullScreenExitKeyCombination()
全画面モードを終了するために使用される現在の順序を取得します。
|
ObservableList<Image> |
getIcons()
ウィンドウの装飾に使用され、最小化時に使用されるアイコン・イメージを取得します。
|
double |
getMaxHeight()
プロパティmaxHeightの値を取得します。
|
double |
getMaxWidth()
プロパティmaxWidthの値を取得します。
|
double |
getMinHeight()
プロパティminHeightの値を取得します。
|
double |
getMinWidth()
プロパティminWidthの値を取得します。
|
Modality |
getModality()
このステージのモダリティ属性を取得します。
|
Window |
getOwner()
このステージの所有者ウィンドウを取得するか、または所有者がいないステージの場合はnullとなります。
|
StageStyle |
getStyle()
このステージのスタイル属性を取得します。
|
String |
getTitle()
プロパティtitleの値を取得します。
|
ReadOnlyBooleanProperty |
iconifiedProperty()
Stage をアイコン化するかどうかを定義します。 |
void |
initModality(Modality modality)
このステージのモダリティを指定します。
|
void |
initOwner(Window owner)
このステージの所有者ウィンドウを指定するか、または最上位で所有者のいないステージの場合はnullとなります。
|
void |
initStyle(StageStyle style)
このステージのスタイルを指定します。
|
boolean |
isAlwaysOnTop()
プロパティalwaysOnTopの値を取得します。
|
boolean |
isFullScreen()
プロパティfullScreenの値を取得します。
|
boolean |
isIconified()
プロパティiconifiedの値を取得します。
|
boolean |
isMaximized()
プロパティmaximizedの値を取得します。
|
boolean |
isResizable()
プロパティresizableの値を取得します。
|
DoubleProperty |
maxHeightProperty()
この
Stage の最大高さを定義します。 |
ReadOnlyBooleanProperty |
maximizedProperty()
Stage を最大化するかどうかを定義します。 |
DoubleProperty |
maxWidthProperty()
この
Stage の最大幅を定義します。 |
DoubleProperty |
minHeightProperty()
この
Stage の最小高さを定義します。 |
DoubleProperty |
minWidthProperty()
この
Stage の最小幅を定義します。 |
BooleanProperty |
resizableProperty()
ユーザーが
Stage をサイズ変更できるかどうかを定義します。 |
void |
setAlwaysOnTop(boolean value)
プロパティalwaysOnTopの値を設定します。
|
void |
setFullScreen(boolean value)
プロパティfullScreenの値を設定します。
|
void |
setFullScreenExitHint(String value)
ユーザーが全画面モードに入った場合に表示するテキストを指定します(通常は、全画面モードを終了する方法を示すために使用されます)。
|
void |
setFullScreenExitKeyCombination(KeyCombination keyCombination)
ユーザーが全画面モードを終了できるKeyCombinationを指定します。
|
void |
setIconified(boolean value)
プロパティiconifiedの値を設定します。
|
void |
setMaxHeight(double value)
プロパティmaxHeightの値を設定します。
|
void |
setMaximized(boolean value)
プロパティmaximizedの値を設定します。
|
void |
setMaxWidth(double value)
プロパティmaxWidthの値を設定します。
|
void |
setMinHeight(double value)
プロパティminHeightの値を設定します。
|
void |
setMinWidth(double value)
プロパティminWidthの値を設定します。
|
void |
setResizable(boolean value)
プロパティresizableの値を設定します。
|
void |
setScene(Scene value)
このステージで使用されるシーンを指定します。
|
void |
setTitle(String value)
プロパティtitleの値を設定します。
|
void |
show()
表示をtrueに設定して、このウィンドウの表示を試みます。
|
void |
showAndWait()
このステージを表示し、このステージが非表示になる(閉じられる)まで待機してから呼出し元に戻ります。
|
StringProperty |
titleProperty()
Stage のタイトルを定義します。 |
void |
toBack()
Window を背面に移動します。 |
void |
toFront()
Window を前面に移動します。 |
addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getProperties, getScene, getUserData, getWidth, getX, getY, hasProperties, heightProperty, hide, isFocused, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, removeEventFilter, removeEventHandler, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setUserData, setWidth, setX, setY, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
public final ReadOnlyBooleanProperty fullScreenProperty
Stage
を全画面の装飾のないウィンドウにするかどうかを指定します。
全画面モードの実装は、プラットフォームおよびプロファイルに依存します。
true
に設定した場合、Stage
は表示可能な場合は全画面モードに入ろうとします。false
に設定して、Stage
をウィンドウ・モードに戻します。このプロパティがJavaFXアプリケーション・スレッド以外のスレッドで設定されている場合は、IllegalStateException
がスローされます。
全画面のStage
がフォーカスを失った場合、または別のStage
が同じScreen
上で全画面モードに入った場合は、全画面モードが終了します(また、fullScreen
属性がfalse
に設定されます)。全画面モードのStage
は、その全画面ステータスを失わずに非表示になることができ、そのStage
は表示可能になると再度全画面モードに入ります。
Screen
を制御するために、全画面モードに入る前にそのScreen
の境界内にStageの位置を設定します。
ただし、いったん全画面モードになると、Stage
のx
、y
、width
およびheight
の各変数は、引き続き非全画面位置およびウィンドウのサイズを表し、iconified
、resizable
、style
およびopacity
についても同様です。全画面モード中にこれらのいずれかの属性に変更が加えられた場合、全画面モードの終了時にStage
はこれらの属性を使用します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen、maximized
の順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
デスクトップ・プロファイル実装に関する注意。デスクトップ・プロファイルでは、全画面排他モード(FSEM)がプラットフォームでサポートされ、アプリケーションで許可されている場合、ランタイムは全画面排他モードに入ろうとします。いずれも当てはまらない場合は、シミュレートされた全画面ウィンドウがかわりに使用され、ウィンドウは最大化され、可能な場合は修飾なしとなり、前面に移動されます。
デスクトップ・プロファイルでは、ユーザーは[Esc]
キーを押していつでも全画面モードを無条件で終了できます。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、無制限で全画面排他モードに入ることができます。適切な権限を持たないアプリケーションには、次の制限があります。
Node.mousePressed/mouseReleased/mouseClicked
)またはキーボード(Node.keyPressed/keyReleased/keyTyped
)のイベント・ハンドラで入ることができます。[Esc]
キーへの応答でFSEMに入ることはできません。その他のコンテキストでFSEMに入ろうとすると、エミュレートされた全画面モードになります。
Stage
が全画面として構築されているが、表示可能でない場合は、表示可能になったときに全画面モードに入りますが、これが許可される状況に対しては、fullScreen
をtrue
に設定した場合と同じ制限が適用されます。
UP、DOWN、LEFT、RIGHT、SPACE、TAB、PAGE_UP、PAGE_DOWN、HOME、END、ENTER
の各キーからのKEY_PRESSEDイベントとKEY_RELEASEDイベントのみが受け取られます。
isFullScreen()
, setFullScreen(boolean)
public final StringProperty titleProperty
Stage
のタイトルを定義します。getTitle()
, setTitle(String)
public final ReadOnlyBooleanProperty iconifiedProperty
Stage
をアイコン化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified}、fullScreen
、maximized
の順となります(高いものから低いもの)。
一部のモバイル・プラットフォームおよび組込みプラットフォーム上では、このプロパティをtrueに設定すると、Stage
が非表示になりますが、そのアイコンは表示されません。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
isIconified()
, setIconified(boolean)
public final ReadOnlyBooleanProperty maximizedProperty
Stage
を最大化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen
、maximizedの順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
isMaximized()
, setMaximized(boolean)
public final ReadOnlyBooleanProperty alwaysOnTopProperty
Stage
を他のウィンドウの上に保持するかどうかを定義します。
ほかに最前面ウィンドウがある場合、これらのウィンドウの相対的な順序は指定されず、プラットフォームに依存します。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、常に手前に表示フラグをStageに設定できます。適切な権限を持たないアプリケーションでは、このフラグを設定しようとしても無視され、プロパティ値はfalseに戻ります。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
isAlwaysOnTop()
, setAlwaysOnTop(boolean)
public final BooleanProperty resizableProperty
Stage
をサイズ変更できるかどうかを定義します。Stageのサイズは、引き続きプログラムで変更できます。このことは、ユーザーによるStageのサイズ変更をオプションで可能にする実装を許可するヒントになります。
警告: 8.0以降、プロパティはバインドできなくなり、バインドしようとするとRuntimeException
がスローされます。これは、サイズ変更可能の設定は、一部のシステムでは非同期となったり、一般にシステム・マネージャやウィンドウ・マネージャによって設定される可能性があるためです。
双方向バインディングは、システムでのプロパティ設定をブロックしないため、引き続き許可されています。
isResizable()
, setResizable(boolean)
public final DoubleProperty minWidthProperty
Stage
の最小幅を定義します。getMinWidth()
, setMinWidth(double)
public final DoubleProperty minHeightProperty
Stage
の最小高さを定義します。getMinHeight()
, setMinHeight(double)
public final DoubleProperty maxWidthProperty
Stage
の最大幅を定義します。getMaxWidth()
, setMaxWidth(double)
public final DoubleProperty maxHeightProperty
Stage
の最大高さを定義します。getMaxHeight()
, setMaxHeight(double)
public final ObjectProperty<KeyCombination> fullScreenExitKeyProperty
public final ObjectProperty<String> fullScreenExitHintProperty
public Stage()
Stage
の新しいインスタンスを作成します。IllegalStateException
- このコンストラクタがJavaFXアプリケーション・スレッド以外のスレッドで呼び出された場合。public Stage(StageStyle style)
Stage
の新しいインスタンスを作成します。style
- Stage
のスタイルIllegalStateException
- このコンストラクタがJavaFXアプリケーション・スレッド以外のスレッドで呼び出された場合。public final void setScene(Scene value)
public final void show()
Window
public void showAndWait()
ステージは、次のいずれかの理由で非表示になっています(閉じられています)。
Window.hide()
またはclose()
メソッドをこのステージで呼び出しているステージが非表示になり、アプリケーションがイベント・ハンドラからイベント・ループに戻った後に、ネストされたイベント・ループが終了し、このメソッドが呼出し元に戻ります。
たとえば、様々なイベント・ハンドラの次の一連の操作を、示されている順序で実行するとします。
void evtHander1(...) { stage1.showAndWait(); doSomethingAfterStage1Closed(...) } void evtHander2(...) { stage1.hide(); doSomethingElseHere(...) }evtHandler1は、showAndWaitの呼出し時にブロックされます。stage1が非表示になった後に実行が再開され、現在のイベント・ハンドラ(この場合はevtHandler2)がイベント・ループに戻ります。これは、doSomethingElseHereがdoSomethingAfterStage1Closedの前に実行されることを意味します。
複数のステージがshowAndWaitにより表示される場合があります。各呼出しは、新規のネストされたイベント・ループを開始します。ステージは任意の順序で非表示にできますが、特定のネストされたイベント・ループ(および関連付けられたステージのshowAndWaitメソッド)は、すべての内部イベント・ループが終了した後にのみ終了します。
たとえば、様々なイベント・ハンドラの次の一連の操作を、示されている順序で実行するとします。
void evtHander1() { stage1.showAndWait(); doSomethingAfterStage1Closed(...) } void evtHander2() { stage2.showAndWait(); doSomethingAfterStage2Closed(...) } void evtHander3() { stage1.hide(); doSomethingElseHere(...) } void evtHander4() { stage2.hide(); doSomethingElseHereToo(...) }evtHandler1はstage1.showAndWaitの呼出し時にブロックされ、ネストされたイベント・ループは前の例とまったく同じように開始されます。次に、evtHandler2はstage2.showAndWaitの呼出し時にブロックされ、別の(内部の)ネストされたイベント・ループを開始します。stage1.showAndWaitの最初の呼出しは、stage1が非表示となった後、stage2.showAndWaitによって開始された内部にネストされたイベント・ループが終了した後にのみ、実行が再開されます。これは、stage1.showAndWaitの呼出しが、evtHandler2が戻るまで戻らないことを意味します。実行の順序は、stage1.showAndWait、stage2.showAndWait、stage1.hide、doSomethingElseHere、stage2.hide、doSomethingElseHereToo、doSomethingAfterStage2Closed、doSomethingAfterStage1Closedとなります。
このメソッドは、プライマリ・ステージまたはすでに表示可能なステージで呼び出すことはできません。
IllegalStateException
- このメソッドがJavaFXアプリケーション・スレッド以外のスレッドで呼び出された場合。IllegalStateException
- このメソッドがイベント・ハンドラ外で呼び出された場合。これには、アニメーション・コールバック、プロパティ・ハンドラおよびレイアウト処理が含まれます。IllegalStateException
- このメソッドがプライマリ・ステージで呼び出された場合。IllegalStateException
- このステージがすでに表示されている場合。public final void initStyle(StageStyle style)
style
- このステージのスタイル。IllegalStateException
- このプロパティが、ステージが表示可能になった後に設定された場合。public final StageStyle getStyle()
public final void initModality(Modality modality)
modality
- このステージのモダリティ。IllegalStateException
- このプロパティが、ステージが表示可能になった後に設定された場合。IllegalStateException
- このステージがプライマリ・ステージの場合。public final Modality getModality()
public final void initOwner(Window owner)
owner
- このステージの所有者。IllegalStateException
- このプロパティが、ステージが表示可能になった後に設定された場合。IllegalStateException
- このステージがプライマリ・ステージの場合。public final Window getOwner()
public final void setFullScreen(boolean value)
Stage
を全画面の装飾のないウィンドウにするかどうかを指定します。
全画面モードの実装は、プラットフォームおよびプロファイルに依存します。
true
に設定した場合、Stage
は表示可能な場合は全画面モードに入ろうとします。false
に設定して、Stage
をウィンドウ・モードに戻します。このプロパティがJavaFXアプリケーション・スレッド以外のスレッドで設定されている場合は、IllegalStateException
がスローされます。
全画面のStage
がフォーカスを失った場合、または別のStage
が同じScreen
上で全画面モードに入った場合は、全画面モードが終了します(また、fullScreen
属性がfalse
に設定されます)。全画面モードのStage
は、その全画面ステータスを失わずに非表示になることができ、そのStage
は表示可能になると再度全画面モードに入ります。
Screen
を制御するために、全画面モードに入る前にそのScreen
の境界内にStageの位置を設定します。
ただし、いったん全画面モードになると、Stage
のx
、y
、width
およびheight
の各変数は、引き続き非全画面位置およびウィンドウのサイズを表し、iconified
、resizable
、style
およびopacity
についても同様です。全画面モード中にこれらのいずれかの属性に変更が加えられた場合、全画面モードの終了時にStage
はこれらの属性を使用します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen、maximized
の順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
デスクトップ・プロファイル実装に関する注意。デスクトップ・プロファイルでは、全画面排他モード(FSEM)がプラットフォームでサポートされ、アプリケーションで許可されている場合、ランタイムは全画面排他モードに入ろうとします。いずれも当てはまらない場合は、シミュレートされた全画面ウィンドウがかわりに使用され、ウィンドウは最大化され、可能な場合は修飾なしとなり、前面に移動されます。
デスクトップ・プロファイルでは、ユーザーは[Esc]
キーを押していつでも全画面モードを無条件で終了できます。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、無制限で全画面排他モードに入ることができます。適切な権限を持たないアプリケーションには、次の制限があります。
Node.mousePressed/mouseReleased/mouseClicked
)またはキーボード(Node.keyPressed/keyReleased/keyTyped
)のイベント・ハンドラで入ることができます。[Esc]
キーへの応答でFSEMに入ることはできません。その他のコンテキストでFSEMに入ろうとすると、エミュレートされた全画面モードになります。
Stage
が全画面として構築されているが、表示可能でない場合は、表示可能になったときに全画面モードに入りますが、これが許可される状況に対しては、fullScreen
をtrue
に設定した場合と同じ制限が適用されます。
UP、DOWN、LEFT、RIGHT、SPACE、TAB、PAGE_UP、PAGE_DOWN、HOME、END、ENTER
の各キーからのKEY_PRESSEDイベントとKEY_RELEASEDイベントのみが受け取られます。
public final boolean isFullScreen()
Stage
を全画面の装飾のないウィンドウにするかどうかを指定します。
全画面モードの実装は、プラットフォームおよびプロファイルに依存します。
true
に設定した場合、Stage
は表示可能な場合は全画面モードに入ろうとします。false
に設定して、Stage
をウィンドウ・モードに戻します。このプロパティがJavaFXアプリケーション・スレッド以外のスレッドで設定されている場合は、IllegalStateException
がスローされます。
全画面のStage
がフォーカスを失った場合、または別のStage
が同じScreen
上で全画面モードに入った場合は、全画面モードが終了します(また、fullScreen
属性がfalse
に設定されます)。全画面モードのStage
は、その全画面ステータスを失わずに非表示になることができ、そのStage
は表示可能になると再度全画面モードに入ります。
Screen
を制御するために、全画面モードに入る前にそのScreen
の境界内にStageの位置を設定します。
ただし、いったん全画面モードになると、Stage
のx
、y
、width
およびheight
の各変数は、引き続き非全画面位置およびウィンドウのサイズを表し、iconified
、resizable
、style
およびopacity
についても同様です。全画面モード中にこれらのいずれかの属性に変更が加えられた場合、全画面モードの終了時にStage
はこれらの属性を使用します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen、maximized
の順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
デスクトップ・プロファイル実装に関する注意。デスクトップ・プロファイルでは、全画面排他モード(FSEM)がプラットフォームでサポートされ、アプリケーションで許可されている場合、ランタイムは全画面排他モードに入ろうとします。いずれも当てはまらない場合は、シミュレートされた全画面ウィンドウがかわりに使用され、ウィンドウは最大化され、可能な場合は修飾なしとなり、前面に移動されます。
デスクトップ・プロファイルでは、ユーザーは[Esc]
キーを押していつでも全画面モードを無条件で終了できます。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、無制限で全画面排他モードに入ることができます。適切な権限を持たないアプリケーションには、次の制限があります。
Node.mousePressed/mouseReleased/mouseClicked
)またはキーボード(Node.keyPressed/keyReleased/keyTyped
)のイベント・ハンドラで入ることができます。[Esc]
キーへの応答でFSEMに入ることはできません。その他のコンテキストでFSEMに入ろうとすると、エミュレートされた全画面モードになります。
Stage
が全画面として構築されているが、表示可能でない場合は、表示可能になったときに全画面モードに入りますが、これが許可される状況に対しては、fullScreen
をtrue
に設定した場合と同じ制限が適用されます。
UP、DOWN、LEFT、RIGHT、SPACE、TAB、PAGE_UP、PAGE_DOWN、HOME、END、ENTER
の各キーからのKEY_PRESSEDイベントとKEY_RELEASEDイベントのみが受け取られます。
public final ReadOnlyBooleanProperty fullScreenProperty()
Stage
を全画面の装飾のないウィンドウにするかどうかを指定します。
全画面モードの実装は、プラットフォームおよびプロファイルに依存します。
true
に設定した場合、Stage
は表示可能な場合は全画面モードに入ろうとします。false
に設定して、Stage
をウィンドウ・モードに戻します。このプロパティがJavaFXアプリケーション・スレッド以外のスレッドで設定されている場合は、IllegalStateException
がスローされます。
全画面のStage
がフォーカスを失った場合、または別のStage
が同じScreen
上で全画面モードに入った場合は、全画面モードが終了します(また、fullScreen
属性がfalse
に設定されます)。全画面モードのStage
は、その全画面ステータスを失わずに非表示になることができ、そのStage
は表示可能になると再度全画面モードに入ります。
Screen
を制御するために、全画面モードに入る前にそのScreen
の境界内にStageの位置を設定します。
ただし、いったん全画面モードになると、Stage
のx
、y
、width
およびheight
の各変数は、引き続き非全画面位置およびウィンドウのサイズを表し、iconified
、resizable
、style
およびopacity
についても同様です。全画面モード中にこれらのいずれかの属性に変更が加えられた場合、全画面モードの終了時にStage
はこれらの属性を使用します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen、maximized
の順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
デスクトップ・プロファイル実装に関する注意。デスクトップ・プロファイルでは、全画面排他モード(FSEM)がプラットフォームでサポートされ、アプリケーションで許可されている場合、ランタイムは全画面排他モードに入ろうとします。いずれも当てはまらない場合は、シミュレートされた全画面ウィンドウがかわりに使用され、ウィンドウは最大化され、可能な場合は修飾なしとなり、前面に移動されます。
デスクトップ・プロファイルでは、ユーザーは[Esc]
キーを押していつでも全画面モードを無条件で終了できます。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、無制限で全画面排他モードに入ることができます。適切な権限を持たないアプリケーションには、次の制限があります。
Node.mousePressed/mouseReleased/mouseClicked
)またはキーボード(Node.keyPressed/keyReleased/keyTyped
)のイベント・ハンドラで入ることができます。[Esc]
キーへの応答でFSEMに入ることはできません。その他のコンテキストでFSEMに入ろうとすると、エミュレートされた全画面モードになります。
Stage
が全画面として構築されているが、表示可能でない場合は、表示可能になったときに全画面モードに入りますが、これが許可される状況に対しては、fullScreen
をtrue
に設定した場合と同じ制限が適用されます。
UP、DOWN、LEFT、RIGHT、SPACE、TAB、PAGE_UP、PAGE_DOWN、HOME、END、ENTER
の各キーからのKEY_PRESSEDイベントとKEY_RELEASEDイベントのみが受け取られます。
isFullScreen()
, setFullScreen(boolean)
public final ObservableList<Image> getIcons()
public final void setTitle(String value)
Stage
のタイトルを定義します。public final String getTitle()
Stage
のタイトルを定義します。public final StringProperty titleProperty()
Stage
のタイトルを定義します。getTitle()
, setTitle(String)
public final void setIconified(boolean value)
Stage
をアイコン化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified、fullScreen
、maximized
の順となります(高いものから低いもの)。
一部のモバイル・プラットフォームおよび組込みプラットフォーム上では、このプロパティをtrueに設定すると、Stage
が非表示になりますが、そのアイコンは表示されません。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
public final boolean isIconified()
Stage
をアイコン化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified、fullScreen
、maximized
の順となります(高いものから低いもの)。
一部のモバイル・プラットフォームおよび組込みプラットフォーム上では、このプロパティをtrueに設定すると、Stage
が非表示になりますが、そのアイコンは表示されません。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
public final ReadOnlyBooleanProperty iconifiedProperty()
Stage
をアイコン化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified、fullScreen
、maximized
の順となります(高いものから低いもの)。
一部のモバイル・プラットフォームおよび組込みプラットフォーム上では、このプロパティをtrueに設定すると、Stage
が非表示になりますが、そのアイコンは表示されません。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
isIconified()
, setIconified(boolean)
public final void setMaximized(boolean value)
Stage
を最大化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen
、maximizedの順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
public final boolean isMaximized()
Stage
を最大化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen
、maximizedの順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
public final ReadOnlyBooleanProperty maximizedProperty()
Stage
を最大化するかどうかを定義します。
他のStage
モードが同時に設定されている場合、それらの重要性はiconified
、fullScreen
、maximizedの順となります(高いものから低いもの)。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
isMaximized()
, setMaximized(boolean)
public final void setAlwaysOnTop(boolean value)
Stage
を他のウィンドウの上に保持するかどうかを定義します。
ほかに最前面ウィンドウがある場合、これらのウィンドウの相対的な順序は指定されず、プラットフォームに依存します。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、常に手前に表示フラグをStageに設定できます。適切な権限を持たないアプリケーションでは、このフラグを設定しようとしても無視され、プロパティ値はfalseに戻ります。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
public final boolean isAlwaysOnTop()
Stage
を他のウィンドウの上に保持するかどうかを定義します。
ほかに最前面ウィンドウがある場合、これらのウィンドウの相対的な順序は指定されず、プラットフォームに依存します。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、常に手前に表示フラグをStageに設定できます。適切な権限を持たないアプリケーションでは、このフラグを設定しようとしても無視され、プロパティ値はfalseに戻ります。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
public final ReadOnlyBooleanProperty alwaysOnTopProperty()
Stage
を他のウィンドウの上に保持するかどうかを定義します。
ほかに最前面ウィンドウがある場合、これらのウィンドウの相対的な順序は指定されず、プラットフォームに依存します。
セキュリティ・マネージャが存在する場合、アプリケーション間の動作には相違があります。権限のあるアプリケーションは、常に手前に表示フラグをStageに設定できます。適切な権限を持たないアプリケーションでは、このフラグを設定しようとしても無視され、プロパティ値はfalseに戻ります。
プロパティは、基礎となるプラットフォームによって外部的に変更可能であり、バインド可能にできないため、読取り専用となっています。
isAlwaysOnTop()
, setAlwaysOnTop(boolean)
public final void setResizable(boolean value)
Stage
をサイズ変更できるかどうかを定義します。Stageのサイズは、引き続きプログラムで変更できます。このことは、ユーザーによるStageのサイズ変更をオプションで可能にする実装を許可するヒントになります。
警告: 8.0以降、プロパティはバインドできなくなり、バインドしようとするとRuntimeException
がスローされます。これは、サイズ変更可能の設定は、一部のシステムでは非同期となったり、一般にシステム・マネージャやウィンドウ・マネージャによって設定される可能性があるためです。
双方向バインディングは、システムでのプロパティ設定をブロックしないため、引き続き許可されています。
public final boolean isResizable()
Stage
をサイズ変更できるかどうかを定義します。Stageのサイズは、引き続きプログラムで変更できます。このことは、ユーザーによるStageのサイズ変更をオプションで可能にする実装を許可するヒントになります。
警告: 8.0以降、プロパティはバインドできなくなり、バインドしようとするとRuntimeException
がスローされます。これは、サイズ変更可能の設定は、一部のシステムでは非同期となったり、一般にシステム・マネージャやウィンドウ・マネージャによって設定される可能性があるためです。
双方向バインディングは、システムでのプロパティ設定をブロックしないため、引き続き許可されています。
public final BooleanProperty resizableProperty()
Stage
をサイズ変更できるかどうかを定義します。Stageのサイズは、引き続きプログラムで変更できます。このことは、ユーザーによるStageのサイズ変更をオプションで可能にする実装を許可するヒントになります。
警告: 8.0以降、プロパティはバインドできなくなり、バインドしようとするとRuntimeException
がスローされます。これは、サイズ変更可能の設定は、一部のシステムでは非同期となったり、一般にシステム・マネージャやウィンドウ・マネージャによって設定される可能性があるためです。
双方向バインディングは、システムでのプロパティ設定をブロックしないため、引き続き許可されています。
isResizable()
, setResizable(boolean)
public final void setMinWidth(double value)
Stage
の最小幅を定義します。public final double getMinWidth()
Stage
の最小幅を定義します。public final DoubleProperty minWidthProperty()
Stage
の最小幅を定義します。getMinWidth()
, setMinWidth(double)
public final void setMinHeight(double value)
Stage
の最小高さを定義します。public final double getMinHeight()
Stage
の最小高さを定義します。public final DoubleProperty minHeightProperty()
Stage
の最小高さを定義します。getMinHeight()
, setMinHeight(double)
public final void setMaxWidth(double value)
Stage
の最大幅を定義します。public final double getMaxWidth()
Stage
の最大幅を定義します。public final DoubleProperty maxWidthProperty()
Stage
の最大幅を定義します。getMaxWidth()
, setMaxWidth(double)
public final void setMaxHeight(double value)
Stage
の最大高さを定義します。public final double getMaxHeight()
Stage
の最大高さを定義します。public final DoubleProperty maxHeightProperty()
Stage
の最大高さを定義します。getMaxHeight()
, setMaxHeight(double)
public void toFront()
Window
を前面に移動します。Window
がすでに前面にある場合、視覚上変わりがありません。public void toBack()
Window
を背面に移動します。Window
がすでに背面にある場合、視覚上変わりがありません。このアクションでは、スタックをサポートしているプラットフォーム上でスタック順序の一番下にこのWindow
が配置されます。public void close()
Stage
を閉じます。この呼出しは、hide()
と同等です。public final void setFullScreenExitKeyCombination(KeyCombination keyCombination)
この値の内部コピーは、全画面モードに入ると作成され、全画面モードの終了をトリガーするために使用されます。アプリケーションに適切な権限がない場合、この設定は無視されます。
keyCombination
- 終了するためのキー組合せpublic final KeyCombination getFullScreenExitKeyCombination()
public final ObjectProperty<KeyCombination> fullScreenExitKeyProperty()
public final void setFullScreenExitHint(String value)
アプリケーションに適切な権限がない場合、この設定は無視されます。
value
- 表示される文字列。public final String getFullScreenExitHint()
public final ObjectProperty<String> fullScreenExitHintProperty()
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.