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

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

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

JTree.setEnabled介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** Delegate the setEnable method to Jtree
 *  @param enabled whether to enable the tree
 */
@Override
public void setEnabled(boolean enabled) {
  this.tree.setEnabled(enabled);
}

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

/** Delegate the setEnable method to Jtree
 *  @param enabled whether to enable the tree
 */
public void setEnabled (boolean enabled){
  this.tree.setEnabled (enabled);
}

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

/** Delegate the setEnable method to Jtree
 *  @param enabled whether to enable the tree
 */
public void setEnabled (boolean enabled){
  this.tree.setEnabled (enabled);
}

代码示例来源:origin: tonikelope/megabasterd

private void restore_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_restore_buttonActionPerformed
  restore_button.setText(LabelTranslatorSingleton.getInstance().translate("Restoring data, please wait..."));
  file_tree.setEnabled(false);
  restore_button.setEnabled(false);
  dance_button.setEnabled(false);
  THREAD_POOL.execute(
      new Runnable() {
    @Override
    public void run() {
      _loadMegaDirTree();
      _genDownloadLiks();
      swingInvoke(
          new Runnable() {
        @Override
        public void run() {
          restore_button.setVisible(false);
          restore_button.setText(LabelTranslatorSingleton.getInstance().translate("Restore folder data"));
          boolean root_childs = ((TreeNode) file_tree.getModel().getRoot()).getChildCount() > 0;
          for (JComponent c : new JComponent[]{restore_button, dance_button, skip_button, skip_rest_button, file_tree}) {
            c.setEnabled(root_childs);
          }
        }
      });
    }
  }
  );
}//GEN-LAST:event_restore_buttonActionPerformed

代码示例来源:origin: tonikelope/megabasterd

skip_rest_button.setEnabled(false);
warning_label.setEnabled(false);
file_tree.setEnabled(false);

代码示例来源:origin: org.rescarta.rc-cmgr/rc-cmgr

/**
 * Update the contents of the collectonsJTree.
 */
private void doRefreshCollectionsJTree() {
  this.collectionsRootNode.removeAllChildren();
  if (this.currentResCartaVolumeDirectory != null) {
    this.collectionsJTree.setShowsRootHandles(true);
    this.collectionsJTree.getSelectionModel().setSelectionPath(null);
    this.assignedObjectMap.clear();
    this.addCollections(this.rcCollectionMetadata, this.collectionsRootNode);
    this.collectionsJTree.setEnabled(true);
    this.collectionCountJLabel.setText(this.collectionNodeMap.size() + " collections");
    this.collectionCountJLabel.setVisible(true);
    ((DefaultTreeModel) this.collectionsJTree.getModel()).nodeStructureChanged(this.collectionsRootNode);
    this.collectionsJTree.expandPath(new TreePath(this.collectionsRootNode));
  }
  else {
    this.collectionsJTree.setShowsRootHandles(false);
    this.collectionsRootNode.add(new DefaultMutableTreeNode("Open a ResCarta data volume"));
    this.collectionsJTree.getSelectionModel().setSelectionPath(null);
    this.collectionsJTree.setEnabled(false);
    this.collectionCountJLabel.setText(" ");
    this.collectionCountJLabel.setVisible(false);
    ((DefaultTreeModel) this.collectionsJTree.getModel()).nodeStructureChanged(this.collectionsRootNode);
    this.collectionsJTree.expandPath(new TreePath(this.collectionsRootNode));
  }
}

代码示例来源:origin: de.sciss/jtreetable

@Override
public void propertyChange(PropertyChangeEvent evt) {
  String name = evt.getPropertyName();
  if (name.equals("rowSorter")) {
    table.setRowSorter(evt.getNewValue() == null ? null : new RowSorterAdapter());
  } else if (name.equals("enabled")) {
    boolean enabled = (Boolean)evt.getNewValue();
    table.setEnabled(enabled);
    tree.setEnabled(enabled);
  } else if (name.equals("componentOrientation")) {
    ComponentOrientation o = (ComponentOrientation)evt.getNewValue();
    table.setComponentOrientation(o);
    tree.setComponentOrientation(o);
    treeTable.revalidate();
    treeTable.repaint();
  } else if ("JTree.lineStyle".equals(name)) {
    tree.putClientProperty("JTree.lineStyle", evt.getNewValue());
  } else if ("columnModel".equals(name)) {
    table.setColumnModel(new ColumnModelAdapter((TableColumnModel)evt.getNewValue()));
  }
}

