Example usage for javafx.scene.control TreeView getWidth

List of usage examples for javafx.scene.control TreeView getWidth

Introduction

In this page you can find the example usage for javafx.scene.control TreeView getWidth.

Prototype

public final double getWidth() 

Source Link

Usage

From source file:org.eclipse.jubula.rc.javafx.tester.adapter.TreeOperationContext.java

@Override
public Rectangle getVisibleRowBounds(final Rectangle rowBounds) {
    Rectangle result = EventThreadQueuerJavaFXImpl.invokeAndWait("getVisibleRowBounds", //$NON-NLS-1$
            new Callable<Rectangle>() {

                @Override//from w  w w .j  a v a2s. c  o  m
                public Rectangle call() throws Exception {
                    TreeView<?> tree = ((TreeView<?>) getTree());
                    // Update the layout coordinates otherwise
                    // we would get old position values
                    tree.layout();
                    Rectangle visibleTreeBounds = new Rectangle(0, 0, Rounding.round(tree.getWidth()),
                            Rounding.round(tree.getHeight()));
                    return rowBounds.intersection(visibleTreeBounds);
                }
            });
    return result;

}