|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object charva.awt.Component charvax.swing.JComponent charvax.swing.AbstractButton
This forms the base class for components that exhibit button-like behavior.
Field Summary | |
protected java.util.Vector |
_actionListeners
A list of ActionListeners registered for this component. |
protected java.util.Vector |
_itemListeners
A list of ItemListeners registered for this component. |
Fields inherited from class charvax.swing.JComponent |
_border |
Fields inherited from class charva.awt.Component |
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
AbstractButton()
|
Method Summary | |
void |
addActionListener(ActionListener al_)
Register an ActionListener object for this button. |
void |
addItemListener(ItemListener il_)
Register an ItemListener object for this component. |
void |
doClick()
Programmatically performs a "click" of this button. |
protected void |
fireActionPerformed(ActionEvent ae_)
Invoke all the ActionListener callbacks that may have been registered for this button. |
protected void |
fireItemStateChanged(ItemEvent ie_)
Invoke all the ItemListener callbacks that may have been registered for this component. |
java.lang.String |
getActionCommand()
Returns the action command for this button. |
java.lang.String |
getLabel()
Deprecated. Replaced by getText(). |
protected java.lang.String |
getLabelString()
Returns the complete label string, including the mnemonic key surrounded by parentheses (if there is a mnemonic key and the mnemonic key does not appear within the label). |
int |
getMnemonic()
Returns the button's mnemonic character. |
java.lang.String |
getText()
Returns the button's label text. |
boolean |
isSelected()
Returns the state of the button. |
void |
keyPressed(KeyEvent ke_)
Implements the KeyListener interface; this is called if a control character or a function key or cursor key was typed. |
void |
keyReleased(KeyEvent ke_)
Implements the KeyListener interface but is never invoked. |
void |
keyTyped(KeyEvent ke_)
Implements the KeyListener interface; this is called if a printable (ASCII or ISO8859-1) character was typed. |
protected void |
processEvent(AWTEvent evt_)
Process events. |
void |
processMouseEvent(MouseEvent e)
Process a MouseEvent that was generated by clicking the mouse somewhere inside this component. |
void |
removeItemListener(ItemListener listener_)
|
void |
setActionCommand(java.lang.String text_)
Sets the action command for this button. |
void |
setLabel(java.lang.String label_)
Deprecated. Replaced by setText(). |
void |
setMnemonic(int mnemonic_)
Set the button's mnemonic character. |
void |
setSelected(boolean state_)
Sets the state of the button. |
void |
setText(java.lang.String label_)
Sets the button's label text. |
Methods inherited from class charvax.swing.JComponent |
draw, getBorder, getInsets, setBorder |
Methods inherited from class charva.awt.Component |
addFocusListener, addKeyListener, contains, contains, debug, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getHeight, getLocation, getLocationOnScreen, getName, getParent, getSize, getWidth, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, minimumSize, processFocusEvent, processKeyEvent, repaint, requestFocus, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector _actionListeners
protected java.util.Vector _itemListeners
Constructor Detail |
public AbstractButton()
Method Detail |
public void setLabel(java.lang.String label_)
public void setText(java.lang.String label_)
public void setMnemonic(int mnemonic_)
A mnemonic must correspond to a single key on the keyboard and should be specified using one of the VK_XXX keycodes defined in java.awt.event.KeyEvent. Mnemonics are case-insensitive, therefore a key event with the corresponding keycode would cause the button to be activated whether or not the Shift modifier was pressed.
If the character defined by the mnemonic is found within the button's label string, the first occurrence of it will be underlined to indicate the mnemonic to the user. If the corresponding character is not contained within the button's label, then it will be displayed to the right, surrounded by parentheses.
In the case of a JButton, JCheckBox or JRadioButton, this method should only be called after the button has been added to a Window, otherwise pressing the corresponding key will have no effect.
mnemonic_
- the keycode of the mnemonic key.public java.lang.String getLabel()
public java.lang.String getText()
public int getMnemonic()
public void setActionCommand(java.lang.String text_)
public java.lang.String getActionCommand()
public void processMouseEvent(MouseEvent e)
processMouseEvent
in class Component
public void doClick()
public void setSelected(boolean state_)
public boolean isSelected()
protected void processEvent(AWTEvent evt_)
processEvent
in class Component
public void addActionListener(ActionListener al_)
protected void fireActionPerformed(ActionEvent ae_)
public void addItemListener(ItemListener il_)
addItemListener
in interface ItemSelectable
public void removeItemListener(ItemListener listener_)
removeItemListener
in interface ItemSelectable
public void keyPressed(KeyEvent ke_)
keyPressed
in interface KeyListener
public void keyTyped(KeyEvent ke_)
keyTyped
in interface KeyListener
public void keyReleased(KeyEvent ke_)
keyReleased
in interface KeyListener
protected void fireItemStateChanged(ItemEvent ie_)
protected java.lang.String getLabelString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |