use of javax.swing.tree.DefaultTreeSelectionModel in project JMRI by JMRI.
the class RosterGroupsPanel method getTree.
/**
* Get the JTree containing the roster groups.
*
* @return The internal JTree
*/
public final JTree getTree() {
if (_tree == null) {
TreeSelectionModel sm = new DefaultTreeSelectionModel();
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
sm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
renderer.setLeafIcon(null);
renderer.setClosedIcon(null);
renderer.setOpenIcon(null);
_tree = new JTree(getModel());
_tree.setUI(new TreeUI());
_tree.putClientProperty("JTree.lineStyle", "None");
_tree.setRootVisible(false);
_tree.expandRow(0);
_tree.setSelectionModel(sm);
_tree.setCellRenderer(renderer);
_tree.addTreeWillExpandListener(new TreeWillExpandListener());
_TSL = new TreeSelectionListener();
_tree.addTreeSelectionListener(_TSL);
_tree.setDragEnabled(true);
_tree.setDropMode(DropMode.ON);
_tree.setTransferHandler(new TransferHandler());
_tree.addMouseListener(new MouseAdapter());
setSelectionToGroup(selectedRosterGroup);
Roster.getDefault().addPropertyChangeListener(new PropertyChangeListener());
}
return _tree;
}
use of javax.swing.tree.DefaultTreeSelectionModel in project binnavi by google.
the class CSelectionHistoryChooser method dispose.
/**
* Frees allocated resources.
*/
public void dispose() {
m_selectionHistory.removeHistoryListener(m_selectionHistoryListener);
m_graph.removeListener(m_graphSelectionListener);
m_tree.removeMouseListener(m_treeMouseListener);
m_tree.removeTreeSelectionListener(m_treeSelectionListener);
m_tree.setSelectionModel(new DefaultTreeSelectionModel());
}
use of javax.swing.tree.DefaultTreeSelectionModel in project binnavi by google.
the class CCombinedRightPanel method dispose.
/**
* Frees allocated resources.
*/
public void dispose() {
taggingPanel.getTree().dispose();
taggingPanel.getTree().setSelectionModel(new DefaultTreeSelectionModel());
}
Aggregations