当前位置: 首页>>代码示例>>Java>>正文


Java Stage.setMaximized方法代码示例

本文整理汇总了Java中javafx.stage.Stage.setMaximized方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.setMaximized方法的具体用法?Java Stage.setMaximized怎么用?Java Stage.setMaximized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.stage.Stage的用法示例。


在下文中一共展示了Stage.setMaximized方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createStage

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * Creates stage by calling createScene and with almost every properties of object.
 *
 * @see GenericView#createScene()
 * @see javafx.stage.Stage
 * @return
 * @throws IOException
 */
public Stage createStage() throws IOException {
    Stage stage = new Stage();

    if (this.getTitle() != null) stage.setTitle(this.getTitle());

    stage.setScene(this.createScene());

    stage.setResizable(this.isResizable());
    stage.setMaximized(this.isMaximized());
    stage.setFullScreen(this.isFullscreen());
    stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);

    if (!this.isDecorated()) stage.initStyle(StageStyle.UNDECORATED);
    if (this.isModal()) stage.initModality(Modality.APPLICATION_MODAL);

    if (this.getIcon() != null)
        stage.getIcons().add(this.getIcon());

    if (this.getIcon() == null && GenericView.getGlobalIcon() != null)
        stage.getIcons().add(GenericView.getGlobalIcon());

    return stage;
}
 
开发者ID:erayerdin,项目名称:primitivefxmvc,代码行数:32,代码来源:GenericView.java

示例2: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("menuSample.fxml"));
    primaryStage.setTitle("Hello World");

    Screen screen = Screen.getPrimary();
    Rectangle2D bounds = screen.getVisualBounds();
    primaryStage.setX(bounds.getMinX());
    primaryStage.setY(bounds.getMinY());
    primaryStage.setWidth(bounds.getWidth());
    primaryStage.setHeight(bounds.getHeight());
    primaryStage.setMaximized(true);
    Scene menuScene = new Scene(root, 1080, 720);
    //primaryStage.setFullScreen(true);
    primaryStage.setScene(menuScene);


    //primaryStage.setFullScreen(true);
    primaryStage.show();
}
 
开发者ID:gokcan,项目名称:Mafia-TCoS-CS319-Group2A,代码行数:21,代码来源:Main.java

示例3: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
	logger.info(getRuntimeDetails());

	Point mousePosition = MouseInfo.getPointerInfo().getLocation();
	stage.setX(mousePosition.getX());
	stage.setY(mousePosition.getY());

	try {
		dataStorage = new DataStorage();
	} catch (IOException ex) {
		logger.error("Could not initialize working directory", ex);

		ExceptionDialog exceptionDialog = new ExceptionDialog(ex);
		exceptionDialog.setTitle("Error");
		exceptionDialog.setHeaderText("Could not initialize working directory");
		exceptionDialog.show();

		return;
	}

	new MainWindow(stage);

	stage.setMaximized(true);
}
 
开发者ID:Quantencomputer,项目名称:cyoastudio,代码行数:26,代码来源:Application.java

示例4: showInDialog

import javafx.stage.Stage; //导入方法依赖的package包/类
private void showInDialog(javafx.event.ActionEvent event) {
    Stage s = new Stage(StageStyle.DECORATED);
    s.setTitle(tp.getText());
    s.initModality(Modality.APPLICATION_MODAL);
    s.setMinHeight(640);
    s.setMinHeight(480);
    //s.setFullScreen(true);
    s.setMaximized(true);
    //TableView<HybridRow> newView = new TableView<>(tableView.getItems());
    BorderPane root = new BorderPane(content);
    tp.setContent(new Label("opened externally"));
    ButtonBar bb = new ButtonBar();
    root.setTop(bb);
    s.setScene(new Scene(root));
    Button yesButton = new Button("Close");
    ButtonBar.setButtonData(yesButton, ButtonBar.ButtonData.CANCEL_CLOSE);
    bb.getButtons().addAll(yesButton);
    yesButton.setOnAction(e -> s.hide());
    s.showAndWait();
    tp.setContent(content);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:22,代码来源:TimingDiagramCollectionView.java

示例5: 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);
    }
}
 
开发者ID:Matthieu42,项目名称:Steam-trader-tools,代码行数:19,代码来源:AppController.java

示例6: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage rootStage) throws Exception {
    rootStage.setMaximized(true);
    main = this;

    FXMLLoader loader = new FXMLLoader(getClass().getResource("/resources/layouts/main.fxml"));

    Parent root = loader.load();

    Scene rootScene = new Scene(root);

    rootStage.setTitle("Parallator");

    rootController = loader.getController();

    rootStage.setScene(rootScene);

    initMenu(rootStage);

    rootStage.show();
    rootStage.setOnCloseRequest(event -> {
        if (rootController.getFile() == null || !rootController.isEdited()) return;
        Alert alert = new Alert(Alert.AlertType.WARNING);
        alert.setHeaderText("Сохранить перед выходом?");
        alert.getButtonTypes().setAll(ButtonType.YES, ButtonType.NO, ButtonType.CANCEL);
        Optional<ButtonType> result = alert.showAndWait();
        if (result.isPresent() && result.get() == ButtonType.YES) {
            rootController.save();
        }
        if (result.isPresent() && result.get() == ButtonType.CANCEL) {
            event.consume();
        }
    });

    rootScene.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
        switch (event.getCode()) {
            case DOWN:
                rootController.down();
                break;
            case UP:
                rootController.up();
                break;
        }
    });

    if (MainConfig.getMainConfig().path() != null) rootController.open(new File(MainConfig.getMainConfig().path()));
}
 
