コード例 #1
0
  /** @param fp */
  private void addItems(FlowPane fp) {

    for (CafeItemsInfo cafeItem : CafePricingPersistence.cafeItems) {
      FlowPane horizontalPane = new FlowPane(Orientation.HORIZONTAL);
      horizontalPane.setHgap(30);
      horizontalPane.setAlignment(Pos.CENTER);
      final CafeItemsInfo c = (CafeItemsInfo) cafeItem;
      // Items FLD -----------------------------------------------------------
      TextField itemName = new TextField();
      itemName.setMaxWidth(70);
      itemName.setText(c.itemName);
      itemName.setEditable(false);
      itemName.setPromptText("Item Name");
      horizontalPane.getChildren().add(itemName);
      TextField itemPrice = new TextField();
      itemPrice.setMaxWidth(70);
      itemPrice.setText(c.itemPrice + " Rs");
      itemPrice.setEditable(false);
      itemPrice.setPromptText("Price PKR");
      horizontalPane.getChildren().add(itemPrice);
      Button saveButt = new Button("Delete");
      horizontalPane.getChildren().add(saveButt);
      saveButt.setOnAction(
          new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent t) {
              CafePricingPersistence.deleteCafeItems(c.itemName);
              primaryStage.close();
              new CafePricingDialog();
            }
          });
      fp.getChildren().add(horizontalPane);
    }
  }
コード例 #2
0
  private VBox createStatePane() {
    VBox stateBox = new VBox();
    stateBox.setSpacing(10);
    stateBox.setPadding(new Insets(10, 20, 0, 0));
    stateBox.setAlignment(Pos.TOP_CENTER);
    Label levelLabel = new Label("level");
    Label lineLabel = new Label("line");
    Label scoreLabel = new Label("score");
    levelField.setMaxWidth(120);
    lineField.setMaxWidth(120);
    scoreField.setMaxWidth(120);
    levelField.setEditable(false);
    lineField.setEditable(false);
    scoreField.setEditable(false);

    levelField.setText(level + "");
    lineField.setText(numberOfLines + "");
    scoreField.setText(score + "");

    VBox.setMargin(nextGrid, new Insets(0, 0, 80, 0));
    stateBox
        .getChildren()
        .addAll(nextGrid, levelLabel, levelField, lineLabel, lineField, scoreLabel, scoreField);
    return stateBox;
  }
コード例 #3
0
  /** @param fp */
  private void addItems(FlowPane fp) {

    for (StaffInfo staff : StaffWagesPersistence.wagesItems) {
      FlowPane horizontalPane = new FlowPane(Orientation.HORIZONTAL);
      horizontalPane.setHgap(30);
      horizontalPane.setAlignment(Pos.CENTER);
      final StaffInfo s = (StaffInfo) staff;
      // Items FLD -----------------------------------------------------------
      TextField itemName = new TextField();
      itemName.setMaxWidth(70);
      itemName.setText(s.staffName);
      itemName.setEditable(false);
      itemName.setPromptText("Item Name");
      horizontalPane.getChildren().add(itemName);
      TextField itemPrice = new TextField();
      itemPrice.setMaxWidth(70);
      itemPrice.setText(s.staffWages);
      itemPrice.setEditable(false);
      itemPrice.setPromptText("Price PKR");
      horizontalPane.getChildren().add(itemPrice);
      Button saveButt = new Button("Delete");
      horizontalPane.getChildren().add(saveButt);
      saveButt.setOnAction(
          new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent t) {
              StaffWagesPersistence.deleteStaff(s.staffName);
              primaryStage.close();
              new StaffWagesDialog();
            }
          });
      fp.getChildren().add(horizontalPane);
    }
  }
