• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JFXCheckBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.jfoenix.controls.JFXCheckBox的典型用法代码示例。如果您正苦于以下问题:Java JFXCheckBox类的具体用法?Java JFXCheckBox怎么用?Java JFXCheckBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JFXCheckBox类属于com.jfoenix.controls包,在下文中一共展示了JFXCheckBox类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addBoolean

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
/**
 * Add a yes/no choice to a wizard step.
 *
 * @param fieldName
 * @param defaultValue
 *            of the choice.
 * @param prompt
 *            the tooltip to show
 * @return
 */
@SuppressWarnings("unchecked")
public WizardStepBuilder addBoolean(final String fieldName, final boolean defaultValue, final String prompt)
{
    final JFXCheckBox box = new JFXCheckBox();
    box.setTooltip(new Tooltip(prompt));
    box.setSelected(defaultValue);

    this.current.getData().put(fieldName, new SimpleBooleanProperty());
    this.current.getData().get(fieldName).bind(box.selectedProperty());

    final Label label = new Label(fieldName);
    GridPane.setHalignment(label, HPos.RIGHT);
    GridPane.setHalignment(box, HPos.LEFT);
    this.current.add(label, 0, this.current.getData().size() - 1);
    this.current.add(box, 1, this.current.getData().size() - 1);
    return this;
}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:28,代码来源:WizardStepBuilder.java


示例2: AssociatedCheckBoxes

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
public AssociatedCheckBoxes(JFXCheckBox selectAll, List<JFXCheckBox> boxes) {
    this.boxes = boxes;
    this.selectAll = selectAll;
    this.boxes.forEach(box -> box.selectedProperty().addListener((observable, wasSelected, isSelected) -> {
        processClick();
    }));

    this.selectAll.selectedProperty().addListener((observable, wasSelected, isSelected) -> scheduleSelectAllStateChangeProcessing());

    this.selectAll.indeterminateProperty().addListener((observable, wasIndeterminate, isIndeterminate) -> scheduleSelectAllStateChangeProcessing());
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:12,代码来源:AssociatedCheckBoxes.java


示例3: processClick

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
private void processClick() {
    if (selectAllStateChangeProcessor == null) {
        boolean allSelected = this.boxes.stream()
                .map(JFXCheckBox::isSelected)
                .reduce(
                        true,
                        (a, b) -> a && b
                );

        boolean anySelected = this.boxes.stream()
                .map(JFXCheckBox::isSelected)
                .reduce(
                        false,
                        (a, b) -> a || b
                );

        if (allSelected) {
            this.selectAll.setSelected(true);
        }

        if (!anySelected) {
            this.selectAll.setSelected(false);
            this.selectAll.setIndeterminate(false);
        }

        if (anySelected && !allSelected) {
            this.selectAll.setSelected(false);
            this.selectAll.setIndeterminate(true);
        }
    }
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:32,代码来源:AssociatedCheckBoxes.java


示例4: start

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
@Override
public void start(Stage stage) {

    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);

    CheckBox cb = new CheckBox("CheckBox");
    JFXCheckBox jfxCheckBox = new JFXCheckBox("JFX CheckBox");
    JFXCheckBox customJFXCheckBox = new JFXCheckBox("Custom JFX CheckBox");
    customJFXCheckBox.getStyleClass().add("custom-jfx-check-box");

    main.getChildren().add(cb);
    main.getChildren().add(jfxCheckBox);
    main.getChildren().add(customJFXCheckBox);

    StackPane pane = new StackPane();
    pane.getChildren().add(main);
    StackPane.setMargin(main, new Insets(100));
    pane.setStyle("-fx-background-color:WHITE");

    final Scene scene = new Scene(pane, 600, 200);
    scene.getStylesheets().add(CheckBoxDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX CheckBox Demo ");
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();

}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:30,代码来源:CheckBoxDemo.java


示例5: createFillTransition

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
private void createFillTransition() {
    select = new JFXFillTransition(Duration.millis(120),
        box,
        Color.TRANSPARENT,
        (Color) ((JFXCheckBox) getSkinnable()).getCheckedColor());
    select.setInterpolator(Interpolator.EASE_OUT);
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:8,代码来源:JFXCheckBoxSkin.java


示例6: constructContentPane

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
/**
 * Constructs central part of stage.
 * Contains dynamical content.
 * @return main pane of the page containing all of the auctions
 */
@Override
public Pane constructContentPane() {

    //Panes
    BorderPane mainPane = new BorderPane();
    HBox filterPane = new HBox();
    JFXMasonryPane auctionPane = new JFXMasonryPane();
    //filterPane.setStyle();
    filterPane.setSpacing(10);

    //Fill filter option pane
    JFXRadioButton filterAll = new JFXRadioButton("All");
    JFXRadioButton filterPaintings = new JFXRadioButton("Paintings");
    JFXRadioButton filterSculptures = new JFXRadioButton("Sculptures");
    filterAll.setSelected(true);

    ToggleGroup filterGroup = new ToggleGroup();
    filterAll.setToggleGroup(filterGroup);
    filterPaintings.setToggleGroup(filterGroup);
    filterSculptures.setToggleGroup(filterGroup);

    //Is complete filter
    JFXCheckBox filterIsComplete = new JFXCheckBox("Hide completed");
    filterIsComplete.setSelected(hideCompleted);
    filterIsComplete.selectedProperty().addListener((observable, oldValue, newValue) -> {
        hideCompleted = newValue;
        fillAuctionPane(auctionPane, dc.filterAuctions(auctionKey, hideCompleted));
    });

    filterPane.getChildren().addAll(
            new Label("Filter auctions: "), filterAll, filterPaintings, filterSculptures, filterIsComplete
    );

    //Fill auction pane
    fillAuctionPane(auctionPane, dc.filterAuctions(AuctionFilterKey.ALL, hideCompleted));

    //Filter events
    filterAll.selectedProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue) {
            auctionKey = AuctionFilterKey.ALL;
            fillAuctionPane(auctionPane, dc.filterAuctions(auctionKey, hideCompleted));
        }
    });
    filterPaintings.selectedProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue) {
            auctionKey = AuctionFilterKey.PAINTING;
            fillAuctionPane(auctionPane, dc.filterAuctions(auctionKey, hideCompleted));
        }
    });
    filterSculptures.selectedProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue) {
            auctionKey = AuctionFilterKey.SCULPTURE;
            fillAuctionPane(auctionPane, dc.filterAuctions(auctionKey, hideCompleted));
        }
    });

    //Add panes to main pane
    mainPane.setTop(filterPane);
    mainPane.setCenter(auctionPane);

    BorderPane.setMargin(filterPane, new Insets(20,20,20,20));

    return  mainPane;
}
 
开发者ID:hadalhw17,项目名称:Artatawe,代码行数:70,代码来源:ArtworkContainer.java


示例7: createChkBoxList

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
private List<JFXCheckBox> createChkBoxList(JFXCheckBox... jfxCheckBoxs) {
    List<JFXCheckBox> boxes = new ArrayList<>();
    boxes.addAll(Arrays.asList(jfxCheckBoxs));
    return boxes;
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:6,代码来源:DataForExtractionController.java


示例8: JFXCheckBoxOldSkin

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
public JFXCheckBoxOldSkin(JFXCheckBox control) {
    super(control);

    box.setMinSize(20, 20);
    box.setPrefSize(20, 20);
    box.setMaxSize(20, 20);
    box.setBorder(new Border(new BorderStroke(control.getUnCheckedColor(),
        BorderStrokeStyle.SOLID,
        new CornerRadii(0),
        new BorderWidths(lineThick))));
    //
    StackPane boxContainer = new StackPane();
    boxContainer.getChildren().add(box);
    boxContainer.setPadding(new Insets(padding));
    rippler = new JFXRippler(boxContainer, RipplerMask.CIRCLE);
    rippler.setRipplerFill(getSkinnable().isSelected() ? control.getUnCheckedColor() : control.getCheckedColor());

    rightLine = new Line();
    leftLine = new Line();
    rightLine.setStroke(control.getCheckedColor());
    rightLine.setStrokeWidth(lineThick);
    leftLine.setStroke(control.getCheckedColor());
    leftLine.setStrokeWidth(lineThick);
    rightLine.setVisible(false);
    leftLine.setVisible(false);

    container.getChildren().add(rightLine);
    container.getChildren().add(leftLine);
    container.getChildren().add(rippler);
    AnchorPane.setRightAnchor(rippler, labelOffset);

    // add listeners
    getSkinnable().selectedProperty().addListener((o, oldVal, newVal) -> {
        rippler.setRipplerFill(newVal ? control.getUnCheckedColor() : control.getCheckedColor());
        transition.setRate(newVal ? 1 : -1);
        transition.play();
    });

    updateChildren();

}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:42,代码来源:JFXCheckBoxOldSkin.java


示例9: JFXCheckBoxSkin

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
public JFXCheckBoxSkin(JFXCheckBox control) {
    super(control, new ButtonBehavior<>(control));

    indeterminateMark.getStyleClass().setAll("indeterminate-mark");
    indeterminateMark.setOpacity(0);
    indeterminateMark.setScaleX(0);
    indeterminateMark.setScaleY(0);

    mark.getStyleClass().setAll("mark");
    mark.setOpacity(0);
    mark.setScaleX(0);
    mark.setScaleY(0);

    box.getStyleClass().setAll("box");
    box.setBorder(new Border(new BorderStroke(control.getUnCheckedColor(),
        BorderStrokeStyle.SOLID,
        new CornerRadii(2),
        new BorderWidths(2))));
    box.getChildren().setAll(indeterminateMark, mark);

    boxContainer = new StackPane();
    boxContainer.getChildren().add(box);
    boxContainer.getStyleClass().add("box-container");
    rippler = new JFXRippler(boxContainer, RipplerMask.CIRCLE, JFXRippler.RipplerPos.BACK);

    updateRippleColor();

    // add listeners
    control.selectedProperty().addListener( observable -> {
        updateRippleColor();
        playSelectAnimation(control.isSelected(), true);
    });
    control.indeterminateProperty().addListener(observable -> {
        updateRippleColor();
        playIndeterminateAnimation(control.isIndeterminate(), true);
    });

    // show focused state
    control.focusedProperty().addListener((o, oldVal, newVal) -> {
        if (newVal) {
            if (!getSkinnable().isPressed()) {
                rippler.setOverlayVisible(true);
            }
        } else {
            rippler.setOverlayVisible(false);
        }
    });
    control.pressedProperty().addListener((o, oldVal, newVal) -> rippler.setOverlayVisible(false));
    updateChildren();

    // create animation
    transition = new CheckBoxTransition(mark);
    indeterminateTransition = new CheckBoxTransition(indeterminateMark);
    createFillTransition();

    registerChangeListener(control.checkedColorProperty(), "CHECKED_COLOR");
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:58,代码来源:JFXCheckBoxSkin.java


示例10: updateRippleColor

import com.jfoenix.controls.JFXCheckBox; //导入依赖的package包/类
private void updateRippleColor() {
    rippler.setRipplerFill(getSkinnable().isSelected() ? ((JFXCheckBox) getSkinnable()).getCheckedColor() : ((JFXCheckBox) getSkinnable())
        .getUnCheckedColor());
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:5,代码来源:JFXCheckBoxSkin.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HtmlTextArea类代码示例发布时间:2022-05-22
下一篇:
Java FreeMarkerConfigurationFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap