From: Dennis M. <mil...@us...> - 2006-01-29 07:23:01
|
Update of /cvsroot/jmri/jmri/jmrit/symbolicprog In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15452/src/jmri/jmrit/symbolicprog Modified Files: CombinedLocoSelTreePane.java Log Message: Add ability to open a programmer by double clicking on a decoder Index: CombinedLocoSelTreePane.java =================================================================== RCS file: /cvsroot/jmri/jmri/jmrit/symbolicprog/CombinedLocoSelTreePane.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CombinedLocoSelTreePane.java 13 Jun 2005 23:23:01 -0000 1.12 --- CombinedLocoSelTreePane.java 29 Jan 2006 07:22:53 -0000 1.13 *************** *** 24,27 **** --- 24,28 ---- import javax.swing.tree.TreePath; import java.awt.event.MouseEvent; + import java.awt.event.MouseAdapter; import com.sun.java.util.collections.List; *************** *** 167,170 **** --- 168,186 ---- } }); + + // Mouselistener for doubleclick activation of proprammer + dTree.addMouseListener(new MouseAdapter(){ + public void mouseClicked(MouseEvent me){ + /* check for both double click and that it's a decoder + that is being clicked on. If it's just a Family, the programmer + button is enabled by the TreeSelectionListener, but we don't + want to automatically open a programmer so a user has the opportunity + to select an individual decoder + */ + if (me.getClickCount() == 2){ + if (go2.isEnabled() && ((TreeNode)dTree.getSelectionPath().getLastPathComponent()).isLeaf()) go2.doClick(); + } + } + } ); // add button |