Package javax.swing.tree

Examples of javax.swing.tree.TreeNode


        /* (non-Javadoc)
         * @see javax.swing.tree.DefaultMutableTreeNode#getChildAt(int)
         */
        public TreeNode getChildAt(int index) throws ArrayIndexOutOfBoundsException{
            TreeNode res = null;

            if (children == null) {
                throw new ArrayIndexOutOfBoundsException("node has no children");
            }
            int realIndex = -1;
View Full Code Here


    /**
     * returns true if this node is locked, or one of its parents
     */
    public boolean isLocked() {
      if (locked) return true;
      TreeNode tn = getParent();
      if (tn==null) return false;
      if (tn instanceof SourceNode) return ((SourceNode)tn).isLocked();
      return false;
    }
View Full Code Here

                        if (((oldAlias == null) && (alias != null)) || ((oldAlias != null) && (alias == null))
                                || ((oldAlias != null) && (!oldAlias.equals(alias)))) {
                            di.alias = alias;
                            ((DataSource) o).notifyListenersForInfoChange(di);
                            tfAlias.getDocument().removeDocumentListener(this);
                            TreeNode tn = (TreeNode) ( filteredSourceTree.getSourceTree().getSelectionPath().getLastPathComponent());
                            ((DefaultTreeModel) ( filteredSourceTree.getSourceTree().getModel())).nodeChanged(tn);
                            tfAlias.getDocument().addDocumentListener(this);
                            tfAlias.requestFocus();
                        }
                    }
View Full Code Here

      TreePath[] paths = getSelectionPaths();

      if (paths.length > 0){
          res = true;
          for(int i=0;i<paths.length && res; i++){
              TreeNode node = (TreeNode)paths[i].getLastPathComponent();
              res &=  rootNode.isNodeChild(node);
          }
      }
      return res;
  }
View Full Code Here

            row--;
        }
    }

    private void expandAll(TreePath parent) {
        TreeNode node = (TreeNode)parent.getLastPathComponent();
        boolean hasAuxiliaryDsNodes = node instanceof DataSourceNode && ((DataSource)((DataSourceNode) node).getUserObject()).isCompound();

        if ((node.getChildCount() >= 0) && !hasAuxiliaryDsNodes) {
            for (Enumeration e=node.children(); e.hasMoreElements(); ) {
                TreeNode n = (TreeNode)e.nextElement();
                TreePath path = parent.pathByAddingChild(n);
                expandAll(path);
            }
        }
View Full Code Here

                    ExpressionDataSource ds = (ExpressionDataSource)o;
                    if (name.equals(DataInfo.getLabel(ds)) || name.equals(DataInfo.getAlias(ds))) {
                        ds.changeExpression(exp, node);
                        newSource = false;
                        ExpressionPanel.this.sourceTree.setSelectedValue(ds);
                        TreeNode tn = (TreeNode)(ExpressionPanel.this.sourceTree.getSelectionPath().getLastPathComponent());
                        ((DefaultTreeModel)(ExpressionPanel.this.sourceTree.getModel())).nodeChanged(tn);
                        break;
                    }
                }
                if (newSource) {
View Full Code Here

                        ((DataSource) o).getInformation().alias = vc.var;
                        list.repaint();
                        if (clm.resolved()) {
                            bok.setEnabled(true);
                        }
                        TreeNode tn = (TreeNode) (st.getSelectionPath().getLastPathComponent());
                        ((DefaultTreeModel) (st.getModel())).nodeChanged(tn);
                    }
                });
                st.addTreeSelectionListener(new TreeSelectionListener() {
                    public void valueChanged(TreeSelectionEvent e) {
                        Object o = st.getSelectedSourceOrCollection();
                        if ((o instanceof DataSource) && e.isAddedPath()) {
                            VariableConflict vc = (VariableConflict) list.getSelectedValue();
                            vc.ds = (DataSource) o;
                            list.repaint();
                            if (clm.resolved()) {
                                bok.setEnabled(true);
                            }
                            TreeNode tn = (TreeNode) (st.getSelectionPath().getLastPathComponent());
                            ((DefaultTreeModel) (st.getModel())).nodeChanged(tn);
                        }
                    }
                });
                list.addListSelectionListener(new ListSelectionListener() {
View Full Code Here

        super(tree, graphObject, getChildren);
    }
   
   
    BranchGroup getRootGroup(){
        TreeNode n=this;
        while(n!=null){
            if((n instanceof BranchGroupNode)&&(n.getParent() instanceof UniverseNode)){
                return (BranchGroup)((BranchGroupNode)n).getGraphObject();
            }
            n=n.getParent();
        }
        return null;
    }
View Full Code Here

        }
        return null;
    }
   
    Universe getUniverse(){
        TreeNode n=getParent();
        while(n!=null){
            if(n instanceof UniverseNode){
                return (Universe)((AbstractNode)n).getGraphObject();
            }
            n=n.getParent();
        }
        return null;
    }
View Full Code Here

        return (SceneGraphObject)getGraphObject();
    }

    @Override
    public SceneGraphObjectHolder getParentHolder(){
        TreeNode p=getParent();
        if(p instanceof SceneGraphObjectHolder){
            return (SceneGraphObjectHolder)p;
        }
        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.