public void setMenuBar(BeanTableFrame f) { final jmri.util.JmriJFrame finalF = f; // needed for anonymous ActionListener class JMenuBar menuBar = f.getJMenuBar(); JMenu pathMenu = new JMenu("Paths"); menuBar.add(pathMenu); JMenuItem item = new JMenuItem("Delete Paths..."); pathMenu.add(item); item.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { deletePaths(finalF); } }); JMenu speedMenu = new JMenu("Speeds"); item = new JMenuItem("Defaults..."); speedMenu.add(item); item.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { setDefaultSpeeds(finalF); } }); menuBar.add(speedMenu); }
/** * Add the radiobuttons (only 1 may be selected) TODO change names from -box to radio- add radio * buttons to a ButtongGroup delete extra inchBoxChanged() and centimeterBoxChanged() methods */ public void addToFrame(BeanTableFrame f) { // final BeanTableFrame finalF = f; // needed for anonymous ActionListener class f.addToBottomBox(inchBox, this.getClass().getName()); inchBox.setToolTipText(Bundle.getMessage("InchBoxToolTip")); inchBox.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { inchBoxChanged(); } }); f.addToBottomBox(centimeterBox, this.getClass().getName()); centimeterBox.setToolTipText(Bundle.getMessage("CentimeterBoxToolTip")); centimeterBox.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { centimeterBoxChanged(); } }); }