@PostConstruct
 void init() {
   if (Font.getFontNames("Hack").isEmpty()) {
     Font.loadFont(
         DartFileManager.class
             .getClassLoader()
             .getResource("css/Hack-Regular.ttf")
             .toExternalForm(),
         10);
     Font.loadFont(
         DartFileManager.class
             .getClassLoader()
             .getResource("css/Hack-Italic.ttf")
             .toExternalForm(),
         10);
     Font.loadFont(
         DartFileManager.class
             .getClassLoader()
             .getResource("css/Hack-BoldItalic.ttf")
             .toExternalForm(),
         10);
     Font.loadFont(
         DartFileManager.class.getClassLoader().getResource("css/Hack-Bold.ttf").toExternalForm(),
         10);
   }
 }
예제 #2
0
public abstract class AbstractListCell<T> extends ListCell<T> {
  /**
   * @author David
   *     <p>This class is designed to be extended to create modified ListCells. It contains info for
   *     getting resource files and fonts. Implement the makeCell method to decide how a cell should
   *     be created.
   */
  private final String DEFAULT_RESOURCE_PACKAGE = "resources/";

  private String className = this.getClass().getName();
  protected ResourceBundle myResources;
  protected ResourceBundle visualResources =
      ResourceBundle.getBundle(DEFAULT_RESOURCE_PACKAGE + "Visual");

  protected Font titleFont =
      Font.loadFont(
          getClass().getClassLoader().getResourceAsStream("Ubuntu.ttf"),
          Double.parseDouble(visualResources.getString("title")));
  protected Font headerFont =
      Font.loadFont(
          getClass().getClassLoader().getResourceAsStream("Ubuntu.ttf"),
          Double.parseDouble(visualResources.getString("header")));
  protected Font textFont =
      Font.loadFont(
          getClass().getClassLoader().getResourceAsStream("Ubuntu.ttf"),
          Double.parseDouble(visualResources.getString("text")));

  protected void findResources() {
    myResources =
        ResourceBundle.getBundle(
            DEFAULT_RESOURCE_PACKAGE + className.substring(className.lastIndexOf('.') + 1));
  }

  @Override
  public void updateItem(T item, boolean empty) {
    super.updateItem(item, empty);
    if (item != null) {
      try {
        makeCell(item);
      } catch (NullPointerException e) {
        setText(null);
        setGraphic(null);
      }
    }
  }

  protected abstract void makeCell(T item);
}
예제 #3
0
  private void setTrollMessage() {
    switch (getScoreForTrolling()) {
      case Game.BAD_SCORE:
        {
          trollMessage.setText(Messages.NOT_GOOD + currentName);
          break;
        }
      case Game.CAN_BETTER_SCORE:
        {
          trollMessage.setText(Messages.YOU_CAN_BETTER + currentName);
          break;
        }
      case Game.NOT_BAD_SCORE:
        {
          trollMessage.setText(Messages.NOT_BAD + currentName);
          break;
        }
      case Game.AWESOME_SCORE:
        {
          trollMessage.setText(Messages.AWESOME + currentName);
          break;
        }
    }

    trollMessage.setTranslateX(90);
    trollMessage.setTranslateY(190);
    trollMessage.setFill(Color.WHITE);
    trollMessage.setTextAlignment(TextAlignment.CENTER);
    trollMessage.setFont(Font.loadFont(GameFiles.SENSEI, 24));

    gameOverBox.getChildren().remove(playerName);
    gameOverBox.getChildren().add(trollMessage);
    return;
  }
예제 #4
0
 @Override
 public void start(Stage primaryStage) throws Exception {
   // Load the font
   Font.loadFont(getClass().getResource("/fonts/VarelaRound-Regular.ttf").toExternalForm(), 10);
   Parent root = FXMLLoader.load(getClass().getResource("/fxml/home.fxml"));
   primaryStage.setScene(new Scene(root, 500, 500));
   primaryStage.setResizable(false);
   primaryStage.show();
 }
예제 #5
0
 private Text createText(String s, int yPos, int size) {
   Font font =
       Font.loadFont(getClass().getClassLoader().getResourceAsStream("SECRCODE.TTF"), size);
   Text t = new Text(s);
   t.setFont(font);
   t.setLayoutX((WIDTH - t.getBoundsInLocal().getWidth()) / 2);
   t.setLayoutY(yPos);
   root.getChildren().add(t);
   return t;
 }
