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

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

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

JTree.setLargeModel介绍

暂无

代码示例

代码示例来源:origin: guru.nidi/jdepend

/**
 * Creates and returns a peered tree.
 *
 * @return Tree.
 */
private JTree createTree() {
  JTree tree = new JTree();
  tree.setShowsRootHandles(false);
  tree.setFont(new Font("Dialog", Font.PLAIN, 12));
  tree.addTreeSelectionListener(this);
  tree.setRootVisible(false);
  tree.setLargeModel(true);
  return tree;
}

代码示例来源:origin: com.hermit-reasoner/org.semanticweb.hermit

public DerivationViewer(Prefixes prefixes,DerivationHistory.Fact root) {
  super("Derivation tree for "+root.toString(prefixes));
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  m_prefixes=prefixes;
  m_derivationTreeTreeModel=new DerivationTreeTreeModel(root);
  m_derivationTree=new JTree(m_derivationTreeTreeModel);
  m_derivationTree.setLargeModel(true);
  m_derivationTree.setShowsRootHandles(true);
  m_derivationTree.setCellRenderer(new DerivationTreeCellRenderer());
  JScrollPane scrollPane=new JScrollPane(m_derivationTree);
  scrollPane.setPreferredSize(new Dimension(600,400));
  JButton button=new JButton("Refresh");
  button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      refresh();
    }
  });
  JPanel panel=new JPanel(new BorderLayout());
  panel.add(scrollPane,BorderLayout.CENTER);
  panel.add(button,BorderLayout.SOUTH);
  setContentPane(panel);
  getRootPane().setDefaultButton(button);
  pack();
  setLocation(150,150);
  setVisible(true);
}
public void refresh() {

代码示例来源:origin: net.sourceforge.owlapi/org.semanticweb.hermit

m_derivationTreeTreeModel=new DerivationTreeTreeModel(root);
m_derivationTree=new JTree(m_derivationTreeTreeModel);
m_derivationTree.setLargeModel(true);
m_derivationTree.setShowsRootHandles(true);
m_derivationTree.setCellRenderer(new DerivationTreeCellRenderer());

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

tree.setLargeModel(true);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);

代码示例来源:origin: com.hermit-reasoner/org.semanticweb.hermit

m_subtreeTreeModel=new SubtreeTreeModel(debugger,rootNode);
m_tableauTree=new JTree(m_subtreeTreeModel);
m_tableauTree.setLargeModel(true);
m_tableauTree.setShowsRootHandles(true);
m_tableauTree.setCellRenderer(new NodeCellRenderer(debugger));

代码示例来源:origin: digital-preservation/droid

tree.setLargeModel(true);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);

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

/**
 * Inits the FS tree.
 */
private void initFSTree() {
 FSTreeModel treeModel = new FSTreeModel();
 this.fsTree = new JTree(treeModel);
 this.fsTree.addMouseListener(new StringFsPopupEventAdapter());
 this.fsTree.setBorder(BorderFactory.createEmptyBorder(2, 4, 2, 2));
 this.fsTree.setLargeModel(true);
 // Only one node can be selected at any one time.
 this.fsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 this.fsTree.addTreeSelectionListener(new FSTreeSelectionListener(this));
 DefaultTreeCellRenderer cellRenderer = new DefaultTreeCellRenderer();
 cellRenderer.setLeafIcon(null);
 // cellRenderer.setIcon(null);
 cellRenderer.setClosedIcon(null);
 cellRenderer.setOpenIcon(null);
 this.fsTree.setCellRenderer(cellRenderer);
}

代码示例来源:origin: cpesch/RouteConverter

