if (node != null && node.isLeaf()) {   setValue(treeNodes.getValue(getIndices(e.getPath())), false); sendSysex(); } else { return; }
if (node != null && node.isLeaf()) {   setValue(treeNodes.getValue(getIndices(e.getPath())), false); sendSysex(); } else { return; } } });  if (playWithLineStyle) { tree.putClientProperty("JTree.lineStyle", lineStyle);
  public void setup() {    super.setup();    //Create the nodes.    rootNode = populate(treeNodes.getRoot());    //Create a tree that allows one selection at a time.    tree = new JTree(rootNode);    tree.getSelectionModel().setSelectionMode      (TreeSelectionModel.SINGLE_TREE_SELECTION);    //Listen for when the selection changes.    tree.addTreeSelectionListener(new TreeSelectionListener() {	public void valueChanged(TreeSelectionEvent e) {	  DefaultMutableTreeNode node	    = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();	  if (node != null && node.isLeaf()) {	    /*	    ErrorMsg.reportStatus("TreeSelectionLister: " + e.getPath());	    int[] tmp = getIndices(e.getPath());	    for (int i = 0; i < tmp.length; i++)	      System.out.println(tmp[i]);	    */	    // don't have to set seletction here	    setValue(treeNodes.getValue(getIndices(e.getPath())), false);	    sendSysex();	  } else {	    return;	  }	}      });    if (playWithLineStyle) {      tree.putClientProperty("JTree.lineStyle", lineStyle);    }    // disable default file folder icon    // Can anyone provide any fancy icons?    DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();    //renderer.setLeafIcon(new ImageIcon("images/middle.gif"));    //renderer.setOpenIcon(null);    //renderer.setClosedIcon(null);    renderer.setLeafIcon(null);    tree.setCellRenderer(renderer);    //Create the scroll pane and add the tree to it.     JScrollPane treeScrollPane = new JScrollPane(tree);    // consider to add Dimension parameter to all SysexWidget classes    // !!!FIXIT!!!    treeScrollPane.setPreferredSize(new Dimension(180, 320));    add(treeScrollPane, BorderLayout.CENTER);    // set selection    //setSelection(getValue());  }