Package javafx.scene.control

Examples of javafx.scene.control.CheckBox


      Class<? extends Control> controlType, final String restictTo,
      T... choices) {
    HBox box = new HBox();
    Control ctrl;
    if (controlType == CheckBox.class) {
      CheckBox cb = new CheckBox();
      // POJO binding magic...
      personPA.bindBidirectional(path, cb.selectedProperty());
      ctrl = cb;
    } else if (controlType == ComboBox.class) {
      ComboBox<T> cb = new ComboBox<>(
          FXCollections.observableArrayList(choices));
      cb.setPromptText("Select");
      cb.setPrefWidth(100d);
      // POJO binding magic (due to erasure of T in
      // ObjectProperty<T> of cb.valueProperty() we need
      // to also pass in the choice class)
      personPA.bindBidirectional(path, cb.valueProperty(),
          (Class<T>) choices[0].getClass());
      ctrl = cb;
    } else if (controlType == ListView.class) {
      ListView<T> lv = new ListView<>(
          FXCollections.observableArrayList(choices));
View Full Code Here


//          fillContextMenu(tableView, copyMenuItem,copyCellMenuItem);
//        }
//      }
//    });
   
    final CheckBox regExp = new CheckBox("RegExp");
   
    HBox pane= new HBox();
    BorderPane.setMargin(pane,new Insets(3));
    pane.setSpacing(3);
    pane.setAlignment(Pos.CENTER_LEFT);
    Button copy = new Button("copy");
    copy.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        copyTable(tableView);
      }
    });
    copyMenuItem.setOnAction(copy.getOnAction());
    pane.getChildren().add(copy);
    Button copyCell = new Button("copy cell");
    copyCell.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        copyTableCell(tableView);
      }
    });
    copyCellMenuItem.setOnAction(copyCell.getOnAction());
    pane.getChildren().add(copyCell);
    pane.getChildren().add(new Label("Search"));
    final TextField textField = new TextField();
    textField.textProperty().addListener(new ChangeListener<String>() {
      @Override
      public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
        if (newValue!=null && newValue.length()>1){
          searchInTable(tableView, newValue,regExp.isSelected());
        }
      }
    });
    regExp.selectedProperty().addListener(new ChangeListener<Boolean>() {
      @Override
      public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
        if (newValue!=null){
          searchInTable(tableView,textField.getText(),newValue);
        }
      }
    });
    textField.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        searchInTable(tableView,textField.getText(),regExp.isSelected());
      }
    });
    HBox.setHgrow(textField,Priority.ALWAYS);
    final Label count = new Label("count: 0");
//    tableView.itemsProperty().addListener(new ChangeListener<ObservableList<M>>() {
View Full Code Here

    @Override // This method is called by the FXMLLoader when initialization is complete
    public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
        assert pane != null : "fx:id=\"pane\" was not injected: check your FXML file 'EngineLoadFilter.fxml'.";

        for (Entry<WorkflowInstanceState,SimpleBooleanProperty> entry: model.stateFilters.entrySet()){
          CheckBox checkBox  = new CheckBox();
          checkBox.setText(entry.getKey().toString());
          checkBox.selectedProperty().bindBidirectional(entry.getValue());
          pane.getChildren().add(checkBox);
        }
  }
View Full Code Here

    });
    lEndCalendarTextField.setVisible(abstractAppointmentPane.appointment.getEndTime() != null);
    // wholeday
    if ((abstractAppointmentPane.appointment.isWholeDay() != null && abstractAppointmentPane.appointment.isWholeDay() == true) || abstractAppointmentPane.appointment.getEndTime() != null)
    {
      final CheckBox lWholedayCheckBox = new CheckBox("Wholeday");
      lWholedayCheckBox.setId("wholeday-checkbox");
      lWholedayCheckBox.selectedProperty().set(abstractAppointmentPane.appointment.isWholeDay());
      lMenuVBox.getChildren().add(lWholedayCheckBox);
      lWholedayCheckBox.selectedProperty().addListener(new ChangeListener<Boolean>()
      {
        @Override
        public void changed(ObservableValue<? extends Boolean> arg0, Boolean oldValue, Boolean newValue)
        {
          abstractAppointmentPane.appointment.setWholeDay(newValue);
View Full Code Here

        });
        return this;
    }

    public InternalPopupMessage setDoNotAskAgain() {
        check_box = new CheckBox(RBLoader.ll("Don't show again."));
        check_box.setFont(new Font("Arial", 16));
        check_box.setPrefSize(185, 25);
        check_box.setSelected(false);
        return this;
    }
View Full Code Here

        });
        return this;
    }

    public InternalPopupMessage setDoNotAskAgain() {
        check_box = new CheckBox(RBLoader.ll("Don't show again."));
        check_box.setFont(new Font("Arial", 16));
        check_box.setPrefSize(185, 25);
        check_box.setSelected(false);
        return this;
    }
View Full Code Here

        });
        return this;
    }

    public InternalPopupMessage setDoNotAskAgain() {
        check_box = new CheckBox(RBLoader.ll("Don't show again."));
        check_box.setFont(new Font("Arial", 16));
        check_box.setPrefSize(185, 25);
        check_box.setSelected(false);
        return this;
    }
View Full Code Here

    }}, 2, 1);
    gridPane.add(new Label() {{
      textProperty().bind(alignment.asString("%4.2f"));
    }}, 3, 1);

    gridPane.add(new CheckBox("Reflection?") {{
      selectedProperty().bindBidirectional(reflectionEnabled);
    }}, 2, 2);

    gridPane.add(new CheckBox("Clip Reflections?") {{
      selectedProperty().bindBidirectional(clipReflections);
    }}, 2, 3);

    gridPane.add(new Label("fieldOfViewRatio (0.0 - 2.0)"), 1, 4);
    gridPane.add(new Slider(0.0, 2.0, 0.5) {{
View Full Code Here

   * It does so by creating new checkboxes for each function in the function set.
   */
  private void refreshFunctions() {
    // remove all current functions
    nodeFunctions.getChildren().clear();
    CheckBox checkBox;
    // get a reference to the function set
    final FunctionSet functionSet = gui.getExperiment().getResources().getFunctionSet();
    for (int i = 0; i < functionSet.getTotalFunctionCount(); i++) {
      // add a checkbox for each function
      checkBox = new CheckBox(functionSet.getFunction(i).toString());
      checkBox.setId(String.valueOf(i));
      // make sure the selection matches the function set
      checkBox.setSelected(functionSet.isEnabled(functionSet.getFunction(i)));
      final int index = i;
      // set listener so function set gets updated if the checkboxes change
      checkBox.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
          if (((CheckBox) event.getSource()).isSelected()) {
            functionSet.enableFunction(index);
          } else {
View Full Code Here

    super(parameter, sp);
  }
 
  @Override
  protected Control makeControl() {
    checkBox = new CheckBox();
    checkBox.setSelected(parameter.get());
   
    return checkBox;
  }
View Full Code Here

TOP

Related Classes of javafx.scene.control.CheckBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.