private void reloadTree() { treeModel.reload(); tree.expandRow(1); }
public void restoreExpanstionState(Set<String> expansionState) { if (tree != null && expansionState != null) { // tree.getRowCount() changes at tree.expandRow() for (int i = 0; i < tree.getRowCount(); i++) { TreePath path = tree.getPathForRow(i); if (expansionState.contains(getRowPathStr(path))) { tree.expandRow(i); } } } }
tree.setVisibleRowCount(10); for (int ii = tree.getRowCount(); ii>-1; ii--) { tree.expandRow(ii);
if(node.isLeaf()) continue; int row = tree.getRowForPath(new TreePath(node.getPath())); tree.expandRow(row);
tree.expandRow(ii);
protected void init() { // Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts"); createNodes(top); tree = new JTree(top); // Create a tree that allows one selection at a time. tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); // Listen for when the selection changes. tree.addTreeSelectionListener(this); // Create the scroll pane and add the tree to it. JScrollPane treeView = new JScrollPane(tree); // Create Chart Panel tabbedPane = new JTabbedPane(); for (int i = 0; i < tree.getRowCount(); i++) { tree.expandRow(i); } // select first leaf DefaultMutableTreeNode firstLeaf = top.getFirstLeaf(); tree.setSelectionPath(new TreePath(firstLeaf.getPath())); // Add the scroll panes to a split pane. splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPane.setTopComponent(treeView); splitPane.setBottomComponent(tabbedPane); Dimension minimumSize = new Dimension(130, 160); treeView.setMinimumSize(minimumSize); splitPane.setPreferredSize(new Dimension(700, 700)); // Add the split pane to this panel. add(splitPane); }
private static void expandTreeNodes(JTree tree) { for (int i = 0; i < tree.getRowCount(); i++) { tree.expandRow(i); } } }
@Override public void run() { int i = 0; while (i < tree.getRowCount()) { tree.expandRow(i++); } } });
public void expandAll() { for (int i = 0; i < _tree.getRowCount(); i++) { _tree.expandRow(i); } }
public void expandTree() { if (tree != null){ for (int row = 0; row < tree.getRowCount(); row ++) { tree.expandRow(row); } } } }
public static void expandJTree(JTree toexpand) { // replace this with a sensible implementation if it fails for (int row = 0; row < toexpand.getRowCount(); ++row) { toexpand.expandRow(row); } } public static void setUIFont(Font f) {
/** * Initialize the jtree for the UI. Sets the model and adds the PrivacyLists * to the model using loadPrivacyLists() * */ private void initializeTree() { _model = new DefaultTreeModel(_top); _tree.setModel(_model); loadPrivacyLists(); _tree.expandRow(0); }
/** Refreshes the tree to match the state of its model. */ public void refreshTree() { treeModel.reload(); // TODO: retain previously expanded nodes only for (int i = 0; i < tree.getRowCount(); i++) { tree.expandRow(i); } }
private void modifyTransactionView () { if (transactions.isCollapsed(1)) transactions.expandRow(1); else transactions.collapseRow(1); }
private void modifyTransactionView () { if (transactions.isCollapsed(1)) transactions.expandRow(1); else transactions.collapseRow(1); }
private void modifyTransactionView () { if (transactions.isCollapsed(1)) transactions.expandRow(1); else transactions.collapseRow(1); }
@Override public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if (source == expandAllButton) { for (int i = 0; i < tree.getRowCount(); i++) tree.expandRow(i); } else if (source == collapseAllButton) { for (int i = 0; i < tree.getRowCount(); i++) tree.collapseRow(i); } }
private void expandAllNodes(JTree tree, int startingIndex, int rowCount){ for(int i=startingIndex;i<rowCount;++i){ tree.expandRow(i); } if(tree.getRowCount()!=rowCount){ expandAllNodes(tree, rowCount, tree.getRowCount()); } }
/** Expands all paths. */ public void expandAll () { int i = 0, j/*, k = tree.getRowCount()*/; do { do { j = tree.getRowCount (); tree.expandRow (i); } while (j != tree.getRowCount ()); i++; } while (i < tree.getRowCount ()); }
private void expandAll( int startingIndex, int rowCount ) { for( int i = startingIndex; i < rowCount; ++i ) { _tree.expandRow( i ); } if( _tree.getRowCount() != rowCount ) { expandAll( rowCount, _tree.getRowCount() ); } }