private void observe(Node n) { n.layoutXProperty().addListener(this); n.layoutYProperty().addListener(this); }
curvedLine.setFill(Color.TRANSPARENT); curvedLine.setMouseTransparent(true); rotationAngle.addListener((o, oldVal, newVal) -> { final double newstartXR = ((cosRotAngle * diffStartCenterX) - (sinRotAngle * diffStartCenterY)) + centerX; final double newstartYR = (sinRotAngle * diffStartCenterX) + (cosRotAngle * diffStartCenterY) + centerY;
root.vgapProperty().addListener((observable -> autoCompletePopup.setShift(root.getVgap() * 2)));
private void refreshView() { if (glyph.getValue() == null) { idLabel.setText(""); nameLabel.setText(""); return; } sizeSlider.valueProperty().addListener(observable -> glyph.get().setSize(sizeSlider.getValue())); idLabel.setText(String.format("%04d", glyph.get().getGlyphId())); nameLabel.setText(glyph.get().getName()); glyph.get().setFill(colorPicker.getValue()); glyph.get().fillProperty().bind(colorPicker.valueProperty()); centeredGlyph.getChildren().setAll(glyph.get()); }
innerCircleCurve.endXProperty().bind(curves.get(1).startXProperty()); innerCircleCurve.endYProperty().bind(curves.get(1).startYProperty()); curves.get(0).startXProperty().addListener((o, oldVal, newVal) -> { final Point2D controlPoint = makeControlPoint(newVal.doubleValue(), curves.get(0).getStartY(), innerCircleCurve.setControlY1(controlPoint.getY()); }); curves.get(0).startYProperty().addListener((o, oldVal, newVal) -> { final Point2D controlPoint = makeControlPoint(curves.get(0).getStartX(), newVal.doubleValue(), innerCircleCurve.setControlY1(controlPoint.getY()); }); curves.get(1).startXProperty().addListener((o, oldVal, newVal) -> { final Point2D controlPoint = makeControlPoint(newVal.doubleValue(), curves.get(1).getStartY(), innerCircleCurve.setControlY2(controlPoint.getY()); }); curves.get(1).startYProperty().addListener((o, oldVal, newVal) -> { final Point2D controlPoint = makeControlPoint(curves.get(1).getStartX(), newVal.doubleValue(),
}); colorSelector.translateXProperty() .addListener((o, oldVal, newVal) -> updateHSLCircleColor((int) (newVal.intValue() + colorSelector.getPrefWidth() / 2), (int) (colorSelector.getTranslateY() + colorSelector .getPrefHeight() / 2))); colorSelector.translateYProperty() .addListener((o, oldVal, newVal) -> updateHSLCircleColor((int) (colorSelector.getTranslateX() + colorSelector .getPrefWidth() / 2), (int) (newVal.intValue() + colorSelector.getPrefHeight() / 2))); .addListener((o, oldVal, newVal) -> setColorAtLocation(newVal.intValue() + selectorSize / 2, (int) selector.getTranslateY() + selectorSize / 2)); selector.translateYProperty() .addListener((o, oldVal, newVal) -> setColorAtLocation((int) selector.getTranslateX() + selectorSize / 2, newVal.intValue() + selectorSize / 2));
control.fixedCellSizeProperty().addListener(observable -> suggestionList.setFixedCellSize(control.getFixedCellSize())); suggestionList.getItems().addListener((InvalidationListener) observable -> { itemChanged = true;
offsetProperty.addListener((o, oldVal, newVal) -> header.updateScrollOffset(newVal.doubleValue()));
initTranslate.addListener(observable -> updateDrawerAnimation(initTranslate.get())); translateProperty.addListener((o, oldVal, newVal) -> { if (!openCalled && closeCalled && directionProperty.get().doubleValue() * newVal.doubleValue() > translateProperty.addListener((o, oldVal, newVal) -> { if (openCalled && !closeCalled && directionProperty.get().doubleValue() * newVal.doubleValue() <
private void initListeners() { // delegate slider mouse events to track node mouseHandlerPane.setOnMousePressed(this::delegateToTrack); mouseHandlerPane.setOnMouseReleased(this::delegateToTrack); mouseHandlerPane.setOnMouseDragged(this::delegateToTrack); // animate value node track.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> { timeline.setRate(1); timeline.play(); }); track.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> { timeline.setRate(-1); timeline.play(); }); thumb.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> { timeline.setRate(1); timeline.play(); }); thumb.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> { timeline.setRate(-1); timeline.play(); }); refreshSliderValueBinding(); updateValueStyleClass(); getSkinnable().valueProperty().addListener(observable -> updateValueStyleClass()); getSkinnable().orientationProperty().addListener(observable -> initAnimation(getSkinnable().getOrientation())); }
scrollPane.setContent(contentContainer); scrollPane.setFitToWidth(true); scrollPane.vvalueProperty().addListener((o, oldVal, newVal) -> { if (minHeight == -1) { minHeight = bottomBar.getBoundsInParent().getMinY();
private void install() { this.lineCount.addListener(this::recomputeContentHeight); this.lineHeight.addListener(this::recomputeContentHeight); this.contentHeight.addListener(this::recomputeMax); this.contentAreaHeight.addListener(this::recomputeMax); this.lineHeight.addListener(this::recomputeVisibleLineCount); this.contentAreaHeight.addListener(this::recomputeVisibleLineCount); this.offset.addListener(this::recomputeVisibleLines); this.lineHeight.addListener(this::recomputeVisibleLines); this.visibleLineCount.addListener(this::recomputeVisibleLines); }
public LineRuler(LineRulerAnnotationPresenter.LayoutHint h, Function<Integer, Set<Annotation>> converter, Predicate<Set<Annotation>> needsPresentation, Supplier<Node> nodeFactory, BiConsumer<Node, Set<Annotation>> nodePopulator) { super(converter, needsPresentation, nodeFactory, nodePopulator); this.h = h; this.yOffset.addListener((x, o, n)->requestLayout()); this.fixedWidth.addListener((x, o, n)->requestLayout()); }
@Override public void addListener(ChangeListener<? super Number> listener) { if (listener instanceof UIThreadAware) { getDelegate().addListener(listener); } else { getDelegate().addListener(new UIThreadAwareChangeListener<>(listener)); } }
@Override public void addListener(InvalidationListener listener) { if (listener instanceof UIThreadAware) { getDelegate().addListener(listener); } else { getDelegate().addListener(new UIThreadAwareInvalidationListener(listener)); } }
public VFlow(Supplier<N> nodeFactory, BiConsumer<N, Integer> nodePopulator) { this.nodeFactory = nodeFactory; this.nodePopulator = nodePopulator; this.visibleLines.addListener(this::onVisibleLinesChange); this.yOffset.addListener((x)->requestLayout()); this.numberOfLines.addListener(this::onNumberOfLinesChange); }
private void addDividerPositionChangeListener(int dividerIndex) { SplitPane.Divider divider = splitPane.getDividers().get(dividerIndex); if (dividerPositionChangeListeners.containsKey(divider)) { throw new IllegalStateException(); } DividerPositionChangeListener dividerPositionChangeListener = new DividerPositionChangeListener(dividerIndex); dividerPositionChangeListener.adjustingProperty().bindBidirectional(adjustingProperty()); dividerPositionChangeListeners.put(divider, dividerPositionChangeListener); divider.positionProperty().addListener(dividerPositionChangeListener); }
private void addResizeHandler(final Group g) { control.parentWidthProperty().addListener((observable, oldValue, newValue) -> { g.getChildren().clear(); initializeFrame(g); }); }
private void init() { this.getStyleClass().add("vnode-connector"); this.setManaged(true); setCacheShape(true); setCache(true); setCacheHint(CacheHint.SPEED); this.prefWidthProperty().bind(radiusProperty()); radiusProperty().addListener((ov,oldV,newV)-> { resize(newV.doubleValue()*2, newV.doubleValue()*2); }); }
private void listenToValues() { segments.get().addListener(weakSumListener); getSegments().forEach(segment -> { // first remove then add listener to ensure listener is only added once segment.valueProperty().removeListener(weakSumListener); segment.valueProperty().addListener(weakSumListener); }); }