leftIndent = leftIndent + 5; Map groupNameToId = ExperimentDB.getOrganizationGroups(experimentId); Set groups = groupNameToId.keySet(); groupNames = (String[])groups.toArray(new String[groups.size()]); int nGroupNames = groupNames.length; for (int i = 0; i < nGroupNames; i++) { String groupName = (String)groupNames[i]; JCheckBox groupCB = new JCheckBox(groupName); boolean sel = ExperimentDB.isGroupSelected(trialId, groupName); groupCheckBoxes.add(groupCB); originalGroupSelected.add(new Boolean(sel)); groupCB.setSelected(sel); groupCB.setEnabled(false); add(groupCB, new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0,
leftIndent = leftIndent + 5; for (int i = 0; i < nGroupNames; i++) { String groupName = (String)groupNames[i]; JCheckBox groupCB = new JCheckBox(groupName); boolean sel = ExperimentDB.isGroupSelected(trialId, groupName); groupCheckBoxes.add(groupCB); originalGroupSelected.add(new Boolean(sel)); groupCB.setSelected(sel); groupCB.setEnabled(false); add(groupCB, new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0,
  private void updateDisplay() {    removeAll(); // remove previous components    if (experiment == null || !DBUtils.dbMode ||        !ExperimentDB.isExperimentNameInDatabase(experiment.getExperimentName())) {      setLayout(new BorderLayout());      add(new JLabel("Experiment is not in database or otherwise has no thread information available.", SwingConstants.CENTER), BorderLayout.CENTER);        return;    }    String experimentId = experiment.getExperimentID();    String trialId = experiment.getTrialID();    setLayout(new GridBagLayout());    int x = 0;    int y = 0;    int leftIndent = 0;    add(new JLabel("Threads:"),        new GridBagConstraints(x, y++, 1, 1, 0.0, 0.0,                               GridBagConstraints.WEST,                               GridBagConstraints.NONE,                               new Insets(0, leftIndent, 5, 0),                               0, 0));    leftIndent = leftIndent + 5;    for (int i = 0; i < ULThreads.length; i++) {      JCheckBox cb = new JCheckBox(ULThreads[i]);      boolean sel =         ExperimentDB.isULThreadSelected(trialId, CMT.ULDBThreads[i]);      ULThreadCheckBoxes.add(cb);      cb.setSelected(sel);      originalThreadSelected.add(new Boolean(sel));      cb.setEnabled(false);      add(cb,          new GridBagConstraints(x, y++, 1, 1, 0.0, 0.0,                                 GridBagConstraints.WEST,                                 GridBagConstraints.NONE,                                 new Insets(0, leftIndent, 5, 0),                                 0, 0));    }    leftIndent = leftIndent - 5;    add(new JLabel("Organization Groups:"),        new GridBagConstraints(x, y++, 1, 1, 0.0, 0.0,                               GridBagConstraints.WEST,                               GridBagConstraints.NONE,                               new Insets(0, leftIndent, 0, 0),                               0, 0));    leftIndent = leftIndent + 5;    Map groupNameToId = ExperimentDB.getOrganizationGroups(experimentId);    Set groups = groupNameToId.keySet();    groupNames = (String[])groups.toArray(new String[groups.size()]);    int nGroupNames = groupNames.length;    for (int i = 0; i < nGroupNames; i++) {      String groupName = (String)groupNames[i];      JCheckBox groupCB = new JCheckBox(groupName);      boolean sel = ExperimentDB.isGroupSelected(trialId, groupName);      groupCheckBoxes.add(groupCB);      originalGroupSelected.add(new Boolean(sel));      groupCB.setSelected(sel);      groupCB.setEnabled(false);      add(groupCB,          new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0,                                 GridBagConstraints.WEST,                                 GridBagConstraints.NONE,                                 new Insets(0, leftIndent, 5, 0),                                 0, 0));      add(new JLabel("Number of Copies:"),          new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0,                                 GridBagConstraints.WEST,                                 GridBagConstraints.NONE,                                 new Insets(0, 0, 5, 5),                                 0, 0));      JTextField multiplierField = new JTextField(4);      multiplierFields.add(multiplierField);      int multiplier = ExperimentDB.getMultiplier(trialId, groupName);      multiplierField.setText(String.valueOf(multiplier));      multiplierField.setEnabled(false);      originalGroupMultiplier.add(new Integer(multiplier));      add(multiplierField,          new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0,                                 GridBagConstraints.WEST,                                 GridBagConstraints.NONE,                                 new Insets(0, 0, 5, 5),                                 0, 0));      add(new JLabel("Members:"),          new GridBagConstraints(x++, y, 1, 1, 0.0, 0.0,                                 GridBagConstraints.WEST,                                 GridBagConstraints.NONE,                                 new Insets(0, 0, 5, 5),                                 0, 0));      Set members =         ExperimentDB.getOrganizationsInGroup(experimentId,                                          (String)groupNameToId.get(groupName));      JList membersList = new JList(members.toArray());      membersList.setVisibleRowCount(4);      membersList.setEnabled(false);      add(new JScrollPane(membersList),          new GridBagConstraints(x++, y++, 1, 1, 0.0, 0.0,                                 GridBagConstraints.WEST,                                 GridBagConstraints.NONE,                                 new Insets(0, 0, 5, 5),                                 0, 0));    }  }