Package javax.swing.tree

Examples of javax.swing.tree.TreePath


            }
            return false;
        }

        public Object getTransferData(DataFlavor flavor) {
            TreePath tp=Tree.this.getSelectionPath();
            Object s = (AbstractNode)tp.getLastPathComponent();
            if (s == null) {
                return null;
            }
            if ((s instanceof UniverseNode) && ShapeCreator.class.equals(flavor.getRepresentationClass())) {
                return new Shape3DCreator(Java3dPlugin._3DShape, _plugin, (UniverseNode)s);
View Full Code Here


                _tree._treeModel.nodeStructureChanged(this);
            }
            else{
                if(getChildCount()==1){
                    // first node : expand it to force display
                    _tree.expandPath(new TreePath(this));
                }
                _tree._treeModel.nodesWereInserted(this, ci);
            }
        }
        else if(removedNodes.length>0){
View Full Code Here

        }

        @Override
        public void actionPerformed(ActionEvent e) {
            getNode().getTree().getPool().createUniverse();
            getNode().getTree().expandPath(new TreePath(getNode()));
        }
View Full Code Here

    rejectedPaths.clear();
    acceptedPaths.clear();
    final Iterator it = this.listener.iterator();
    while (it.hasNext()) {
      TreeModelListener current = (TreeModelListener) it.next();
      current.treeStructureChanged(new TreeModelEvent(this, new TreePath(
          getRoot())));
    }
  }
View Full Code Here

    // Create the page nodes!
    createPageNodes(fileNode);

    // Expand the tree to show the page nodes!
    tree.expandPath(new TreePath(fileNode));
  }
View Full Code Here

      inspectionPanel.linkButton.addItemListener(new LinkListener());
      inspectionPanel.optionsPanel.add(
          this.optionPanel = new InspectionOptionPanel(this),
          BorderLayout.CENTER);
      new MessageSetter(this);
      expandAll(getSourceTree(), new TreePath(getSourceTree().getModel()
          .getRoot()));
      expandAll(getTargetTree(), new TreePath(getTargetTree().getModel()
          .getRoot()));
    }

    this.dialog = new JDialog(fileRenamer.getParentFrame());
    this.dialog.setModal(true);
View Full Code Here

    int childCount = tree.getModel().getChildCount(current);
    for (int i = 0; i < childCount; i++) {
      Object[] newPath = new Object[path.getPath().length + 1];
      System.arraycopy(path.getPath(), 0, newPath, 0, newPath.length - 1);
      newPath[newPath.length - 1] = tree.getModel().getChild(current, i);
      expandAll(tree, new TreePath(newPath));
    }
  }
View Full Code Here

   * @param tree
   *            The tree whose expanded paths should be determined.
   * @return All expanded treepaths.
   */
  private TreePath[] getExpanded(JTree tree) {
    Enumeration enumeration = tree.getExpandedDescendants(new TreePath(tree
        .getModel().getRoot()));
    ArrayList result = new ArrayList();
    while (enumeration.hasMoreElements()) {
      result.add(enumeration.nextElement());
    }
View Full Code Here

   * This method causes the control class to place every gui option into the
   * rename configuration and update the preview.
   */
  protected synchronized void optionsChanged() {
    TreePath[] expandedSource = getExpanded(getSourceTree());
    TreePath sourceSelected = getSourceTree().getSelectionPath();
    TreePath[] expandedTarget = getExpanded(getTargetTree());
    TreePath targetSelected = getTargetTree().getSelectionPath();
    /*
     * Now change the configuration
     */
    fileRenamer.setCopyUnmodifiableFiles(this.optionPanel.copyIfUnmodifiableBox.isSelected());
    fileRenamer.getConfig().fireConfigChange();
 
View Full Code Here

    completePath[0] = tree.getModel().getRoot();
    System.arraycopy(directoryPath, 0, completePath, 1,
        directoryPath.length);
    completePath[completePath.length - 1] = selectedFile;

    TreePath toAssign = new TreePath(completePath);
    tree.getSelectionModel().setSelectionPath(toAssign);
    tree.scrollPathToVisible(toAssign);
  }
View Full Code Here

TOP

Related Classes of javax.swing.tree.TreePath

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.