if (scrollPane.getContent().getParent() != null) { scrollPane.getContent().getParent().addEventHandler(MouseEvent.DRAG_DETECTED, dragHandler); scrollPane.getContent().getParent().addEventHandler(ScrollEvent.ANY, scrollHandler); scrollPane.getContent().parentProperty().addListener((o,oldVal, newVal)->{ if (oldVal != null) { oldVal.removeEventHandler(MouseEvent.DRAG_DETECTED, dragHandler); double size = sizeFunc.apply(scrollPane.getContent().getLayoutBounds()); scrollDriection.set(Math.min(Math.max(scrollDriection.get() + dy / size, 0), 1)); if (Math.abs(dy) < 0.001) {
}); if (((ScrollPane) component).getContent() instanceof Parent) { scanAllNodes((Parent) ((ScrollPane) component).getContent(), pseudoClass);
/** * Scrolls scroll pane to make the given node visible */ public static void scrollToVisible(@Nonnull ScrollPane scrollPane, @Nonnull Node node) { Point2D l_positionInViewPort = localToAncestor(node, scrollPane.getContent(), 0, 0); @px double l_nodeHeight = node.getLayoutBounds().getHeight(); scrollToVisible(scrollPane, l_positionInViewPort.getY(), l_nodeHeight); }
if (scrollPane.getContent().getParent() != null) { scrollPane.getContent().getParent().addEventHandler(MouseEvent.DRAG_DETECTED, dragHandler); scrollPane.getContent().getParent().addEventHandler(ScrollEvent.ANY, scrollHandler); scrollPane.getContent().parentProperty().addListener((o,oldVal, newVal)->{ if (oldVal != null) { oldVal.removeEventHandler(MouseEvent.DRAG_DETECTED, dragHandler); double size = sizeFunc.apply(scrollPane.getContent().getLayoutBounds()); scrollDriection.set(Math.min(Math.max(scrollDriection.get() + dy / size, 0), 1)); if (Math.abs(dy) < 0.001) {
if (scrollPane.getContent() != null) { Node found = findNode(scrollPane.getContent(), id); if (found != null) { return found; }
}); if (((ScrollPane) component).getContent() instanceof Parent) { scanAllNodes((Parent) ((ScrollPane) component).getContent(), pseudoClass);
if (scrollPane.getContent() != null) { findElements(scrollPane.getContent(), predicate, accumulator);
if (scrollPane.getContent() != null) { Object found = findElement(scrollPane.getContent(), predicate); if (found != null) { return found; }
if (scrollPane.getContent() != null) { Object found = findElement(scrollPane.getContent(), id); if (found != null) { return found; }
@px double l_contentHeight = scrollPane.getContent().getLayoutBounds().getHeight();