 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.action;
22 import java.awt.Component;
23 import java.io.IOException;
24 import javax.swing.Action;
25 import javax.swing.JFrame;
37 import net.
sf.japi.swing.action.ActionBuilder;
38 import net.
sf.japi.swing.action.ActionBuilderFactory;
39 import net.
sf.japi.swing.action.ActionMethod;
40 import net.
sf.japi.swing.misc.Progress;
41 import net.
sf.japi.swing.misc.ProgressDisplay;
42 import org.apache.log4j.Category;
43 import org.apache.log4j.Logger;
44 import org.jetbrains.annotations.NotNull;
45 import org.jetbrains.annotations.Nullable;
57 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
131 synchronized (
this) {
141 public void finished() {
148 public Component getParentComponent() {
149 return progress.getParentComponent();
153 public void setLabel(
final String msg,
final int max) {
154 progress.setLabel(msg, max);
158 public void setValue(
final int value) {
159 progress.setValue(value);
193 public void preExitNotify() {
198 public void appExitNotify() {
203 public void waitExitNotify() {
208 }
catch (
final InterruptedException ignored) {
209 Thread.currentThread().interrupt();
210 LOG.warn(
"DelayedMapModelListenerManager was interrupted");
211 }
catch (
final IOException ex) {
212 ACTION_BUILDER.showMessageDialog(
parent,
"archCollectErrorIOException",
"arches, animations and animtree, images", ex);
void updateAction()
Updates the action's enabled state.
Base package of all Gridarta classes.
A Collector is capable of iterating over a collection of {Collectables} and collecting them in a sepa...
void collectArches()
Runs the archetype collection.
void waitUntilFinished()
Waits until collection has finished.
static final Category LOG
The Logger for printing log messages.
Reflects a game object (object on a map).
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
Graphical User Interface of Gridarta.
final ProjectSettings projectSettings
The project settings instance.
ExiterListener newExiterListener()
Creates a new ExiterListener that delays application exit until archetype collection has finished.
GameObjects are the objects based on Archetypes found on maps.
void start()
Starts collecting.
boolean canWriteCollected()
Whether the resources can be written in collected form.
An EditorAction that runs the archetype collection.
CollectArchesAction(@NotNull final ProjectSettings projectSettings, @NotNull final AbstractResources< G, A, R > resources, @NotNull final Exiter exiter, @NotNull final JFrame parent)
Creates a new instance.
Interface for MapArchObjects.
boolean doCollectArches(final boolean performAction)
Executes the "collect arches" action.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
volatile Collector collector
The Collector if an archetype collection is running, or else.
Settings that apply to a project.
static final ActionBuilder ACTION_BUILDER
Action Builder to create Actions.
Implements a Progress that forwards to another.
File getCollectedDirectory()
Returns the directory where collected archetypes are stored.
Utility class for ActionBuilder related functions.
final JFrame parent
The parent component for dialog windows.
final AbstractResources< G, A, R > resources
The AbstractResources to collect.
Interface for listeners interested in Exiter related events.
Action action
The action associated with this editor action.