コード例 #4
0
 private void listen() {
   this.prefHeightProperty()
       .addListener(
           (bservable, oldValue, newValue) -> {
             textField.setPrefHeight(newValue.doubleValue());
           });
   this.prefWidthProperty()
       .addListener(
           (bservable, oldValue, newValue) -> {
             textField.setPrefWidth(newValue.doubleValue());
           });
   this.minHeightProperty()
       .addListener(
           (bservable, oldValue, newValue) -> {
             textField.setMinHeight(newValue.doubleValue());
           });
   this.maxHeightProperty()
       .addListener(
           (bservable, oldValue, newValue) -> {
             textField.setMaxHeight(newValue.doubleValue());
           });
   this.minWidthProperty()
       .addListener(
           (bservable, oldValue, newValue) -> {
             textField.setMinWidth(newValue.doubleValue());
           });
   this.maxWidthProperty()
       .addListener(
           (bservable, oldValue, newValue) -> {
             textField.setMaxWidth(newValue.doubleValue());
           });
 }
コード例 #5
0
 private TextField buildField(String text, double maxWidth) {
   TextField tf = new TextField(text);
   tf.setEditable(false);
   tf.setMinWidth(maxWidth);
   tf.setMaxWidth(maxWidth);
   return tf;
 }
コード例 #6
0
 private TextField joinButtonToTextField() {
   buttonContainer.getChildren().remove(joinButton);
   TextField ipTextField = new TextField();
   ipTextField.setPrefSize(200, 35);
   ipTextField.setMaxWidth(200);
   ipTextField.setAlignment(Pos.CENTER);
   buttonContainer.getChildren().add(ipTextField);
   ipTextField.requestFocus();
   return ipTextField;
 }
コード例 #7
0
 private TextField nameButtonToTextField() {
   buttonContainer.getChildren().remove(nameButton);
   TextField editNameTextField = new TextField();
   editNameTextField.setPrefSize(200, 20);
   editNameTextField.setMaxWidth(200);
   editNameTextField.setAlignment(Pos.TOP_CENTER);
   buttonContainer.getChildren().add(0, editNameTextField);
   editNameTextField.requestFocus();
   return editNameTextField;
 }
コード例 #8
0
  // MEETODID:
  public static void leftVisuaalid() {
    leftVbox = new VBox(); // l2heb borderPane'i vasakule
    leftVbox.setSpacing(5);
    leftVbox.setPadding(new Insets(15, 0, 0, 0)); // top, right, bottom, left
    leftVbox.setPrefWidth(180);

    kysimus = new Label("MIDA SOOVID SORTEERIDA?");
    kasutajaInput = new TextField(); // kasutaja sisestab prygi, mida soovib sorteerida
    kasutajaInput.setMaxWidth(140);
    sorteeriNupp = new Button("Sorteeri");
    sorteeriNupp.setStyle("-fx-font: 12 helvetica");

    leftVbox.getChildren().addAll(kysimus, kasutajaInput, sorteeriNupp);
    nupuvajutus(sorteeriNupp, kasutajaInput);
    Java_fx.border.setLeft(leftVbox);
  }
コード例 #9
0
  public void start(Stage primaryStage) {

    GridPane pane = new GridPane();
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        TextField text = new TextField(Integer.toString((int) (Math.random() * 2)));
        text.setMinWidth(WIDTH / 10.0);
        text.setMaxWidth(WIDTH / 10.0);
        text.setMinHeight(HEIGHT / 10.0);
        text.setMaxHeight(HEIGHT / 10.0);
        pane.add(text, j, i);
      }
    }
    Scene scene = new Scene(pane, WIDTH, HEIGHT);
    primaryStage.setScene(scene);
    primaryStage.setMinWidth(WIDTH);
    primaryStage.setMinHeight(HEIGHT);
    primaryStage.setTitle("10 by 10 matrix");
    primaryStage.show();
  }
コード例 #10
0
ファイル: Reading.java プロジェクト: Locitao/jsf32week14
  @Override
  public void start(Stage primaryStage) {
    // Create four buttons, for each of the read/writing ways.
    Button btnTextNoBuffer = new Button();
    btnTextNoBuffer.setText("Save and load to text file, no buffer.");
    Button btnTextWithBuffer = new Button();
    btnTextWithBuffer.setText("Save and load to text file, with buffer.");
    Button btnBinaryNoBuffer = new Button();
    btnBinaryNoBuffer.setText("Save and load to Mapped file.");
    Button btnBinaryWithBuffer = new Button();
    btnBinaryWithBuffer.setText("Save and load to binary file, with buffer.");

    // Textfield to enter the number of edges + label
    TextField nrOfEdges = new TextField();
    Label lbl = new Label();
    lbl.setText("Enter your desired level.");

    // Label to present the read/write time.
    Label speed = new Label();
    speed.setText("The write speed will be shown here.");
    // New canvas
    kochPanel = new Canvas(kpWidth, kpHeight);
    kochPanel.setTranslateX(100);

    // position the elements
    btnTextNoBuffer.setTranslateY(-80);
    btnTextWithBuffer.setTranslateY(-40);
    btnBinaryWithBuffer.setTranslateY(40);
    btnTextNoBuffer.setTranslateX(-240);
    btnTextWithBuffer.setTranslateX(-240);
    btnBinaryNoBuffer.setTranslateX(-240);
    btnBinaryWithBuffer.setTranslateX(-240);
    nrOfEdges.setTranslateY(-220);
    nrOfEdges.setTranslateX(-310);
    nrOfEdges.setMaxWidth(50);
    lbl.setTranslateX(-240);
    lbl.setTranslateY(-200);
    speed.setTranslateY(-240);

    StackPane root = new StackPane();
    // root.getChildren().add(btnTextNoBuffer);
    // root.getChildren().add(btnTextWithBuffer);
    root.getChildren().add(btnBinaryNoBuffer);
    // root.getChildren().add(btnBinaryWithBuffer);
    // root.getChildren().add(nrOfEdges);
    // root.getChildren().add(lbl);
    root.getChildren().add(kochPanel);
    root.getChildren().add(speed);

    Scene scene = new Scene(root, 700, 500);

    primaryStage.setTitle("Edges and stuff");
    primaryStage.setScene(scene);
    primaryStage.show();

    // Event handlers for buttons
    //        btnTextNoBuffer.setOnMouseClicked(event -> {
    //            int i = Integer.parseInt(nrOfEdges.getText());
    //            currentLevel = i;
    //            clearKochPanel();
    //            createKochFractal(i);
    //            double x = 0;
    //            try {
    //                x = saveTextFileNoBuffer();
    //            } catch (IOException e) {
    //                e.printStackTrace();
    //            }
    //            speed.setText(String.valueOf((x / 1000000)));
    //            //drawAllEdges();
    //        });

    //        btnTextWithBuffer.setOnMouseClicked(event -> {
    //            int i = Integer.parseInt(nrOfEdges.getText());
    //            currentLevel = i;
    //            clearKochPanel();
    //            createKochFractal(i);
    //            double x = 0;
    //            try {
    //                x = saveTextFileWithBuffer();
    //            }
    //            catch (Exception ex)
    //            {
    //                ex.printStackTrace();
    //            }
    //            speed.setText(String.valueOf(x / 1000000));
    //            //drawAllEdges();
    //        });

    btnBinaryNoBuffer.setOnMouseClicked(
        event -> {
          // int i = Integer.parseInt(nrOfEdges.getText());
          // currentLevel = i;
          //            if (i > 10)
          //            {
          //                speed.setText("Too high of a level count!");
          //                throw new UnsupportedOperationException();
          //            }
          clearKochPanel();
          // createKochFractal(i);
          double x = 0;
          try {
            x = loadBinaryFile();
          } catch (Exception e) {
            e.printStackTrace();
          }
          speed.setText(String.valueOf(x / 1000000));
          // drawAllEdges();
        });

    btnBinaryWithBuffer.setOnMouseClicked(
        event -> {
          int i = Integer.parseInt(nrOfEdges.getText());
          currentLevel = i;
          clearKochPanel();
          createKochFractal(i);
          double x = 0;
          try {
            x = saveBinaryFileWithBuffer();
          } catch (Exception e) {
            e.printStackTrace();
          }
          speed.setText(String.valueOf(x / 1000000));
        });
    Thread t =
        new Thread() {
          public void run() {
            watchForNewEdges();
          }
        };
    t.start();
  }
コード例 #11
0
  /** Background edition */
  public final void backgroundEdition() {
    final ColorPicker colorPickerChartBackground =
        new ColorPicker(javafx.scene.paint.Color.web(strChartBackgroundColor));
    colorPickerChartBackground.setMaxWidth(Double.MAX_VALUE);
    final ColorPicker colorPickerGridline =
        new ColorPicker(javafx.scene.paint.Color.web(strGridlineColor));
    colorPickerGridline.setMaxWidth(Double.MAX_VALUE);
    final ColorPicker colorPickerBackground =
        new ColorPicker(javafx.scene.paint.Color.web(strBackgroundColor));
    colorPickerBackground.setMaxWidth(Double.MAX_VALUE);
    final ColorPicker colorPickerTick = new ColorPicker(javafx.scene.paint.Color.web(strTickColor));
    colorPickerTick.setMaxWidth(Double.MAX_VALUE);
    final TextField tfFontSize = new TextField();
    tfFontSize.setMaxWidth(Double.MAX_VALUE);

    GridPane grid = new GridPane();
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(0, 10, 0, 10));

    grid.add(new Label("Background color"), 0, 0);
    grid.add(colorPickerChartBackground, 1, 0);
    grid.add(new Label("Gridline color"), 0, 1);
    grid.add(colorPickerGridline, 1, 1);
    grid.add(new Label("Frame color"), 0, 2);
    grid.add(colorPickerBackground, 1, 2);
    grid.add(new Label("Tick color"), 0, 3);
    grid.add(colorPickerTick, 1, 3);
    grid.add(new Label("Font size"), 0, 4);
    grid.add(tfFontSize, 1, 4);
    tfFontSize.setText(String.valueOf(fontSize));

    new PseudoModalDialog(skeleton, grid, true) {

      @Override
      public boolean validation() {
        fontSize = Float.valueOf(tfFontSize.getText().replace(",", "."));
        strBackgroundColor = colorPickerBackground.getValue().toString().replace("0x", "#");
        for (Node le : legendFrame.getChildren()) {
          if (le instanceof LegendAxis) {
            le.setStyle("-fx-background-color:" + strBackgroundColor);
            ((LegendAxis) le).selected = false;
          }
        }
        chart.setBackgroundPaint(scene2awtColor(javafx.scene.paint.Color.web(strBackgroundColor)));
        chartPanel.setBorder(
            BorderFactory.createCompoundBorder(
                BorderFactory.createEmptyBorder(4, 4, 4, 4),
                BorderFactory.createLineBorder(
                    scene2awtColor(javafx.scene.paint.Color.web(strBackgroundColor)))));
        chartPanel.setBackground(scene2awtColor(javafx.scene.paint.Color.web(strBackgroundColor)));

        legendFrame.setStyle(
            "marco: "
                + colorPickerBackground.getValue().toString().replace("0x", "#")
                + ";-fx-background-color: marco;");

        strChartBackgroundColor =
            colorPickerChartBackground.getValue().toString().replace("0x", "#");
        plot.setBackgroundPaint(
            scene2awtColor(javafx.scene.paint.Color.web(strChartBackgroundColor)));

        for (Node le : legendFrame.getChildren()) {
          if (le instanceof LegendAxis) {
            le.setStyle("-fx-background-color:" + strBackgroundColor);
            ((LegendAxis) le).selected = false;
            for (Node nn : ((LegendAxis) le).getChildren()) {
              if (nn instanceof Label) {
                ((Label) nn)
                    .setStyle(
                        "fondo: "
                            + colorPickerChartBackground.getValue().toString().replace("0x", "#")
                            + ";-fx-background-color: fondo;-fx-text-fill: ladder(fondo, white 49%, black 50%);-fx-padding:5px;-fx-background-radius: 5;-fx-font-size: "
                            + String.valueOf(fontSize)
                            + "px");
              }
            }
          }
        }

        strGridlineColor = colorPickerGridline.getValue().toString().replace("0x", "#");
        plot.setDomainGridlinePaint(scene2awtColor(javafx.scene.paint.Color.web(strGridlineColor)));
        plot.setRangeGridlinePaint(scene2awtColor(javafx.scene.paint.Color.web(strGridlineColor)));

        strTickColor = colorPickerTick.getValue().toString().replace("0x", "#");
        abcissaAxis.setLabelPaint(scene2awtColor(javafx.scene.paint.Color.web(strTickColor)));
        abcissaAxis.setTickLabelPaint(scene2awtColor(javafx.scene.paint.Color.web(strTickColor)));
        abcissaAxis.setLabelFont(abcissaAxis.getLabelFont().deriveFont(fontSize));
        abcissaAxis.setTickLabelFont(abcissaAxis.getLabelFont().deriveFont(fontSize));

        for (NumberAxis ejeOrdenada : AxesList) {
          ejeOrdenada.setLabelPaint(scene2awtColor(javafx.scene.paint.Color.web(strTickColor)));
          ejeOrdenada.setTickLabelPaint(scene2awtColor(javafx.scene.paint.Color.web(strTickColor)));
          ejeOrdenada.setLabelFont(ejeOrdenada.getLabelFont().deriveFont(fontSize));
          ejeOrdenada.setTickLabelFont(ejeOrdenada.getLabelFont().deriveFont(fontSize));
        }
        return true;
      }
    }.show();
  }
コード例 #12
0
  @Override
  protected void updateItem(ShoppingItem item, boolean empty) {
    super.updateItem(item, empty);

    if (item != null) {
      if (empty) {
        setText(null);
        setGraphic(null);
      } else {
        setText(null);

        BorderPane pane = new BorderPane();
        pane.setPadding(new Insets(2, 5, 2, 5));
        TextField txtField = new TextField((int) item.getAmount() + "");
        txtField.setMaxWidth(40);
        txtField.setDisable(false);
        txtField.setEditable(true);
        pane.setLeft(txtField);

        Label name = new Label(item.getProduct().getName());
        BorderPane.setAlignment(name, Pos.CENTER_LEFT);
        BorderPane.setMargin(name, new Insets(0, 0, 0, 10));
        name.getStyleClass().add("produktnamn");
        pane.setCenter(name);

        GridPane priceAndDelete = new GridPane();
        double cost = item.getTotal();
        Label price = new Label(String.format("%.2f", cost) + " kr");
        price.setTextAlignment(TextAlignment.CENTER);
        GridPane.setMargin(price, new Insets(0, 10, 0, 0));
        priceAndDelete.add(price, 0, 0);

        Button delete = new Button("X");
        priceAndDelete.add(delete, 1, 0);

        pane.setRight(priceAndDelete);
        setGraphic(pane);

        delete.setOnMouseClicked(
            new EventHandler<MouseEvent>() {
              @Override
              public void handle(MouseEvent event) {
                IMatDataHandler.getInstance().getShoppingCart().removeItem(item);
                IMatDataHandler.getInstance()
                    .getShoppingCart()
                    .fireShoppingCartChanged(item, false);
              }
            });

        // Listen for TextField text changes
        txtField
            .textProperty()
            .addListener(
                new ChangeListener<String>() {
                  @Override
                  public void changed(
                      ObservableValue<? extends String> observable,
                      String oldValue,
                      String newValue) {
                    try {
                      if (!txtField.getText().equals("")) {
                        int amount = Integer.parseInt(txtField.getText());
                        if (amount < 1) {
                          txtField.setText(1 + "");
                        } else if (amount > 99) {
                          txtField.setText(99 + "");
                        }
                        item.setAmount(Integer.parseInt(txtField.getText()));
                        double cost2 = item.getTotal();
                        price.setText(String.format("%.2f", cost2) + " kr");
                        // IMatDataHandler.getInstance().getShoppingCart().fireShoppingCartChanged(item, true);
                        lastValidProductAmountString = txtField.getText();
                      }
                    } catch (NumberFormatException e) {
                      txtField.setText(lastValidProductAmountString);
                    }
                  }
                });
      }
    } else {
      if (count < 1) {
        Label noProducts = new Label("Din kundvagn är tom");
        noProducts.getStyleClass().add("produktnamn");
        setGraphic(noProducts);
        count++;
      } else {
        setText(null);
        setGraphic(null);
      }
    }
  }
