private void fillColumns() {

      // remove all columns.
      this.tableColumns.removeAllElements();

      FunctionalGroup g = controller.getSelectedFunctionalGroup();

      if (g != null) {

        Collection<String> stages = g.getStageNames();
        // Sort the stage names alphabetically
        ArrayList<String> stage_names = new ArrayList<String>();
        for (String s : stages) {
          stage_names.add(s);
        }
        Collections.sort(stage_names);
        int modelIndex = 1;

        for (String s : stage_names) {
          TableColumn c = new TableColumn(modelIndex);
          c.setHeaderValue(s);
          this.addColumn(c);
          modelIndex++;
        }
      }
    }
 /**
  * Returns a list of all stage names in the current functional group
  *
  * @return - <code>Collection</code> of Strings corresponding to stage names
  */
 public Collection<String> get_stages() {
   // Get all available stages
   FunctionalGroup g = controller.getSelectedFunctionalGroup();
   if (g != null) {
     Collection<String> stages = g.getStageNames();
     ArrayList<String> stage_names = new ArrayList<String>();
     for (String s : stages) {
       stage_names.add(s);
     }
     // Alphabetise them
     Collections.sort(stage_names);
     return stage_names;
   }
   return null;
 }
    @Override
    /**
     * if x < 2 it returns the function name at y
     *
     * <p>else it returns whether the function(y) is called in the stage(x)
     *
     * @param x
     * @param y return correct value at cell (x, y)
     */
    public Object getValueAt(int x, int y) {

      if (controller.getSelectedFunctionalGroup() == null) {

        return "No Selected Functional Group.";

      } else {
        String stageName = this.getColumnName(y - 1);

        return this.controller.stageIsCalledIn(stageName, x);
      }
    }