代码示例来源:origin: tonikelope/megabasterd

file_tree.setEnabled(true);

代码示例来源:origin: tonikelope/megabasterd

file_tree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
file_tree.setDoubleBuffered(true);
file_tree.setEnabled(false);
file_tree_scrollpane.setViewportView(file_tree);

代码示例来源:origin: tonikelope/megabasterd

file_tree.setEnabled(root_childs);
warning_label.setEnabled(root_childs);
dance_button.setEnabled(root_childs);
add_folder_button.setEnabled(true);
file_tree.setRootVisible(root_childs);
file_tree.setEnabled(root_childs);
warning_label.setEnabled(root_childs);
dance_button.setEnabled(root_childs);

代码示例来源:origin: tonikelope/megabasterd

file_tree.setEnabled(root_childs);
warning_label.setEnabled(root_childs);
dance_button.setEnabled(root_childs);
add_folder_button.setEnabled(true);
file_tree.setRootVisible(root_childs);
file_tree.setEnabled(root_childs);
warning_label.setEnabled(root_childs);
dance_button.setEnabled(root_childs);

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

private void createTargetTree()
{
  rootNode = new FirebirdManagerGrantTreeNode(i18n.GRANTMANAGER_LBL_TREENODE_ROOT, TREENODE_TYPE_ROOT);
  DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
  jtreeReceiver = new JTree(treeModel);
  jtreeReceiver.addTreeSelectionListener(new TreeSelectionListener()
  {
    public void valueChanged(TreeSelectionEvent e)
    {
      FirebirdManagerGrantTreeNode node =
        (FirebirdManagerGrantTreeNode) e.getPath().getLastPathComponent();
      gsTreenodeName = node.getUserObject().toString();
      gTreenodeType = node.getTreenodeType();
      readData();
    }
  });
  TreeSelectionModel tsm = new DefaultTreeSelectionModel();
  tsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  jtreeReceiver.setBackground(Color.LIGHT_GRAY);
  jtreeReceiver.setSelectionModel(tsm);
  jtreeReceiver.setEnabled(true);
  jtreeReceiver.setRootVisible(true); // false);
  FirebirdManagerGrantTreeRenderer treeRenderer = new FirebirdManagerGrantTreeRenderer();
  jtreeReceiver.setCellRenderer(treeRenderer);
  setTreeData();
}

代码示例来源:origin: tonikelope/megabasterd

tree.setEnabled(true);

代码示例来源:origin: tonikelope/megabasterd

file_tree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
file_tree.setDoubleBuffered(true);
file_tree.setEnabled(false);
file_tree.setRootVisible(false);
file_tree_scrollpane.setViewportView(file_tree);

代码示例来源:origin: net.sf.sfac/sfac-core

@Override
protected void synchronizeEditableState() {
  if (theTree != null) {
    boolean treeEnabled = isEditable() && isEnabled();
    theTree.setEnabled(treeEnabled);
    theTree.setBackground(treeEnabled ? Color.WHITE : Color.LIGHT_GRAY);
    theTree.setForeground(treeEnabled ? Color.BLACK : Color.DARK_GRAY);
    theTree.repaint();
  }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

m_expressionTree.setEnabled(true);
m_expressionTree.setRootVisible(true);
m_expressionTree.setShowsRootHandles(true);

代码示例来源:origin: tonikelope/megabasterd

tree.setEnabled(true);
tree.setEnabled(true);

代码示例来源:origin: Waikato/weka-trunk

m_expressionTree.setEnabled(true);
m_expressionTree.setRootVisible(true);
m_expressionTree.setShowsRootHandles(true);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

m_expressionTree.setEnabled(true);
m_expressionTree.setRootVisible(true);
m_expressionTree.setShowsRootHandles(true);

代码示例来源:origin: Waikato/weka-trunk

m_expressionTree.setEnabled(true);
m_expressionTree.setRootVisible(true);
m_expressionTree.setShowsRootHandles(true);

相关文章

JTree类方法