javax.swing.JTree.expandRow()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中javax.swing.JTree.expandRow()方法的一些代码示例,展示了JTree.expandRow()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.expandRow()方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:expandRow

JTree.expandRow介绍

暂无

代码示例

代码示例来源:origin: skylot/jadx

private void reloadTree() {
  treeModel.reload();
  tree.expandRow(1);
}

代码示例来源:origin: deathmarine/Luyten

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);
      }
    }
  }
}

代码示例来源:origin: stackoverflow.com

tree.setVisibleRowCount(10);
for (int ii = tree.getRowCount(); ii>-1; ii--) {
  tree.expandRow(ii);

代码示例来源:origin: stackoverflow.com

if(node.isLeaf()) continue;
int row = tree.getRowForPath(new TreePath(node.getPath()));
tree.expandRow(row);

代码示例来源:origin: stackoverflow.com

tree.expandRow(ii);

代码示例来源:origin: knowm/XChart

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);
}

代码示例来源:origin: infinitest/infinitest

private static void expandTreeNodes(JTree tree) {
    for (int i = 0; i < tree.getRowCount(); i++) {
      tree.expandRow(i);
    }
  }
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime

@Override
  public void run() {
    int i = 0;
    while (i < tree.getRowCount()) {
      tree.expandRow(i++);
    }
  }
});

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public void expandAll()
{
 for (int i = 0; i < _tree.getRowCount(); i++)
 {
   _tree.expandRow(i);
 }
}

代码示例来源:origin: net.sf.taverna.t2.ui-components/results-view

public void expandTree() {

    if (tree != null){
      for (int row = 0; row < tree.getRowCount(); row ++) {
         tree.expandRow(row);
       }
    }
  }
}

代码示例来源:origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

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) {

代码示例来源:origin: igniterealtime/Spark

/**
 * 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);
}

代码示例来源:origin: org.scijava/scijava-ui-swing

/** 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);
  }
}

代码示例来源:origin: jboss.jbossts/jbossjts

private void modifyTransactionView ()
{
  if (transactions.isCollapsed(1))
    transactions.expandRow(1);
  else
    transactions.collapseRow(1);
}

代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta

private void modifyTransactionView ()
{
  if (transactions.isCollapsed(1))
    transactions.expandRow(1);
  else
    transactions.collapseRow(1);
}

代码示例来源:origin: org.jboss.jbossts.arjunacore/arjuna

private void modifyTransactionView ()
{
  if (transactions.isCollapsed(1))
    transactions.expandRow(1);
  else
    transactions.collapseRow(1);
}

代码示例来源:origin: org.apache.uima/uimaj-tools

@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);
 }
}

代码示例来源:origin: stackoverflow.com

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());
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** 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 ());
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

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() );
 }
}

相关文章

JTree类方法