Class SwingTimer


  • public class SwingTimer
    extends java.lang.Object
    A UITimer for Swing and SwingOwner.
    • Constructor Summary

      Constructors 
      Constructor Description
      SwingTimer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCount()
      Returns the number of times the timer has fired.
      java.lang.String getName()
      Returns the name.
      SwingOwner getOwner()
      Returns the owner.
      int getPeriod()
      Returns the time in milliseconds between firings.
      long getTime()
      Returns the number of milliseconds timer has been active since start.
      protected void incrementSendCount()
      Increments the send count.
      SwingTimer init​(SwingOwner anOwner, java.lang.String aName, int aPeriod)
      Creates a new timer for name and period.
      boolean isRunning()
      Returns whether timer is running.
      protected void sendEvent()
      Sends the event.
      protected void sendEventInUIThread()
      Sends the event in UI Thread.
      void setPeriod​(int aPeriod)
      Sets the time in milliseconds between firings.
      void start()
      Start timer.
      void start​(long aDelay)
      Start timer.
      void stop()
      Stop timer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SwingTimer

        public SwingTimer()
    • Method Detail

      • init

        public SwingTimer init​(SwingOwner anOwner,
                               java.lang.String aName,
                               int aPeriod)
        Creates a new timer for name and period.
      • getOwner

        public SwingOwner getOwner()
        Returns the owner.
      • getName

        public java.lang.String getName()
        Returns the name.
      • getPeriod

        public int getPeriod()
        Returns the time in milliseconds between firings.
      • setPeriod

        public void setPeriod​(int aPeriod)
        Sets the time in milliseconds between firings.
      • isRunning

        public boolean isRunning()
        Returns whether timer is running.
      • getTime

        public long getTime()
        Returns the number of milliseconds timer has been active since start.
      • getCount

        public int getCount()
        Returns the number of times the timer has fired.
      • start

        public void start()
        Start timer.
      • start

        public void start​(long aDelay)
        Start timer.
      • stop

        public void stop()
        Stop timer.
      • sendEventInUIThread

        protected void sendEventInUIThread()
        Sends the event in UI Thread.
      • sendEvent

        protected void sendEvent()
        Sends the event.
      • incrementSendCount

        protected void incrementSendCount()
        Increments the send count.