 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.action.exportmap;
22 import java.awt.image.BufferedImage;
24 import java.io.IOException;
25 import javax.imageio.ImageIO;
26 import javax.swing.Action;
27 import javax.swing.JFrame;
39 import net.
sf.japi.swing.action.ActionMethod;
40 import org.jetbrains.annotations.NotNull;
41 import org.jetbrains.annotations.Nullable;
96 public void mapCreated(@NotNull
final MapControl<G, A, R> mapControl,
final boolean interactive) {
149 if (mapControl ==
null) {
184 if (mapFile ==
null) {
189 final BufferedImage image = collector.
createImage(mapFile, includeTiledMaps, progress);
195 ImageIO.write(image,
"png", file);
196 }
catch (
final IOException ex) {
197 System.err.println(file +
": " + ex);
A MapModel reflects the data of a map.
A MapManager manages all opened maps.
Dialog to export a new map file into an image file.
Base package of all Gridarta classes.
BufferedImage createImage(@NotNull final MapFile mapFile, final boolean includeTiledMaps, @NotNull final ExportMapProgress progress)
Creates an image from a map file.
Interface for listeners listening to MapManager changes.
void addMapManagerListener(@NotNull MapManagerListener< G, A, R > listener)
Adds a MapManagerListener to be notified.
Creates images from maps.
Reflects a game object (object on a map).
ExportMapAsImageAction(@NotNull final MapManager< G, A, R > mapManager, @NotNull final RendererFactory< G, A, R > rendererFactory, @NotNull final JFrame parent)
Creates a new instance.
Graphical User Interface of Gridarta.
final RendererFactory< G, A, R > rendererFactory
The RendererFactory for creating images from maps.
The dialog for exporting maps as image files.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
GameObjects are the objects based on Archetypes found on maps.
boolean doExportMap(final boolean performAction)
Executes the "validate map" action.
Interface for receiving progress information while the map is exported.
Action action
The Action associated with this editor action.
void updateActions()
Updates the state of the action.
Interface for MapArchObjects.
MapControl< G, A, R > getCurrentMap()
Returns the current map.
The location of a map file with a map directory.
boolean exportMap(@NotNull final MapControl< G, A, R > mapControl, final boolean includeTiledMaps, @NotNull final File file, @NotNull final ExportMapProgress progress)
Exports a map as an image file.
Factory for creating MapRenderer instances.
Base classes for rendering maps.
final JFrame parent
The parent frame for export map dialogs.
Currently nothing more than a marker interface for unification.
MapModel< G, A, R > getMapModel()
Returns the map model.
void exportMapAsImage()
Exports the current map as an image file.
MapFile getMapFile()
Returns the map file.
MapControl< G, A, R > currentMapControl
The last known active map, or.
MapManagerListener< G, A, R > newMapManagerListener()
Creates a new MapManagerListener that refreshes the actions when the current map changes.
final MapManager< G, A, R > mapManager
The MapManager for loading maps.
An EditorAction that runs the map export on the current map.