Exemplo n.º 1
0
 /**
  * Called whenever the value of the selection changes.
  *
  * @param e the event that characterizes the change.
  */
 public void valueChanged(TreeSelectionEvent e) {
   TreePath path = e.getPath();
   if (path != null) {
     DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
     if (node.isLeaf()) {
       if (getInformation(path) != null) {
         // When selecting an image information.
         XmlInformation info = getInformation(path);
         for (int i = 0; i < listener_list.size(); i++) {
           InformationTreeSelectionListener listener =
               (InformationTreeSelectionListener) listener_list.elementAt(i);
           listener.select(info);
         }
       } else {
         // When expanding a folder.
         expandNode(node);
       }
     }
   }
 }