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

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.SwingTextComponent
All Implemented Interfaces:
javax.swing.event.DocumentListener, java.util.EventListener, java.awt.event.FocusListener, XComponent, XText
Direct Known Subclasses:
SwingInput, SwingTextArea

public abstract class SwingTextComponent
extends SwingStylableComponent
implements XText, javax.swing.event.DocumentListener, java.awt.event.FocusListener

Common base class for text components

Author:
Mikko Honkala

Field Summary
protected  GUI fGUI
           
protected  boolean insideChangeEvent
           
protected  javax.swing.text.JTextComponent textcomponent
           
 
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
SwingTextComponent(GUI gui)
           
 
Method Summary
 void addFocusListener(java.awt.event.FocusListener fl)
           
 void addTextListener(java.awt.event.TextListener tl)
          Adds the specified text event listener to receive text events from this text component.
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
 void focusGained(java.awt.event.FocusEvent ae)
           
 void focusLost(java.awt.event.FocusEvent ae)
           
 java.awt.Color getDefaultBackgroundColor()
          the default background color for this type of component null = transparent.
 boolean getEditable()
           
 java.lang.String getText()
           
 void init()
           
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 void notifyIncrementalChange(javax.swing.event.DocumentEvent e)
           
 void removeFocusListener(java.awt.event.FocusListener fl)
           
 void removeTextListener(java.awt.event.TextListener tl)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
 void setEditable(boolean editable)
           
 void setEnabled(boolean b)
           
 void setText(java.lang.String text)
           @param s The text is set to s
 
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
addActionListener, addMouseListener, getAddableComponent, getComponent, getDefaultSize, getEnabled, getHeight, getMinimumSize, getPreferredSize, getSizableComponent, getSize, getStylableComponent, getStyle, getWidth, getX, getY, removeActionListener, removeMouseListener, setBounds, setDefaultSize, 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
addActionListener, addHelpListener, addMouseListener, getComponent, getEnabled, getHeight, getSize, getStyle, getWidth, getX, getY, removeActionListener, removeHelpListener, removeMouseListener, setBackground, setBounds, setFocus, setForeground, setHintText, setInputMode, setStyle, setVisible, setZoom
 

Field Detail

textcomponent

protected javax.swing.text.JTextComponent textcomponent

fGUI

protected GUI fGUI

insideChangeEvent

protected boolean insideChangeEvent
Constructor Detail

SwingTextComponent

public SwingTextComponent(GUI gui)
Method Detail

init

public void init()
Overrides:
init in class SwingStylableComponent

setText

public void setText(java.lang.String text)
Description copied from interface: XText
 @param s The text is set to s

Specified by:
setText in interface XText

getText

public java.lang.String getText()
Specified by:
getText in interface XText
Returns:
Return the password currently typed in.

addTextListener

public void addTextListener(java.awt.event.TextListener tl)
Description copied from interface: XText
Adds the specified text event listener to receive text events from this text component. If l is null, no exception is thrown and no action is performed.

Specified by:
addTextListener in interface XText

removeTextListener

public void removeTextListener(java.awt.event.TextListener tl)
Specified by:
removeTextListener in interface XText

getDefaultBackgroundColor

public java.awt.Color getDefaultBackgroundColor()
Description copied from class: ComponentBase
the default background color for this type of component null = transparent.

Overrides:
getDefaultBackgroundColor in class ComponentBase

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

notifyIncrementalChange

public void notifyIncrementalChange(javax.swing.event.DocumentEvent e)

setEditable

public void setEditable(boolean editable)
Specified by:
setEditable in interface XText

getEditable

public boolean getEditable()
Specified by:
getEditable in interface XText

setEnabled

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

focusGained

public void focusGained(java.awt.event.FocusEvent ae)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent ae)
Specified by:
focusLost in interface java.awt.event.FocusListener

addFocusListener

public void addFocusListener(java.awt.event.FocusListener fl)
Specified by:
addFocusListener in interface XComponent
Overrides:
addFocusListener in class ComponentBase

removeFocusListener

public void removeFocusListener(java.awt.event.FocusListener fl)
Specified by:
removeFocusListener in interface XComponent
Overrides:
removeFocusListener in class ComponentBase


X-Smiles 1.2