Пример #1
0
 private void initXmlList() {
   xmlLoader = new ComboBox<String>();
   xmlLoader.setPromptText("XML File to Load");
   xmlLoader.setEditable(true);
   xmlLoader.setLayoutX(
       ConfigManager.getInt(ConfigManager.scope(this.getClass().getName(), "xml-x")));
   xmlLoader.setLayoutY(
       ConfigManager.getInt(ConfigManager.scope(this.getClass().getName(), "xml-y")));
   xmlLoader.setVisibleRowCount(3);
   root.getChildren().add(xmlLoader);
 }
  private void initializeWorkflowProcessesComboBox() {
    workflowProcessesComboBox.setEditable(false);
    workflowProcessesComboBox.setPromptText("Select Workflow Process");
    workflowProcessesComboBox.setCellFactory(
        (p) -> {
          final ListCell<WorkflowProcess> cell =
              new ListCell<WorkflowProcess>() {
                @Override
                protected void updateItem(WorkflowProcess a, boolean bln) {
                  super.updateItem(a, bln);

                  if (a != null) {
                    setText(a.getText());
                  } else {
                    setText(null);
                  }
                }
              };

          return cell;
        });

    workflowProcessesComboBox.setButtonCell(
        new ListCell<WorkflowProcess>() {
          @Override
          protected void updateItem(WorkflowProcess t, boolean bln) {
            super.updateItem(t, bln);
            if (bln) {
              setText("");
              initiateButton.setDisable(true);
            } else {
              setText(t.getText());
              initiateButton.setDisable(!isDataRequiredForInitiateOk());
            }
          }
        });
    workflowProcessesComboBox.setOnAction(
        (event) -> {
          LOG.trace(
              "workflowProcessesComboBox event (selected: "
                  + workflowProcessesComboBox.getSelectionModel().getSelectedItem()
                  + ")");

          initiateButton.setDisable(!isDataRequiredForInitiateOk());
        });
  }
Пример #3
0
  public Node buildNuclideCtrl() {
    VBox vbox = new VBox();
    vbox.getStyleClass().add("infobar");

    Text title = new Text("Nuclide");
    title.getStyleClass().add("title");

    _filters.getStyleClass().add("nuclide");

    _filters.setPromptText("filter");
    _filters.setEditable(true);
    _filters.setItems(_nuclideFilterNames);

    _filters.valueProperty().addListener(o -> selectNuclideFilter(_filters.getValue()));

    vbox.getChildren().addAll(title, _filters);
    ;
    return vbox;
  }
