yu.ac.bg.etf.javaqx.qswing
Class JQAbstractButton

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.core.AbstractDisposable
      extended byyu.ac.bg.etf.javaqx.qswing.JQComponent
          extended byyu.ac.bg.etf.javaqx.qswing.JQAbstractButton
All Implemented Interfaces:
Disposable, JQAbstractButtonProperties, JQComponentProperties, JQTextProperty
Direct Known Subclasses:
JQButton, JQToggleButton, JQToolButton

public abstract class JQAbstractButton
extends JQComponent
implements JQAbstractButtonProperties

Abstract Button Component.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Nested Class Summary
protected static class JQAbstractButton.ActionPropertyChangeListener
          Action PropertyChangeListener.
 
Field Summary
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
listenerList
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQAbstractButtonProperties
PROPERTY_ACTION, PROPERTY_ACTION_COMMAND, PROPERTY_DISABLED_ICON, PROPERTY_ICON, PROPERTY_MODEL, PROPERTY_PRESSED_ICON, PROPERTY_ROLLOVER_ICON
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQTextProperty
PROPERTY_MNEMONIC, PROPERTY_TEXT
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQComponentProperties
PROPERTY_BACKGROUND, PROPERTY_COMPONENT_ORIENTATION, PROPERTY_CONTEXT_MENU, PROPERTY_ENABLED, PROPERTY_FIXED_SIZE, PROPERTY_FOCUSABLE, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_INSETS, PROPERTY_LOCALE, PROPERTY_MAXIMUM_SIZE, PROPERTY_MINIMUM_SIZE, PROPERTY_NAME, PROPERTY_OPAQUE, PROPERTY_PREFERRED_SIZE, PROPERTY_RESOURCE_BUNDLE_NAME, PROPERTY_STATUS_TIP_TEXT, PROPERTY_STYLE_SHEET, PROPERTY_TOOL_TIP_TEXT, PROPERTY_VISIBLE, PROPERTY_WHATS_THIS_TEXT
 
Constructor Summary
protected JQAbstractButton()
          Constructs new JQAbstractButton object.
protected JQAbstractButton(Action action)
          Constructs new JQAbstractButton object.
protected JQAbstractButton(Icon icon)
          Constructs new JQAbstractButton object.
protected JQAbstractButton(java.lang.String text)
          Constructs new JQAbstractButton object.
protected JQAbstractButton(java.lang.String text, Icon icon)
          Constructs new JQAbstractButton object.
 
Method Summary
 void addActionListener(ActionListener listener)
          Adds action listener.
protected  void configurePropertiesFromAction(Action action)
          Configures action properties from the specified action.
protected  java.beans.PropertyChangeListener createActionPropertyChangeListener()
          Creates and returns PropertyChangeListener for menu item action.
protected  void fireActionPerformed(ActionEvent e)
          Fires action event.
protected  void fireStateChanged()
          Fires state changed event.
 Action getAction()
          Returns action.
 java.lang.String getActionCommand()
          Returns action command.
 ActionListener[] getActionListeners()
          Returns all action listeners.
 Icon getDisabledIcon()
          Returns disabled icon.
 Icon getIcon()
          Returns icon.
 int getMnemonic()
          Returns the keyboard mnemonic.
 ButtonModel getModel()
          Returns button model.
 Icon getPressedIcon()
          Returns pressed icon.
 Icon getRolloverIcon()
          Returns rollover icon.
 java.lang.String getText()
          Returns button's text.
 boolean isPressed()
          Returns true if the button is pressed.
protected  java.lang.String paramString()
          Returns parameters string.
 void removeActionListener(ActionListener listener)
          Remove action listener.
 void setAction(Action action)
          Sets the action.
 void setActionCommand(java.lang.String actionCommand)
          Sets action command for this button.
 void setDisabledIcon(Icon icon)
          Sets disabled icon.
 void setEnabled(boolean enabled)
          Enables or disables the component.
 void setIcon(Icon icon)
          Sets icon.
 void setMnemonic(int mnemonic)
          Sets the keyboard mnemonic.
 void setModel(ButtonModel model)
          Sets button model.
 void setPressed(boolean pressed)
          Pressed/unpressed the button.
 void setPressedIcon(Icon icon)
          Sets pressed icon.
 void setRolloverIcon(Icon icon)
          Sets rollover icon.
 void setText(java.lang.String text)
          Sets button's text.
 void updateLocalization()
          Updates localization.
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, disableEvents, disposeComponent, disposeObject, enableEvents, eventEnabled, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getClientProperty, getComponentListeners, getComponentOrientation, getContextMenu, getCursor, getEventMask, getFocusListener, getFont, getFontMetrics, getForeground, getHeight, getInsets, getKeyListeners, getLocale, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getOwnedComponents, getOwner, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getResourceBundleName, getSize, getStatusTipText, getStyleSheet, getToolTipText, getToolTipText, getWhatsThisText, getWidth, getX, getY, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLeftToRight, isLocaleSet, isOpaque, isOwnerOf, isPainting, isResizable, isResourceBundleNameSet, isUpdatesEnabled, isValid, isVisible, localizeObject, localizeString, localizeString, localizeStrings, paintComponent, processComponentEvent, processContextMenuEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processStyleChange, putClientProperty, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, removeStyleSheet, repaint, repaint, repaint, requestFocus, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setContextMenu, setCursor, setDefaultResourceBundleName, setDisplayable, setFixedSize, setFixedSize, setFocusable, setFont, setForeground, setInsets, setInsets, setLeftToRightComponentOrientation, setLocale, setLocation, setLocation, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setOpaque, setPreferredSize, setPreferredSize, setResizable, setResourceBundleName, setRightToLeftComponentOrientation, setSize, setSize, setStatusTipText, setStyleSheet, setStyleSheet, setToolTipText, setUpdatesEnabled, setVisible, setWhatsThisText, toString, unsetComponentOrientation, update, update, update, updateComponentOrientation, validate
 
