fi.hut.tml.xsmiles.gui.components.swing
Class SwingButton

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.components.general.ComponentBase
      extended byfi.hut.tml.xsmiles.gui.components.swing.SwingStylableComponent
          extended byfi.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:

Author:
Mikko Honkala, Juha Vierine

Field Summary
protected  javax.swing.JButton button
           
protected  javax.swing.ImageIcon icon
           
protected  java.lang.String name
           
 
Fields inherited from class fi.hut.tml.xsmiles.gui.components.swing.SwingStylableComponent
HELPKEY
 
Fields inherited from class fi.hut.tml.xsmiles.gui.components.general.ComponentBase
content, currentFont, currentZoom, defaultBGColor, defaultFont, defaultSize, fInputMode, hintText, minSize, style
 
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
 
Method Summary
 void addActionListener(java.awt.event.ActionListener al)
          At the moment ALL events are delegated through a simple actionListener
 java.awt.Component createContent()
           
 java.awt.Component getComponent()
          Return the visual component for this extension element
 java.awt.Color getDefaultBackgroundColor()
          the default background color for this component null = default.
 void init()
           
 void removeActionListener(java.awt.event.ActionListener al)
           
 void setActionCommand(java.lang.String ac)
           
 void setCaptionText(java.lang.String text)
           
 void setImage(java.lang.String fn)
           
 void setImageDisabled(java.lang.String fn)
           
 void setImagePressed(java.lang.String fn)
           
 void setImageRollOver(java.lang.String fn)
           
 void setLabel(java.lang.String t)
          ?@param t Set the label of this component
 
Methods inherited from class fi.hut.tml.xsmiles.gui.components.swing.SwingStylableComponent
addHelpListener, createHint, getFormatter, isCaption, removeHelpListener, setBackground, setHintRecursively, setHintText, sizeComponent
 
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
 

Field Detail

button

protected javax.swing.JButton button

name

protected java.lang.String name

icon

protected javax.swing.ImageIcon icon
Constructor Detail

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

Method Detail

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