/** * Bandscope Receiver Applet 1.0.0 [PEAK HOLD BUTTON] * @author Robert J Morton * @version 13 March 2002, 22 March 2012 * @copyright Robert J Morton (all rights reserved) */ import javax.swing.*; // swing widgets import java.awt.*; // for graphics operations (GUI) import java.awt.event.*; // for the new-fangled 1.1 event handling class peakhold { private static final int X = 395, // x-coordinate of hold button on applet panel Y = 30, // y-coordinate of hold button on applet panel W = 140, // width of peak hold button H = 30, // height of peak hold button h = 15, // height of peak hold message label y = 12; // y-coordinate of peak hold label private JLabel HldLab; // label above the button private JComboBox SelRX; private boolean peakHold = false; private ar86000 rx; peakhold(Container cp, Font font) { SelRX = new JComboBox(); // create the HOLD button cp.add(SelRX); // add to applet's content pane SelRX.setBounds(X,Y,W,H); // set its size and position SelRX.addItem("AR AR86000"); // create the HOLD button SelRX.addItem("IC-7200"); // create the HOLD button SelRX.addItem("IC-735"); // create the HOLD button SelRX.addItem("IC-7600"); // create the HOLD button SelRX.addItem("TS-590S"); // create the HOLD button SelRX.addItem("Elct KX3"); // create the HOLD button SelRX.addItem("Al DX-SR8T"); // create the HOLD button SelRX.addItem("T-T OMNIVII"); // create the HOLD button SelRX.addItem("T-T Eagle"); // create the HOLD button // add a listener to listen for the button being pushed SelRX.addActionListener(new phbl(phbl.HLDBUT, this)); // create a label to go above the button HldLab = new JLabel("Receiver model:"); cp.add(HldLab); // add it to the applet's content pane HldLab.setBounds(X,y,W,h); // set its position and size } // set reference to the ar86000-specific class void setAR86000(ar86000 rx) {this.rx = rx;} // action to be taken when a new receiver model is selected void selectRX() { /* Future development for selecting the scan data file interpretation and POST commands for other receiver models and configurations */ } } class phbl implements ActionListener { static final int HLDBUT = 0; // 'Peak Hold button pressed' event int id; // identity of current instance of the event peakhold ap; // class instance that called: always the above app public phbl(int id, peakhold ap) { // constructor for a new command this.id = id; this.ap = ap; } /* This method is called whenever the listened-for event occurs. It can only ever be the "peak Hols" button that was clicked. */ public void actionPerformed(ActionEvent e) { switch(id) {case HLDBUT: ap.selectRX(); break;} } }