20 package net.sf.gridarta.action;
22 import java.awt.Component;
23 import javax.swing.Action;
24 import javax.swing.JFrame;
36 import net.
sf.japi.swing.action.ActionBuilder;
37 import net.
sf.japi.swing.action.ActionBuilderFactory;
38 import net.
sf.japi.swing.action.ActionMethod;
39 import net.
sf.japi.swing.misc.Progress;
40 import net.
sf.japi.swing.misc.ProgressDisplay;
41 import org.apache.log4j.Category;
42 import org.apache.log4j.Logger;
43 import org.jetbrains.annotations.NotNull;
44 import org.jetbrains.annotations.Nullable;
56 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
119 public void setAction(@NotNull
final Action action, @NotNull
final String name) {
129 synchronized (
this) {
139 public void finished() {
146 public Component getParentComponent() {
147 return progress.getParentComponent();
151 public void setLabel(
final String msg,
final int max) {
152 progress.setLabel(msg, max);
156 public void setValue(
final int value) {
157 progress.setValue(value);
163 assert collector != null;
176 if (action != null) {
192 public void preExitNotify() {
197 public void appExitNotify() {
202 public void waitExitNotify() {
207 }
catch (
final InterruptedException ignored) {
208 Thread.currentThread().interrupt();
209 LOG.warn(
"DelayedMapModelListenerManager was interrupted");
void updateAction()
Updates the action's enabled state.
A Collector is capable of iterating over a collection of Collectables and collecting them in a separa...
void waitUntilFinished()
Waits until collection has finished.
Graphical User Interface of Gridarta.
void collectArches()
Runs the archetype collection.
Action action
The action associated with this editor action.
Settings that apply to a project.
boolean canWriteCollected()
Whether the resources can be written in collected form.
final JFrame parent
The parent component for dialog windows.
void start()
Starts collecting.
static final ActionBuilder ACTION_BUILDER
Action Builder to create Actions.
static final Category LOG
The Logger for printing log messages.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
Base package of all Gridarta classes.
final AbstractResources< G, A, R > resources
The AbstractResources to collect.
Reflects a game object (object on a map).
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 listeners interested in Exiter related events.
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 setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
An EditorAction that runs the archetype collection.
boolean doCollectArches(final boolean performAction)
Executes the "collect arches" action.
Utility class for ActionBuilder related functions.
Implements a Progress that forwards to another.
File getCollectedDirectory()
Returns the directory where collected archetypes are stored.
volatile Collector collector
The Collector if an archetype collection is running, or else.
final ProjectSettings projectSettings
The project settings instance.
Interface for MapArchObjects.