setCellRenderer(createRenderer());
MouseListener ml = new MouseAdapter() {
public void mousePressed(MouseEvent e) {
JComponent c = (JComponent)e.getSource();
if (c != SourceTree.this) return;
TreePath path = getPathForLocation(e.getX(), e.getY());
if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) == MouseEvent.BUTTON3_MASK) {
if (path!=null) setSelectionPath(path);
boolean locked = false;
if (getSelectionPath()!=null) {
Object node = getSelectionPath().getLastPathComponent();
if (node instanceof SourceNode) {
if (((SourceNode)node).isLocked()) {
locked = true;
}
}
}
if (!locked) doPopup(e.getX(), e.getY());
return;
}
}
public void mouseExited(MouseEvent e) {
setCursor(Cursor.getDefaultCursor());
}
};
addMouseListener(ml);
MouseMotionListener mml = new MouseMotionAdapter() {
public void mouseMoved(MouseEvent e) {
JComponent c = (JComponent)e.getSource();
if (c != SourceTree.this) return;
TreePath path = getPathForLocation(e.getX(), e.getY());
if (path!=null) {
Object node = path.getLastPathComponent();
if (node instanceof SourceNode) {