Package org.jfree.ui
Class FloatingButtonEnabler
java.lang.Object
java.awt.event.MouseAdapter
org.jfree.ui.FloatingButtonEnabler
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addButton
(AbstractButton button) Adds a button to this enabler.static FloatingButtonEnabler
Returns a default instance of this enabler.void
Triggers the drawing of the border when the mouse entered the button area.void
Disables the drawing of the border when the mouse leaves the button area.void
removeButton
(AbstractButton button) Removes a button from the enabler.Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
-
Field Details
-
singleton
A single instance.
-
-
Constructor Details
-
FloatingButtonEnabler
private FloatingButtonEnabler()Default constructor.
-
-
Method Details
-
getInstance
Returns a default instance of this enabler.- Returns:
- a shared instance of this class.
-
addButton
Adds a button to this enabler.- Parameters:
button
- the button.
-
removeButton
Removes a button from the enabler.- Parameters:
button
- the button.
-
mouseEntered
Triggers the drawing of the border when the mouse entered the button area.- Specified by:
mouseEntered
in interfaceMouseListener
- Overrides:
mouseEntered
in classMouseAdapter
- Parameters:
e
- the mouse event.
-
mouseExited
Disables the drawing of the border when the mouse leaves the button area.- Specified by:
mouseExited
in interfaceMouseListener
- Overrides:
mouseExited
in classMouseAdapter
- Parameters:
e
- the mouse event.
-