Package javax.swing.tree

Examples of javax.swing.tree.VariableHeightLayoutCache$TreeStateNode


        assertEquals(4, ui.treeState.getRowCount());
        assertEquals(4, ui.getRowCount(new JTree()));
        TreePath p = new TreePath(new Object[] { root, node2 });
        tree.expandPath(p);
        assertEquals(6, ui.getRowCount(tree));
        ui.treeState = new VariableHeightLayoutCache() {
            @Override
            public int getRowCount() {
                return -200;
            }
        };
View Full Code Here


        assertTrue(tree.isRootVisible());
        TreePath p = new TreePath(new Object[] { root, node2 });
        assertEquals(2, ui.getRowForPath(tree, p));
        assertEquals(2, ui.getRowForPath(new JTree(), p));
        tree.expandPath(new TreePath(new Object[] { root, node1 }));
        ui.treeState = new VariableHeightLayoutCache() {
            @Override
            public int getRowForPath(final TreePath p) {
                return -200;
            }
        };
View Full Code Here

    public void testUpdateExpandedDescendants() {
        TreePath pathToExpand = new TreePath(tree.getModel().getRoot())
                .pathByAddingChild(node1);
        tree.expandPath(pathToExpand);
        assertTrue(ui.treeState.isExpanded(pathToExpand));
        ui.treeState = new VariableHeightLayoutCache();
        ui.treeState.setModel(tree.getModel());
        assertFalse(ui.treeState.isExpanded(pathToExpand));
        ui.updateExpandedDescendants(new TreePath(tree.getModel().getRoot()));
        assertTrue(ui.treeState.isExpanded(pathToExpand));
    }
View Full Code Here

    public void testConfigureLayoutCache() {
        TreePath expandedPath = new TreePath(tree.getModel().getRoot())
                .pathByAddingChild(node1);
        tree.expandPath(expandedPath);
        ui.treeState = new VariableHeightLayoutCache();
        ui.configureLayoutCache();
        assertSame(tree.getModel(), ui.treeState.getModel());
        assertSame(tree.getSelectionModel(), ui.treeState.getSelectionModel());
        assertSame(ui.nodeDimensions, ui.treeState.getNodeDimensions());
        assertEquals(tree.getRowHeight(), ui.treeState.getRowHeight());
View Full Code Here

   *
   * @return the object responsible for managing what is expanded.
   */
  protected AbstractLayoutCache createLayoutCache()
  {
    return new VariableHeightLayoutCache();
  }
View Full Code Here

TOP

Related Classes of javax.swing.tree.VariableHeightLayoutCache$TreeStateNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.