コード例 #13
0
  public Veld1RijtechniekKijktechniek(
      SchermController schermCtrl, EvaController evaCtrl, LeerlingController llnCtrl) {
    evaController = evaCtrl;
    schermController = schermCtrl;
    llnController = llnCtrl;

    this.llnController.getLeerling().addView(this);

    aandachtBtn = new Button("Aandachtspunt");
    aandachtBtn.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent e) {
            aandacht();
          }
        });

    commentaarCol = new TableColumn("Commentaar");
    commentaarCol.setCellValueFactory(new PropertyValueFactory<Rijtechniek, String>("commentaar"));
    commentaarCol.setCellFactory(TextFieldTableCell.forTableColumn());
    commentaarCol.setOnEditCommit(
        new EventHandler<CellEditEvent<Rijtechniek, String>>() {
          @Override
          public void handle(CellEditEvent<Rijtechniek, String> t) {
            ((Rijtechniek) t.getTableView().getItems().get(t.getTablePosition().getRow()))
                .setCommentaar(t.getNewValue());
          }
        });

    table.setItems(data);
    table.getColumns().addAll(commentaarCol);

    commentaarFld = new TextField();
    commentaarFld.setPromptText("Commentaar");

    addButton = new Button("Voeg toe");
    addButton.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent e) {
            resetAandachtBtn();
            if (!"".equals(commentaarFld.getText())) {
              data.add(new Rijtechniek(commentaarFld.getText()));
              commentaarFld.clear();
            }
          }
        });
    table.setItems(data);
    table.setOnMouseClicked(
        new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent e) {
            resetAandachtBtn();
          }
        });
    table.setEditable(true);

    vBox2.getChildren().addAll(table, commentaarFld);
    exit = new Button("Ga terug");

    exit.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent e) {
            evaController.saveListDataRijtechniek("Stuurtechniek", data);
            Veld1RijtechniekKijktechniek.this.schermController.setScherm(MainApp.RIJTECHNIEK_ID);
            resetAandachtBtn();
          }
        });
    delBtn = new Button("Verwijder");
    delBtn.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent e) {
            resetAandachtBtn();

            table.getItems().remove(table.getSelectionModel().getSelectedItem());
          }
        });
    delBtn.setMinHeight(30);
    delBtn.setMaxHeight(30);
    delBtn.setMinWidth(125);
    delBtn.setMaxWidth(125);
    delBtn.setAlignment(Pos.CENTER);
    delBtn.setTranslateX(-47);
    delBtn.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white");
    table.getStylesheets().add("resource/tableView.css");
    commentaarFld.setStyle("-fx-background-color:#789EBF; -fx-text-fill:white");
    commentaarCol.setMaxWidth(496);
    commentaarCol.setMinWidth(496);
    hBox1.getChildren().addAll(titelAfb, titel);
    hBox1.setMinHeight(50);
    hBox1.setMaxHeight(50);
    hBox1.setMinWidth(600);
    hBox1.setMaxWidth(600);
    hBox1.setSpacing(15);
    hBox1.setAlignment(Pos.CENTER);
    titelAfb.setFitHeight(50);
    titelAfb.setFitWidth(50);
    titel.setStyle("-fx-font: 40px Tahoma; -fx-text-fill:white");

    table.setMinWidth(500);
    table.setMaxWidth(500);
    table.setMinHeight(400);
    table.setMaxHeight(400);
    addButton.setMinHeight(30);
    addButton.setMaxHeight(30);
    addButton.setMinWidth(150);
    addButton.setMaxWidth(150);
    addButton.setAlignment(Pos.CENTER);
    aandachtBtn.setMinHeight(30);
    aandachtBtn.setMaxHeight(30);
    aandachtBtn.setMinWidth(150);
    aandachtBtn.setMaxWidth(150);
    aandachtBtn.setAlignment(Pos.CENTER);
    exit.setMinHeight(30);
    exit.setMaxHeight(30);
    exit.setMinWidth(150);
    exit.setMaxWidth(150);
    exit.setAlignment(Pos.CENTER);
    commentaarFld.setMinHeight(30);
    commentaarFld.setMaxHeight(30);
    commentaarFld.setMinWidth(250);
    commentaarFld.setMaxWidth(250);
    commentaarFld.setAlignment(Pos.CENTER);
    table.setTranslateX(70);
    commentaarFld.setTranslateX(90);
    addButton.setTranslateX(90);
    aandachtBtn.setTranslateX(90);
    exit.setTranslateX(90);

    addButton.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white");
    exit.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white");
    aandachtBtn.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white");

    gp.setStyle(
        "-fx-border-color: #282E54; -fx-border-radius:10 10 10 10;"
            + "-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 0);"
            + "-fx-background-color: #282B3A;"
            + "-fx-background-radius: 5;");
    gp.setMaxWidth(900);
    gp.setMinWidth(900);
    gp.setMinHeight(600);
    gp.setMaxHeight(600);
    gp.setHgap(50);
    gp.setVgap(20);
    gp.setAlignment(Pos.CENTER);
    gp.add(hBox1, 0, 0, 2, 1);
    gp.add(table, 0, 1, 2, 1);
    gp.add(commentaarFld, 0, 2);
    gp.add(addButton, 1, 2);
    gp.add(aandachtBtn, 0, 3);
    gp.add(exit, 1, 3);
    gp.add(delBtn, 1, 3);

    this.setAlignment(Pos.CENTER);
    this.getChildren().add(gp);
    this.setStyle("-fx-background-image: url('resource/achtergrondStandaard.png')");

    update();
  }
コード例 #14
0
  public PlongeeSimpleView() {
    MN90.getLogger().debug(this, "Construction de la vue PlongeeSimple");
    // this.setGridLinesVisible(MN90.AFFICHAGE_GRILLE);
    this.setGridLinesVisible(true);

    ColumnConstraints col = new ColumnConstraints();
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(90);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);

    RowConstraints row = new RowConstraints();
    // row.setPercentHeight(90);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    // row.setPercentHeight(90);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);

    mImgView.setImage(mImgPlongeeFond);
    mImgView.setFitWidth(100);
    mImgView.setManaged(true);
    mImgView.setPreserveRatio(true);
    mImgView.setSmooth(true);
    mImgView.setCache(true);
    this.add(mImgView, 0, 1, 13, 8);

    this.add(mHeureDepartLabel, 0, 0);

    mHeureDepartValue.setPrefWidth(100);
    mHeureDepartValue.setMaxWidth(100);
    mHeureDepartValue.setMinWidth(100);
    this.add(mHeureDepartValue, 1, 0, 2, 1);

    this.add(mProfMaxLabel, 2, 8);

    mProfMaxValue.setPrefWidth(45);
    mProfMaxValue.setMaxWidth(45);
    mProfMaxValue.setMinWidth(45);
    this.add(mProfMaxValue, 3, 8);

    this.add(mHeureSortieLabel, 10, 0);

    mHeureSortieValue.setPrefWidth(100);
    mHeureSortieValue.setMaxWidth(100);
    mHeureSortieValue.setMinWidth(100);
    this.add(mHeureSortieValue, 11, 0, 2, 1);

    this.add(mDureePlongeeLabel, 2, 7);

    mDureePlongeeValue.setPrefWidth(45);
    mDureePlongeeValue.setMaxWidth(45);
    mDureePlongeeValue.setMinWidth(45);
    this.add(mDureePlongeeValue, 3, 7);

    this.add(mPalier3mLabel, 11, 2);

    mDureePalier3mValue.setPrefWidth(50);
    mDureePalier3mValue.setMaxWidth(50);
    mDureePalier3mValue.setMinWidth(50);
    this.add(mDureePalier3mValue, 11, 3);

    this.add(mDTRLabel, 10, 8);

    mDTRValue.setPrefWidth(50);
    mDTRValue.setMaxWidth(50);
    mDTRValue.setMinWidth(50);
    this.add(mDTRValue, 11, 8);

    this.add(mGPSLabel, 10, 7);

    mGPSValue.setPrefWidth(50);
    mGPSValue.setMaxWidth(50);
    mGPSValue.setMinWidth(50);
    this.add(mGPSValue, 11, 7);
  }