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

x33g5p2x  于2022-01-23 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(115)

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

Label.addEventFilter介绍

暂无

代码示例

代码示例来源:origin: torakiki/pdfsam

public SingleSelectionPane(String ownerModule) {
  this.getStyleClass().add("single-selection-pane");
  this.ownerModule = defaultString(ownerModule);
  this.details.getStyleClass().add("-pdfsam-selection-details");
  field.enforceValidation(true, false);
  passwordPopup = new PasswordFieldPopup(this.ownerModule);
  encryptionIndicator.getStyleClass().addAll("encryption-status");
  encryptionIndicator.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> {
    if (descriptor.loadingStatus().getValue() == ENCRYPTED) {
      showPasswordFieldPopup();
    } else if (descriptor.loadingStatus().getValue() == WITH_ERRORS) {
      eventStudio().broadcast(ShowStageRequest.INSTANCE, "LogStage");
    }
  });
  HBox.setMargin(encryptionIndicator, new Insets(0, 0, 0, 2));
  field.setGraphic(encryptionIndicator);
  field.getStyleClass().add("single-selection-top");
  HBox.setHgrow(field, Priority.ALWAYS);
  getChildren().addAll(field, details);
  field.getTextField().validProperty().addListener(onValidState);
  initContextMenu();
  eventStudio().addAnnotatedListeners(this);
}

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

protected void buildCollpaseExpand() {
 StackPane wrapper = new StackPane();
 FontIcon collpasedLabelicon = new FontIcon("fa-arrow-right:20");
 collpasedLabel.setGraphic(collpasedLabelicon);
 FontIcon expandedLabelicon = new FontIcon("fa-arrow-left:20");
 expandedLabel.setGraphic(expandedLabelicon);
 collpasedLabel.managedProperty().bind(Bindings.not(collpased));
 collpasedLabel.visibleProperty().bind(collpasedLabel.managedProperty());
 expandedLabel.managedProperty().bind(collpased);
 expandedLabel.visibleProperty().bind(expandedLabel.managedProperty());
 collpased.set(true);
 wrapper.getChildren().addAll(collpasedLabel, expandedLabel);
 wrapper.setStyle("-fx-max-width:48;-fx-min-width:48;");
 collpasedLabel.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> onCollapseExpand());
 expandedLabel.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> onCollapseExpand());
 // !! should be las items
 // child class should handle this
 rootContainer.getChildren().add(wrapper);
}

相关文章