Package net.sf.gridarta.gui.scripts
Class AbstractScriptArchUtils
- java.lang.Object
-
- net.sf.gridarta.gui.scripts.AbstractScriptArchUtils
-
- All Implemented Interfaces:
ScriptArchUtils
- Direct Known Subclasses:
DefaultScriptArchUtils,DefaultScriptArchUtils,DefaultScriptArchUtils
public abstract class AbstractScriptArchUtils extends java.lang.Object implements ScriptArchUtils
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractScriptArchUtils(@NotNull java.lang.Iterable<Pair<java.lang.Integer,java.lang.String>> eventTypes, @NotNull java.lang.String subtypeAttribute, int eventTypeNo)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventsToJList(@NotNull javax.swing.JList<java.lang.String> list, @NotNull java.lang.Iterable<? extends GameObject<?,?,?>> gameObject)Set all ScriptedEvents to appear in the given JList This method should be fast because it may be executed when user clicks on map objects.@NotNull java.lang.String @NotNull []getEventNames()Returns all event names.protected @Nullable java.lang.StringgetEventType(int eventType)Returns the type name for an event type.intindexToEventType(int index)Converts a combo box index to an event type.@NotNull java.lang.StringtypeName(int eventType)Returns a human readable name for an event type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.gridarta.model.scripts.ScriptArchUtils
getArchetypeNameForEventType
-
-
-
-
Constructor Detail
-
AbstractScriptArchUtils
protected AbstractScriptArchUtils(@NotNull @NotNull java.lang.Iterable<Pair<java.lang.Integer,java.lang.String>> eventTypes, @NotNull @NotNull java.lang.String subtypeAttribute, int eventTypeNo)Creates a new instance.- Parameters:
eventTypes- the event typessubtypeAttribute- the attribute name for the subtype fieldeventTypeNo- the object type for event objects
-
-
Method Detail
-
typeName
@NotNull public @NotNull java.lang.String typeName(int eventType)
Description copied from interface:ScriptArchUtilsReturns a human readable name for an event type.- Specified by:
typeNamein interfaceScriptArchUtils- Parameters:
eventType- the event type- Returns:
- the event type name
-
getEventType
@Nullable protected @Nullable java.lang.String getEventType(int eventType)
Returns the type name for an event type.- Parameters:
eventType- the event type- Returns:
- the type name or
nullfor invalid event types
-
indexToEventType
public int indexToEventType(int index)
Description copied from interface:ScriptArchUtilsConverts a combo box index to an event type.- Specified by:
indexToEventTypein interfaceScriptArchUtils- Parameters:
index- the combo box index- Returns:
- the event type
-
getEventNames
@NotNull public @NotNull java.lang.String @NotNull [] getEventNames()
Description copied from interface:ScriptArchUtilsReturns all event names.- Specified by:
getEventNamesin interfaceScriptArchUtils- Returns:
- all event names; the array may be modified
-
addEventsToJList
public void addEventsToJList(@NotNull @NotNull javax.swing.JList<java.lang.String> list, @NotNull @NotNull java.lang.Iterable<? extends GameObject<?,?,?>> gameObject)Description copied from interface:ScriptArchUtilsSet all ScriptedEvents to appear in the given JList This method should be fast because it may be executed when user clicks on map objects.- Specified by:
addEventsToJListin interfaceScriptArchUtils- Parameters:
list- theJListgameObject- the game object to operate on
-
-