Package net.sf.freecol.client.control
Class MapEditorController
- java.lang.Object
- 
- net.sf.freecol.client.control.FreeColClientHolder
- 
- net.sf.freecol.client.control.MapEditorController
 
 
- 
 public final class MapEditorController extends FreeColClientHolder The map editor controller.
- 
- 
Field SummaryFields Modifier and Type Field Description private MapTransformcurrentMapTransformThe transform that should be applied to aTilethat is clicked on the map.private static java.util.logging.Loggerloggerprivate static intMINI_MAP_THUMBNAIL_FINAL_HEIGHTMap height in MapGeneratorOptionsDialog.
 - 
Constructor SummaryConstructors Constructor Description MapEditorController(FreeColClient freeColClient)Creates a newMapEditorController.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.image.BufferedImagecreateMiniMapThumbNail()Create a thumbnail for the minimap.SpecificationgetDefaultSpecification()Get the default specification from the default TC.MapTransformgetMapTransform()Gets the currentMapTransform.voidloadGame()Opens a dialog where the user should specify the filename and loads the game.private voidloadGame(java.io.File file)Loads a game from the given file.voidnewMap()Creates a new map using aMapGenerator.private voidrequireNativeNations(Game game)Require all native nation players to be present in a game.voidsaveMapEditorGame()Opens a dialog where the user should specify the filename and saves the game.voidsaveMapEditorGame(java.io.File file)Saves the game to the given file.voidsetMapTransform(MapTransform mt)Sets the currently chosenMapTransform.voidstartMapEditor()Enters map editor mode.voidtransform(Tile t)- 
Methods inherited from class net.sf.freecol.client.control.FreeColClientHolderaskServer, currentPlayerIsMyPlayer, getClientOptions, getConnectController, getFreeColClient, getFreeColServer, getGame, getGUI, getMap, getMyPlayer, getSpecification, igc, pgc
 
- 
 
- 
- 
- 
Field Detail- 
loggerprivate static final java.util.logging.Logger logger 
 - 
MINI_MAP_THUMBNAIL_FINAL_HEIGHTprivate static final int MINI_MAP_THUMBNAIL_FINAL_HEIGHT Map height in MapGeneratorOptionsDialog.- See Also:
- Constant Field Values
 
 - 
currentMapTransformprivate MapTransform currentMapTransform The transform that should be applied to aTilethat is clicked on the map.
 
- 
 - 
Constructor Detail- 
MapEditorControllerpublic MapEditorController(FreeColClient freeColClient) Creates a newMapEditorController.- Parameters:
- freeColClient- The- FreeColClientfor the game.
 
 
- 
 - 
Method Detail- 
createMiniMapThumbNailprivate java.awt.image.BufferedImage createMiniMapThumbNail() Create a thumbnail for the minimap. FIXME: Delete all code inside this method and replace it with sensible code directly drawing in necessary size, without creating a throwaway GUI panel, drawing in wrong size and immediately resizing. Consider moving to ImageLibrary in due course, but not until the MiniMap dependency is gone.- Returns:
- The created BufferedImage.
 
 - 
requireNativeNationsprivate void requireNativeNations(Game game) Require all native nation players to be present in a game.- Parameters:
- game- The- Gameto add native nations to.
 
 - 
startMapEditorpublic void startMapEditor() Enters map editor mode. FIXME: The TC and difficulty level can now be set at the command line, but we should do better.
 - 
getDefaultSpecificationpublic Specification getDefaultSpecification() Get the default specification from the default TC.- Returns:
- A Specificationto use in the map editor.
 
 - 
setMapTransformpublic void setMapTransform(MapTransform mt) Sets the currently chosenMapTransform.- Parameters:
- mt- The transform that should be applied to a- Tilethat is clicked on the map.
 
 - 
getMapTransformpublic MapTransform getMapTransform() Gets the currentMapTransform.- Returns:
- The transform that should be applied to a
     Tilethat is clicked on the map.
 
 - 
transformpublic void transform(Tile t) - Parameters:
- t- The- Tileto be modified.
 
 - 
newMappublic void newMap() Creates a new map using aMapGenerator. A panel with theMapGeneratorOptionsis first displayed.- See Also:
- MapGenerator,- MapGeneratorOptions
 
 - 
saveMapEditorGamepublic void saveMapEditorGame() Opens a dialog where the user should specify the filename and saves the game.
 - 
saveMapEditorGamepublic void saveMapEditorGame(java.io.File file) Saves the game to the given file.- Parameters:
- file- The- File.
 
 - 
loadGamepublic void loadGame() Opens a dialog where the user should specify the filename and loads the game.
 - 
loadGameprivate void loadGame(java.io.File file) Loads a game from the given file.- Parameters:
- file- The- File.
 
 
- 
 
-