public void changeTheme(){
  if (game == null)   return;
  IBoard board=game.getBoard();
  if (board.inSpace())   return;
  Set<String> themes=tileManager.getThemes();
  if (themes.remove(""))   themes.add("(No Theme)");
  themes.add("(Original Theme)");
  setShouldIgnoreKeys(true);
  selectedTheme=(String)JOptionPane.showInputDialog(null,"Choose the desired theme:","Theme Selection",JOptionPane.PLAIN_MESSAGE,null,themes.toArray(),selectedTheme);
  setShouldIgnoreKeys(false);
  if (selectedTheme == null) {
    return;
  }
 else   if (selectedTheme.equals("(Original Theme)")) {
    for (    Coords c : allBoardHexes()) {
      IHex hex=board.getHex(c);
      hex.resetTheme();
      board.setHex(c,hex);
    }
  }
 else {
    for (    Coords c : allBoardHexes()) {
      IHex hex=board.getHex(c);
      hex.setTheme(selectedTheme.equals("(No Theme)") ? "" : selectedTheme);
      board.setHex(c,hex);
    }
  }
}

public void changeTheme ( ) { if ( game == null ) return ; IBoard board = game . getBoard ( ) ; if ( board . inSpace ( ) ) return ; Set < String > themes = tileManager . getThemes ( ) ; if ( themes . remove ( "" ) ) themes . add ( "(No Theme)" ) ; themes . add ( "(Original Theme)" ) ; setShouldIgnoreKeys ( true ) ; selectedTheme = ( String ) JOptionPane . showInputDialog ( null , "Choose the desired theme:" , "Theme Selection" , JOptionPane . PLAIN_MESSAGE , null , themes . toArray ( ) , selectedTheme ) ; setShouldIgnoreKeys ( false ) ; if ( selectedTheme == null ) { return ; } else if ( selectedTheme . equals ( "(Original Theme)" ) ) { for ( Coords c : allBoardHexes ( ) ) { IHex hex = board . getHex ( c ) ; hex . resetTheme ( ) ; board . setHex ( c , hex ) ; } } else { for ( Coords c : allBoardHexes ( ) ) { IHex hex = board . getHex ( c ) ; hex . setTheme ( selectedTheme . equals ( "(No Theme)" ) ? "" : selectedTheme ) ; board . setHex ( c , hex ) ; } } }
displays a dialog and changes the theme of all board hexes to the user - chosen theme .
