Topics topics = solver.getTopics(); Persons persons = solver.getPersons();
Topics    topics    = solver.getTopics(); Persons   persons   = solver.getPersons(); Locations locations = solver.getLocations(); Times     times     = solver.getTimes();
  protected void additionalEditSetup(ComboBoxModel model, Solver solver, int selected,                                     ChangeMonitor changeMonitor)  {    this.solver = solver;    this.selected = selected;        Topics topics = solver.getTopics();    Persons persons = solver.getPersons();    int tNumber = topics.getNumber();   // Number of topics    int pNumber = persons.getNumber();  // Number of persons    int sNumber = solver.getSessionNumber();   // Number of sessions    int gNumber = tNumber / sNumber;    // Number of topic groups    gColor = new Color[gNumber]; // Colors for topic groups        //System.out.println("addEdSetup: t" + tNumber + ", p" + pNumber    //                   + ", s" + sNumber + ", g" + gNumber);        // Create Layout of Topic Clustering Panel    topicsPanel.removeAll();    topicsPanel.setLayout(new GridBagLayout());    GridBagConstraints c = new GridBagConstraints();    c.anchor = GridBagConstraints.LINE_START;    c.insets = new Insets(0, 0, 5, 10);    c.weightx = 0.0;    c.weighty = 0.0;        // Create the group colors    for (int g = 0;  g < gNumber;  ++g)      gColor[g] = new Color(Color.HSBtoRGB(g / (float)gNumber, 0.9f, 0.7f));        for (int g = 0;  g < gNumber+1;  ++g)      for (int s = 0;  s < sNumber+1;  ++s)      {        c.gridx = s;        c.gridy = g;                JLabel label = new JLabel();        topicsPanel.add(label, c);        if (g > 0)          label.setForeground(gColor[g-1]);  // set color of sessions                if (g == 0)  // Column headers        {          if (s > 0)            label.setText("Session " + s);        }        else if (s == 0)  // Row headers        {          if (g > 0)            label.setText("Group " + g);        }      }         // add cells to the layout that push it to the upper left    c.gridx = sNumber+1;    c.gridy = 0;    c.weightx = 1.0;    topicsPanel.add(Box.createHorizontalGlue(), c);    c.gridx = 0;    c.gridy = gNumber+1;    c.weightx = 0.0;    c.weighty = 1.0;    topicsPanel.add(Box.createVerticalGlue(), c);        // Create Layout of Role Assignment Panel    rolesPanel.removeAll();    rolesPanel.setLayout(new GridBagLayout());    c.weightx = 0.0;    c.weighty = 0.0;        for (int p = 0;  p < pNumber+1;  ++p)      for (int t = 0; t < tNumber+2;  ++t)      {        c.gridx = t;        c.gridy = p;        JLabel label = new JLabel();        rolesPanel.add(label, c);      }    // add cells to the layout that push it to the upper left    c.gridx = tNumber+2;    c.gridy = 0;    c.weightx = 1.0;    rolesPanel.add(Box.createHorizontalGlue(), c);    c.gridx = 0;    c.gridy = pNumber+1;    c.weightx = 0.0;    c.weighty = 1.0;    rolesPanel.add(Box.createVerticalGlue(), c);    update();  }