20 package net.sf.gridarta.gui.scripts;
22 import java.awt.Frame;
23 import javax.swing.JList;
24 import javax.swing.JOptionPane;
32 import org.apache.log4j.Category;
33 import org.apache.log4j.Logger;
34 import org.jetbrains.annotations.NotNull;
103 for (
final G tmp : gameObject) {
105 if (eventCount == eventIndex) {
113 if (oldEvent != null) {
117 scriptedEventEditor.
openScript(mapManager, event.getScriptPath(), parent);
120 case EVENT_EDIT_PATH:
125 if (JOptionPane.showConfirmDialog(panelList,
"Are you sure you want to remove this \"" + scriptArchUtils.
typeName(event.getEventType()) +
"\" event which is\n" +
"linked to the script: '" + event.getScriptPath() +
"'?\n" +
"(The script file itself is not going to be deleted)",
"Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
132 LOG.error(
"Error in modifyEventScript(): No event selected?");
ScriptArchDataUtils(final int eventTypeNo, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final ScriptedEventFactory< G, A, R > scriptedEventFactory, @NotNull final ScriptedEventEditor< G, A, R > scriptedEventEditor)
Creates a new instance.
void modifyEventScript(final int eventIndex, final ScriptTask task, @NotNull final JList< String > panelList, @NotNull final MapManager<?, ?, ?> mapManager, @NotNull final Frame parent, @NotNull final Iterable< G > gameObject)
If there is a scripted event of the specified type, the script pad is opened and the appropriate scri...
Package with common types for event archetypes.
A MapManager manages all opened maps.
void addEventsToJList(@NotNull JList< String > list, @NotNull Iterable<? extends GameObject<?, ?, ?>> gameObject)
Set all ScriptedEvents to appear in the given JList This method should be fast because it may be exec...
final ScriptedEventEditor< G, A, R > scriptedEventEditor
The ScriptedEventEditor to use.
Parameter for operation to perform in ScriptTask, javax.swing.JList, net.sf.gridarta.model.mapmanager.MapManager, java.awt.Frame, Iterable).
final ScriptedEventFactory< G, A, R > scriptedEventFactory
The ScriptedEventFactory instance to use.
Factory for creating ScriptedEvent instances.
final ScriptArchUtils scriptArchUtils
The ScriptArchUtils instance to use.
final int eventTypeNo
The object type for event objects.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
void openScript(@NotNull final MapManager<?, ?, ?> mapManager, @NotNull final String scriptPath, @NotNull final Component parent)
Opens the script pad to display a script.
GameObjects are the objects based on Archetypes found on maps.
ScriptedEvent< G, A, R > newScriptedEvent(int eventType, @NotNull String pluginName, @NotNull String scriptPath, @NotNull String options)
Creates a new ScriptedEvent instance.
net.sf.gridarta.model.scripts.ScriptArchData related functions.
void editParameters(@NotNull final ScriptedEvent< G, A, R > scriptedEvent, @NotNull final Frame parent)
Edit path and plugin name for an event.
static final Category LOG
The Logger for printing log messages.
String typeName(int eventType)
Returns a human readable name for an event type.
Interface for MapArchObjects.
Class which stores information about one scripted event.