fi.hut.tml.xsmiles.gui.components.swing
Class SwingButton
java.lang.Object
fi.hut.tml.xsmiles.gui.components.general.ComponentBase
fi.hut.tml.xsmiles.gui.components.swing.SwingStylableComponent
fi.hut.tml.xsmiles.gui.components.swing.SwingButton
- All Implemented Interfaces:
- XButton, XComponent
- Direct Known Subclasses:
- SwingUpload
- public class SwingButton
- extends SwingStylableComponent
- implements XButton
Similar functionality as normal AWT button.
Features:
- lightweight
- three different states (focus, non-focus, pressed), each with graphical representations.
- not all button functionality is included.
- Author:
- Mikko Honkala, Juha Vierine
|
Field Summary |
protected javax.swing.JButton |
button
|
protected javax.swing.ImageIcon |
icon
|
protected java.lang.String |
name
|
|
Constructor Summary |
SwingButton(java.lang.String iconUrl)
A plain swing button |
SwingButton(java.lang.String a_name,
java.lang.String iconUrl)
A iconed swing button |
| Methods inherited from class fi.hut.tml.xsmiles.gui.components.general.ComponentBase |
addFocusListener, addMouseListener, getAddableComponent, getDefaultSize, getEnabled, getHeight, getMinimumSize, getPreferredSize, getSizableComponent, getSize, getStylableComponent, getStyle, getWidth, getX, getY, removeFocusListener, removeMouseListener, setBounds, setDefaultSize, setEnabled, setFocus, setFont, setForeground, setInputMode, setStyle, setVisible, setZoom, sizeComponent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface fi.hut.tml.xsmiles.gui.components.XComponent |
addFocusListener, addHelpListener, addMouseListener, getEnabled, getHeight, getSize, getStyle, getWidth, getX, getY, removeFocusListener, removeHelpListener, removeMouseListener, setBackground, setBounds, setEnabled, setFocus, setForeground, setHintText, setInputMode, setStyle, setVisible, setZoom |
button
protected javax.swing.JButton button
name
protected java.lang.String name
icon
protected javax.swing.ImageIcon icon
SwingButton
public SwingButton(java.lang.String iconUrl)
- A plain swing button
SwingButton
public SwingButton(java.lang.String a_name,
java.lang.String iconUrl)
- A iconed swing button
init
public void init()
- Overrides:
init in class SwingStylableComponent
createContent
public java.awt.Component createContent()
getComponent
public java.awt.Component getComponent()
- Description copied from interface:
XComponent
- Return the visual component for this extension element
- Specified by:
getComponent in interface XComponent- Overrides:
getComponent in class ComponentBase
getDefaultBackgroundColor
public java.awt.Color getDefaultBackgroundColor()
- the default background color for this component
null = default.
- Overrides:
getDefaultBackgroundColor in class ComponentBase
setCaptionText
public void setCaptionText(java.lang.String text)
setLabel
public void setLabel(java.lang.String t)
- Description copied from interface:
XButton
- ?@param t Set the label of this component
- Specified by:
setLabel in interface XButton
addActionListener
public void addActionListener(java.awt.event.ActionListener al)
- Description copied from interface:
XComponent
- At the moment ALL events are delegated through a simple actionListener
- Specified by:
addActionListener in interface XComponent- Overrides:
addActionListener in class ComponentBase
removeActionListener
public void removeActionListener(java.awt.event.ActionListener al)
- Specified by:
removeActionListener in interface XComponent- Overrides:
removeActionListener in class ComponentBase
setImage
public void setImage(java.lang.String fn)
- Specified by:
setImage in interface XButton
setImagePressed
public void setImagePressed(java.lang.String fn)
- Specified by:
setImagePressed in interface XButton
setImageRollOver
public void setImageRollOver(java.lang.String fn)
- Specified by:
setImageRollOver in interface XButton
setImageDisabled
public void setImageDisabled(java.lang.String fn)
- Specified by:
setImageDisabled in interface XButton
setActionCommand
public void setActionCommand(java.lang.String ac)
- Specified by:
setActionCommand in interface XButton
X-Smiles 1.2