Methods inherited from class yu.ac.bg.etf.javaqx.core.AbstractDisposable
addDisposeListener, dispose, disposedCheck, disposedErrorString, finalize, isDisposed, removeDisposeListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JQAbstractButton

protected JQAbstractButton()
Constructs new JQAbstractButton object.


JQAbstractButton

protected JQAbstractButton(Action action)
Constructs new JQAbstractButton object.

Parameters:
action - the action

JQAbstractButton

protected JQAbstractButton(java.lang.String text)
Constructs new JQAbstractButton object.

Parameters:
text - the button's text

JQAbstractButton

protected JQAbstractButton(Icon icon)
Constructs new JQAbstractButton object.

Parameters:
icon - the icon

JQAbstractButton

protected JQAbstractButton(java.lang.String text,
                           Icon icon)
Constructs new JQAbstractButton object.

Parameters:
text - the button's text
icon - the icon
Method Detail

getModel

public ButtonModel getModel()
Returns button model.

Returns:
button model

setModel

public void setModel(ButtonModel model)
Sets button model.

Parameters:
model - the button model

isPressed

public boolean isPressed()
Returns true if the button is pressed.

Returns:
true if the button is pressed

setPressed

public void setPressed(boolean pressed)
Pressed/unpressed the button.

Parameters:
pressed - true if pressed

getText

public java.lang.String getText()
Returns button's text.

Returns:
button's text

setText

public void setText(java.lang.String text)
Sets button's text.

Parameters:
text - the button's text

getMnemonic

public int getMnemonic()
Returns the keyboard mnemonic.

Returns:
the keyboard mnemonic

setMnemonic

public void setMnemonic(int mnemonic)
Sets the keyboard mnemonic.

Parameters:
mnemonic - the keyboard mnemonic

getIcon

public Icon getIcon()
Returns icon.

Returns:
icon

setIcon

public void setIcon(Icon icon)
Sets icon.

Parameters:
icon - the icon

getDisabledIcon

public Icon getDisabledIcon()
Returns disabled icon.

Returns:
disabled icon

setDisabledIcon

public void setDisabledIcon(Icon icon)
Sets disabled icon.

Parameters:
icon - the disabled icon

getRolloverIcon

public Icon getRolloverIcon()
Returns rollover icon.

Returns:
rollover icon

setRolloverIcon

public void setRolloverIcon(Icon icon)
Sets rollover icon.

Parameters:
icon - the rollover icon

getPressedIcon

public Icon getPressedIcon()
Returns pressed icon.

Returns:
pressed icon

setPressedIcon

public void setPressedIcon(Icon icon)
Sets pressed icon.

Parameters:
icon - the pressed icon

getAction

public Action getAction()
Returns action.

Returns:
action

setAction

public void setAction(Action action)
Sets the action.

Parameters:
action - the action

getActionCommand

public java.lang.String getActionCommand()
Returns action command.

Returns:
action command

setActionCommand

public void setActionCommand(java.lang.String actionCommand)
Sets action command for this button.

Parameters:
actionCommand - the action command

addActionListener

public void addActionListener(ActionListener listener)
Adds action listener.

Parameters:
listener - the action listener

removeActionListener

public void removeActionListener(ActionListener listener)
Remove action listener.

Parameters:
listener - the action listener

getActionListeners

public ActionListener[] getActionListeners()
Returns all action listeners.

Returns:
the action listener array

configurePropertiesFromAction

protected void configurePropertiesFromAction(Action action)
Configures action properties from the specified action.

Parameters:
action - the action

createActionPropertyChangeListener

protected java.beans.PropertyChangeListener createActionPropertyChangeListener()
Creates and returns PropertyChangeListener for menu item action.

Returns:
PropertyChangeListener for menu item action

fireActionPerformed

protected void fireActionPerformed(ActionEvent e)
Fires action event.

Parameters:
e - the action event

fireStateChanged

protected void fireStateChanged()
Fires state changed event.


setEnabled

public void setEnabled(boolean enabled)
Enables or disables the component.

Overrides:
setEnabled in class JQComponent
Parameters:
enabled - if true the component is enabled; otherwise the component is disabled

updateLocalization

public void updateLocalization()
Updates localization.

Overrides:
updateLocalization in class JQComponent

paramString

protected java.lang.String paramString()
Returns parameters string.

Overrides:
paramString in class JQComponent
Returns:
parameters string


Copyright © 2007 ETF and contributors. All Rights Reserved.