本文整理汇总了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;
}
}