Class MaterialUITimer

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, MaterialMouseHover

    public class MaterialUITimer
    extends java.lang.Object
    implements java.awt.event.ActionListener, MaterialMouseHover
    This class implement a complex mouse hover event with a timer

    This event call component.setBackground() inside the timer it should be managed the live cycle more complex

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MaterialUITimer​(javax.swing.JComponent component, java.awt.Color to, int steps, int interval)
      Dont use the !component.isEnabled() how check in the builder if the component born disabled the mouse hover will never install
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent ae)  
      boolean isRunning()  
      void mouseClicked​(java.awt.event.MouseEvent me)  
      void mouseDragged​(java.awt.event.MouseEvent e)  
      void mouseEntered​(java.awt.event.MouseEvent me)  
      void mouseExited​(java.awt.event.MouseEvent me)  
      void mouseMoved​(java.awt.event.MouseEvent e)  
      void mousePressed​(java.awt.event.MouseEvent me)  
      void mouseReleased​(java.awt.event.MouseEvent me)  
      protected void stopTimer()
      Include inside the function the logic to disable the timer with all control on null object.
      • Methods inherited from class java.lang.Object

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

      • MaterialUITimer

        protected MaterialUITimer​(javax.swing.JComponent component,
                                  java.awt.Color to,
                                  int steps,
                                  int interval)
        Dont use the !component.isEnabled() how check in the builder if the component born disabled the mouse hover will never install
    • Method Detail

      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent me)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent me)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent me)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent ae)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent e)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent me)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent me)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • stopTimer

        protected void stopTimer()
        Include inside the function the logic to disable the timer with all control on null object.

        !! DONT USE THIS METHOD IN OTHER PLACE WHEN IS CHECKED THE COMPONENT IS DISABLED !! THIS METHOD IS ONLY TO CHECK IF THE TIMER IS A VALID INSTANCE. !! Fro example: if you insert this method inside the actionPerformed, you will introduce the bug inside button when the button have been disabled after click.