Пример #4
0
  private GridPane getTopPane() {
    topPane = new GridPane();

    // Top pane
    Label DateL = new Label("Date");
    Label surveyDateL = new Label("Surveyed Date");
    Label NameL = new Label("Name");
    Label spouseNameL = new Label("Spouse Name");
    Label addressL = new Label("Address");
    Label ageL = new Label("Age");
    Label yearofResidencyL = new Label("Year of Residency");
    Label numofChildrenL = new Label("Number of Children");

    // search nodes declaration

    // topPane nodes declaration
    dateField = new TextField(Utility.getCurrentDate());

    datePicker = new DatePicker();
    Name = new TextField();
    SpouseName = new TextField();
    agefield = new TextField();
    addressF = new TextField();
    yrResidency = new TextField();
    numofChildrenF = new TextField();

    // nodes initialization
    dateField.setAlignment(Pos.CENTER);
    dateField.setDisable(true);
    numofChildrenF.setText("0");

    Name.setPromptText("First Name");
    LastName.setPromptText("Last Name");
    MidlleName.setPromptText("Middle Name");

    SpouseName.setPromptText("Spouse Full Name");
    agefield.setPromptText("35");
    addressF.setPromptText("e.g 12345 Manga st. Mabalacat");
    yrResidency.setPromptText("e.g 2012");
    numofChildrenF.setPromptText("Number of children");

    SpouseName.setDisable(true);

    maritalCBox = new ComboBox(getMaritalStatus());
    barangayCb = new ComboBox(getBarangayListModel());
    genderCB = new ComboBox(getGender());

    maritalCBox.setPrefWidth(140);
    maritalCBox.setPromptText("Marital Status");
    maritalCBox.setEditable(false);

    genderCB.setPromptText("Gender");
    genderCB.setPrefWidth(140);

    barangayCb.setPromptText("Barangay");
    barangayCb.setEditable(false);

    // --------------------- Layouting ----------------------------///

    int indexYTop = 0;

    topPane.setConstraints(topTitleL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.TOP);

    indexYTop++;
    topPane.setConstraints(DateL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    topPane.setConstraints(dateField, 1, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);
    topPane.setConstraints(barangayCb, 5, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);

    indexYTop++;

    topPane.setConstraints(surveyDateL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    topPane.setConstraints(datePicker, 1, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);
    bottomPane.setConstraints(maritalCBox, 5, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);

    indexYTop++;
    bottomPane.setConstraints(yearofResidencyL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    bottomPane.setConstraints(yrResidency, 1, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    bottomPane.setConstraints(genderCB, 5, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);

    indexYTop++;
    bottomPane.setConstraints(numofChildrenL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    bottomPane.setConstraints(numofChildrenF, 1, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    topPane.setConstraints(ageL, 4, indexYTop, 1, 1, HPos.RIGHT, VPos.CENTER);
    topPane.setConstraints(agefield, 5, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);

    indexYTop++;
    topPane.setConstraints(NameL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    topPane.setConstraints(Name, 1, indexYTop, 3, 1, HPos.CENTER, VPos.CENTER);
    topPane.setConstraints(LastName, 4, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);
    topPane.setConstraints(MidlleName, 5, indexYTop, 1, 1, HPos.CENTER, VPos.CENTER);

    indexYTop++;
    topPane.setConstraints(spouseNameL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    topPane.setConstraints(SpouseName, 1, indexYTop, 5, 1, HPos.CENTER, VPos.CENTER);

    indexYTop++;
    topPane.setConstraints(addressL, 0, indexYTop, 1, 1, HPos.LEFT, VPos.CENTER);
    topPane.setConstraints(addressF, 1, indexYTop, 5, 1, HPos.CENTER, VPos.CENTER);

    dateField.setPrefColumnCount(6);
    agefield.setPrefColumnCount(6);

    // adding nodes to the top gridpane
    topPane
        .getChildren()
        .addAll(
            topTitleL,
            DateL,
            dateField,
            surveyDateL,
            datePicker,
            barangayCb,
            yearofResidencyL,
            yrResidency,
            maritalCBox,
            numofChildrenL,
            numofChildrenF,
            genderCB,
            NameL,
            Name,
            LastName,
            MidlleName,
            ageL,
            agefield,
            spouseNameL,
            SpouseName,
            addressL,
            addressF);

    addTopComponentListeners();

    return topPane;
  }
Пример #5
0
  @Override
  public void start(Stage stage) {
    sun.setFitHeight(100);
    sun.setFitWidth(100);
    sun.setX(200);
    sun.setY(200);
    quas.setFitHeight(50);
    quas.setFitWidth(50);
    wex.setFitHeight(50);
    wex.setFitWidth(50);
    exort.setFitHeight(50);
    exort.setFitWidth(50);

    Circle orbit1 = new Circle();
    orbit1.setRotate(-90);
    orbit1.setRadius(100);
    orbit1.setCenterX(250);
    orbit1.setCenterY(250);
    PathTransition path1 = new PathTransition();
    path1.setPath(orbit1);
    path1.setNode(quas);
    path1.setDuration(Duration.seconds(5));
    path1.setCycleCount(Timeline.INDEFINITE);

    Circle orbit2 = new Circle();
    orbit2.setRotate(30);
    orbit2.setRadius(100);
    orbit2.setCenterX(250);
    orbit2.setCenterY(250);
    PathTransition path2 = new PathTransition();
    path2.setPath(orbit2);
    path2.setNode(wex);
    path2.setDuration(Duration.seconds(5));
    path2.setCycleCount(Timeline.INDEFINITE);

    Circle orbit3 = new Circle();
    orbit3.setRotate(150);
    orbit3.setRadius(100);
    orbit3.setCenterX(250);
    orbit3.setCenterY(250);
    PathTransition path3 = new PathTransition();
    path3.setPath(orbit3);
    path3.setNode(exort);
    path3.setDuration(Duration.seconds(5));
    path3.setCycleCount(Timeline.INDEFINITE);

    ComboBox<String> invoke = new ComboBox<String>();
    invoke.setEditable(false);
    invoke
        .getItems()
        .addAll(
            "Cold Snap",
            "Ghost Walk",
            "Tornado",
            "EMP",
            "Alacrity",
            "Chaos Meteor",
            "Sun Strike",
            "Forge Spirit",
            "Ice Wall",
            "Deafening Blast");
    invoke.setOnAction(
        e -> {
          switch (invoke.getValue()) {
            case "Cold Snap":
              path1.setNode(quas);
              path2.setNode(quas);
              path3.setNode(quas);
              break;
            case "Ghost Walk":
              path1.setNode(quas);
              path2.setNode(quas);
              path3.setNode(wex);
              break;
            case "Tornado":
              path1.setNode(wex);
              path2.setNode(wex);
              path3.setNode(quas);
              break;
            case "EMP":
              path1.setNode(wex);
              path2.setNode(wex);
              path3.setNode(wex);
              break;
            case "Alacrity":
              path1.setNode(wex);
              path2.setNode(wex);
              path3.setNode(exort);
              break;
            case "Chaos Meteor":
              path1.setNode(exort);
              path2.setNode(exort);
              path3.setNode(wex);
              break;
            case "Sun Strike":
              path1.setNode(exort);
              path2.setNode(exort);
              path3.setNode(exort);
              break;
            case "Forge Spirit":
              path1.setNode(exort);
              path2.setNode(exort);
              path3.setNode(quas);
              break;
            case "Ice Wall":
              path1.setNode(quas);
              path2.setNode(quas);
              path3.setNode(exort);
              break;
            case "Deafening Blast":
              path1.setNode(quas);
              path2.setNode(wex);
              path3.setNode(exort);
              break;
            default:
              path1.setNode(quas);
              path2.setNode(wex);
              path3.setNode(exort);
              break;
          }
        });

    path1.play();
    path2.play();
    path3.play();

    Pane pane = new Pane();
    pane.getChildren().addAll(quas, wex, exort, sun, invoke);
    stage.setScene(new Scene(pane, 500, 500));
    stage.setTitle("Spell Combinations");
    stage.show();
  }