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

Java ToggleSwitch类代码示例

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

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



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

示例1: createCountBox

import org.controlsfx.control.ToggleSwitch; //导入依赖的package包/类
private VBox createCountBox() {
  VBox countBox = new VBox(10);
  countBox.setAlignment(Pos.CENTER);
  Set<Sip> selectedSet = RodaInApplication.getSelectedDescriptionObjects().keySet();
  Set<Sip> allSet = RodaInApplication.getAllDescriptionObjects().keySet();
  selectedSIP = selectedSet.stream().filter(p -> p instanceof SipPreview).count();
  selectedItems = selectedSet.size() - selectedSIP;
  allSIP = allSet.stream().filter(p -> p instanceof SipPreview).count();
  allItems = allSet.size() - allSIP;

  sSelectedSIP = String.format("%s %d/%d SIP", I18n.t(Constants.I18N_SELECTED), this.selectedSIP, this.allSIP);
  sSelectedItems = String.format("%d/%d %s", this.selectedItems, this.allItems, I18n.t(Constants.I18N_ITEMS));
  sZeroItems = String.format("%d/%d %s", 0, this.allItems, I18n.t(Constants.I18N_ITEMS));
  sAllSIP = String.format("%s %d/%d SIP", I18n.t(Constants.I18N_SELECTED), this.allSIP, this.allSIP);
  sAllItems = String.format("%d/%d %s", this.allItems, this.allItems, I18n.t(Constants.I18N_ITEMS));

  String startingLabel = sSelectedSIP;
  if (allItems != 0) {
    startingLabel = String.format("%s %s %s", sSelectedSIP, I18n.t(Constants.I18N_AND), sZeroItems);
  }

  Label countLabel = new Label(startingLabel);
  countLabel.getStyleClass().add(Constants.CSS_PREPARECREATIONSUBTITLE);
  sipExportSwitch = new ToggleSwitch(I18n.t(Constants.I18N_CREATIONMODALPREPARATION_EXPORT_ALL));
  sipExportSwitch.selectedProperty().addListener((o, old, newValue) -> setSelectedLabel(countLabel));

  if (this.selectedSIP == 0 || this.selectedSIP == this.allSIP)
    sipExportSwitch.setSelected(true);

  itemExportSwitch = new ToggleSwitch(I18n.t(Constants.I18N_CREATIONMODALPREPARATION_INCLUDE_HIERARCHY));
  itemExportSwitch.selectedProperty().addListener((o, old, newValue) -> setSelectedLabel(countLabel));

  String savedState = ConfigurationManager.getAppConfig(Constants.CONF_K_EXPORT_LAST_ITEM_EXPORT_SWITCH);
  if (StringUtils.isNotBlank(savedState)) {
    itemExportSwitch.setSelected(Boolean.valueOf(savedState));
  }

  countBox.getChildren().addAll(countLabel, sipExportSwitch, itemExportSwitch);
  return countBox;
}
 
开发者ID:keeps,项目名称:roda-in,代码行数:41,代码来源:CreationModalPreparation.java


示例2: createReportBox

import org.controlsfx.control.ToggleSwitch; //导入依赖的package包/类
private VBox createReportBox() {
  VBox reportBox = new VBox(10);
  reportBox.setAlignment(Pos.CENTER);
  reportCreationSwitch = new ToggleSwitch(I18n.t(Constants.I18N_CREATIONMODALPREPARATION_CREATE_REPORT));
  reportCreationSwitch.setSelected(true);

  String savedState = ConfigurationManager.getAppConfig(Constants.CONF_K_EXPORT_LAST_REPORT_CREATION_SWITCH);
  if (StringUtils.isNotBlank(savedState)) {
    reportCreationSwitch.setSelected(Boolean.valueOf(savedState));
  }

  reportBox.getChildren().addAll(reportCreationSwitch);
  return reportBox;

}
 
开发者ID:keeps,项目名称:roda-in,代码行数:16,代码来源:CreationModalPreparation.java


示例3: ToggleSwitchEditor

import org.controlsfx.control.ToggleSwitch; //导入依赖的package包/类
ToggleSwitchEditor(Item item) {
  super(item, new ToggleSwitch());
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:4,代码来源:ExtendedPropertySheet.java


示例4: addFeature

import org.controlsfx.control.ToggleSwitch; //导入依赖的package包/类
public void addFeature(final Feature feature) {
    features.add(feature);

    ToggleSwitch toggleSwitch = new ToggleSwitch();
    toggleSwitch.setAlignment(Pos.CENTER_LEFT);
    toggleSwitch.textProperty().bindBidirectional(feature.nameProperty());
    toggleSwitch.selectedProperty().bindBidirectional(feature.activeProperty());
    Util.installWindowDragListener(toggleSwitch);
    toggleSwitch.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    HBox.setHgrow(toggleSwitch, Priority.ALWAYS);

    Button showSlidesButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.FILM);
    showSlidesButton.getStyleClass().add("show-slides-button");
    showSlidesButton.setVisible(false);
    HBox.setHgrow(showSlidesButton, Priority.NEVER);
    Util.installWindowDragListener(showSlidesButton);

    HBox featureBox = new HBox(10, toggleSwitch, showSlidesButton);
    featureBox.setAlignment(Pos.TOP_CENTER);

    getChildren().add(featureBox);

    Optional<SlidesEntry> slidesEntry = MovieApp.slidesDatabase.getSlideEntry(feature.getId());
    if (slidesEntry.isPresent()) {
        SlidesEntry entry = slidesEntry.get();
        if (!entry.getSlides().isEmpty()) {
            showSlidesButton.setVisible(true);
            showSlidesButton.setOnAction(evt -> SlidesViewer.showSlides(entry, true));

            toggleSwitch.selectedProperty().addListener(it -> {
                if (toggleSwitch.isSelected()) {
                    SlidesViewer.showSlides(entry, false);
                }
            });
        } else {
            toggleSwitch.selectedProperty().addListener(it -> {
                if (toggleSwitch.isSelected()) {
                    SlidesViewer.showSlides(null, false);
                }
            });
        }
    } else {
        toggleSwitch.selectedProperty().addListener(it -> {
            if (toggleSwitch.isSelected()) {
                SlidesViewer.showSlides(null, false);
            }
        });
    }
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:50,代码来源:FeaturesPane.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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