/**
* Invoked when the mouse button has been clicked (pressed and released) on
* a component.
*
* @param e
* MouseEvent
* @todo Implement this java.awt.event.MouseListener method
*/
public void mouseClicked(MouseEvent e) {
int count = e.getClickCount();
if (count != 1) {
// System.out.println(count);
} else {
int x = e.getX();
int y = e.getY();
int row = this.getRowForLocation(x, y);
TreePath path = this.getPathForRow(row);
if (path != null) {
FileNode node = (FileNode) path.getLastPathComponent();
boolean isSelected = !(node.isSelected());
node.setSelected(isSelected);
((DefaultTreeModel) this.getModel()).nodeChanged(node);
}
}
}
/**
* Invoked when a mouse button has been pressed on a component.
*
* @param e
* MouseEvent
* @todo Implement this java.awt.event.MouseListener method
*/
public void mousePressed(MouseEvent e) {
}
/**
* Invoked when a mouse button has been released on a component.
*
* @param e
* MouseEvent
* @todo Implement this java.awt.event.MouseListener method
*/
public void mouseReleased(MouseEvent e) {
}
/**
* Invoked when the mouse enters a component.
*
* @param e
* MouseEvent
* @todo Implement this java.awt.event.MouseListener method
*/
public void mouseEntered(MouseEvent e) {
}
/**
* Invoked when the mouse exits a component.
*
* @param e
* MouseEvent
* @todo Implement this java.awt.event.MouseListener method
*/
public void mouseExited(MouseEvent e) {
}
public static void main(String args[]){
JFrame f = new JFrame();
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(new AgileSuperJTreeBasic(),BorderLayout.CENTER);
f.setSize(400,300);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);