Package javax.swing

Examples of javax.swing.JTree$TreeSelectionRedirector


    public void testPaint() throws Exception {
        renderer.paint(createTestGraphics());
    }

    public void testGetPreferredSize() throws Exception {
        renderer.getTreeCellRendererComponent(new JTree(), "value", true, true, true, 0, false);
        JLabel label = new JLabel("value", renderer.getDefaultLeafIcon(), SwingConstants.LEFT);
        label.setFont(renderer.getFont());
        Dimension baseDimenstion = label.getPreferredSize();
        if (isHarmony()) {
            assertEquals(new Dimension(baseDimenstion.width + 2, baseDimenstion.height),
View Full Code Here


        titleBox.addVerticalStrut(20);
        add(titleBox, BorderLayout.NORTH);

        DefaultMutableTreeNode root = SetupDataProvider.createTree();

        componentTree = new JTree(root);
        componentTree.setShowsRootHandles(true);
        componentTree.setRootVisible(false);
        componentTree.setVisibleRowCount(3);
        componentTree.setCellRenderer(new TreeNodeRenderer());
        componentTree.addMouseListener( this );
View Full Code Here

        pResult.add(gScrollPane, BorderLayout.CENTER);

        // Set up the tree
        rootNode    = new DefaultMutableTreeNode("Connection");
        treeModel   = new DefaultTreeModel(rootNode);
        tTree       = new JTree(treeModel);
        tScrollPane = new JScrollPane(tTree);

        tScrollPane.setPreferredSize(new Dimension(120, 400));
        tScrollPane.setMinimumSize(new Dimension(70, 100));
        txtCommandScroll.setPreferredSize(new Dimension(360, 100));
View Full Code Here

    /* Set up the tree */
    m_leftTreeModelAdapter = new DomToTreeModelAdapter(m_document);
    m_middleTreeModelAdapter = new DomToTreeModelAdapter(m_document);
    m_rightTreeModelAdapter = new DomToTreeModelAdapter(m_document);
   
    m_leftTree = new JTree(m_leftTreeModelAdapter);
    m_leftTextArea = new JTextArea();
    m_middleTree = new JTree(m_middleTreeModelAdapter);
    m_rightTree = new JTree(m_rightTreeModelAdapter);
   
    ToolTipManager.sharedInstance().registerComponent(m_leftTree);
    ToolTipManager.sharedInstance().registerComponent(m_middleTree);
    ToolTipManager.sharedInstance().registerComponent(m_rightTree);
   
View Full Code Here

        titleBox.addVerticalStrut(20);
        add(titleBox, BorderLayout.NORTH);
               
        DefaultMutableTreeNode root = SetupDataProvider.createTree();

        componentTree = new JTree(root);
        componentTree.setShowsRootHandles(true);
        componentTree.setRootVisible(false);
        componentTree.setVisibleRowCount(3);
        componentTree.setCellRenderer(new TreeNodeRenderer());
        componentTree.addMouseListener( this );
View Full Code Here

    log.debug("Start : init1");
    SampleResult rootSampleResult = new SampleResult();
    rootSampleResult.setSampleLabel("Root");
    root = new DefaultMutableTreeNode(rootSampleResult);
    treeModel = new DefaultTreeModel(root);
    jTree = new JTree(treeModel);
    jTree.getSelectionModel().setSelectionMode(
        TreeSelectionModel.SINGLE_TREE_SELECTION);
    jTree.addTreeSelectionListener(this);
    treePane = new JScrollPane(jTree);
    gridBag = new GridBagLayout();
View Full Code Here

                SampleResult rootSampleResult = new SampleResult();
                rootSampleResult.setSampleLabel("Root");
                rootSampleResult.setSuccessful(true);
                root = new DefaultMutableTreeNode(rootSampleResult);
                treeModel = new DefaultTreeModel(root);
                jTree = new JTree(treeModel);
                jTree.setCellRenderer(new ResultsNodeRenderer());
                jTree.getSelectionModel().setSelectionMode(
                        TreeSelectionModel.SINGLE_TREE_SELECTION);
                jTree.addTreeSelectionListener(this);
                treePane = new JScrollPane(jTree);
View Full Code Here

    mainPanel.add(Box.createGlue());
  }

  private JTree makeTree()
  {
    tree = new JTree(this.treeModel);
    tree.setCellRenderer(getCellRenderer());
    tree.setRootVisible(false);
    tree.setShowsRootHandles(true);
    treeListener.setJTree(tree);
    tree.addTreeSelectionListener(treeListener);
View Full Code Here

    this.addNewButtonPanel = addNewButtonPanel;

    this.repositoryTreeModel = new RepositoryTreeModel();

    repositoryBrowser = new JTree(repositoryTreeModel);
    repositoryBrowser.setCellRenderer(new RepositoryTreeCellRenderer());
    repositoryBrowser.addMouseListener(new DoubleClickHandler());
    repositoryBrowser.setRootVisible(true);
    repositoryBrowser.setShowsRootHandles(true);
    repositoryBrowser.setToggleClickCount(1);
View Full Code Here

     *
     * @param e the event that characterizes the change.
     */
    public void valueChanged(final TreeSelectionEvent e)
    {
      final JTree tree = getTree();
      final TreePath selectionPath = tree.getLeadSelectionPath();
      if (selectionPath == null)
      {
        setLeadSelection(null);
        return;
      }
View Full Code Here

TOP

Related Classes of javax.swing.JTree$TreeSelectionRedirector

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.