browsePanel.add(scrollPane2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
treeCategories = new JTree();
treeCategories.setLargeModel(true);
treeCategories.setRootVisible(false);
scrollPane2.setViewportView(treeCategories);

代码示例来源:origin: net.sourceforge.owlapi/org.semanticweb.hermit

m_subtreeTreeModel=new SubtreeTreeModel(debugger,rootNode);
m_tableauTree=new JTree(m_subtreeTreeModel);
m_tableauTree.setLargeModel(true);
m_tableauTree.setShowsRootHandles(true);
m_tableauTree.setCellRenderer(new NodeCellRenderer(debugger));

代码示例来源:origin: Vhati/Slipstream-Mod-Manager

/**
 * Constructor.
 *
 * Modifies a given tree to add checkboxes.
 * - The tree's existing cell renderer will be wrapped with a ChecklistTreeCellRenderer.
 * - A MouseListener will be added to the tree to detect clicks, which will toggle checkboxes.
 *
 * A secondary ChecklistTreeSelectionModel will track checkboxes' states (independent of row
 * highlighting).
 *
 * @param tree  a tree to modify
 * @param dig  true show that a node is partially selected by scanning its descendents, false otherwise
 * @checklistFilter  a filter to decide which TreePaths need checkboxes, or null
 */
public ChecklistTreeManager( JTree tree, boolean dig, ChecklistTreePathFilter checklistFilter ) {
  this.tree = tree;
  this.checklistFilter = checklistFilter;
  // Note: If largemodel is not set then treenodes are getting truncated.
  // Need to debug further to find the problem.
  if ( checklistFilter != null ) tree.setLargeModel( true );
  selectionModel = new ChecklistTreeSelectionModel( tree.getModel(), dig );
  ChecklistTreeCellRenderer checklistRenderer = new ChecklistTreeCellRenderer( tree.getCellRenderer(), selectionModel, checklistFilter );
  setCheckboxMaxX( checklistRenderer.getCheckboxMaxX() );
  tree.setCellRenderer( checklistRenderer );
  selectionModel.addTreeSelectionListener( this );
  tree.addMouseListener( this );
}

代码示例来源:origin: com.google.code.findbugs/findbugs

@Override
  public void run() {
    tree = newTree;
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setLargeModel(true);
    tree.setCellRenderer(new BugRenderer());
    treePanel.remove(treeScrollPane);
    treeScrollPane = new JScrollPane(newTree);
    treePanel.add(treeScrollPane);
    mainFrame.setFontSizeHelper(Driver.getFontSize(), treeScrollPane);
    tree.setRowHeight((int) (Driver.getFontSize() + 7));
    mainFrame.getContentPane().validate();
    mainFrame.getContentPane().repaint();
    setupTreeListeners();
    newModel.openPreviouslySelected(((BugTreeModel) (tree.getModel())).getOldSelectedBugs());
    expandTree(10);
    expandToFirstLeaf(14);
    mainFrame.getSorter().addColumnModelListener(newModel);
    FilterActivity.addFilterListener(newModel.bugTreeFilterListener);
    mainFrame.mainFrameTree.setSorting(true);
  }
});

代码示例来源:origin: notzippy/JALOPY2-MAIN

_tree.putClientProperty("JTree.lineStyle" /* NOI18N */, "Angled" /* NOI18N */);
_tree.setScrollsOnExpand(true);
_tree.setLargeModel(true);

代码示例来源:origin: com.google.code.findbugs/findbugs

getTree().setLargeModel(true);
getTree().getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
getTree().setCellRenderer(new BugRenderer());

代码示例来源:origin: net.sf.taverna.t2.workbench.views/results

tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setExpandsSelectedPaths(true);
tree.setLargeModel(true);
tree.setRootVisible(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

treeTable.setRowMargin(UIConstants.TABLE_ROW_MARGIN);
treeTable.setRowHeight(UIUtils.getDefaultRowHeight() + 2);
treeTable.getTree().setLargeModel(true);

代码示例来源:origin: GoldenGnu/jeveassets

jTree.setCellEditor(new CheckBoxNodeEditor(jTree));
jTree.setEditable(true);
jTree.setLargeModel(true);
jTree.setRowHeight(16);

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

int rowHeight = rend.getTreeCellRendererComponent(tree, null, false, false, false, 0, true).getPreferredSize().height;
tree.setRowHeight(rowHeight);
tree.setLargeModel(true);

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

tree.setLargeModel(true);
tree.setEditable(false);
tree.setExpandsSelectedPaths(true);

代码示例来源:origin: org.xworker/xworker_core

comp.setLargeModel(largeModel);

相关文章

JTree类方法