Gridarta Editor
net.sf.gridarta.gui.scripts.AbstractScriptArchUtils Class Referenceabstract
+ Inheritance diagram for net.sf.gridarta.gui.scripts.AbstractScriptArchUtils:
+ Collaboration diagram for net.sf.gridarta.gui.scripts.AbstractScriptArchUtils:

Public Member Functions

void addEventsToJList (@NotNull final JList< String > list, @NotNull final 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. More...
 
String [] getEventNames ()
 Returns all event names. More...
 
int indexToEventType (final int index)
 Converts a combo box index to an event type. More...
 
String typeName (final int eventType)
 Returns a human readable name for an event type. More...
 
- Public Member Functions inherited from net.sf.gridarta.model.scripts.ScriptArchUtils
String getArchetypeNameForEventType (int eventType) throws UndefinedEventArchetypeTypeException
 Returns the archetype for an event type. More...
 

Protected Member Functions

 AbstractScriptArchUtils (@NotNull final Iterable< Pair< Integer, String >> eventTypes, @NotNull final String subtypeAttribute, final int eventTypeNo)
 Creates a new instance. More...
 
String getEventType (final int eventType)
 Returns the type name for an event type. More...
 

Private Member Functions

void add (final int eventType, @NotNull final String eventName)
 Adds on event description. More...
 

Private Attributes

final Map< Integer, String > allEventTypes = new HashMap<>()
 Maps event type to event name. More...
 
final List< String > eventNames = new ArrayList<>()
 All event names. More...
 
final int eventTypeNo
 The object type for event objects. More...
 
final Map< Integer, Integer > indexToEventType = new HashMap<>()
 Maps index into eventNames to event type. More...
 
final String subtypeAttribute
 The attribute name for the subtype field. More...
 

Detailed Description

Definition at line 35 of file AbstractScriptArchUtils.java.

Constructor & Destructor Documentation

◆ AbstractScriptArchUtils()

net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.AbstractScriptArchUtils ( @NotNull final Iterable< Pair< Integer, String >>  eventTypes,
@NotNull final String  subtypeAttribute,
final int  eventTypeNo 
)
protected

Creates a new instance.

Parameters
eventTypesthe event types
subtypeAttributethe attribute name for the subtype field
eventTypeNothe object type for event objects

Definition at line 74 of file AbstractScriptArchUtils.java.

References net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.add(), net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.eventTypeNo, and net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.subtypeAttribute.

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

void net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.add ( final int  eventType,
@NotNull final String  eventName 
)
private

Adds on event description.

Parameters
eventTypethe event type
eventNamethe event name

Definition at line 89 of file AbstractScriptArchUtils.java.

Referenced by net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.AbstractScriptArchUtils().

+ Here is the caller graph for this function:

◆ addEventsToJList()

void net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.addEventsToJList ( @NotNull final JList< String >  list,
@NotNull final 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.

Parameters
listthe
JList
gameObjectthe game object to operate on

Implements net.sf.gridarta.model.scripts.ScriptArchUtils.

Definition at line 130 of file AbstractScriptArchUtils.java.

References net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.eventTypeNo, and net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.typeName().

+ Here is the call graph for this function:

◆ getEventNames()

String [] net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.getEventNames ( )

Returns all event names.

Returns
all event names; the array may be modified

Implements net.sf.gridarta.model.scripts.ScriptArchUtils.

Definition at line 125 of file AbstractScriptArchUtils.java.

◆ getEventType()

String net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.getEventType ( final int  eventType)
protected

Returns the type name for an event type.

Parameters
eventTypethe event type
Returns
the type name or
null
for invalid event types

Definition at line 109 of file AbstractScriptArchUtils.java.

Referenced by net.sf.gridarta.var.crossfire.gui.scripts.DefaultScriptArchUtils.getArchetypeNameForEventType().

+ Here is the caller graph for this function:

◆ indexToEventType()

int net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.indexToEventType ( final int  index)

Converts a combo box index to an event type.

Parameters
indexthe combo box index
Returns
the event type

Implements net.sf.gridarta.model.scripts.ScriptArchUtils.

Definition at line 114 of file AbstractScriptArchUtils.java.

◆ typeName()

String net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.typeName ( final int  eventType)

Returns a human readable name for an event type.

Parameters
eventTypethe event type
Returns
the event type name

Implements net.sf.gridarta.model.scripts.ScriptArchUtils.

Definition at line 98 of file AbstractScriptArchUtils.java.

Referenced by net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.addEventsToJList(), and net.sf.gridarta.var.crossfire.gui.scripts.DefaultScriptArchUtils.getArchetypeNameForEventType().

+ Here is the caller graph for this function:

Member Data Documentation

◆ allEventTypes

final Map<Integer, String> net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.allEventTypes = new HashMap<>()
private

Maps event type to event name.

Definition at line 54 of file AbstractScriptArchUtils.java.

◆ eventNames

final List<String> net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.eventNames = new ArrayList<>()
private

All event names.

Definition at line 66 of file AbstractScriptArchUtils.java.

◆ eventTypeNo

final int net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.eventTypeNo
private

◆ indexToEventType

final Map<Integer, Integer> net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.indexToEventType = new HashMap<>()
private

Maps index into eventNames to event type.

Definition at line 60 of file AbstractScriptArchUtils.java.

◆ subtypeAttribute

final String net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.subtypeAttribute
private

The attribute name for the subtype field.

Definition at line 42 of file AbstractScriptArchUtils.java.

Referenced by net.sf.gridarta.gui.scripts.AbstractScriptArchUtils.AbstractScriptArchUtils().


The documentation for this class was generated from the following file: