javafx.scene.control.Button.visibleProperty()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中javafx.scene.control.Button.visibleProperty()方法的一些代码示例,展示了Button.visibleProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.visibleProperty()方法的具体详情如下:
包路径:javafx.scene.control.Button
类名称:Button
方法名:visibleProperty

Button.visibleProperty介绍

暂无

代码示例

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Constructor
 */
public SingleLocationNavigationBar() {
 super();
 IconUtils.setHeaderNavigationBack(backIcon);
 backIcon.setOnAction(e -> goBack());
 backIcon.getStyleClass().addAll("app-header-button", "simple-button");
 backIcon.managedProperty().bind(backIcon.visibleProperty());
 backIcon.setDisable(true);
 getChildren().addAll(backIcon, locationContainer);
 getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar");
 getStyleClass().add("ep-primary-menu-with-navbar-toolbar");
 managedProperty().bind(visibleProperty());
}

代码示例来源:origin: io.datafx/ui

@Override public void changed(
      ObservableValue<? extends Service<?>> observableValue,
      Service<?> oldValue, Service<?> newValue) {
    try {
      if (oldValue != null) {
        taskTitleLabel.textProperty().unbind();
        taskMessageLabel.textProperty().unbind();
        taskProgress.progressProperty().unbind();
        killTaskButton.visibleProperty().unbind();
      }
      if (newValue != null) {
        taskTitleLabel.textProperty().bind(newValue.titleProperty());
        taskMessageLabel.textProperty().bind(newValue.messageProperty());
        taskProgress.progressProperty().bind(newValue.progressProperty());
        if (newValue instanceof DataFxService<?>) {
          killTaskButton.visibleProperty().bind(((DataFxService<?>) newValue).cancelableProperty());
        } else {
          killTaskButton.visibleProperty().set(true);
        }
        anchorPane.setVisible(true);
      } else {
        anchorPane.setVisible(false);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
});

代码示例来源:origin: org.javafxdata/datafx-ui

@Override public void changed(
      ObservableValue<? extends Service<?>> observableValue,
      Service<?> oldValue, Service<?> newValue) {
    try {
      if (oldValue != null) {
        taskTitleLabel.textProperty().unbind();
        taskMessageLabel.textProperty().unbind();
        taskProgress.progressProperty().unbind();
        killTaskButton.visibleProperty().unbind();
      }
      if (newValue != null) {
        taskTitleLabel.textProperty().bind(newValue.titleProperty());
        taskMessageLabel.textProperty().bind(newValue.messageProperty());
        taskProgress.progressProperty().bind(newValue.progressProperty());
        newValue.progressProperty().addListener((e) -> System.out.println("Changed: " + newValue.progressProperty().get()));
        if (newValue instanceof DataFxService<?>) {
          killTaskButton.visibleProperty().bind(((DataFxService<?>) newValue).cancelableProperty());
        } else {
          killTaskButton.visibleProperty().set(true);
        }
        anchorPane.setVisible(true);
      } else {
        anchorPane.setVisible(false);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
});

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

closeFilterButton.managedProperty().bind(closeFilterButton.visibleProperty());
closeFilterButton.setVisible(false);
closeFilterButton.setOnAction(e -> endFiltering());
IconUtils.setFontIcon("fa-close:20", closeFilterButton);
filterButton.managedProperty().bind(filterButton.visibleProperty());
IconUtils.setFontIcon("fa-filter:20", filterButton);
actionsAndFiltersContainer.getChildren().add(0, filterButton);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

maximize.managedProperty().bind(maximize.visibleProperty());
maximize.visibleProperty().bind(Bindings.not(maximizeProperty));
restore.managedProperty().bind(restore.visibleProperty());
restore.visibleProperty().bind(maximizeProperty);
iconify.managedProperty().bind(iconify.visibleProperty());

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Constructor
 */
public SingleLocationPrimaryMenuWithNavigationBar() {
 super();
 IconUtils.setHeaderNavigationBack(backIcon);
 backIcon.setOnAction(e -> goBack());
 backIcon.getStyleClass().remove("jfx-button");
 backIcon.getStyleClass().remove("button");
 backIcon.managedProperty().bind(backIcon.visibleProperty());
 backIcon.setVisible(false);
 final HBox box = NodeHelper.wrapInHbox(backIcon);
 box.getStyleClass().add("ep-navbar-top-toolbar-back-icon-container");
 topToolbar.getChildren().addAll(box, locationContainer);
 getChildren().addAll(topToolbar, bottomToolbar);
 topToolbar.getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar");
 bottomToolbar.getStyleClass().add("ep-primary-menu-with-navbar-bottom-toolbar");
 getStyleClass().add("ep-primary-menu-with-navbar-toolbar");
 // location0.getStyleClass().add("current-location-item-label");
 topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty());
 topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty());
 topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty());
 bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty());
 bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty());
 bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty());
 bottomToolbar.managedProperty().bind(bottomToolbar.visibleProperty());
 NodeHelper.setHVGrow(topToolbar, bottomToolbar, this);
 bottomToolbar.setVisible(false);
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

protected ButtonBase build(VLViewComponentXML configuration) {
 if ("button".equals(type)) {
  Button buttonAction = new JFXButton();
  buttonAction.getStyleClass().remove(0);
  buttonAction.getStyleClass().removeAll("jfx-button", "button");
  buttonAction.managedProperty().bind(buttonAction.visibleProperty());
  NodeHelper.setTitle(buttonAction, configuration, controller);
  IconUtils.setIcon(buttonAction, configuration);
  NodeHelper.setStyleClass(buttonAction, configuration, "styleClass", true);
  buttonAction.getStyleClass().add("ep-button");
  String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE, "LEFT");
  buttonAction.setContentDisplay(ContentDisplay.valueOf(displayMode));
  boolean readOnly = configuration.getBooleanProperty("readOnly", false);
  buttonAction.setDisable(readOnly);
  buttonAction.addEventFilter(ActionEvent.ACTION, e -> onAction(buttonAction));
  return buttonAction;
 } else {
  Hyperlink hyperlinkAction = new Hyperlink();
  hyperlinkAction.managedProperty().bind(hyperlinkAction.visibleProperty());
  NodeHelper.setTitle(hyperlinkAction, configuration, controller);
  NodeHelper.setStyleClass(hyperlinkAction, configuration, "styleClass", true);
  IconUtils.setIcon(hyperlinkAction, configuration);
  boolean readOnly = configuration.getBooleanProperty("readOnly", false);
  hyperlinkAction.setDisable(readOnly);
  hyperlinkAction.addEventFilter(ActionEvent.ACTION, e -> onAction(hyperlinkAction));
  return hyperlinkAction;
 }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Constructor
 */
public PrimaryMenuWithNavigationBar() {
 super();
 IconUtils.setHeaderNavigationBack(backIcon);
 backIcon.setOnAction(e -> goBack());
 backIcon.getStyleClass().addAll("app-header-button", "hand-hover");
 backIcon.managedProperty().bind(backIcon.visibleProperty());
 // TO DO HANDLE PREVIOUS AND CURRENT
 previousLocation.managedProperty().bind(previousLocation.visibleProperty());
 previousLocation.setVisible(false);
 topToolbar.getChildren().addAll(backIcon, currentLocation);
 bottomToolbar.getChildren().add(previousLocation);
 getChildren().addAll(topToolbar, bottomToolbar);
 topToolbar.getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar");
 bottomToolbar.getStyleClass().add("ep-primary-menu-with-navbar-bottom-toolbar");
 getStyleClass().add("ep-primary-menu-with-navbar-toolbar");
 topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty());
 // topToolbar.maxWidthProperty().bind(topToolbar.prefWidthProperty());
 topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty());
 topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty());
 bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty());
 // bottomToolbar.maxWidthProperty().bind(bottomToolbar.prefWidthProperty());
 bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty());
 bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty());
 bottomToolbar.managedProperty().bind(bottomToolbar.visibleProperty());
 NodeHelper.setHVGrow(topToolbar, bottomToolbar, this);
 bottomToolbar.setVisible(false);
}

相关文章

微信公众号

最新文章

更多