Class InteractionImpl<D extends InteractionData,​E,​F extends FSM<E>>

    • Field Detail

      • fsm

        protected final F extends FSM<E> fsm
      • activated

        protected boolean activated
        Defines whether the interaction is activated. If not, the interaction will not change on events.
      • logger

        protected Logger logger
      • throttleTimeout

        protected long throttleTimeout
      • throttleCounter

        protected final AtomicLong throttleCounter
      • currentThrottledEvent

        protected E currentThrottledEvent
    • Constructor Detail

      • InteractionImpl

        protected InteractionImpl​(F fsm)
    • Method Detail

      • setLogger

        public static void setLogger​(Logger logger)
        Sets the logger to use. Cannot be null. Does not change the loggers of existing user interactions.
        Parameters:
        logger - The new logger to use.
      • getData

        public abstract D getData()
      • setThrottleTimeout

        public void setThrottleTimeout​(long timeout)
      • updateEventsRegistered

        protected abstract void updateEventsRegistered​(OutputState<E> newState,
                                                       OutputState<E> oldState)
      • isRunning

        public boolean isRunning()
      • fullReinit

        public void fullReinit()
      • isEventsOfSameType

        protected abstract boolean isEventsOfSameType​(E evt1,
                                                      E evt2)
        Defines whether the two given events are of the same type. For example, whether they are both mouse move events. This check is platform specific.
        Parameters:
        evt1 - The first event to check.
        evt2 - The second event to check.
        Returns:
        True: the two events are of the same type.
      • runInUIThread

        protected abstract void runInUIThread​(Runnable cmd)
        Runs the given command in the UI thread. This is necessary since some created threads (e.g. throttling, timeout transition) exit the UI thread but may require some job to be executed in the UI thread.
        Parameters:
        cmd - The job to execute in the UI thread.
      • processEvent

        public void processEvent​(E event)
      • log

        public void log​(boolean log)
      • isActivated

        public boolean isActivated()
      • setActivated

        public void setActivated​(boolean activated)
      • getFsm

        public F getFsm()
      • reinit

        protected void reinit()
      • reinitData

        protected abstract void reinitData()
      • uninstall

        public void uninstall()