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); } }
private void removeLayoutListeners() { Window stage = getOwner(); if (stage != null) { stage.getScene().widthProperty().removeListener(widthListener); stage.getScene().heightProperty().removeListener(heightListener); stage.xProperty().removeListener(xListener); stage.yProperty().removeListener(yListener); } }
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); } }
private void removeLayoutListeners() { Window stage = getOwner(); if (stage != null) { stage.getScene().widthProperty().removeListener(widthListener); stage.getScene().heightProperty().removeListener(heightListener); stage.xProperty().removeListener(xListener); stage.yProperty().removeListener(yListener); } }
ownerWindow.xProperty().addListener(new WeakInvalidationListener(o -> updateLocation())); ownerWindow.yProperty().addListener(new WeakInvalidationListener(o -> updateLocation())); note.setOnShown(e -> updateLocation());
ownerWindow.xProperty().removeListener(weakXListener); ownerWindow.yProperty().removeListener(weakYListener); ownerWindow.widthProperty().removeListener(weakHideListener); ownerWindow.xProperty().addListener(weakXListener); ownerWindow.yProperty().addListener(weakYListener); ownerWindow.widthProperty().addListener(weakHideListener);
oldV.widthProperty().removeListener(this::handleStageChange); oldV.heightProperty().removeListener(this::handleStageChange); oldV.xProperty().removeListener(this::handleStageChange); oldV.yProperty().removeListener(this::handleStageChange); newV.widthProperty().addListener(this::handleStageChange); newV.heightProperty().addListener(this::handleStageChange); newV.xProperty().addListener(this::handleStageChange); newV.yProperty().addListener(this::handleStageChange);
oldV.widthProperty().removeListener(this::handleStageChange); oldV.heightProperty().removeListener(this::handleStageChange); oldV.xProperty().removeListener(this::handleStageChange); oldV.yProperty().removeListener(this::handleStageChange); newV.widthProperty().addListener(this::handleStageChange); newV.heightProperty().addListener(this::handleStageChange); newV.xProperty().addListener(this::handleStageChange); newV.yProperty().addListener(this::handleStageChange);
getPopupWindow().xProperty().addListener(updatePathListener); getPopupWindow().yProperty().addListener(updatePathListener); popOver.arrowLocationProperty().addListener(updatePathListener);