Main Page | Compound List | File List | Compound Members

DaqDriverTest.java

Go to the documentation of this file.
00001 
00023 package dndtester;
00024 import javax.swing.*;
00025 import javax.swing.event.*;
00026 import java.awt.*;
00027 import java.awt.event.*;
00028 import java.util.*;
00037 public class DaqDriverTest extends JFrame{
00039     static boolean debug = false; 
00040 
00042     protected DaqPanel daqPanel; 
00043 
00045     protected JPanel driverPanel;
00046 
00048     protected JPanel nsdsPanel;
00049     
00051     JTabbedPane tabbedPane;
00052     
00054     public static DaqDriverTest daqDriverTest;
00059     public static void main(String[] args){
00060         if(args.length != 0 && args[0].equals("-g")){
00061             debug = true;
00062         }
00063         new DaqDriverTest();
00064     }
00065 
00072     public DaqDriverTest(){
00073         daqDriverTest = this;
00074         Container contentPane = getContentPane();
00075         //contentPane.setLayout(null);
00076         // Creating a menu to save states and to close program.
00077         JMenuBar menubar = new JMenuBar(); 
00078         JMenu menu = new JMenu("File");
00079         
00080         menu.add("Open ..");
00081         menu.add("Save As ...");
00082         menu.add("Save");
00083         menu.add("Exit");
00084         menubar.add(menu);
00085         setJMenuBar(menubar);
00086 
00087         // Initializing variables
00088         tabbedPane = new JTabbedPane();
00089         daqPanel = new DaqPanel(getRootPane());
00090         driverPanel = new JPanel();
00091         nsdsPanel = new JPanel();
00092         JPanel panelAll = new JPanel();
00093         
00094         
00095         // adding three tabs to the tabbedPane, each is a JPanel
00096         tabbedPane.add(daqPanel, "DAQ Tests");
00097         tabbedPane.addTab("Driver Tests",
00098                   new ImageIcon("document.gif"),
00099                   driverPanel, "tooltip text");
00100         tabbedPane.addTab("NSDS Tests",
00101                   new ImageIcon("document.gif"),
00102                   nsdsPanel, "tooltip text");
00103         tabbedPane.addTab("Complete Tests",
00104                   null,
00105                   panelAll, "tooltip text");
00106         
00107         // setting a layout manager
00108         contentPane.setLayout(new BorderLayout());
00109         contentPane.add(tabbedPane, BorderLayout.CENTER);
00110 
00111         // Setting the size for the JFrame, this could be adjusted or calculated
00112         // Correctly depending on the platform being used or the font size used.
00113         setBounds(300,300, 760, 499);
00114         setTitle("Test Module");
00115         setVisible(true); 
00116 
00117         // Get rid of the windo when close
00118         setDefaultCloseOperation(
00119                                  WindowConstants.DISPOSE_ON_CLOSE);
00120         // Exit the program if the window is close
00121         addWindowListener(new WindowAdapter(){
00122                 public void windowClosed(WindowEvent event){
00123                     System.exit(0);
00124                 }
00125             });
00126         
00127         
00128     }
00129 }
00130 
00138 class StopThread extends Thread{
00140     boolean stop = false;
00141     
00143     public void stopThread(){
00144         stop = true;
00145     }
00146 
00148     public boolean isStopped(){
00149         return stop;
00150     }
00151 }

Generated on Mon Jul 28 13:59:24 2003 by doxygen 1.3.2