Class EventQueue

  • All Implemented Interfaces:
    AnnotationListener

    public class EventQueue
    extends Object
    implements AnnotationListener
    A queue that ensures that events are added to the trail one at a time. This is to prevent race conditions
    Version:
    $Revision$
    Author:
    sjb90
    • Field Detail

      • SLEEP_TIME

        public static final long SLEEP_TIME
        a constant defining the amount of time to sleep for
        See Also:
        Constant Field Values
      • m_Trail

        protected Trail m_Trail
        the trail we add the steps to
      • m_Runnable

        protected adams.flow.core.RunnableWithLogging m_Runnable
        the runable we use for the internal thread
      • m_Playing

        protected boolean m_Playing
        a flag that says if we're paused or not
    • Constructor Detail

      • EventQueue

        public EventQueue()
        Constructs a queue that adds steps to a trail.
    • Method Detail

      • resetTrail

        public void resetTrail()
        Resets the trail to an empty one. Clears the queue so any left over steps are not added mistakenly to the new trail.
      • getTrail

        public Trail getTrail()
        A getter for the trail EventQueue adds steps to
        Returns:
        The trail we've been adding steps to
      • loadTrail

        public void loadTrail​(Trail trail)
        Loads a saved trail EventQueue adds steps to. Clears the steps queue so any remaining steps are not mistakenly added to the newly loaded queue.
        Parameters:
        trail - The trail we're loading in
      • clearQueue

        protected void clearQueue()
      • start

        protected void start()
      • toSpreadSheet

        public adams.data.spreadsheet.SpreadSheet toSpreadSheet()
        Turns the inner trail into a spreadsheet.
        Returns:
        the spread sheet object
      • cleanUp

        public void cleanUp()
        Cleans up any loose ends
      • setBackgroundImage

        public void setBackgroundImage​(BufferedImage backgroundImage)
        sets the background image to be stored with the trail.
        Parameters:
        backgroundImage -
      • getBackgroundImage

        public BufferedImage getBackgroundImage()
        a getter for the background image stored with the trail
        Returns:
        the image