private DoubleBinding createYPositionBinding(StackPane track, ScrollBar scrollBar) { Callable<Double> getY = () -> { double height = track.getLayoutBounds().getHeight(); return scalePosition(position.get(), height, scrollBar); }; return Bindings.createDoubleBinding( getY, position, alignment, thickness, track.layoutBoundsProperty(), scrollBar.minProperty(), scrollBar.maxProperty()); }
private DoubleBinding createXPositionBinding(StackPane track, ScrollBar scrollBar) { Callable<Double> getX = () -> { double width = track.getLayoutBounds().getWidth(); return scalePosition(position.get(), width, scrollBar); }; return Bindings.createDoubleBinding( getX, position, alignment, thickness, track.layoutBoundsProperty(), scrollBar.minProperty(), scrollBar.maxProperty()); }