public class ButtonBehavior<C extends ButtonBase> extends BehaviorBase<C>
Modifier and Type | Field and Description |
---|---|
protected static List<KeyBinding> |
BUTTON_BINDINGS |
IS_TOUCH_SUPPORTED, TRAVERSAL_BINDINGS
Constructor and Description |
---|
ButtonBehavior(C button)
*
Constructors *
*
|
ButtonBehavior(C button,
List<KeyBinding> bindings) |
Modifier and Type | Method and Description |
---|---|
protected void |
callAction(String name)
Called to invoke the action associated with the given name.
|
protected void |
focusChanged()
*
Focus change handling *
*
|
void |
mouseEntered(MouseEvent e)
Invoked when the mouse enters the Button.
|
void |
mouseExited(MouseEvent e)
Invoked when the mouse exits the Button.
|
void |
mousePressed(MouseEvent e)
Invoked when a mouse press has occurred over the button.
|
void |
mouseReleased(MouseEvent e)
Invoked when a mouse release has occurred.
|
callActionForEvent, contextMenuRequested, dispose, getControl, matchActionForEvent, mouseDragged, traverse, traverseDown, traverseLeft, traverseNext, traversePrevious, traverseRight, traverseUp
protected static final List<KeyBinding> BUTTON_BINDINGS
public ButtonBehavior(C button)
public ButtonBehavior(C button, List<KeyBinding> bindings)
protected void focusChanged()
focusChanged
in class BehaviorBase<C extends ButtonBase>
protected void callAction(String name)
BehaviorBase
When a KeyEvent is handled, it is first passed through callActionForEvent which resolves which "action" should be executed based on the key event. This action is indicated by name. This name is then passed to this function which is responsible for invoking the right function based on the name.
callAction
in class BehaviorBase<C extends ButtonBase>
public void mousePressed(MouseEvent e)
mousePressed
in class BehaviorBase<C extends ButtonBase>
e
- the mouse eventpublic void mouseReleased(MouseEvent e)
mouseReleased
in class BehaviorBase<C extends ButtonBase>
e
- the mouse eventpublic void mouseEntered(MouseEvent e)
mouseEntered
in class BehaviorBase<C extends ButtonBase>
e
- the mouse eventpublic void mouseExited(MouseEvent e)
mouseExited
in class BehaviorBase<C extends ButtonBase>
e
- the mouse eventCopyright © 2020. All rights reserved.