예제 #6
0
  /**
   * Method provides opening of game over menu. It will display player score and offer to user for
   * score saving.
   *
   * @param score - player score.
   */
  public void openGameOverMessage(Integer score) {
    setTranslateX(300);
    setTranslateY(110);
    setPrefSize(400, 340);

    gameOverMenu.setTranslateX(60);
    gameOverMenu.setTranslateY(220);
    gameOverMenu.setStyle("-fx-background-color: grey;");

    gameOverMessageBlock.setWidth(400);
    gameOverMessageBlock.setHeight(340);
    gameOverMessageBlock.setArcWidth(30);
    gameOverMessageBlock.setArcHeight(30);
    gameOverMessageBlock.setOpacity(0.7);

    gameOverMessage.setTranslateX(105);
    gameOverMessage.setTranslateY(65);
    gameOverMessage.setFill(Color.RED);
    gameOverMessage.setFont(Font.loadFont(GameFiles.SENSEI, 40));
    gameOverMessage.setText("GAME OVER");

    gameOverScore.setTranslateX(100);
    gameOverScore.setTranslateY(95);
    gameOverScore.setFill(Color.WHITE);
    gameOverScore.setTextAlignment(TextAlignment.CENTER);
    gameOverScore.setFont(Font.loadFont(GameFiles.SENSEI, 24));
    gameOverScore.setText("Your score:\n" + score.toString() + "\nEnter your name:");

    playerName.setTranslateX(79);
    playerName.setTranslateY(170);
    playerName.setEditable(true);
    playerName.setFont(Font.loadFont(GameFiles.SENSEI, 20));
    playerName.setPrefSize(240, 40);
    playerName.setStyle("-fx-background-color: grey;");

    gameOverBox
        .getChildren()
        .addAll(gameOverMessageBlock, gameOverMessage, gameOverScore, playerName, gameOverMenu);

    getChildren().add(gameOverBox);
    return;
  }
  @Override
  public void start(Stage stage) throws Exception {
    javafx.scene.text.Font.loadFont(
        FXGraphics2DDemo1.class.getResourceAsStream(
            "/org/scilab/forge/jlatexmath/fonts/base/jlm_cmmi10.ttf"),
        1);
    javafx.scene.text.Font.loadFont(
        FXGraphics2DDemo1.class.getResourceAsStream(
            "/org/scilab/forge/jlatexmath/fonts/base/jlm_cmex10.ttf"),
        1);
    javafx.scene.text.Font.loadFont(
        FXGraphics2DDemo1.class.getResourceAsStream(
            "/org/scilab/forge/jlatexmath/fonts/maths/jlm_cmsy10.ttf"),
        1);
    javafx.scene.text.Font.loadFont(
        FXGraphics2DDemo1.class.getResourceAsStream(
            "/org/scilab/forge/jlatexmath/fonts/latin/jlm_cmr10.ttf"),
        1);

    ScrollPane scrollPane = new ScrollPane();
    MyCanvas canvas = new MyCanvas(formula);
    canvas.setWidth(3000);
    canvas.setHeight(5000);

    //  canvas.widthProperty().bind(scrollPane.hvalueProperty());
    //  canvas.heightProperty().bind(scrollPane.heightProperty());

    scrollPane.setContent(canvas);
    // scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);

    Scene scene = new Scene(scrollPane, 700, 200);

    stage.setScene(scene);
    stage.setTitle("FXGraphics2DDemo3.java");

    stage.show();
  }
