use of net.sourceforge.processdash.hier.ui.PropTreeModel in project processdash by dtuma.
the class TimeLogEditor method constructTreePanel.
private JScrollPane constructTreePanel() {
/* Create the JTreeModel. */
treeModel = new PropTreeModel(new DefaultMutableTreeNode("root"), null);
/* Create the tree. */
tree = new JTree(treeModel);
treeModel.fill(useProps);
tree.expandRow(0);
tree.setShowsRootHandles(true);
tree.setEditable(false);
tree.addTreeSelectionListener(this);
tree.setRootVisible(false);
// Make tree ask for the height of each row.
tree.setRowHeight(-1);
/* Put the Tree in a scroller. */
JScrollPane scrollPane = new JScrollPane(tree, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.setPreferredSize(new Dimension(300, 300));
return scrollPane;
}
use of net.sourceforge.processdash.hier.ui.PropTreeModel in project processdash by dtuma.
the class TeamProjectBrowser method buildTree.
private void buildTree() {
treeModel = new PropTreeModel(new DefaultMutableTreeNode("root"), null);
tree = new JTree(treeModel);
reloadHierarchy();
tree.setEditable(false);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
tree.setExpandsSelectedPaths(true);
tree.setCellRenderer(new ProjectTreeCellRenderer());
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(handler);
filterReloadIndicator = new JProgressBar();
filterReloadIndicator.setIndeterminate(true);
filterReloadIndicator.setVisible(false);
ToolTipTimingCustomizer.INSTANCE.install(filterReloadIndicator);
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.add(new JScrollPane(tree), BorderLayout.CENTER);
leftPanel.add(filterReloadIndicator, BorderLayout.SOUTH);
setLeftComponent(leftPanel);
}
Aggregations