Package org.jfree.ui

Class FloatingButtonEnabler

java.lang.Object
java.awt.event.MouseAdapter
org.jfree.ui.FloatingButtonEnabler
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener

public final class FloatingButtonEnabler extends MouseAdapter
Enables a button to have a simple floating effect. The border of the button is only visible, when the mouse pointer is floating over the button.
  • Field Details

  • Constructor Details

    • FloatingButtonEnabler

      private FloatingButtonEnabler()
      Default constructor.
  • Method Details

    • getInstance

      public static FloatingButtonEnabler getInstance()
      Returns a default instance of this enabler.
      Returns:
      a shared instance of this class.
    • addButton

      public void addButton(AbstractButton button)
      Adds a button to this enabler.
      Parameters:
      button - the button.
    • removeButton

      public void removeButton(AbstractButton button)
      Removes a button from the enabler.
      Parameters:
      button - the button.
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Triggers the drawing of the border when the mouse entered the button area.
      Specified by:
      mouseEntered in interface MouseListener
      Overrides:
      mouseEntered in class MouseAdapter
      Parameters:
      e - the mouse event.
    • mouseExited

      public void mouseExited(MouseEvent e)
      Disables the drawing of the border when the mouse leaves the button area.
      Specified by:
      mouseExited in interface MouseListener
      Overrides:
      mouseExited in class MouseAdapter
      Parameters:
      e - the mouse event.