/** * Complete Control Panel for DifEqnAp.class * @author Robert J Morton * @version 27 November 1997 modified 07 August 2009, 18 April 2012 */ /* This Panel class contains 6 sub panels: The SelPer panel, the SelEqn panel, the SelScan panel, the SetCval panel, the IncCval panel and the SetButt panel, each of which is implemented in a class bearing its respective name. */ import java.awt.*; // for graphics operations (GUI) import javax.swing.*; // library for constructing Swing GUI public class ctrlpanl extends JPanel { ctrlpanl(difeqnap ap, timegr tg, bouncegr bg, formula f, int ls) { setLayout(null); // allow free laying out of components on panel Color pc = new Color(238,238,238); // panel colour setFont(new Font("Sans",Font.PLAIN,14)); /* For each of the following widgets, create an instance of it, add it to this, the main control panel, and morph it into the required space. */ // Period Selector panel selper sp = new selper(ap,pc,ls); add(sp); sp.setBounds(5,5,100,135); // Scan Mode Selector panel selscan ss = new selscan(tg,sb,pc,ls); add(ss); ss.setBounds(240,90,130,80); // Plot Mode Selector panel selplot st = new selplot(sb,ss,tg,pc,ls); add(st); st.setBounds(240,5,130,80); ss.setST(st); // c-value entry/adjustment panel cval cv = new cval(sb,f,pc,ls); add(cv); cv.setBounds(110,90,125,50); // equation selector seleqn se = new seleqn(cv,tg,bg,f,pc,ls); add(se); se.setBounds(110,5,125,80); // Start/Stop/Reset panel setbutt sb = new setbutt(ap,tg,bg,f,ls); add(sb); sb.setBounds(5,145,230, 35); ap.setSB(sb); // inform main applet of setbutt's instance reference tg.setSB(sb); // inform time-graph class of setbutt's instance reference } }