本文整理汇总了Java中javafx.scene.control.CheckBox.setSelected方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBox.setSelected方法的具体用法?Java CheckBox.setSelected怎么用?Java CheckBox.setSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.CheckBox
的用法示例。
在下文中一共展示了CheckBox.setSelected方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: beforeEach
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Override
public void beforeEach() {
graphVisualizer = mock(GraphVisualizer.class);
settings = mock(Settings.class);
createContextOfTest();
advancedSettingsViewController = new AdvancedSettingsViewController();
injectMembers(advancedSettingsViewController);
final SimpleBooleanProperty displayLaneBorder = new SimpleBooleanProperty();
displayLaneBorder.setValue(false);
when(graphVisualizer.getDisplayBordersProperty()).thenReturn(displayLaneBorder);
checkBox = new CheckBox();
checkBox.setSelected(true);
mouseEvent = mock(ActionEvent.class);
}
示例2: refreshProperties
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
/**
* Refresh terrain properties.
*/
private void refreshProperties() {
setIgnoreListeners(true);
try {
final Terrain terrain = getProcessedObject();
final Material material = terrain.getMaterial();
final FloatTextField shininessField = getShininessField();
final CheckBox triPlanarCheckBox = getTriPlanarCheckBox();
final MatParam shininess = material.getParam("Shininess");
final MatParam useTriPlanarMapping = material.getParam("useTriPlanarMapping");
shininessField.setValue(shininess == null ? 0F : (float) shininess.getValue());
triPlanarCheckBox.setSelected(useTriPlanarMapping != null && (boolean) useTriPlanarMapping.getValue());
} finally {
setIgnoreListeners(false);
}
}
示例3: zeroOnReadsFromUninitializedMemorySelection
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private Node zeroOnReadsFromUninitializedMemorySelection( SimulatorSettingDetails settingDetails )
{
HBox hBox = new HBox();
//TODO ensure numerical values only
CheckBox zeroOnReadsFromUninitializedMemoryCheckBox =
new CheckBox("Assume zero on reads from uninitialized memory");
zeroOnReadsFromUninitializedMemoryCheckBox.setAllowIndeterminate(false);
zeroOnReadsFromUninitializedMemoryCheckBox
.setSelected(Boolean.valueOf(settingDetails.getAssumeZeroOnReadsFromUninitializedMemory()));
assumeZeroOnReadsFromUninitializedMemoryModel = zeroOnReadsFromUninitializedMemoryCheckBox.selectedProperty();
hBox.getChildren().add(zeroOnReadsFromUninitializedMemoryCheckBox);
return hBox;
}
示例4: selectCheckboxSelectedNotSelected
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Test public void selectCheckboxSelectedNotSelected() throws Throwable {
CheckBox checkBoxNode = (CheckBox) getPrimaryStage().getScene().getRoot().lookup(".check-box");
checkBoxNode.setSelected(true);
AssertJUnit.assertEquals(true, checkBoxNode.isSelected());
checkBox.marathon_select("unchecked");
new Wait("Waiting for the check box deselect.") {
@Override public boolean until() {
return !checkBoxNode.isSelected();
}
};
}
示例5: add
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private CheckBox add(BooleanOption ob) {
CheckBox cb = new CheckBox(ob.getDescribe());
cb.setSelected(ob.get());
onSubmit.add(() -> ob.set(cb.isSelected()));
add(cb);
return cb;
}
示例6: 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);
}
示例7: selectCheckboxSelectedSelected
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Test public void selectCheckboxSelectedSelected() throws Throwable {
CheckBox checkBoxNode = (CheckBox) getPrimaryStage().getScene().getRoot().lookup(".check-box");
checkBoxNode.setSelected(true);
AssertJUnit.assertEquals(true, checkBoxNode.isSelected());
checkBox.marathon_select("checked");
new Wait("Waiting for the check box selection.") {
@Override public boolean until() {
return checkBoxNode.isSelected();
}
};
}
示例8: createCheckBox
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private Node createCheckBox () {
CheckBox checkBox = new CheckBox();
checkBox.setSelected(getController().isSpriteInLevel(getProfilable()));
checkBox.selectedProperty()
.addListener( (observable, oldValue, newValue) -> checkBoxChange(oldValue,
newValue));
addToolTip(checkBox);
return checkBox;
}
示例9: makeCheckBoxTitledPane
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
public TitledPane makeCheckBoxTitledPane (String title, Node content, boolean isExpanded) {
TitledPane pane = new TitledPane(title, content);
CheckBox checkBox = new CheckBox();
checkBox.setSelected(false);
pane.setGraphic(checkBox);
pane.expandedProperty().bindBidirectional(checkBox.selectedProperty());
// Node arrow = pane.lookup(".arrow");
// arrow.setVisible(false);
pane.setExpanded(isExpanded);
return pane;
}
示例10: reload
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Override
@FXThread
protected void reload() {
final Boolean value = getPropertyValue();
final CheckBox checkBox = getCheckBox();
checkBox.setSelected(Boolean.TRUE.equals(value));
}
示例11: initSelector
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private void initSelector(boolean done) {
selector = new CheckBox();
selector.setSelected(done);
selector.setOnAction(event -> {
updateStyles(selector.isSelected());
uiHandlers.onItemStateChanged(this);
});
}
示例12: select
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private void select(Feature feature) {
CheckBox checkBox = checkboxFor(feature);
boolean oldValue = checkBox.isSelected();
clickOn(checkBox).interrupt();
//workaround when sometimes it wont click the checkbox
if(checkBox.isSelected() == oldValue) {
checkBox.setSelected(!oldValue);
}
}
示例13: clickCheckBox
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private void clickCheckBox(CheckBox checkBox) {
boolean oldValue = checkBox.isSelected();
clickOn(checkBox).interrupt();
//workaround when sometimes it wont click the checkbox
if(checkBox.isSelected() == oldValue) {
checkBox.setSelected(!oldValue);
}
}
示例14: createDemoNode
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
public static Node createDemoNode() {
XYZDataset dataset = createDataset();
Chart3D chart = createChart(dataset);
Chart3DViewer viewer = new Chart3DViewer(chart);
BorderPane node = new BorderPane();
node.setCenter(viewer);
HBox container = new HBox();
CheckBox checkBox = new CheckBox("Logarithmic Axis?");
checkBox.setSelected(true);
checkBox.setOnAction((e) -> {
XYZPlot plot = (XYZPlot) chart.getPlot();
if (checkBox.isSelected()) {
LogAxis3D logAxis = new LogAxis3D("Y (log scale)");
logAxis.setTickLabelOrientation(LabelOrientation.PERPENDICULAR);
logAxis.receive(new ChartStyler(chart.getStyle()));
plot.setYAxis(logAxis);
} else {
NumberAxis3D yAxis = new NumberAxis3D("Y");
yAxis.setTickLabelOrientation(LabelOrientation.PERPENDICULAR);
yAxis.receive(new ChartStyler(chart.getStyle()));
plot.setYAxis(yAxis);
}
});
container.setAlignment(Pos.CENTER);
container.setPadding(new Insets(4.0, 4.0, 4.0, 4.0));
container.getChildren().add(checkBox);
node.setBottom(container);
return node;
}
示例15: 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;
}