Exemple #1
0
  protected void setTrayPresent(String strPath) {
    String strzone = "zones";
    BufferedReader reader = WFileUtil.openReadFile(strPath);
    if (reader == null) return;

    String strLine;
    try {
      // if the zones are set to 0, then there is no tray present
      // set rackInfo(1,zones) 3 => tray 1 present
      // set rackInfo(2,zones) 0 => tray 2 not present
      while ((strLine = reader.readLine()) != null) {
        int index = strLine.indexOf(strzone);
        if (index < 0) continue;

        String strTray = strLine.substring(index - 2, index - 1);
        int nTray = 0;
        try {
          nTray = Integer.parseInt(strTray);
        } catch (Exception e) {
        }

        if (nTray <= 0) continue;

        int nZone = 0;
        try {
          strTray = strLine.substring(index + strzone.length() + 2, strLine.length());
          nZone = Integer.parseInt(strTray);
        } catch (Exception e) {
        }

        Color colorbg = Color.white;
        String strTooltip = TRAY;
        if (nZone <= 0) {
          colorbg = Color.black;
          strTooltip = NOTRAY;
        }
        VBox pnlVast = m_pnlVast[nTray - 1];
        pnlVast.setbackground(colorbg);
        pnlVast.setToolTipText(Util.getTooltipString(strTooltip));
      }
      reader.close();
    } catch (Exception e) {
      // e.printStackTrace();
      Messages.writeStackTrace(e);
    }
  }
Exemple #2
0
  protected void setPref() {
    Color color = DisplayOptions.getColor("PlainText");
    Font font = DisplayOptions.getFont("PlainText");
    m_lblUsername.setForeground(color);
    m_lblUsername.setFont(font);
    m_lblPassword.setForeground(color);
    m_lblPassword.setFont(font);
    m_cmbUser.getEditor().getEditorComponent().setForeground(color);
    m_cmbUser.getEditor().getEditorComponent().setFont(font);
    m_passwordField.setForeground(color);
    m_passwordField.setFont(font);

    color = DisplayOptions.getColor("Heading3");
    font = DisplayOptions.getFont("Heading3");
    m_lblSampleName.setForeground(color);
    m_pnlTrays.setBorder(
        BorderDeli.createBorder("Empty", "Sample Trays", "Bottom", "Center", color, font));
    VBox.setforeground(color);
    VBox.setfont(font);
  }