Class AbstractScriptArchUtils

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractScriptArchUtils​(@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
      void addEventsToJList​(@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.String getEventType​(int eventType)
      Returns the type name for an event type.
      int indexToEventType​(int index)
      Converts a combo box index to an event type.
      @NotNull java.lang.String typeName​(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
    • 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 types
        subtypeAttribute - the attribute name for the subtype field
        eventTypeNo - the object type for event objects
    • Method Detail

      • typeName

        @NotNull
        public @NotNull java.lang.String typeName​(int eventType)
        Description copied from interface: ScriptArchUtils
        Returns a human readable name for an event type.
        Specified by:
        typeName in interface ScriptArchUtils
        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 null for invalid event types
      • indexToEventType

        public int indexToEventType​(int index)
        Description copied from interface: ScriptArchUtils
        Converts a combo box index to an event type.
        Specified by:
        indexToEventType in interface ScriptArchUtils
        Parameters:
        index - the combo box index
        Returns:
        the event type
      • getEventNames

        @NotNull
        public @NotNull java.lang.String @NotNull [] getEventNames()
        Description copied from interface: ScriptArchUtils
        Returns all event names.
        Specified by:
        getEventNames in interface ScriptArchUtils
        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: ScriptArchUtils
        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.
        Specified by:
        addEventsToJList in interface ScriptArchUtils
        Parameters:
        list - the JList
        gameObject - the game object to operate on