예제 #8
0
  /** Method provides creation of score block in game. */
  public void createPrintScoreBlock() {
    setTranslateX(40);
    setTranslateY(40);
    setPrefSize(40, 120);

    printScoreBlock.setWidth(120);
    printScoreBlock.setHeight(40);
    printScoreBlock.setArcWidth(20);
    printScoreBlock.setArcHeight(20);
    printScoreBlock.setOpacity(0.6);

    printScore.setTranslateX(40);
    printScore.setTranslateY(27);
    printScore.setTextAlignment(TextAlignment.CENTER);
    printScore.setFill(Color.WHITE);
    printScore.setFont(Font.loadFont(GameFiles.SENSEI, 24));
    printScore.setText("0");

    printScoreBox.getChildren().addAll(printScoreBlock, printScore);
    getChildren().add(printScoreBox);
    return;
  }
  @Override
  public void start(Stage primaryStage) throws Exception {
    FXMLLoader loader = new FXMLLoader();
    loader.setLocation(getClass().getResource("/GraphicPack/client.fxml"));
    Parent root = loader.load();
    primaryStage.setTitle("PubblicaComunicazione");
    primaryStage.getIcons().add(new Image("/GraphicPack/Images/favicon.png"));
    Scene s = new Scene(root, 629, 666);
    primaryStage.setScene(s);
    robo = Font.loadFont(getClass().getResourceAsStream("/GraphicPack/Fonts/Roboto-Black.ttf"), 20);
    // s.getStylesheets().add("https://fonts.googleapis.com/css?family=Roboto");
    // primaryStage.setMinWidth(625);
    clientController = loader.getController();
    clientController.tabbone.setMinWidth(625);
    clientController.setMain(this);

    // clientController.tabbone.setStyle("-fx-font-family: Roboto");
    primaryStage.show();
    System.out.println("SHOWED");
    /* clientController.clientTab.setMinHeight(400);
    clientController.clientTab.setMinWidth(400); */
    // TODO: NON VA
  }
예제 #10
0
 public static Font load(double size) {
   return Font.loadFont("file:res/monaco.ttf", size);
 }
예제 #11
0
  @SuppressWarnings("unchecked")
  public StackPane viewStock(String categoryId, String categoryName) {
    stack = new StackPane();

    GridPane grid = new GridPane();

    grid.setVgap(8);
    grid.setPadding(new Insets(30));
    final ObservableList<ItemVO> dataTable;
    // final ObservableList<ItemVO> dataTable1;
    // final ObservableList<ItemVO> dataTable2;
    ObservableList<CategoryTypeVO> typeList;

    Rectangle roundRect =
        RectangleBuilder.create()
            .x(50)
            .y(50)
            .width(Screen.getPrimary().getVisualBounds().getWidth() - 428)
            .height(Screen.getPrimary().getVisualBounds().getHeight() - 150)
            .arcWidth(30)
            .arcHeight(30)
            .build();

    roundRect.setFill(Color.DARKGRAY);
    roundRect.setOpacity(0.2);
    roundRect.setStroke(Color.TRANSPARENT);

    HBox hlabel = new HBox();
    hlabel.setMaxWidth(Screen.getPrimary().getVisualBounds().getWidth() - 170);
    hlabel.setMaxHeight(30);
    hlabel.setStyle("-fx-background-color:black;");
    hlabel.setOpacity(0.3);
    hlabel.setLayoutX(20);

    try {
      typeList = FXCollections.observableArrayList();
      typeList = UtiliesDAO.getUtiliesDAO().fetchTypes(categoryId);

      dataTable = FXCollections.observableArrayList();
      dataTable.addAll(stockDetailsService.viewStock(categoryId));

      /*dataTable1 = FXCollections.observableArrayList();
      dataTable2 = FXCollections.observableArrayList();

      for(int i=0;i<dataTable.size();i++)
      {
      	dataTable1.add(dataTable.get(i++));
      	if(i<=dataTable.size()-1)
      	{
      		dataTable2.add(dataTable.get(i));
      	}
      }*/

      final Label label = new Label(categoryName + " Stock");

      final Text text5 = new Text(25, 175, categoryName + " Stock");
      text5.setFill(Color.DARKORANGE);
      // text5.setFont(Font.font ("Edwardian Script ITC", 50));
      text5.setFont(Font.loadFont("file:resources/fonts/ITCEDSCR.TTF", 50));
      final Light.Distant light = new Light.Distant();
      light.setAzimuth(-135.0);
      final Lighting lighting = new Lighting();
      lighting.setLight(light);
      lighting.setSurfaceScale(9.0);
      text5.setEffect(lighting);

      label.setAlignment(Pos.CENTER_LEFT);
      // grid.add(label,1,0);

      final TableView<ItemVO> table1 = new TableView<ItemVO>();
      table1.setEditable(false);
      // table1.setMaxSize(roundRect.getWidth()*0.41, roundRect.getHeight()*0.519);//400,300
      table1.setMinSize(roundRect.getWidth() * 0.41, roundRect.getHeight() * 0.519); // 400,300
      table1.setMaxSize(roundRect.getWidth() - 50, roundRect.getHeight() - 200);

      table1.getSelectionModel().setCellSelectionEnabled(false);

      table1.setStyle("-fx-background-color: transparent;");

      TableColumn<ItemVO, String> itemName = new TableColumn<ItemVO, String>("Item");
      itemName.setResizable(false);
      itemName.setMaxWidth(roundRect.getWidth() * 0.5);
      itemName.setMinWidth(roundRect.getWidth() * 0.5); // 200
      itemName.setCellValueFactory(new PropertyValueFactory<ItemVO, String>("itemName"));

      TableColumn<ItemVO, Integer> quantity = new TableColumn<ItemVO, Integer>("Quantity#");
      quantity.setResizable(false);
      quantity.setMinWidth(roundRect.getWidth() * 0.107); // 200

      /*quantity.setCellValueFactory(
      new PropertyValueFactory<ItemVO, Integer>("quantity"));*/

      for (final CategoryTypeVO type : typeList) {
        TableColumn<ItemVO, Integer> col = new TableColumn<ItemVO, Integer>(type.getTypeName());
        col.setMinWidth(roundRect.getWidth() * 0.107); // 100
        col.setResizable(false);

        col.setCellValueFactory(
            new Callback<CellDataFeatures<ItemVO, Integer>, ObservableValue<Integer>>() {
              @Override
              public ObservableValue<Integer> call(CellDataFeatures<ItemVO, Integer> item) {
                ItemVO itemVO = item.getValue();
                if (itemVO == null) {
                  return null;
                  // or perhaps
                  // return new ReadOnlyObjectWrapper<Integer>(null);
                } else {
                  ObservableMap<String, ItemTypeVO> itemTypesMap =
                      FXCollections.observableHashMap();
                  itemTypesMap = item.getValue().getListType();

                  return new ReadOnlyObjectWrapper<Integer>(
                      itemTypesMap.get(type.getTypeId()).getQuantity());
                }
              }
            });
        col.setCellFactory(
            new Callback<TableColumn<ItemVO, Integer>, TableCell<ItemVO, Integer>>() {

              @Override
              public TableCell<ItemVO, Integer> call(TableColumn<ItemVO, Integer> paramP) {
                // TODO Auto-generated method stub
                return new TableCell<ItemVO, Integer>() {
                  @Override
                  public void updateItem(Integer item, boolean empty) {
                    super.updateItem(item, empty);
                    if (!isEmpty()) {
                      setText(item.toString());
                      if (item <= 5) {
                        this.getStyleClass().add("celllow");
                        setTextFill(Color.RED);
                      }
                    }
                  }
                };
              }
            });
        quantity.getColumns().add(col);
      }

      if (quantity.getColumns().size() >= 5 && quantity.getColumns().size() <= 7) {
        itemName.setMinWidth(itemName.getWidth() - (quantity.getColumns().size() - 4) * 100);
      }
      if (quantity.getColumns().size() > 7) {
        itemName.setMinWidth(itemName.getWidth() - ((7 - 4) * 100));
      }

      table1.setItems(dataTable);
      final TableColumn[] columns1 = {itemName, quantity};
      table1.getColumns().addAll(columns1);
      table1
          .getColumns()
          .addListener(
              new ListChangeListener() {
                public boolean suspended;

                @Override
                public void onChanged(Change change) {
                  change.next();
                  if (change.wasReplaced() && !suspended) {
                    this.suspended = true;
                    table1.getColumns().setAll(columns1);
                    this.suspended = false;
                  }
                }
              });

      /*//final TableView<ItemVO> table2 = new TableView<ItemVO>();
      table2.setEditable(false);

      table2.setMaxSize(roundRect.getWidth()*0.41, roundRect.getHeight()*0.519);
      table2.setMinSize(roundRect.getWidth()*0.35, roundRect.getHeight()*0.519);//400,300
      table2.setStyle("-fx-background-color: transparent;");

      TableColumn<ItemVO,String> itemName2 = new TableColumn<ItemVO,String> ("Item");
      itemName2.setMinWidth(roundRect.getWidth()*0.3);//200

      itemName2.setCellValueFactory(
      		new PropertyValueFactory<ItemVO, String>("itemName"));

      TableColumn<ItemVO, Integer>  quantity2 = new TableColumn<ItemVO, Integer> ("Quantity#");
      quantity2.setMinWidth(roundRect.getWidth()*0.107);//200
      quantity.setCellValueFactory(
      		new PropertyValueFactory<ItemVO, Integer>("quantity"));



      for (final CategoryTypeVO type : typeList)
      {
      	  TableColumn<ItemVO, Integer> col2 = new TableColumn<ItemVO, Integer>(type.getTypeName());
      	  col2.setMinWidth(roundRect.getWidth()*0.107);//100
      	  col2.setResizable(false);

      	  col2.setCellValueFactory(new Callback<CellDataFeatures<ItemVO,Integer>, ObservableValue<Integer>>() {
      	    @Override
      	    public ObservableValue<Integer> call(CellDataFeatures<ItemVO,Integer> item)
      	    {
      	    	ItemVO itemVO = item.getValue();
      	    	if (itemVO == null)
      	    	{
      	    	  return null ;
      	    	// or perhaps
      	    	// return new ReadOnlyObjectWrapper<Integer>(null);
      	    	}
      	    	else
      	    	{
      		    	ObservableMap<String,ItemTypeVO> itemTypesMap = FXCollections.observableHashMap();
      		    	itemTypesMap = item.getValue().getListType();

      		    	return new ReadOnlyObjectWrapper<Integer>(itemTypesMap.get(type.getTypeId()).getQuantity());

      	    	}

      	    }

      	  });
      	 col2.setCellFactory(new Callback<TableColumn<ItemVO,Integer>, TableCell<ItemVO,Integer>>() {

      		@Override
      		public TableCell<ItemVO, Integer> call(TableColumn<ItemVO, Integer> paramP) {
      			// TODO Auto-generated method stub
      			return new TableCell<ItemVO, Integer>(){
      				@Override
      				public void updateItem(Integer item, boolean empty)
      				{
      					super.updateItem(item, empty);
      					if(item!=null)
      					{
      						setText(item.toString());
      						if(item<=5)
      						{
      							this.getStyleClass().add("celllow");
      							setTextFill(Color.RED);
      						}
      					}

      				}
      			};

      		}
      	});
      	  quantity2.getColumns().add(col2);
      	}


      table2.setItems(dataTable2);
      final TableColumn[] columns2 = {itemName2, quantity2};
      table2.getColumns().addAll(columns2);
      table2.getColumns().addListener(new ListChangeListener() {
            public boolean suspended;

            @Override
            public void onChanged(Change change) {
                change.next();
                if (change.wasReplaced() && !suspended) {
                    this.suspended = true;
                    table2.getColumns().setAll(columns2);
                    this.suspended = false;
                }
            }
        });*/

      Rectangle qtyRect = RectangleBuilder.create().x(50).y(50).width(10).height(10).build();

      qtyRect.setFill(Color.rgb(240, 128, 128));

      grid.add(table1, 0, 12);
      // grid.add(table2,1,12);
      grid.setAlignment(Pos.TOP_CENTER);

      Text man_text = new Text(CommonConstants.STAR_MSG);
      man_text.setFill(Color.DARKKHAKI);
      man_text.setFont(Font.font("Arial", 12));

      Text msg_qty = new Text(CommonConstants.QTY_MSG1);
      msg_qty.setFill(Color.DARKKHAKI);
      msg_qty.setFont(Font.font("Arial", 12));

      Text msg_qtyLow = new Text(CommonConstants.QTY_LOW);
      msg_qtyLow.setFill(Color.DARKKHAKI);
      msg_qtyLow.setFont(Font.font("Arial", 12));

      StackPane.setMargin(grid, new Insets(10, 0, 0, 0));

      StackPane.setMargin(qtyRect, new Insets(197, 850, 100, 0));
      StackPane.setAlignment(qtyRect, Pos.BASELINE_CENTER);
      StackPane.setMargin(msg_qtyLow, new Insets(197, 765, 100, 0));
      StackPane.setAlignment(msg_qtyLow, Pos.BASELINE_CENTER);

      StackPane.setAlignment(roundRect, Pos.TOP_CENTER);
      StackPane.setMargin(text5, new Insets(50, 8, 8, 8));
      StackPane.setAlignment(text5, Pos.TOP_CENTER);
      StackPane.setMargin(man_text, new Insets(197, 100, 20, 0));
      StackPane.setAlignment(man_text, Pos.BASELINE_RIGHT);
      StackPane.setMargin(msg_qty, new Insets(210, 95, 20, 0));
      StackPane.setAlignment(msg_qty, Pos.BASELINE_RIGHT);

      stack.getChildren().addAll(text5, roundRect, grid, man_text, msg_qty, qtyRect, msg_qtyLow);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return stack;
  }
예제 #12
0
public class Asteroids extends Application {
  public static final int WALL_WIDTH = 170;
  public static final Font SPACE_FONT =
      Font.loadFont(Util.getResource("SpaceFont.ttf").toString(), 36);

  public static int WIDTH;
  public static int HEIGHT;
  public static int FRAME;
  public static int CANVAS_WIDTH;
  public static int CANVAS_HEIGHT;

  public static WindowControl control;
  public static Stage window;
  public static Canvas cvs;
  public static MediaPlayer music;
  public static MediaPlayer breakSound;
  public static MediaPlayer explosionSound;
  public static Game render;
  public static int score;

  public static Spaceship spaceship = new Spaceship();
  public static HashSet<KeyCode> keys = new HashSet<KeyCode>();
  public static int shipFrame = 0;
  public static long frame = 0;
  public static boolean gameRunning = true;
  public static boolean gameActive = false;

  public static void main(String[] args) {
    WIDTH = 1100;
    HEIGHT = 680;

    launch(args);
  }

  public static void updateDimensions(Boolean updateCanvas) {
    CANVAS_WIDTH = WIDTH - (WALL_WIDTH * 2);
    CANVAS_HEIGHT = HEIGHT;

    if (updateCanvas) {
      Canvas cvs = control.getCanvas(1);
      cvs.setWidth(Asteroids.WIDTH);
      cvs.setHeight(Asteroids.HEIGHT);

      Image wall = Util.getImage("side_wall.png");

      Canvas leftWall = control.getLeftWall();
      Canvas rightWall = control.getRightWall();

      GraphicsContext lw = leftWall.getGraphicsContext2D();
      GraphicsContext rw = rightWall.getGraphicsContext2D();

      leftWall.setHeight(Asteroids.HEIGHT);
      rightWall.setHeight(Asteroids.HEIGHT);

      double wall_height =
          (((Asteroids.WALL_WIDTH * 100) / wall.getWidth()) / 100) * wall.getHeight();

      for (int h = 0; h < Asteroids.HEIGHT; h += wall_height) {
        lw.drawImage(wall, 0, wall_height * h, Asteroids.WALL_WIDTH, wall_height);
        Util.drawRotatedImage(rw, wall, 180, 0, wall_height * h, Asteroids.WALL_WIDTH, wall_height);
      }
    }
  }

  @Override
  public void start(Stage ps) throws Exception {
    window = ps;
    control = new WindowControl();

    music = new MediaPlayer(new Media(Util.getResource("music.mp3").toString()));
    breakSound = new MediaPlayer(new Media(Util.getResource("asteroid_break.mp3").toString()));
    explosionSound = new MediaPlayer(new Media(Util.getResource("explosion.mp3").toString()));

    window.setTitle("Asteroids: Space adventure - By macjuul");

    Image icon_128 = Util.getImage("icon_128.png");
    Image icon_32 = Util.getImage("icon_32.png");
    Image icon_16 = Util.getImage("icon_16.png");

    window.getIcons().addAll(icon_128, icon_32, icon_16);

    window.setMinWidth(WIDTH);
    window.setMinHeight(HEIGHT);
    window.setWidth(WIDTH);
    window.setHeight(HEIGHT);

    Parent layout = (Parent) control.loadLayout();

    Scene s = new Scene(layout);

    // Set our stylesheet
    s.getStylesheets().add(Util.getResource("window/style.css").toExternalForm());

    s.setCursor(Cursor.CROSSHAIR);

    window.setScene(s);

    window
        .widthProperty()
        .addListener(
            (ObservableValue<? extends Number> ov, Number oldN, Number newN) -> {
              WIDTH = newN.intValue();

              updateDimensions(true);
            });

    window
        .heightProperty()
        .addListener(
            (ObservableValue<? extends Number> ov, Number oldN, Number newN) -> {
              HEIGHT = (int) newN.intValue();

              updateDimensions(true);
            });

    // Open the window
    window.show();

    window.setOnCloseRequest(
        e -> {
          Platform.exit();
          System.exit(0);
        });
  }
}