Ejemplo n.º 1
0
  private TitledPane createTitledPane(CreditRequest creditRequest) {
    TitledPane titledPane = new TitledPane();
    titledPane.setText("UserId: " + creditRequest.getUserId());
    VBox vBox = new VBox();
    TextFlow textFlow = new TextFlow();

    Label label = new Label(creditRequest.toString());
    label.setWrapText(true);
    textFlow.getChildren().add(label);

    textFlow.getChildren().add(new Label("Validate: "));
    CheckBox isValidCheckBox = new CheckBox();
    CheckBox rejectCheckBox = new CheckBox();

    isValidCheckBox
        .selectedProperty()
        .addListener(
            (observable, oldValue, newValue) -> {
              if (newValue == true) {
                rejectCheckBox.setSelected(false);
                creditRequest.setValidated(true);
              } else {
                creditRequest.setValidated(null);
              }
            });
    textFlow.getChildren().add(isValidCheckBox);

    textFlow.getChildren().add(new Label("Reject: "));
    rejectCheckBox
        .selectedProperty()
        .addListener(
            (observable, oldValue, newValue) -> {
              if (newValue == true) {
                isValidCheckBox.setSelected(false);
                creditRequest.setValidated(false);
              } else {
                creditRequest.setValidated(null);
              }
            });
    textFlow.getChildren().add(rejectCheckBox);

    Button creditHistoryButton = new Button("View Credit History");
    creditHistoryButton.setOnAction(
        e -> {
          session.setUserUnderValidationId(creditRequest.getUserId());
          screens.toCreditHistoryPage();
        });
    vBox.getChildren().add(textFlow);
    vBox.getChildren().add(creditHistoryButton);

    titledPane.setContent(vBox);

    return titledPane;
  }
  public void setFddObjectModel(FddObjectModel fddObjectModel) {
    logger.entry();
    if (fddObjectModel != null) {
      fddObjectModel
          .getInteractionClasses()
          .values()
          .stream()
          .forEach(
              (value) -> {
                interactions.add(new InteractionState(value));
              });
      InteractionTableView.setItems(interactions);
      interactions.forEach(
          (interaction) -> {
            interaction
                .onProperty()
                .addListener(
                    (observable, oldValue, newValue) -> {
                      if (!newValue) {
                        cb.setSelected(false);
                      } else if (interactions.stream().allMatch(a -> a.isOn())) {
                        cb.setSelected(true);
                      }
                    });
          });
      InteractionTableColumn.setCellValueFactory(new PropertyValueFactory<>("interactionName"));
      CheckTableColumn.setCellValueFactory(
          new Callback<
              TableColumn.CellDataFeatures<InteractionState, Boolean>, ObservableValue<Boolean>>() {
            @Override
            public ObservableValue<Boolean> call(
                TableColumn.CellDataFeatures<InteractionState, Boolean> param) {
              return param.getValue().onProperty();
            }
          });

      CheckTableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(CheckTableColumn));
      cb.setUserData(CheckTableColumn);
      cb.setOnAction(
          (ActionEvent event) -> {
            CheckBox cb1 = (CheckBox) event.getSource();
            TableColumn tc = (TableColumn) cb1.getUserData();
            InteractionTableView.getItems()
                .stream()
                .forEach(
                    (item) -> {
                      item.setOn(cb1.isSelected());
                    });
          });
      CheckTableColumn.setGraphic(cb);
    }
    logger.exit();
  }
Ejemplo n.º 3
0
  public RNADrawingView() {

    // set up gui
    drawingPane.setPrefWidth(400);
    drawingPane.setPrefHeight(400);
    warningLabel.setTextFill(Color.RED);
    animateCheckbox.setSelected(false);

    buttonBox.getChildren().addAll(foldButton, drawButton, animateCheckbox);
    inputBox.getChildren().addAll(sequenceField, bracketField, buttonBox);
    buttonInputBox.getChildren().addAll(inputBox, warningLabel, buttonBox);
    drawingPane.getChildren().add(drawing);
    root.setTop(buttonInputBox);
    root.setBottom(drawingPane);

    buttonBox.setAlignment(Pos.BOTTOM_LEFT);
    inputBox.setPadding(new Insets(10, 5, 10, 5));
    HBox.setMargin(foldButton, new Insets(0, 2.5, 0, 2.5));
    HBox.setMargin(drawButton, new Insets(0, 2.5, 0, 2.5));
    HBox.setMargin(animateCheckbox, new Insets(0, 2.5, 0, 2.5));
    VBox.setMargin(sequenceField, new Insets(0, 0, 5, 0));

    this.scene = new Scene(root);
    scene.getStylesheets().add("resources/assignment6and7.css");
    drawingPane.getStyleClass().add("drawingPane");
  }
