Package javax.swing.tree

Examples of javax.swing.tree.DefaultTreeSelectionModel


*/
public class constructor implements Testlet
{
  public void test(TestHarness h)
  {
    DefaultTreeSelectionModel m = new DefaultTreeSelectionModel();
    h.check(m.getLeadSelectionPath(), null, "getLeadSelectionPath()");
    h.check(m.getLeadSelectionRow(), -1, "getLeadSelectionRow()");
    h.check(m.getMaxSelectionRow(), -1, "getMaxSelectionRow()");
    h.check(m.getMinSelectionRow(), -1, "getMinSelectionRow()");
    h.check(m.getRowMapper(), null, "getRowMapper()");
    h.check(m.getSelectionCount(), 0, "getSelectionCount()");
    h.check(m.getSelectionMode(),
            DefaultTreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION,
            "getSelectionMode()");
    h.check(m.getSelectionPath(), null, "getSelectionPath()");
    h.check(m.getSelectionPaths(), null, "getSelectionPaths()");
    h.check(m.getSelectionRows(), null, "getSelectionRows()");
    h.check(m.isSelectionEmpty(), true, "isSelectionEmpty()");
   
  }
View Full Code Here


  }
 
  public void checkConstructor1(TestHarness harness)
  {
    harness.checkPoint("(Object, TreePath, boolean, TreePath, TreePath)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1 = new TreePath("A");
    TreePath p2 = new TreePath("B");
    TreePath p3 = new TreePath("C");
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, true, p2, p3);
    harness.check(tse.getSource(), m);
View Full Code Here

  }

  public void checkConstructor2(TestHarness harness)
  {
    harness.checkPoint("(Object, TreePath[], boolean[], TreePath, TreePath)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1A = new TreePath("A");
    TreePath p1B = new TreePath("AA");
    TreePath[] p1 = new TreePath[] {p1A, p1B};
    TreePath p2 = new TreePath("B");
    TreePath p3 = new TreePath("C");
View Full Code Here

public class cloneWithSource implements Testlet
{
  public void test(TestHarness harness)
  {
    TreeSelectionModel m1 = new DefaultTreeSelectionModel();
    TreeSelectionModel m2 = new DefaultTreeSelectionModel();
    TreePath p1 = new TreePath("A");
    TreePath p2 = new TreePath("B");
    TreePath p3 = new TreePath("C");
    TreeSelectionEvent tse1 = new TreeSelectionEvent(m1, p1, true, p2, p3);
    TreeSelectionEvent tse2 = (TreeSelectionEvent) tse1.cloneWithSource(m2);
View Full Code Here

  }
 
  public void checkMethod1(TestHarness harness)
  {
    harness.checkPoint("()");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1 = new TreePath("A");
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, false, null, null);
    harness.check(tse.isAddedPath(), false);
  }
View Full Code Here

  }

  public void checkMethod2(TestHarness harness)
  {
    harness.checkPoint("(int)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1A = new TreePath("A");
    TreePath p1B = new TreePath("AA");
    TreePath[] p1 = new TreePath[] {p1A, p1B};
    boolean[] b = new boolean[] {true, false};
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, b, null, null);
View Full Code Here

  }

  public void checkMethod3(TestHarness harness)
  {
    harness.checkPoint("(TreePath)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1A = new TreePath("A");
    TreePath p1B = new TreePath("AA");
    TreePath[] p1 = new TreePath[] {p1A, p1B};
    boolean[] b = new boolean[] {true, false};
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, b, null, null);
View Full Code Here

        ((DefaultTreeModel)getModel()).setAsksAllowsChildren(asksAllowsChildren);
    }

    public JTree(final TreeModel model) {
        setModel(model);
        selectionModel = new DefaultTreeSelectionModel();
        updateUI();
    }
View Full Code Here

          // Install a tableModel representing the visible rows in the tree.
          super.setModel(new TreeTableModelAdapter(treeTableModel, tree));

          // Force the JTable and JTree to share their row selection models.
          tree.setSelectionModel(new DefaultTreeSelectionModel() {
            {
                  setSelectionModel(listSelectionModel);
              }
          });
          // Make the tree and table row heights the same.
View Full Code Here

        // Install a tableModel representing the visible rows in the tree.
        super.setModel(new TreeTableModelAdapter(treeTableModel, tree));

        // Force the JTable and JTree to share their row selection models.

        tree.setSelectionModel(new DefaultTreeSelectionModel() {
            // Extend the implementation of the constructor, as if:
  /*  public this()*/ {
                setSelectionModel(listSelectionModel);
            }
        });
View Full Code Here

TOP

Related Classes of javax.swing.tree.DefaultTreeSelectionModel

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.