/** * Bandscope Receiver Applet 1.0.0 [RECEIVER MODEL] * @author Robert J Morton YE572246C * @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("AOR AR86000"); // create the HOLD button // add a listener to listen for button being pushed SelRX.addActionListener(new phbl(phbl.HLDBUT, this)); /* Create a label to go above the butto, add it to the applet's content pane then set its position and size. */ HldLab = new JLabel("Receiver model:"); cp.add(HldLab); HldLab.setBounds(X, y, W, h); } // 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; // 'Hold button pressed' event int id; // one of the above peakhold ap; // the application that called: always the above applet! // constructor for a new command public phbl(int id, peakhold ap) { this.id = id; this.ap = ap; } // The 'HOLD' button has been clicked public void actionPerformed(ActionEvent e) { switch(id) { case HLDBUT: ap.selectRX(); break; } } }