javafx.beans.property.ReadOnlyDoubleProperty.addListener()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(98)

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

ReadOnlyDoubleProperty.addListener介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

/***************************************************************************
 * * Public API * *
 **************************************************************************/
public void registerSnackbarContainer(Pane snackbarContainer) {
  if (snackbarContainer != null) {
    if (this.snackbarContainer != null) {
      //since listeners are added the container should be properly registered/unregistered
      throw new IllegalArgumentException("Snackbar Container already set");
    }
    this.snackbarContainer = snackbarContainer;
    this.snackbarContainer.getChildren().add(this);
    this.snackbarContainer.heightProperty().addListener(weakSizeListener);
    this.snackbarContainer.widthProperty().addListener(weakSizeListener);
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

private void addLayoutListeners() {
  Window stage = getOwner();
  if (stage != null) {
    if (widthListener == null) {
      throw new RuntimeException("Owner can only be set using the constructor");
    }
    stage.getScene().widthProperty().addListener(widthListener);
    stage.getScene().heightProperty().addListener(heightListener);
    stage.xProperty().addListener(xListener);
    stage.yProperty().addListener(yListener);
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

/***************************************************************************
 * * Setters / Getters * *
 **************************************************************************/
public void setControl(Node control) {
  if (control != null) {
    this.control = control;
    this.badge = new Group();
    this.getChildren().add(control);
    this.getChildren().add(badge);
    // if the control got resized the badge must be rest
    if (control instanceof Region) {
      ((Region) control).widthProperty().addListener((o, oldVal, newVal) -> refreshBadge());
      ((Region) control).heightProperty().addListener((o, oldVal, newVal) -> refreshBadge());
    }
    text.addListener((o, oldVal, newVal) -> refreshBadge());
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

public void show() {
  dialog.setOpacity(0);
  //		pickerDecorator.setOpacity(0);
  if (dialog.getOwner() != null) {
    dialog.widthProperty().addListener(positionAdjuster);
    dialog.heightProperty().addListener(positionAdjuster);
    positionAdjuster.invalidated(null);
  }
  if (dialog.getScene() == null) {
    dialog.setScene(customScene);
  }
  curvedColorPicker.preAnimate();
  dialog.show();
  if (initOnce) {
    initRun.run();
    initOnce = false;
  }
  Timeline timeline = new Timeline(new KeyFrame(Duration.millis(120),
    new KeyValue(dialog.opacityProperty(),
      1,
      Interpolator.EASE_BOTH)));
  timeline.setOnFinished((finish) -> curvedColorPicker.animate());
  timeline.play();
}

代码示例来源:origin: jfoenixadmin/JFoenix

public JFXProgressBarSkin(JFXProgressBar bar) {
  super(bar);
  bar.widthProperty().addListener(observable -> {
    updateProgress();
    updateSecondaryProgress();
  });
  registerChangeListener(bar.secondaryProgressProperty(), "SECONDARY_PROGRESS");
  registerChangeListener(bar.visibleProperty(), "VISIBLE");
  registerChangeListener(bar.parentProperty(), "PARENT");
  registerChangeListener(bar.sceneProperty(), "SCENE");
  getSkinnable().requestLayout();
}

代码示例来源:origin: jfoenixadmin/JFoenix

this.widthProperty().addListener((o, oldVal, newVal) -> updateToggleAnimation());
this.heightProperty().addListener((o, oldVal, newVal) -> updateToggleAnimation());
  newVal.widthProperty().addListener((o1, oldVal1, newVal1) -> updateToggleAnimation());
  newVal.heightProperty().addListener((o1, oldVal1, newVal1) -> updateToggleAnimation());
  newVal.setOnMouseClicked((click) -> togglePane());
});

代码示例来源:origin: jfoenixadmin/JFoenix

if (newList != null) {
  if (getListView() instanceof JFXListView) {
    ((JFXListView<?>) newList).currentVerticalGapProperty().addListener((o, oldVal, newVal) -> {
      cellRippler.rippler.setClip(null);
      if (newVal.doubleValue() != 0) {

代码示例来源:origin: jfoenixadmin/JFoenix

container.getChildren().add(new Label("Selection Path..."));
container.setAlignment(Pos.CENTER_LEFT);
container.widthProperty().addListener(observable -> setHvalue(getHmax()));
setContent(container);
setPannable(true);

代码示例来源:origin: jfoenixadmin/JFoenix

errorLabel.heightProperty().addListener((o, oldVal, newVal) -> {
  if (errorShown) {
    if (oldErrorLabelHeight == -1) {

代码示例来源:origin: com.jfoenix/jfoenix

/***************************************************************************
 * * Public API * *
 **************************************************************************/
public void registerSnackbarContainer(Pane snackbarContainer) {
  if (snackbarContainer != null) {
    if (this.snackbarContainer != null) {
      //since listeners are added the container should be properly registered/unregistered
      throw new IllegalArgumentException("Snackbar Container already set");
    }
    this.snackbarContainer = snackbarContainer;
    this.snackbarContainer.getChildren().add(this);
    this.snackbarContainer.heightProperty().addListener(weakSizeListener);
    this.snackbarContainer.widthProperty().addListener(weakSizeListener);
  }
}

代码示例来源:origin: com.jfoenix/jfoenix

private void addLayoutListeners() {
  Window stage = getOwner();
  if (stage != null) {
    if (widthListener == null) {
      throw new RuntimeException("Owner can only be set using the constructor");
    }
    stage.getScene().widthProperty().addListener(widthListener);
    stage.getScene().heightProperty().addListener(heightListener);
    stage.xProperty().addListener(xListener);
    stage.yProperty().addListener(yListener);
  }
}

代码示例来源:origin: org.beryx.viewreka/viewreka-fxui

/**
 * @param chartParentPane that should contain the {@link WebView} used by this chart controller
 * @param webEngineConsumer a {@link WebEngine} consumer that knows how to retrieve the content to be displayed, without relying on the value returned by {@link #createChartData()}
 */
public HtmlChartController(Pane chartParentPane, Consumer<WebEngine> webEngineConsumer) {
  this.webEngineConsumer = webEngineConsumer;
  chartParentPane.getChildren().add(webView);
  chartParentPane.widthProperty().addListener((obs, oldVal, newVal) -> {webView.setPrefWidth(newVal.doubleValue());});
  chartParentPane.heightProperty().addListener((obs, oldVal, newVal) -> {webView.setPrefHeight(newVal.doubleValue());});
}

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private void registerSizeChanges() {
  root.widthProperty().addListener((observableValue, oldSceneWidth, newSceneWidth) ->
      widthChange((Double) oldSceneWidth, (Double) newSceneWidth));
  root.heightProperty().addListener((observableValue, oldSceneHeight, newSceneHeight) ->
      heightChange((Double) oldSceneHeight, (Double) newSceneHeight));
}
/**

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

/**
 * Constructor
 */
public Toolbar() {
 super();
 setHgrow(this, Priority.ALWAYS);
 widthProperty().addListener((ChangeListener<Number>) this::handleParentWidthChange);
}

代码示例来源:origin: org.drombler.commons/drombler-commons-fx-docking

public DividerPositionRecalculator(DockingSplitPane dockingSplitPane, SplitPane splitPane) {
    this.dockingSplitPane = dockingSplitPane;
    this.splitPane = splitPane;

//        this.splitPane.getItems().addListener(splitPaneItemsListener);
    this.dockingSplitPane.getDockingSplitPaneChildren().addListener(dockingSplitPaneChildrenListener);
    this.dockingSplitPane.widthProperty().addListener(sizeChangeListener);
    this.dockingSplitPane.heightProperty().addListener(sizeChangeListener);
  }

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

protected void init() {
 rootPaneWidthChangeListener = this::handleSceneWidthChange;
 getRootPane().widthProperty().addListener(rootPaneWidthChangeListener);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

public InsertionMarkerLayer() {
  heightProperty().addListener((x, o, n)-> {
    this.getChildren().remove(this.insertionMarker);
    this.insertionMarker = createInsertionMarker(n.doubleValue());
    this.getChildren().add(this.insertionMarker);
  });
  this.insertionMarker = createInsertionMarker(getHeight());
  this.getChildren().add(this.insertionMarker);
}

代码示例来源:origin: com.cedarsoft.commons/javafx

@Nonnull
public static TextField textFieldDoubleReadonly(@Nonnull ReadOnlyDoubleProperty doubleProperty, @Nonnull NumberStringConverterForFloatingPointNumbers floatConverter) {
 TextField textField = new TextField();
 doubleProperty.addListener((observable, oldValue, newValue) -> textField.setText(floatConverter.toString(newValue)));
 textField.setText(floatConverter.toString(doubleProperty.get()));
 textField.setEditable(false);
 return textField;
}

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

public void _doSetSecondaryheader(Node node) {
 secondaryHeaderStack.setVisible(true);
 secondaryHeaderStack.getChildren().clear();
 secondaryHeaderStack.getChildren().add(node);
 secondaryHeaderStack.heightProperty().addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> {
  pushedContentWrapper.translateYProperty().set(newValue.doubleValue() + 2);
  rootStructureWrapper.translateYProperty().set(newValue.doubleValue() + 2);
 });
}

代码示例来源:origin: com.guigarage/responsivefx

public static void addResponsiveToWindow(Window window) {
  StringProperty stylesheet = new SimpleStringProperty(getCurrentResponsiveStylesheet(window));
  Util.bindStyleSheetToWindow(window, stylesheet);
  updatePseudoClassesForAllChildren(window);
  //TODO: Falsch! Hier muss der ursprünglich gesetzte Wert gespeichert werden! managed müsste eine styledProperty sein
  updateManagedPropertyForAllChildren(window);
  Util.registerRecursiveChildObserver(window, n -> removeAllPseudoClasses(n), n -> updatePseudoClasses(n, getTypeForWindow(window)));
  window.widthProperty().addListener(e -> {
    stylesheet.setValue(getCurrentResponsiveStylesheet(window));
    updatePseudoClassesForAllChildren(window);
    updateManagedPropertyForAllChildren(window);
  });
  window.getScene().getRoot().layout();
}

相关文章