本文整理匯總了Java中javafx.stage.Stage.isMaximized方法的典型用法代碼示例。如果您正苦於以下問題:Java Stage.isMaximized方法的具體用法?Java Stage.isMaximized怎麽用?Java Stage.isMaximized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.stage.Stage
的用法示例。
在下文中一共展示了Stage.isMaximized方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: maximize
import javafx.stage.Stage; //導入方法依賴的package包/類
@FXML
void maximize(ActionEvent event)
{
Stage stage = (Stage) root.getScene().getWindow();
stage.setMaximized(!stage.isMaximized());
if (stage.isMaximized())
{
menubar.setPrefWidth(stage.getWidth());
windowsButton.setLayoutX(stage.getWidth() - windowsButton.getWidth());
keyList.setPrefHeight(keyList.getPrefHeight() + 190);
}
if (!stage.isMaximized())
{
windowsButton.setLayoutX(stage.getWidth() - windowsButton.getWidth());
menubar.setPrefWidth(stage.getWidth());
keyList.setPrefHeight(keyList.getPrefHeight() - 190);
}
}
示例2: exit
import javafx.stage.Stage; //導入方法依賴的package包/類
private void exit(Stage primaryStage) {
if (primaryStage.isMaximized()) {
settings.setMaximized(true);
} else {
settings.setLastWindowPosX((int) primaryStage.getX());
settings.setLastWindowPosY((int) primaryStage.getY());
settings.setLastWindowWidth((int) primaryStage.getWidth());
settings.setLastWindowHeight((int) primaryStage.getHeight());
}
client.exit();
Platform.exit();
System.exit(0);
}
示例3: start
import javafx.stage.Stage; //導入方法依賴的package包/類
@Override
@FXThread
public void start(final Stage stage) throws Exception {
JFXApplication.instance = this;
this.stage = stage;
addWindow(stage);
try {
final ResourceManager resourceManager = ResourceManager.getInstance();
resourceManager.reload();
final InitializationManager initializationManager = InitializationManager.getInstance();
initializationManager.onBeforeCreateJavaFXContext();
final PluginManager pluginManager = PluginManager.getInstance();
pluginManager.handlePlugins(editorPlugin -> editorPlugin.register(CSSRegistry.getInstance()));
LogView.getInstance();
SvgImageLoaderFactory.install();
ImageIO.read(getClass().getResourceAsStream("/ui/icons/test/test.jpg"));
final ObservableList<Image> icons = stage.getIcons();
icons.add(new Image("/ui/icons/app/256x256.png"));
icons.add(new Image("/ui/icons/app/128x128.png"));
icons.add(new Image("/ui/icons/app/96x96.png"));
icons.add(new Image("/ui/icons/app/64x64.png"));
icons.add(new Image("/ui/icons/app/48x48.png"));
icons.add(new Image("/ui/icons/app/32x32.png"));
icons.add(new Image("/ui/icons/app/24x24.png"));
icons.add(new Image("/ui/icons/app/16x16.png"));
final EditorConfig config = EditorConfig.getInstance();
stage.initStyle(StageStyle.DECORATED);
stage.setMinHeight(600);
stage.setMinWidth(800);
stage.setWidth(config.getScreenWidth());
stage.setHeight(config.getScreenHeight());
stage.setMaximized(config.isMaximized());
stage.setTitle(Config.TITLE);
stage.show();
if (!stage.isMaximized()) stage.centerOnScreen();
stage.widthProperty().addListener((observable, oldValue, newValue) -> {
if (stage.isMaximized()) return;
config.setScreenWidth(newValue.intValue());
});
stage.heightProperty().addListener((observable, oldValue, newValue) -> {
if (stage.isMaximized()) return;
config.setScreenHeight(newValue.intValue());
});
stage.maximizedProperty().addListener((observable, oldValue, newValue) -> config.setMaximized(newValue));
buildScene();
} catch (final Throwable e) {
LOGGER.error(this, e);
throw e;
}
}