Package javax.swing.tree

Examples of javax.swing.tree.TreeNode


    public void selectTreeNode( Long id )
    {
        Stack<TreeNode> stack = new Stack<TreeNode>();
        Object[] comps;
        TreeNode parent = nodes.get( id );

        while ( parent != null && ( parent != parent.getParent() ) )
        {
            stack.push( parent );
            parent = parent.getParent();
        }

        if ( stack.size() == 0 )
        {
            comps = new Object[1];
View Full Code Here


        AnnotatedFilterTreeDialog treeDialog = new AnnotatedFilterTreeDialog( PartitionFrame.this, false );
        treeDialog.setFilter( filter );

        partition.getSearchEngine().getOptimizer().annotate( root );
        TreeNode astRoot = new ASTNode( null, root );
        TreeModel model = new DefaultTreeModel( astRoot, true );
        treeDialog.setModel( model );
        treeDialog.setVisible( true );
        return true;
    }
View Full Code Here

  public int getIndex(TreeNode node)
  {
    for (int i = 0; i < childs.length; i++)
    {
      TreeNode child = childs[i];
      if (node == child)
      {
        return i;
      }
    }
View Full Code Here

   * @param index  the index from where to read the child.
   * @return the child of <code>parent</code> at index <code>index</code>
   */
  public Object getChild(final Object parent, final int index)
  {
    final TreeNode node = (TreeNode) parent;
    return node.getChildAt(index);
  }
View Full Code Here

   * @param parent a node in the tree, obtained from this data source
   * @return the number of children of the node <code>parent</code>
   */
  public int getChildCount(final Object parent)
  {
    final TreeNode node = (TreeNode) parent;
    return node.getChildCount();
  }
View Full Code Here

   * @param node a node in the tree, obtained from this data source
   * @return true if <code>node</code> is a leaf
   */
  public boolean isLeaf(final Object node)
  {
    final TreeNode tnode = (TreeNode) node;
    return tnode.isLeaf();
  }
View Full Code Here

   * @return the index of the child in the parent, or -1 if either <code>child</code> or <code>parent</code> are
   *         <code>null</code>
   */
  public int getIndexOfChild(final Object parent, final Object child)
  {
    final TreeNode node = (TreeNode) parent;
    final TreeNode childNode = (TreeNode) child;
    return node.getIndex(childNode);
  }
View Full Code Here

    public AbstractAiravataTreeNode(TreeNode parent) {
        setParent(parent);
    }

    protected XBayaEngine getXBayaEngine(){
        TreeNode root=getRootNode();
        if (root instanceof RegistryNode){
            return ((RegistryNode)root).getEngine();
        }
        return null;
    }
View Full Code Here

        }
        return false;
    }

    protected TreeNode getRootNode() {
        TreeNode rootNode = this;
        while (rootNode.getParent() != null) {
            rootNode = rootNode.getParent();
        }
        return rootNode;
    }
View Full Code Here

        }
        return rootNode;
    }

    public AiravataAPI getRegistry() {
        TreeNode rootNode = getRootNode();
        if (rootNode instanceof RegistryNode) {
            return ((RegistryNode) rootNode).getRegistry();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of javax.swing.tree.TreeNode

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.