Exemple #1
0
  /**
   * Make all tableaux associated with this effigy and any effigies it contains visible by raising
   * or deiconifying them. If there is no tableau contained directly by this effigy, then create one
   * by calling createPrimaryTableau() in the configuration.
   *
   * @return The first tableau encountered, or a new one if there are none.
   */
  public Tableau showTableaux() {
    Iterator effigies = entityList(Effigy.class).iterator();

    while (effigies.hasNext()) {
      Effigy effigy = (Effigy) effigies.next();
      effigy.showTableaux();
    }

    Iterator tableaux = entityList(Tableau.class).iterator();
    Tableau result = null;

    while (tableaux.hasNext()) {
      Tableau tableau = (Tableau) tableaux.next();
      tableau.show();

      if (result == null) {
        result = tableau;
      }
    }

    if (result == null) {
      // Create a new tableau.
      Configuration configuration = (Configuration) toplevel();
      result = configuration.createPrimaryTableau(this);
    }

    return result;
  }