Exemple #1
0
  public void setData(TraceDataSet dataSet) {
    this.dataSet = dataSet;
    this.errorsOnly = false;
    this.traceLabel = null;
    this.minTraceTime = 0;

    btnFilterErrors.setSelected(false);
    txtMinTime.setText("");

    tbmTraces.setDataSet(dataSet, null);

    List<String> traceNames = new ArrayList<String>();

    for (ViewerTraceRecord rec : dataSet.getRecords()) {
      String traceName = rec.getTraceName();
      if (traceName != null && !traceNames.contains(traceName)) {
        traceNames.add(traceName);
      }
    }

    Collections.sort(traceNames);
    cmbTraceType.removeAllItems();
    cmbTraceType.addItem("*");

    for (String traceName : traceNames) {
      cmbTraceType.addItem(traceName);
    }
  }
  // Вид формы при изменении сотрудника
  public void sotrDiaUpdate(Sotrudnik s) {
    label_id_hidden.setText(Integer.toString(s.getId_sotrudnika()));
    textField_familiya.setText(s.getFamiliya());
    textField_imya.setText(s.getImya());
    textField_otchestvo.setText(s.getOtchestvo());
    textField_phone.setText(s.getPhone());
    textField_date.setText(s.getData_priema().toString());
    comboBox_doljnost.removeAllItems();
    comboBox_kvalification.removeAllItems();

    try {
      DBClass db = new DBClass();
      ArrayList<Doljnost> d = db.doljnostFromDB();
      DBClass db2 = new DBClass();
      Doljnost dd = db2.doljnostFromDB(s);
      for (int i = 0; i < d.size(); i++) {
        comboBox_doljnost.addItem(d.get(i));
        Doljnost ddd = (Doljnost) comboBox_doljnost.getItemAt(i);
        if (dd.getNazvanie_doljnosti().equals(ddd.getNazvanie_doljnosti())) dd = ddd;
      }
      comboBox_doljnost.setSelectedItem(dd);

      DBClass db3 = new DBClass();
      ArrayList<Kvalification> k = db3.kvalificationFromDB();
      DBClass db4 = new DBClass();
      Kvalification kk = db4.kvalificationFromDB(s);
      for (int i = 0; i < k.size(); i++) {
        comboBox_kvalification.addItem(k.get(i));
        Kvalification kkk = (Kvalification) comboBox_kvalification.getItemAt(i);
        if (kk.getNazvanie_kvalification().equals(kkk.getNazvanie_kvalification())) kk = kkk;
      }

      comboBox_kvalification.setSelectedItem(kk);

    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(panelException, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(panelException, ee.getMessage());
    }
  }
Exemple #3
0
 /** cleans up a connection by removing all user from all maintained lists */
 public void close() {
   error("Connection to server was lost");
   admin = false;
   users.clear();
   afks.clear();
   ignores.clear();
   admins.clear();
   channels.clear();
   cboChannels.removeAllItems();
   updateList();
 }
  // Вид формы при добавлении нового сотрудника
  public void sotrDiaInsert() {
    label_id_hidden.setText("Новый сотрудник");
    textField_familiya.setText("");
    textField_imya.setText("");
    textField_otchestvo.setText("");
    textField_phone.setText("");
    comboBox_doljnost.removeAllItems();
    comboBox_kvalification.removeAllItems();

    Calendar calend = Calendar.getInstance();
    if (calend.get(Calendar.MONTH) <= 9) {
      textField_date.setText(
          String.valueOf(
              (calend.get(Calendar.YEAR) + "-" + ("0" + (1 + calend.get(Calendar.MONTH))) + "-")
                  + (calend.get(Calendar.DATE))));
    } else
      textField_date.setText(
          String.valueOf(
              ((calend.get(Calendar.YEAR)) + "-" + (1 + calend.get(Calendar.MONTH)) + "-")
                  + (calend.get(Calendar.DATE))));
    textField_date.setEnabled(false);

    try {
      DBClass db = new DBClass();
      ArrayList<Doljnost> d = db.doljnostFromDB();
      for (int i = 0; i < d.size(); i++) {
        comboBox_doljnost.addItem(d.get(i));
      }
      DBClass db2 = new DBClass();
      ArrayList<Kvalification> k = db2.kvalificationFromDB();
      for (int i = 0; i < k.size(); i++) {
        comboBox_kvalification.addItem(k.get(i));
      }
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(panelException, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(panelException, ee.getMessage());
    }
  }
 private void addPainter(myjava.gui.syntax.Painter painter) {
   EntryListPanel newPanel = new EntryListPanel(painter);
   listPanelSet.add(newPanel);
   centerPanel.add(newPanel, painter.getName());
   painterComboBox.removeItemListener(painterChangeListener);
   painterComboBox.removeAllItems();
   for (EntryListPanel p : listPanelSet) {
     painterComboBox.addItem(p.getPainter());
   }
   removedPainters.remove(painter);
   painterComboBox.addItemListener(painterChangeListener);
 }
 /**
  * Method which updates the value of the bands
  *
  * @param img New image
  * @param n Number of bands
  */
 public void updateBandsFrame(JIPImage img, int n) {
   bandSel.removeAllItems();
   if (img instanceof JIPBmpColor) {
     bandSel.addItem("COLOR-Bands RGB");
   } else if (img instanceof JIPImgGeometric) {
     bandSel.addItem("Geometric image");
   } else {
     for (int i = 0; i < ((JIPImgBitmap) img).getNumBands(); i++)
       bandSel.addItem(prop.getProperty("Band") + " " + i);
     tamFrame.setText(
         prop.getProperty("FrameSize") + ": " + img.getWidth() + "x" + img.getHeight());
   }
 }
  /**
   * Method which put information of values of the new sequence in the panel
   *
   * @param s New sequence
   */
  public void assocSequence(JIPSequence s) {
    frameSel.removeAllItems();
    bandSel.removeAllItems();
    if (s == null) {
      frameSel.addItem("[ " + prop.getProperty("Nosequence") + " ]");
      bandSel.addItem("[ " + prop.getProperty("Nosequence") + " ]");
      return;
    }

    try {
      for (int i = 0; i < s.getNumFrames(); i++) {
        String tipo = s.getFrame(i).getType().toString();
        String nomF = s.getFrame(i).getName();
        if (nomF.length() > 10) nomF = nomF.substring(0, 7) + "...";
        frameSel.addItem(i + ":" + tipo + ":" + nomF);
      }
      JIPImage aux = s.getFrame(0);
      updateBandsFrame(aux, 0);
    } catch (JIPException e) {
      logger.error(e);
    }
  }
  public static void updateKvalification() {
    try {

      DBClass db2 = new DBClass();
      ArrayList<Kvalification> k = db2.kvalificationFromDB();
      comboBox_kvalification.removeAllItems();
      for (int i = 0; i < k.size(); i++) {
        comboBox_kvalification.addItem(k.get(i));
      }
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(null, ee.getMessage());
    }
  }
  public static void updateDoljnost() {
    try {
      DBClass db = new DBClass();
      ArrayList<Doljnost> d = db.doljnostFromDB();
      comboBox_doljnost.removeAllItems();
      for (int i = 0; i < d.size(); i++) {
        comboBox_doljnost.addItem(d.get(i));
      }

    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null, e.getMessage());
    } catch (SQLException ee) {
      ee.printStackTrace();
      JOptionPane.showMessageDialog(null, ee.getMessage());
    }
  }
  private void affectLibelle() {
    setTitle(ConcoursJeunes.ajrLibelle.getResourceString("criterion.titre"));

    jlCode.setText(ConcoursJeunes.ajrLibelle.getResourceString("criterion.code"));
    jlLibelle.setText(ConcoursJeunes.ajrLibelle.getResourceString("criterion.libelle"));
    jlSortOrder.setText(ConcoursJeunes.ajrLibelle.getResourceString("criterion.ordretri"));
    jcbSortOrder.removeAllItems();
    jcbSortOrder.addItem(ConcoursJeunes.ajrLibelle.getResourceString("criterion.ordretri.asc"));
    jcbSortOrder.addItem(ConcoursJeunes.ajrLibelle.getResourceString("criterion.ordretri.desc"));
    jcbPlacementCriterion.setText(
        ConcoursJeunes.ajrLibelle.getResourceString("criterion.placement"));
    jcbClassementCriterion.setText(
        ConcoursJeunes.ajrLibelle.getResourceString("criterion.classement"));

    jbValider.setText(ConcoursJeunes.ajrLibelle.getResourceString("bouton.valider"));
    jbAnnuler.setText(ConcoursJeunes.ajrLibelle.getResourceString("bouton.annuler"));
  }
  private void updateParams(EDPCellData data) {
    paramComboBox.removeAllItems();
    paramKeys = data.getPlugin().getPrintfDescrs(!m_isCrawlRuleEditor);
    if (!m_isCrawlRuleEditor) {
      paramComboBox.addItem(STRING_LITERAL);
    }

    for (Iterator it = paramKeys.values().iterator(); it.hasNext(); ) {
      ConfigParamDescr descr = (ConfigParamDescr) it.next();
      int type = descr.getType();
      if (!m_isCrawlRuleEditor
          && (type == ConfigParamDescr.TYPE_SET || type == ConfigParamDescr.TYPE_RANGE)) continue;
      paramComboBox.addItem(descr);
    }
    paramComboBox.setEnabled(true);
    paramComboBox.setSelectedIndex(0);
    paramComboBox.setToolTipText("Select a parameter to insert into the format string");
    insertButton.setEnabled(true);
  }
 protected void updateCategoryChooser() {
   if (categoryChooser != null) {
     ArrayList<String> categories;
     categoryChooser.removeAllItems();
     categories = new ArrayList<String>(contribListing.getCategories(filter));
     //      for (int i = 0; i < categories.size(); i++) {
     //        System.out.println(i + " category: " + categories.get(i));
     //      }
     Collections.sort(categories);
     //    categories.add(0, ContributionManagerDialog.ANY_CATEGORY);
     boolean categoriesFound = false;
     categoryChooser.addItem(ContributionManagerDialog.ANY_CATEGORY);
     for (String s : categories) {
       categoryChooser.addItem(s);
       if (!s.equals(Contribution.UNKNOWN_CATEGORY)) {
         categoriesFound = true;
       }
     }
     categoryChooser.setVisible(categoriesFound);
   }
 }
 protected void FillRatingCombo() {
   _RatingCombo.removeAllItems();
   for (Rating r : Rating.values()) _RatingCombo.addItem(r);
   _RatingCombo.setSelectedIndex(-1);
 }
  @Override
  public void actionPerformed(ActionEvent event) {

    if (event.getSource().getClass() == JButton.class) {
      if (event.getSource() == exit) {
        fentreCard.show("Menu");
      }
      if (event.getSource() == valider) {
        try {

          try {
            String at1, re1, at2, re2, at3, re3;
            re1 = recherche1.getText();
            re2 = recherche2.getText();
            re3 = recherche3.getText();
            try {
              at1 = result1.getSelectedItem().toString();
            } catch (Exception e) {
              at1 = "";
            }
            try {
              at2 = result2.getSelectedItem().toString();
            } catch (Exception e) {
              at2 = "";
            }
            try {
              at3 = result3.getSelectedItem().toString();
            } catch (Exception e) {
              at3 = "";
            }

            switch (switchcherche) {
              case 1:
                RechercheTab r1 =
                    new RechercheTab(JobDocteur.FindResult(at1, re1, at2, re2, at3, re3), 1);
                break;
              case 2:
                RechercheTab r2 =
                    new RechercheTab(JobMalade.FindResult(at1, re1, at2, re2, at3, re3), 2);
                break;
              case 3:
                RechercheTab r3 =
                    new RechercheTab(JobInfirmier.FindResult(at1, re1, at2, re2, at3, re3), 3);
                break;
              case 4:
                RechercheTab r4 =
                    new RechercheTab(JobEmploye.FindResult(at1, re1, at2, re2, at3, re3), 4);
                break;
              case 5:
                RechercheTab r5 =
                    new RechercheTab(
                        JobHospitalisation.FindResult(at1, re1, at2, re2, at3, re3), 5);
                break;
              case 6:
                RechercheTab r6 =
                    new RechercheTab(JobChambre.FindResult(at1, re1, at2, re2, at3, re3), 6);
                break;
              case 7:
                RechercheTab r7 =
                    new RechercheTab(JobService.FindResult(at1, re1, at2, re2, at3, re3), 7);
                break;
              case 8:
                RechercheTab r8 =
                    new RechercheTab(JobSoigne.FindResult(at1, re1, at2, re2, at3, re3), 8);
                break;
              default:
                break;
            }
          } catch (SQLException ex) {
            Logger.getLogger(Recherche.class.getName()).log(Level.SEVERE, null, ex);
          }
        } catch (IOException ex) {
          Logger.getLogger(Recherche.class.getName()).log(Level.SEVERE, null, ex);
        }
        fentreCard.show("RechercheTab");
      }
    } else if (event.getSource().getClass() == JComboBox.class) {

      if ("Docteur".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] DocteurRecherche = {
          "Numero", "Nom", "Prenom", "Adresse", "Telephone", "Specialite"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 1;
        for (int i = 0; i < DocteurRecherche.length; i++) {
          result1.insertItemAt(DocteurRecherche[i], i);
          result2.insertItemAt(DocteurRecherche[i], i);
          result3.insertItemAt(DocteurRecherche[i], i);
        }
      } else if ("Malade".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] MaladeRecherche = {"Numero", "Nom", "Prenom", "Telephone", "Adresse", "Mutuelle"};
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 2;
        for (int i = 0; i < MaladeRecherche.length; i++) {
          result1.insertItemAt(MaladeRecherche[i], i);
          result2.insertItemAt(MaladeRecherche[i], i);
          result3.insertItemAt(MaladeRecherche[i], i);
        }
      } else if ("Infirmier".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] InfirmierRecherche = {
          "Numero", "Nom", "Prenom", "Nom Service", "Telephone", "Adresse", "Rotation"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 3;
        for (int i = 0; i < InfirmierRecherche.length; i++) {
          result1.insertItemAt(InfirmierRecherche[i], i);
          result2.insertItemAt(InfirmierRecherche[i], i);
          result3.insertItemAt(InfirmierRecherche[i], i);
        }
      } else if ("Employe".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] EmployeRecherche = {"Numero", "Nom", "Prenom", "Telephone", "Adresse"};
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 4;
        for (int i = 0; i < EmployeRecherche.length; i++) {
          result1.insertItemAt(EmployeRecherche[i], i);
          result2.insertItemAt(EmployeRecherche[i], i);
          result3.insertItemAt(EmployeRecherche[i], i);
        }
      } else if ("Hospitalisation"
          .equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] HospitalisationRecherche = {
          "Numero du Malade",
          "Nom du Malade",
          "Numero du Service",
          "Nom du Service",
          "Chambre",
          "Numero du lit"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 5;
        for (int i = 0; i < HospitalisationRecherche.length; i++) {
          result1.insertItemAt(HospitalisationRecherche[i], i);
          result2.insertItemAt(HospitalisationRecherche[i], i);
          result3.insertItemAt(HospitalisationRecherche[i], i);
        }
      } else if ("Chambre".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] ChambreRecherche = {
          "Numero Chambre", "Surveillant", "Nom Service", "Nombres de lits"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 6;
        for (int i = 0; i < ChambreRecherche.length; i++) {
          result1.insertItemAt(ChambreRecherche[i], i);
          result2.insertItemAt(ChambreRecherche[i], i);
          result3.insertItemAt(ChambreRecherche[i], i);
        }
      } else if ("Service".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] ServiceRecherche = {"Code du Service", "Nom Service", "Batiment", "Directeur"};
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 7;
        for (int i = 0; i < ServiceRecherche.length; i++) {
          result1.insertItemAt(ServiceRecherche[i], i);
          result2.insertItemAt(ServiceRecherche[i], i);
          result3.insertItemAt(ServiceRecherche[i], i);
        }

      } else if ("Soigne".equals((String) ((JComboBox) event.getSource()).getSelectedItem())) {
        String[] SoigneRecherche = {
          "Numero du Docteur",
          "Nom Docteur",
          "Specialite du Docteur",
          "Numero du Malade",
          "Nom du Malade",
          "Mutuelle"
        };
        result1.removeAllItems();
        result2.removeAllItems();
        result3.removeAllItems();
        switchcherche = 8;
        for (int i = 0; i < SoigneRecherche.length; i++) {
          result1.insertItemAt(SoigneRecherche[i], i);
          result2.insertItemAt(SoigneRecherche[i], i);
          result3.insertItemAt(SoigneRecherche[i], i);
        }
      }
    }
  }
 protected void FillJobTypeCombo() {
   _JobTypeCombo.removeAllItems();
   for (JobType jt : JobType.values()) _JobTypeCombo.addItem(jt);
   _JobTypeCombo.setSelectedIndex(-1);
 }
 protected void FillPlanetCombo() {
   _HomePlanetCombo.removeAllItems();
   int PlanetCount = SolarSystemManager.getPlanetCount();
   for (int i = 0; i < PlanetCount; i++) _HomePlanetCombo.addItem(SolarSystemManager.getPlanet(i));
   _HomePlanetCombo.setSelectedIndex(-1);
 }
 public void updateProperty() {
   propertydisplay.removeAllItems();
   for (String x : getPropertyName()) {
     propertydisplay.addItem(x);
   }
 }