fi.hut.tml.xsmiles.gui.components.havi
Class HaviButton

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.components.general.ComponentBase
      extended byfi.hut.tml.xsmiles.gui.components.havi.HaviStylableComponent
          extended byfi.hut.tml.xsmiles.gui.components.havi.HaviButton
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, org.ftv.ui.event.HActionListener, XButton, XComponent
Direct Known Subclasses:
HaviUpload

public class HaviButton
extends HaviStylableComponent
implements XButton, org.ftv.ui.event.HActionListener

Note: pcesar in Havi there are several kinds of buttons depending on the content they can be Text or Graphic Buttons For that reason a Graphic button is the first option in case there is no image, a text button is created


Nested Class Summary
 class HaviButton.HaviActionListenerWrapper
           
 
Field Summary
protected  java.util.Hashtable actionListenerList
           
protected  org.ftv.ui.HActionable button
           
protected  java.awt.Image icon
           
protected  boolean layoutDone
           
protected  java.lang.String name
           
 
Fields inherited from class fi.hut.tml.xsmiles.gui.components.general.ComponentBase
content, currentFont, currentZoom, defaultBGColor, defaultFont, defaultSize, fInputMode, hintText, minSize, style
 
Constructor Summary
HaviButton(java.lang.String iconUrl)
          A plain swing button
HaviButton(java.lang.String a_name, java.lang.String iconUrl)
          A iconed swing button
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addActionListener(java.awt.event.ActionListener al)
          At the moment ALL events are delegated through a simple actionListener
 void addKeyListener(java.awt.event.KeyListener kl)
           
 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 setEnabled(boolean value)
           
 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.havi.HaviStylableComponent
setBackground
 
Methods inherited from class fi.hut.tml.xsmiles.gui.components.general.ComponentBase
addFocusListener, addHelpListener, addMouseListener, getAddableComponent, getDefaultSize, getEnabled, getFormatter, getHeight, getMinimumSize, getPreferredSize, getSizableComponent, getSize, getStylableComponent, getStyle, getWidth, getX, getY, removeFocusListener, removeHelpListener, removeMouseListener, setBounds, setDefaultSize, setFocus, setFont, setForeground, setHintText, setInputMode, setStyle, setVisible, setZoom, sizeComponent, 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, setFocus, setForeground, setHintText, setInputMode, setStyle, setVisible, setZoom
 

Field Detail

button

protected org.ftv.ui.HActionable button

name

protected java.lang.String name

icon

protected java.awt.Image icon

layoutDone

protected boolean layoutDone

actionListenerList

protected java.util.Hashtable actionListenerList
Constructor Detail

HaviButton

public HaviButton(java.lang.String iconUrl)
A plain swing button


HaviButton

public HaviButton(java.lang.String a_name,
                  java.lang.String iconUrl)
A iconed swing button

Method Detail

init

public void init()

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

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

addKeyListener

public void addKeyListener(java.awt.event.KeyListener kl)

setEnabled

public void setEnabled(boolean value)
Specified by:
setEnabled in interface XComponent
Overrides:
setEnabled in class ComponentBase
Parameters:
value - Active or not active


X-Smiles 1.2