开发者ID:KursX,项目名称:Parallator,代码行数:48,代码来源:Main.java

示例7: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage mainStage) throws IOException, PrinterException {
    ScreenManager screenManager = ScreenManager.getInstance();
    screenManager.initialize(mainStage);

    Parent root = FXMLLoader.load(getClass().getResource("/fxml/HomeScreen.fxml"));
    Scene mainScene = new Scene(root);
    mainStage.setScene(mainScene);

    Image appLogo = new Image("images/Logo.png");
    mainStage.getIcons().add(appLogo);
    mainStage.setTitle("Git-Rektsort Booking Software");
    mainStage.setMaximized(true);
    mainStage.show();

    GuestService guestService = new GuestService();
    guestService.getCurrentlyCheckedInGuests();

    DatabaseTestDataLoader.initializeTestData();
}
 
开发者ID:maillouxc,项目名称:git-rekt,代码行数:21,代码来源:GitRekt.java

示例8: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(final Stage primaryStage) throws IOException, UIInitialisationException, SQLException {
    context.init();

    this.primaryStage = primaryStage;
    setInstance(this);

    final URL resource = getClass().getResource(APPLICATION_VIEW);
    fxmlLoader.setLocation(resource);
    final Parent parent = fxmlLoader.load();

    primaryStage.setTitle(TITLE);
    primaryStage.setMaximized(true);


    primaryStage.setOnCloseRequest(e -> {
        bookmarkStore.writeBookmarksToFile();
        Platform.exit();
    });

    final Scene rootScene = new Scene(parent);
    primaryStage.setScene(rootScene);

    final Image hygeneIcon = new Image(String.valueOf(getClass().getResource(APPLICATION_ICON)));
    primaryStage.getIcons().add(hygeneIcon);

    primaryStage.show();

    parseArguments();

    LOGGER.info("Launching Hygene GUI");
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:33,代码来源:Hygene.java

示例9: showPlanchesterGUI

import javafx.stage.Stage; //导入方法依赖的package包/类
private static void showPlanchesterGUI() {
    try {
        primaryStage = new Stage();
        primaryStage.setTitle("Planchester");
        //primaryStage.setResizable(false);
        primaryStage.setMaximized(true);

        primaryStage.setOnCloseRequest(t -> {
            closePlanchester();
        });

        scene = new Scene(FXMLLoader.load(PlanchesterGUI.class.getResource("PlanchesterFrame.fxml")));

        URL url = PlanchesterGUI.class.getResource("CSS/stylesheet.css");
        if (url == null) {
            throw new UnexpectedException("CSS Resource not found. Aborting.");
        }
        String css = url.toExternalForm();
        scene.getStylesheets().add(css);

        primaryStage.setScene(scene);
        primaryStage.getIcons().add(new Image("file:src/Presentation/Images/logoplanchester.png"));
        primaryStage.show();
    } catch (IOException exception) {
        exception.printStackTrace();
    }
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:28,代码来源:PlanchesterGUI.java

示例10: backPressed

import javafx.stage.Stage; //导入方法依赖的package包/类
public void backPressed(MouseEvent mouseEvent) throws IOException {
    Button button = (Button) mouseEvent.getSource();
    if ((button).getText().equals("BACK")) {
        Stage current = (Stage) button.getScene().getWindow();
        Parent root = FXMLLoader.load(getClass().getResource("menuSample.fxml"));
        current.setScene(new Scene(root, screenSize.getWidth(), screenSize.getHeight()));
        current.setMaximized(true);
        current.show();
    }
}
 
开发者ID:gokcan,项目名称:Mafia-TCoS-CS319-Group2A,代码行数:11,代码来源:SettingsController.java

示例11: buttonPressed

import javafx.stage.Stage; //导入方法依赖的package包/类
@FXML
public void buttonPressed(MouseEvent actionEvent) throws IOException {
    Button button = (Button)actionEvent.getSource();
    if ((button).getText().equals("BACK"))
    {
        Stage current = (Stage)button.getScene().getWindow();
        Parent root = FXMLLoader.load(getClass().getResource("menuSample.fxml"));
        current.setMaximized(true);
        current.setScene(new Scene(root, screenSize.getWidth(), screenSize.getHeight()));
        //current.setFullScreen(true);
        current.show();
    }
}
 
开发者ID:gokcan,项目名称:Mafia-TCoS-CS319-Group2A,代码行数:14,代码来源:CreditsController.java

示例12: loadFXMLPage

import javafx.stage.Stage; //导入方法依赖的package包/类
public BaseController loadFXMLPage(String title, FXMLPage fxmlPage, boolean cache) {
    SoftReference<? extends BaseController> parentNodeRef = cacheNodeMap.get(fxmlPage);
    if (cache && parentNodeRef != null) {
        return parentNodeRef.get();
    }
    URL skeletonResource = Thread.currentThread().getContextClassLoader().getResource(fxmlPage.getFxml());
    
    FXMLLoader loader = new FXMLLoader(skeletonResource);
   
    Parent loginNode;
    try {
        loginNode = loader.load();
        BaseController controller = loader.getController();
        dialogStage = new Stage();
        dialogStage.setTitle(title);
        dialogStage.getIcons().add(new Image("image/icon.png"));
        dialogStage.initModality(Modality.APPLICATION_MODAL);
        dialogStage.initOwner(getPrimaryStage());
        dialogStage.setScene(new Scene(loginNode));
        dialogStage.setMaximized(false);
        dialogStage.setResizable(false);
        dialogStage.show();
        controller.setDialogStage(dialogStage);
        SoftReference<BaseController> softReference = new SoftReference<>(controller);
        cacheNodeMap.put(fxmlPage, softReference);
        return controller;
    } catch (IOException e) {
        AlertUtil.showErrorAlert(e.getMessage());
    }
    return null;
}
 
开发者ID:shenzhenMirren,项目名称:vertx-generator,代码行数:32,代码来源:BaseController.java

示例13: initialize

import javafx.stage.Stage; //导入方法依赖的package包/类
public void initialize(Stage stage) {
    String maximized = propertyStore.getProperty(PropertyKey.STAGE_MAXIMIZED);
    if (maximized != null && Boolean.parseBoolean(maximized)) {
        stage.setMaximized(true);
    }
    stage.maximizedProperty().addListener((v, o, n) -> propertyStore.setProperty(PropertyKey.STAGE_MAXIMIZED, "" + n));
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:8,代码来源:StageConfigurer.java

示例14: startApp

import javafx.stage.Stage; //导入方法依赖的package包/类
private void startApp(Stage primaryStage) {
    primaryStage.setTitle("设备模拟客户端");
    primaryStage.setScene(new Scene(MainView.getInstance()));
    primaryStage.setMaximized(true);
    primaryStage.setOnCloseRequest(event -> NettyLauncher.getInstance().shutdown());
    primaryStage.show();
    MainView.getInstance().updateGroupCount(10);
}
 
开发者ID:bitkylin,项目名称:ClusterDeviceControlPlatform,代码行数:9,代码来源:MainLauncher.java

示例15: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
    HostServiceSingleton.setInstance(getHostServices()); //weigl: ???
    this.mainScene = new StvsMainScene();
    this.primaryStage = new Stage();
    Platform.setImplicitExit(true);
    primaryStage.setTitle(StvsVersion.getWindowTitle());
    primaryStage.setScene(mainScene.getScene());
    primaryStage.setMaximized(mainScene.shouldBeMaximizedProperty().get());
    primaryStage.getIcons().addAll(
            new Image(StvsApplication.class.getResourceAsStream("logo_large.png")),
            new Image(StvsApplication.class.getResourceAsStream("logo.png")));
    mainScene.shouldBeMaximizedProperty().bind(primaryStage.maximizedProperty());

    mainScene.getScene().getStylesheets().add(
            StvsApplication.class.getResource("normal.css").toExternalForm()
    );

    CSSFX.start(mainScene.getScene());

    //Debugger snippet for finding the styleclasses for the node under cursor.
    mainScene.getScene().addEventFilter(MouseEvent.MOUSE_MOVED, mouseEvent -> {
        if (mouseEvent.isAltDown() && mouseEvent.isControlDown()) {
            try {
                Node node = (Node) mouseEvent.getTarget();
                ObservableList<String> classes = node.getStyleClass();
                System.out.println("Classes of " + node.getClass().getSimpleName() + " are " + classes);
                System.out.println("Style of " + node.getClass().getSimpleName() + ": " + node.getStyle());

                System.out.println(((TitledPane) node).getAlignment());
                System.out.println(((TitledPane) node).getTextAlignment());

            } catch (ClassCastException e) {

            }
        }
    });


    if (System.getProperty("presentation", "false").equals("true")) {
        mainScene.getScene().getStylesheets().add(
                StvsApplication.class.getResource("presentation.css").toExternalForm()
        );
    }

    if (mainScene.getRootController().getRootModel().isFirstStart()) {
        new WelcomeWizard(mainScene.getRootController().getRootModel().getGlobalConfig())
                .showAndWait();
    }

    primaryStage.show();
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:53,代码来源:StvsApplication.java


注:本文中的javafx.stage.Stage.setMaximized方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。