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

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

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

JTree.collapseRow介绍

暂无

代码示例

代码示例来源:origin: jshiell/checkstyle-idea

/**
 * Collapse the tree so that only the root node is visible.
 */
public void collapseTree() {
  for (int i = 1; i < resultsTree.getRowCount(); ++i) {
    resultsTree.collapseRow(i);
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected void collapseTree() {
 // collapse everything except the first category
 CategoryExplorerTree tree = _monitor.getCategoryExplorerTree();
 for (int i = tree.getRowCount() - 1; i > 0; i--) {
  tree.collapseRow(i);
 }
}

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

@Override
 public void actionPerformed(ActionEvent e) {
  for (int i = tree.getRowCount() - 1; i >= 0; i--) {
   tree.collapseRow(i);
  }
 }
}

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

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

代码示例来源:origin: net.sf.jt400/jt400

/**
Collapses the specified object.

@param  object  The object.
**/
  public void collapse (VNode object)
  {
    if (object == null)
      throw new NullPointerException ("object");

    int row = findRow (object);
    if (row >= 0)
      tree_.collapseRow (row);
  }

代码示例来源:origin: gurkenlabs/litiengine

private void collapseAll() {
 int row = tree.getRowCount() - 1;
 while (row >= 0) {
  tree.collapseRow(row);
  row--;
 }
}

代码示例来源:origin: net.anwiba.commons/anwiba-commons-swing-core

static void internalCollapseAll(final JTree tree) {
 synchronized (tree) {
  int row = tree.getRowCount() - 1;
  while (row >= 0) {
   tree.collapseRow(row);
   row--;
  }
 }
}

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

/**
 * Collapses all but the root node in the tree that have children.
 */
private void collapseAll(JTree tree) {
  int row = 1;
  while (row < tree.getRowCount()) {
    tree.collapseRow(row);
    row++;
  }
}

代码示例来源:origin: realXuJiang/bigtable-sql

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

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

public void actionPerformed(ActionEvent e) {
   for (int i = 1; i < tree.getRowCount(); i++) {
    if (cbExp.isSelected()) {
     tree.expandRow(i);
    }
    else {
     tree.collapseRow(i);
    }
   }
  }
}

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

/**
 * Collapses all direct ascendants of a node in the tree.
 */
@SuppressWarnings("unchecked")
private void collapseAscendants(JTree tree, DefaultMutableTreeNode node) {
  Enumeration<DefaultMutableTreeNode> children = node.children();
  while (children.hasMoreElements()) {
    DefaultMutableTreeNode child = children.nextElement();
    int row = tree.getRowForPath(new TreePath(child.getPath()));
    tree.collapseRow(row);
  }
}

代码示例来源: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: jbosstm/narayana

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

代码示例来源:origin: jbosstm/narayana

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

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

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: 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: UNIVALI-LITE/Portugol-Studio

@Override
public void keyReleased(KeyEvent e)
{
  if(e.getKeyCode() == KeyEvent.VK_ENTER){
    int selectedRow = arvore.getSelectionRows()[0];
    if(arvore.isCollapsed(selectedRow)){
      arvore.expandRow(selectedRow);
    }else{
      arvore.collapseRow(selectedRow);
    }
  }
}

相关文章

JTree类方法