private boolean determineVerticalSBVisible(final ScrollPane scrollPane) { try { final ScrollPaneSkin skin = (ScrollPaneSkin) scrollPane.getSkin(); final Field field = skin.getClass().getDeclaredField("vsb"); field.setAccessible(true); final ScrollBar scrollBar = (ScrollBar) field.get(skin); field.setAccessible(false); return scrollBar.isVisible(); } catch (final Exception e) { e.printStackTrace(); } return false; }
&& vBar.getSelection() == 0) || !vBar.isEnabled() || !vBar.isVisible())) {
.isVisible()) ) { msg = WM_HSCROLL;
@Override protected void layoutChildren() { double layoutWidth = getLayoutBounds().getWidth(); double layoutHeight = getLayoutBounds().getHeight(); boolean vbarVisible = vbar.isVisible(); boolean hbarVisible = hbar.isVisible(); double vbarWidth = vbarVisible ? vbar.prefWidth(-1) : 0; double hbarHeight = hbarVisible ? hbar.prefHeight(-1) : 0; double w = layoutWidth - vbarWidth; double h = layoutHeight - hbarHeight; content.resize(w, h); hbar.setVisibleAmount(w); vbar.setVisibleAmount(h); if(vbarVisible) { vbar.resizeRelocate(layoutWidth - vbarWidth, 0, vbarWidth, h); } if(hbarVisible) { hbar.resizeRelocate(0, layoutHeight - hbarHeight, w, hbarHeight); } }
if (timeline.getStatus() == Animation.Status.RUNNING || !scrollBar.isVisible()) { timeline.pause(); } else {
@Override protected void handleControlPropertyChanged(String p) { super.handleControlPropertyChanged(p); if (p == "HOVER") { setGrowScrollbarAnimation(); if (getSkinnable().isHover() && fadeable) { fadeOutSeq.jumpTo(Duration.millis(0)); fadeOutSeq.stop(); } else if (fadeable && alreadyFaded) { fadeOutSeq.playFromStart(); } } if (p == "VALUE") { /* * when value changes, scrolling is activated and the scrollbar has to fade in for some * time and fade out again, when there is no further interaction */ if (fadeable && fadeOutSeq != null && fadeOutSeq.getCurrentRate() != 0.0d) { fadeOutSeq.playFromStart(); } else if (fadeable) { fading(); } } if (p == "VISIBLE") { if (fadeable && getSkinnable().isVisible()) { fading(); } } }