当前位置: 首页>>代码示例>>Java>>正文


Java CheckBox.setSelected方法代码示例

本文整理汇总了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);
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:19,代码来源:AdvancedSettingsViewControllerTest.java

示例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);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:22,代码来源:TerrainEditingComponent.java

示例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;
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:18,代码来源:SimulatorSettingsPanel.java

示例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();
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:JavaFXCheckBoxElementTest.java

示例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;
}
 
开发者ID:XDean,项目名称:CSS-Editor-FX,代码行数:8,代码来源:OptionsController.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:CheckBoxes.java

示例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();
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:JavaFXCheckBoxElementTest.java

示例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;
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:10,代码来源:DragCheckSpriteCell.java

示例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;
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:13,代码来源:BasicUIFactory.java

示例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));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:8,代码来源:BooleanPropertyControl.java

示例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);
    });
}
 
开发者ID:GwtDomino,项目名称:domino-todolist,代码行数:9,代码来源:TodoItemPanel.java

示例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);
    }
}
 
开发者ID:AntonioGabrielAndrade,项目名称:LIRE-Lab,代码行数:12,代码来源:CreateCollectionViewObject.java

示例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);
    }
}
 
开发者ID:AntonioGabrielAndrade,项目名称:LIRE-Lab,代码行数:11,代码来源:FeatureTableViewObject.java

示例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;
}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:30,代码来源:ScatterPlot3DFXDemo2.java

示例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;
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:76,代码来源:TopsoilPlotWetherill.java


注:本文中的javafx.scene.control.CheckBox.setSelected方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。