public void updateLights() {
   boolean allOk = setIconStatus(modelLight, p.greenLight(false) ? greenLight : redLight);
   boolean speciesOK = (sb2.greenLight(false));
   boolean trackOK = sp2.greenLight(false);
   allOk = setIconStatus(speciesLight, speciesOK ? greenLight : redLight) && allOk;
   allOk =
       setIconStatus(
               foodLight,
               (speciesOK) ? (ftd.greenLight(false) ? greenLight : redLight) : greyLight)
           && allOk;
   allOk = setIconStatus(trackLight, trackOK ? greenLight : redLight) && allOk;
   allOk =
       setIconStatus(
               pmLight,
               (trackOK && speciesOK) ? (pm.greenLight(false) ? greenLight : redLight) : greyLight)
           && allOk;
   boolean colInitOK = icp.greenLight(false);
   allOk = setIconStatus(colInitLight, colInitOK ? greenLight : redLight) && allOk;
   allOk =
       setIconStatus(
               initLight,
               (trackOK & speciesOK & colInitOK)
                   ? (pi.greenLight(false) ? greenLight : redLight)
                   : greyLight)
           && allOk;
   allOk = setIconStatus(closureLight, (cd.greenLight(false) ? greenLight : redLight)) && allOk;
   allOk =
       setIconStatus(
               chemRecycleLight,
               trackOK ? (cr.greenLight(false) ? greenLight : redLight) : greyLight)
           && allOk;
   if (NOC_Mode)
     allOk =
         setIconStatus(
                 vddLight, trackOK ? (vdd.greenLight(false) ? greenLight : redLight) : greyLight)
             && allOk;
   allOk =
       setIconStatus(
               eventsLight, trackOK ? (ep.greenLight(false) ? greenLight : redLight) : greyLight)
           && allOk;
   allOk =
       setIconStatus(
               outputLight,
               (speciesOK && trackOK)
                   ? (od2.greenLight(false) ? greenLight : redLight)
                   : greyLight)
           && allOk;
   allOk =
       setIconStatus(
               runLight, (!allOk) ? greyLight : (rp.greenLight(false) ? greenLight : redLight))
           && allOk;
   setIconStatus(lastPage, yellowLight);
 }
Exemplo n.º 2
0
  /** Creates the experiment environment gui with no initial experiment */
  public Experimenter(boolean classFirst) {

    System.out.println(
        "[DEBUGGER] ---- "
            + Messages.getInstance().getString("Experimenter_TabbedPane_Setup_Key_Text"));

    m_SetupPanel = new SetupModePanel();
    m_ResultsPanel = new ResultsPanel();
    m_RunPanel = new RunPanel();
    m_RunPanel.setResultsPanel(m_ResultsPanel);

    m_ClassFirst = classFirst;

    m_TabbedPane.addTab(
        Messages.getInstance().getString("Experimenter_TabbedPane_Setup_Key_Text"),
        null,
        m_SetupPanel,
        Messages.getInstance().getString("Experimenter_TabbedPane_Setup_Value_Text"));
    m_TabbedPane.addTab(
        Messages.getInstance().getString("Experimenter_TabbedPane_Run_Key_Text"),
        null,
        m_RunPanel,
        Messages.getInstance().getString("Experimenter_TabbedPane_Run_Value_Text"));
    m_TabbedPane.addTab(
        Messages.getInstance().getString("Experimenter_TabbedPane_Analyse_Key_Text"),
        null,
        m_ResultsPanel,
        Messages.getInstance().getString("Experimenter_TabbedPane_Analyse_Value_Text"));
    m_TabbedPane.setSelectedIndex(0);
    m_TabbedPane.setEnabledAt(1, false);
    m_SetupPanel.addPropertyChangeListener(
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent e) {
            // System.err.println("Updated experiment");
            Experiment exp = m_SetupPanel.getExperiment();
            exp.classFirst(m_ClassFirst);
            m_RunPanel.setExperiment(exp);
            // m_ResultsPanel.setExperiment(exp);
            m_TabbedPane.setEnabledAt(1, true);
          }
        });
    setLayout(new BorderLayout());
    add(m_TabbedPane, BorderLayout.CENTER);
  }