Ejemplo n.º 4
0
  public void initialize() {
    constants = Constants.getInstance();

    if (constants.getValue("s_autoupload").equalsIgnoreCase("1")) {
      chckboxautoUpload.setSelected(true);
    } else {
      chckboxautoUpload.setSelected(false);
    }

    txtnralcode.setText(constants.getValue("s_nralcode"));
    txtfiles.setText(constants.getValue("s_archiveCount"));
    txtinterval.setText(constants.getValue("s_backupInterval"));
    txtDir.setText(constants.getValue("s_dumpDir"));

    generateBackupPaths();

    //                generateRestore();

  }
Ejemplo n.º 5
0
  public void open(File f) {
    Properties open = new Properties();
    InputStream input = null;

    try {
      input = new FileInputStream(f);
      open.load(input);

      selectProviderCb.setValue(open.getProperty("provider"));
      selectGrainCb.setValue(open.getProperty("grain"));
      weightTf.setText(open.getProperty("weight"));
      infoTa.setText(open.getProperty("info"));

      for (Entry<String, TextField> entry : propertiesTf.entrySet()) {
        String propertyName = entry.getKey();
        TextField tf = entry.getValue();
        CheckBox cb = propertiesCb.get(propertyName);

        tf.setText(open.getProperty(propertyName));
        if (open.getProperty(propertyName + "_ENABLED").equals("ON")) {
          tf.setDisable(false);
          cb.setSelected(true);
        } else {
          tf.setDisable(true);
          cb.setSelected(false);
        }
      }

      mainStage.setTitle(f.getName());
    } catch (Exception ex) {
      infoTa.setText("Не могу открыть файл");
    } finally {
      if (input != null) {
        try {
          input.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
Ejemplo n.º 6
0
  @Override
  public void initialize(URL location, ResourceBundle resources) {
    // Perform any initialization steps here.
    pc = PropertiesController.getPropertiesController();
    usernameTextField.setText(pc.getProp("username"));
    passwordPasswordField.setText(pc.getProp("password"));

    String signIn = pc.getProp("signInCheckbox");
    if (signIn == null) {
      signIn = "";
    }
    if (signIn.equals("true")) {
      keepMeLoggedInCheckBox.setSelected(true);
    }
  }
Ejemplo n.º 7
0
  public void newFile() {
    infoTa.setText("");
    selectProviderCb.setValue(providers.get(0).getName());
    weightTf.setText("0.0");

    for (Entry<String, TextField> entry : propertiesTf.entrySet()) {
      String propertyName = entry.getKey();
      TextField tf = entry.getValue();
      CheckBox cb = propertiesCb.get(propertyName);

      tf.setText("0.0");
      tf.setDisable(true);
      cb.setSelected(false);
    }

    file = null;
    mainStage.setTitle("unknown");
  }
  public void setTableItemsCollection(ObservableList<FileItem> observableList) {
    if (observableList == null) throw new IllegalArgumentException("observableList is null");

    // set table items
    tableView.setItems(observableList);

    // listener for number of items in table
    tableView
        .getItems()
        .addListener(
            (ListChangeListener<FileItem>)
                change ->
                    Platform.runLater(
                        () -> {
                          if (change.getList().size() > 0) {
                            setSelectButtonsState(true, true, true);
                          } else {
                            // unselect check box in table header
                            selectFilesCheckBox.setSelected(false);

                            setSelectButtonsState(false, false, false);
                          }
                        }));
  }