本文整理汇总了Java中javafx.stage.Stage.setFullScreen方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.setFullScreen方法的具体用法?Java Stage.setFullScreen怎么用?Java Stage.setFullScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.stage.Stage
的用法示例。
在下文中一共展示了Stage.setFullScreen方法的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;
}
示例2: setUpOnStage
import javafx.stage.Stage; //导入方法依赖的package包/类
public void setUpOnStage(Stage stage) {
stage.setTitle("GazePlay");
// setting the scene again will exit fullscreen
// so we need to backup the fullscreen status, and restore it after the scene has been set
boolean fullscreen = stage.isFullScreen();
stage.setScene(scene);
stage.setFullScreen(fullscreen);
stage.setOnCloseRequest((WindowEvent we) -> stage.close());
final Configuration config = ConfigurationBuilder.createFromPropertiesResource().build();
CssUtil.setPreferredStylesheets(config, scene);
stage.show();
log.info("Finished setup stage with the game scene");
}
示例3: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
GameChooser gameManager = new GameChooser(primaryStage);
primaryStage.setScene(makeScene());
primaryStage.setFullScreenExitHint("");
primaryStage.setFullScreenExitKeyCombination(null);
primaryStage.show();
primaryStage.setFullScreen(true);
Animation myAnimation = makeAnimation(myActor, 100, 200, 100);
// start animation
myAnimation.play();
Animation myAnimation1 = makeAnimation(myActor1, 100, 200, 100);
// start animation
myAnimation1.play();
Animation myAnimation2 = makeAnimation(myActor2,100,240,140);
// start animation
myAnimation2.play();
}
示例4: showInDialog
import javafx.stage.Stage; //导入方法依赖的package包/类
private void showInDialog(javafx.event.ActionEvent event) {
//("SpecificationTableView.SpecificationTableView");
Stage s = new Stage(StageStyle.DECORATED);
s.setTitle(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());
setContent(new Label("opened externally"));
BorderPane root = new BorderPane(tableView);
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();
setContent(tableView);
}
示例5: start
import javafx.stage.Stage; //导入方法依赖的package包/类
/**
*
* @param primaryStage
*/
@Override
public void start(Stage primaryStage) {
gameManager = new GameManager();
gameBounds = gameManager.getLayoutBounds();
StackPane root = new StackPane(gameManager);
root.getStyleClass().addAll("game-root");
ChangeListener<Number> resize = (ov, v, v1) -> {
double scale = Math.min((root.getWidth() - MARGIN) / gameBounds.getWidth(), (root.getHeight() - MARGIN) / gameBounds.getHeight());
gameManager.setScale(scale);
gameManager.setLayoutX((root.getWidth() - gameBounds.getWidth()) / 2d);
gameManager.setLayoutY((root.getHeight() - gameBounds.getHeight()) / 2d);
};
root.widthProperty().addListener(resize);
root.heightProperty().addListener(resize);
Scene scene = new Scene(root);
scene.getStylesheets().add(CSS);
addKeyHandler(scene);
addSwipeHandlers(scene);
if (isARMDevice()) {
primaryStage.setFullScreen(true);
primaryStage.setFullScreenExitHint("");
}
if (Platform.isSupported(ConditionalFeature.INPUT_TOUCH)) {
scene.setCursor(Cursor.NONE);
}
Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
double factor = Math.min(visualBounds.getWidth() / (gameBounds.getWidth() + MARGIN),
visualBounds.getHeight() / (gameBounds.getHeight() + MARGIN));
primaryStage.setTitle("2048FX");
primaryStage.setScene(scene);
primaryStage.setMinWidth(gameBounds.getWidth() / 2d);
primaryStage.setMinHeight(gameBounds.getHeight() / 2d);
primaryStage.setWidth((gameBounds.getWidth() + MARGIN) * factor);
primaryStage.setHeight((gameBounds.getHeight() + MARGIN) * factor);
primaryStage.show();
}
示例6: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Test");
primaryStage.setFullScreen(true);
Group root = new Group();
Scene scene = new Scene(root, 1200, 700, Color.BLACK);
Circle circle = new Circle(200, 300, 100, Color.YELLOW);
root.getChildren().add(circle);
GazeUtils.addEventFilter(circle);
primaryStage.setScene(scene);
primaryStage.show();
}
示例7: handlePortrait
import javafx.stage.Stage; //导入方法依赖的package包/类
private void handlePortrait(ActionEvent event) {
final Stage infoStage = new Stage();
GridPane infoPane = new GridPane();
infoPane.setPadding(new Insets(20, 20, 20, 20));
infoPane.setHgap(25);
infoPane.setVgap(25);
infoPane.setAlignment(Pos.CENTER);
ImageView portait = new ImageView(new Image(Main.class.getResourceAsStream("Resources/wdhpor.png")));
portait.setFitWidth(200);
portait.setFitHeight(200);
portait.setPreserveRatio(true);
portait.setPickOnBounds(true);
infoPane.add(portait, 0, 0, 3, 3);
Label nickNameLabel = new Label("昵称");
Label nickNameInfo = new Label("xx");
infoPane.add(nickNameLabel, 0, 3);
infoPane.add(nickNameInfo, 1, 3);
Label IDlabel = new Label("ID");
Label IDinfo = new Label("xx");
infoPane.add(IDlabel, 0, 4);
infoPane.add(IDinfo, 1, 4);
Label accumulateTimeLabel = new Label("积累算时");
Label accumuateTimeInfo = new Label("xx");
infoPane.add(accumulateTimeLabel, 0, 5);
infoPane.add(accumuateTimeInfo, 1, 5);
Scene scene = new Scene(infoPane,Main.screenWidth /5 , Main.screenHeight/2);
scene.getStylesheets().add(Main.class.getResource("base.css").toExternalForm());
infoStage.setScene(scene);
infoStage.setFullScreen(false);
infoStage.setResizable(false);
infoStage.show();
}
示例8: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception{
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("sample.fxml"));
Parent root = fxmlLoader.load();
Screen screen = Screen.getPrimary ();
// 界面初始化
Controller controller = fxmlLoader.getController();
controller.init(primaryStage);
Rectangle2D bounds = screen.getVisualBounds ();
double minX = bounds.getMinX ();
double minY = bounds.getMinY ();
double maxX = bounds.getMaxX ();
double maxY = bounds.getMaxY ();
screenWidth = maxX - minX;
screenHeight = maxY - minY;
Scene scene = new Scene(root, (maxX - minX) * 0.6, (maxY - minY) * 0.6);
primaryStage.setTitle ("Higher Cloud Compute Platform");
primaryStage.setScene (scene);
primaryStage.setFullScreen(true);
primaryStage.show ();
}
示例9: start
import javafx.stage.Stage; //导入方法依赖的package包/类
public void start(Stage primaryStage) {
primaryStage.setTitle(DEVELOPER_GUI);
primaryStage.show();
TowerAuthor developerView = new TowerAuthor();
primaryStage.setScene(developerView.getScene());
primaryStage.setFullScreen(true);
}
示例10: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
this.primaryStage = primaryStage;
Screen screen = Screen.getPrimary();
Rectangle2D screenBounds = screen.getBounds();
primaryStage.setWidth(screenBounds.getWidth() * 0.95);
primaryStage.setHeight(screenBounds.getHeight() * 0.90);
primaryStage.setMaximized(false);
homeMenuScreen = HomeMenuScreen.newInstance(this, ConfigurationBuilder.createFromPropertiesResource().build());
homeMenuScreen.setUpOnStage(primaryStage);
primaryStage.centerOnScreen();
primaryStage.setFullScreen(true);
}
示例11: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Pictogrammes");
primaryStage.setFullScreen(true);
Group root = new Group();
Scene scene = new Scene(root, 1200, 700, Color.BLACK);
Pictos pictos = new Pictos(scene);
root.getChildren().add(pictos);
primaryStage.setOnCloseRequest((WindowEvent we) -> System.exit(0));
primaryStage.setScene(scene);
primaryStage.show();
SecondScreen.launch();
}
示例12: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Bubbles");
primaryStage.setFullScreen(true);
Group root = new Group();
Scene scene = new Scene(root, 1200, 700, Color.BLACK);
primaryStage.setOnCloseRequest((WindowEvent we)-> System.exit(0));
primaryStage.setScene(scene);
Bubble bubble = new Bubble(scene);
root.getChildren().add(bubble);
primaryStage.show();
SecondScreen secondScreen = SecondScreen.launch();
}
示例13: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("WindMill");
primaryStage.setFullScreen(true);
Group root = new Group();
Scene scene = new Scene(root, Screen.getScreens().get(0).getWidth(), Screen.getScreens().get(0).getHeight(),
Color.BLACK);
Choices pictos = new Choices(scene);
root.getChildren().add(pictos);
primaryStage.setOnCloseRequest((WindowEvent we) -> System.exit(0));
primaryStage.setScene(scene);
primaryStage.show();
SecondScreen.launch();
}
示例14: showGantt
import javafx.stage.Stage; //导入方法依赖的package包/类
/**
* Displays a GanttishDiagram window for the given Assignment.
*
* @param assignment Assignment for which to generate the GanttishDiagram.
*/
public void showGantt(Assignment assignment)
{
Stage stage = new Stage();
// Layout:
VBox layout = new VBox();
layout.setSpacing(10);
layout.setPadding(new Insets(15));
layout.getStylesheets().add("/Content/stylesheet.css");
// =================
// Nav bar:
HBox nav = new HBox();
nav.setSpacing(15.0);
// =================
// Title:
Label title = new Label("Ganttish Diagram");
title.getStyleClass().add("title");
HBox x = new HBox();
HBox.setHgrow(x, Priority.ALWAYS);
// =================
// Buttons:
Button save = new Button("Save");
save.setOnAction(e -> {
String path = this.saveFileDialog(stage);
GanttishDiagram.createGanttishDiagram(MainController.getSPC().getPlanner(), assignment, path);
});
Button close = new Button("Close");
close.setOnAction(e -> ((Stage) close.getScene().getWindow()).close());
// =================
nav.getChildren().addAll(title, x, save, close);
// Content:
BufferedImage gantt = GanttishDiagram.createGanttishDiagram(MainController.getSPC().getPlanner(), assignment);
Image image = SwingFXUtils.toFXImage(gantt, null);
Pane content = new Pane();
VBox.setVgrow(content, Priority.ALWAYS);
content.setBackground(new Background(
new BackgroundImage(image, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT,
new BackgroundSize(BackgroundSize.AUTO, BackgroundSize.AUTO, false, false, true, false))));
// =================
layout.getChildren().addAll(nav, content);
// Set the scene:
stage.setScene(new Scene(layout, 1300, 800, true, SceneAntialiasing.BALANCED));
stage.setTitle("Ganttish Diagram");
stage.resizableProperty().setValue(true);
stage.getIcons().add(new Image("file:icon.png"));
stage.setFullScreen(true);
stage.showAndWait();
// =================
}
示例15: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
Parent root = null;
try {
root = FXMLLoader.load(getClass().getResource("/fxml/MainView.fxml"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
pane.getChildren().add(root);
Scene scene = new Scene(pane);
stage.setTitle("Sudo Timer");
stage.setScene(scene);
stage.setResizable(false);
stage.setFullScreen(false);
stage.show();
}