public class ButtonController
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, java.awt.event.FocusListener, java.io.Serializable
ButtonController class controlls the Button
component.AbstractButton,
Button,
ToggleButton,
Checkbox,
直列化された形式| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected AbstractButton |
button
The button component.
|
protected boolean |
focusEmphasizeEnabled
If true, emphasizes the button when the keyboard focus gained.
|
protected int |
mode
The controll mode.
|
protected boolean |
savedState
The saved button state.
|
static int |
TOGGLE_ON_DOWN
The item state is changed when the mouse button is pressed.
|
static int |
TOGGLE_ON_UP
The item state is changed when the mouse button is released.
|
static int |
TRIGGER_ON_DOWN
The action is performed when the mouse button is pressed.
|
static int |
TRIGGER_ON_UP
The action is performed when the mouse button is released.
|
| コンストラクタと説明 |
|---|
ButtonController(AbstractButton button)
Constructs a controller for the specified button component with the
TRIGGER_ON_UP mode. |
ButtonController(AbstractButton button,
int mode)
Constructs a controller for the specified button component with the
controll mode.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus.
|
void |
focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus.
|
int |
getMode()
Returns the control mode.
|
boolean |
isFocusEmphasizeEnabled()
Returns true, if the button is emphasized when the keyboard focus has
been gained; false otherwise.
|
void |
keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed.
|
void |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released.
|
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when the mouse button is pressed on a component and then dragged.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when the mouse has been pressed on a component.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when the mouse has been released on a component.
|
boolean |
needToRequestFocus()
Returns true if the controller needs to request the keyboard focus.
|
void |
setFocusEmphasizeEnabled(boolean b)
Enables the button to be emphasized when the keyboard focus has
been gained.
|
void |
setMode(int mode)
Sets the control mode.
|
protected AbstractButton button
protected int mode
protected boolean focusEmphasizeEnabled
protected boolean savedState
public static final int TRIGGER_ON_UP
public static final int TRIGGER_ON_DOWN
public static final int TOGGLE_ON_UP
public static final int TOGGLE_ON_DOWN
public ButtonController(AbstractButton button)
TRIGGER_ON_UP mode.button - the button component.public ButtonController(AbstractButton button, int mode)
button - the button component.mode - the controll mode.TRIGGER_ON_UP,
TRIGGER_ON_DOWN,
TOGGLE_ON_UP,
TOGGLE_ON_DOWNpublic boolean needToRequestFocus()
public int getMode()
public void setMode(int mode)
public boolean isFocusEmphasizeEnabled()
public void setFocusEmphasizeEnabled(boolean b)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited インタフェース内 java.awt.event.MouseListenerMouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged インタフェース内 java.awt.event.MouseMotionListenerMouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved インタフェース内 java.awt.event.MouseMotionListenerMouseMotionListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped インタフェース内 java.awt.event.KeyListenerKeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed インタフェース内 java.awt.event.KeyListenerKeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased インタフェース内 java.awt.event.KeyListenerKeyListenerpublic void focusGained(java.awt.event.FocusEvent e)
focusGained インタフェース内 java.awt.event.FocusListenerFocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost インタフェース内 java.awt.event.FocusListenerFocusListener