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.
- Author:
- Thomas Morgner
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddButton(AbstractButton button) Adds a button to this enabler.static FloatingButtonEnablerReturns a default instance of this enabler.voidTriggers the drawing of the border when the mouse entered the button area.voidDisables the drawing of the border when the mouse leaves the button area.voidremoveButton(AbstractButton button) Removes a button from the enabler.Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
-
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:
mouseEnteredin interfaceMouseListener- Overrides:
mouseEnteredin classMouseAdapter- Parameters:
e- the mouse event.
-
mouseExited
Disables the drawing of the border when the mouse leaves the button area.- Specified by:
mouseExitedin interfaceMouseListener- Overrides:
mouseExitedin classMouseAdapter- Parameters:
e- the mouse event.
-