 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.map.renderer;
23 import java.io.IOException;
30 import net.
sf.japi.swing.action.ActionBuilder;
31 import net.
sf.japi.swing.action.ActionBuilderFactory;
32 import org.apache.log4j.Category;
33 import org.apache.log4j.Logger;
34 import org.jetbrains.annotations.NotNull;
47 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
78 final File tmpFile =
new File(file.getPath() +
".tmp");
80 if (!tmpFile.renameTo(file)) {
81 if (!file.exists() || !file.delete() || !tmpFile.renameTo(file)) {
82 throw new IOException(
"cannot rename " + tmpFile +
" to " + file);
85 if (
LOG.isInfoEnabled()) {
86 LOG.info(
ACTION_BUILDER.format(
"logImageCreated", file, mapModel.getMapArchObject().getMapName()));
90 public void makeImage(@NotNull
final File in, @NotNull
final File out)
throws IOException {
91 if (
LOG.isInfoEnabled()) {
92 LOG.info(
"converting " + in +
" to " + out);
static final Category LOG
The Logger for printing log messages.
A MapModel reflects the data of a map.
ImageCreator(@NotNull final MapManager< G, A, R > mapManager, @NotNull final RendererFactory< G, A, R > rendererFactory)
Creates a new instance.
A MapManager manages all opened maps.
void createImage(@NotNull final MapModel< G, A, R > mapModel, @NotNull final File file)
Base package of all Gridarta classes.
MapRenderer newSimpleMapRenderer(@NotNull MapModel< G, A, R > mapModel)
Creates a new map renderer instance which paints only squares but no grid, cursor,...
Reflects a game object (object on a map).
final MapManager< G, A, R > mapManager
The MapManager for loading map instances.
GameObjects are the objects based on Archetypes found on maps.
final RendererFactory< G, A, R > rendererFactory
The RendererFactory for creating images.
Interface for MapArchObjects.
MapControl< G, A, R > openMapFile(@NotNull MapFile mapFile, boolean interactive)
Loads a map file.
void makeImage(@NotNull final File in, @NotNull final File out)
void release(@NotNull MapControl< G, A, R > mapControl)
Releases a MapControl instance.
Creates images from map instances.
static final ActionBuilder ACTION_BUILDER
Action Builder.
Currently nothing more than a marker interface for unification.
MapModel< G, A, R > getMapModel()
Returns the map model.
void printFullImage(@NotNull File file)
Saves an image of the entire view to a file.