本文整理汇总了Java中javafx.scene.control.CheckBox.setDisable方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBox.setDisable方法的具体用法?Java CheckBox.setDisable怎么用?Java CheckBox.setDisable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.CheckBox
的用法示例。
在下文中一共展示了CheckBox.setDisable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CheckBoxes
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
public CheckBoxes() {
VBox vbox = new VBox();
vbox.setSpacing(10);
CheckBox cb1 = new CheckBox("Simple checkbox");
CheckBox cb2 = new CheckBox("Three state checkbox");
cb2.setAllowIndeterminate(true);
cb2.setIndeterminate(false);
CheckBox cb3 = new CheckBox("Disabled");
cb3.setSelected(true);
cb3.setDisable(true);
vbox.getChildren().add(cb1);
vbox.getChildren().add(cb2);
vbox.getChildren().add(cb3);
getChildren().add(vbox);
}
示例2: toolbarControlsFactory
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Override
public List<Node> toolbarControlsFactory() {
List<Node> controls = super.toolbarControlsFactory();
CheckBox ellipsesCheckBox = new CheckBox("Ellipses");
ellipsesCheckBox.setSelected(true);
ellipsesCheckBox.setOnAction(mouseEvent -> {
plot.setProperty(ELLIPSES, ellipsesCheckBox.isSelected());
});
ChoiceBox<SigmaPresentationModes> uncertaintyChoiceBox = new ChoiceBox<>(FXCollections.observableArrayList(SigmaPresentationModes.values()));
uncertaintyChoiceBox.setValue(SigmaPresentationModes.TWO_SIGMA_ABSOLUTE);
uncertaintyChoiceBox.setConverter(new StringConverter<SigmaPresentationModes>() {
@Override
public String toString(SigmaPresentationModes object) {
return object.getDisplayName();
}
@Override
public SigmaPresentationModes fromString(String string) {
return null;
}
});
uncertaintyChoiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<SigmaPresentationModes>() {
@Override
public void changed(ObservableValue observable, SigmaPresentationModes oldValue, SigmaPresentationModes newValue) {
plot.setProperty(UNCERTAINTY, newValue.getSigmaMultiplier());
}
});
ColorPicker ellipsesColorPicker = new ColorPicker(Color.RED);
ellipsesColorPicker.setStyle(COLORPICKER_CSS_STYLE_SPECS);
ellipsesColorPicker.setPrefWidth(100);
ellipsesColorPicker.setOnAction(mouseEvent -> {
// to satisfy D3
plot.setProperty(ELLIPSE_FILL_COLOR, ellipsesColorPicker.getValue().toString().substring(0, 8).replaceAll("0x", "#"));
});
CheckBox concordiaLineCheckBox = new CheckBox("Concordia");
concordiaLineCheckBox.setSelected(true);
concordiaLineCheckBox.setOnAction(mouseEvent -> {
plot.setProperty(CONCORDIA_LINE, concordiaLineCheckBox.isSelected());
});
CheckBox allSelectedCheckBox = new CheckBox("Select All");
allSelectedCheckBox.setSelected(true);
allSelectedCheckBox.setOnAction(mouseEvent -> {
setSelectedAllData(allSelectedCheckBox.isSelected());
});
CheckBox regressionUnctEnvelopeCheckBox = new CheckBox("2D Regression Unct");
regressionUnctEnvelopeCheckBox.setSelected(false);
regressionUnctEnvelopeCheckBox.setOnAction(mouseEvent -> {
plot.setProperty(REGRESSION_ENVELOPE, regressionUnctEnvelopeCheckBox.isSelected());
});
CheckBox regressionCheckBox = new CheckBox("2D Regression");
regressionCheckBox.setSelected(false);
regressionUnctEnvelopeCheckBox.setDisable(true);
regressionCheckBox.setOnAction(mouseEvent -> {
boolean isRegression = regressionCheckBox.isSelected();
plot.setProperty(REGRESSION_LINE, isRegression);
regressionUnctEnvelopeCheckBox.setDisable(!isRegression);
});
controls.add(ellipsesCheckBox);
controls.add(uncertaintyChoiceBox);
controls.add(ellipsesColorPicker);
controls.add(allSelectedCheckBox);
controls.add(concordiaLineCheckBox);
controls.add(regressionCheckBox);
controls.add(regressionUnctEnvelopeCheckBox);
return controls;
}