fi.hut.tml.xsmiles.gui.components
Class XComponentWrapper

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.components.XComponentWrapper
All Implemented Interfaces:
XComponent

public class XComponentWrapper
extends java.lang.Object
implements XComponent

Author:
honkkis

Field Summary
 java.awt.Component comp
           
 java.awt.Color defaultColor
           
 CSSFormatter formatter
           
 
Constructor Summary
XComponentWrapper(java.awt.Component aComp, CSSFormatter aFormatter, java.awt.Color aDefaultColor)
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener al)
          At the moment ALL events are delegated through a simple actionListener
 void addFocusListener(java.awt.event.FocusListener fl)
           
 void addHelpListener(java.awt.event.ActionListener fl)
          add a listener for help events
 void addMouseListener(java.awt.event.MouseListener fl)
           
 java.awt.Component getComponent()
          Return the visual component for this extension element
 boolean getEnabled()
           
 int getHeight()
           
 java.awt.Dimension getSize()
          Returns the approximate size of this extension element
 org.w3c.dom.css.CSSStyleDeclaration getStyle()
          gets the css style
 int getWidth()
           
 int getX()
           
 int getY()
           
 void removeActionListener(java.awt.event.ActionListener al)
           
 void removeFocusListener(java.awt.event.FocusListener fl)
           
 void removeHelpListener(java.awt.event.ActionListener fl)
          remove a listener for help events
 void removeMouseListener(java.awt.event.MouseListener fl)
           
 void setBackground(java.awt.Color bg)
          set the background, if null, then reset to default
 void setBounds(int x, int y, int width, int height)
          Set the bounds of Container
 void setEnabled(boolean b)
           
 void setFocus()
          set the focus to this control
 void setForeground(java.awt.Color fg)
           
 void setHintText(java.lang.String text)
          set the hint text
 void setInputMode(java.lang.String inputmode)
          set the input mode attribute (from XForms)
 void setStyle(org.w3c.dom.css.CSSStyleDeclaration style)
          sets the CSS style for this component.
 void setVisible(boolean v)
          Set this drawing area visible.
 void setZoom(double zoom)
          set the zoom level (1.0 is the normal)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comp

public java.awt.Component comp

formatter

public CSSFormatter formatter

defaultColor

public java.awt.Color defaultColor
Constructor Detail

XComponentWrapper

public XComponentWrapper(java.awt.Component aComp,
                         CSSFormatter aFormatter,
                         java.awt.Color aDefaultColor)
Method Detail

setStyle

public void setStyle(org.w3c.dom.css.CSSStyleDeclaration style)
Description copied from interface: XComponent
sets the CSS style for this component. for components, which support this, all styling should be dont thru this

Specified by:
setStyle in interface XComponent

getStyle

public org.w3c.dom.css.CSSStyleDeclaration getStyle()
Description copied from interface: XComponent
gets the css style

Specified by:
getStyle in interface XComponent

setVisible

public void setVisible(boolean v)
Description copied from interface: XComponent
Set this drawing area visible.

Specified by:
setVisible in interface XComponent
Parameters:
v - true=visible, false=invisible

setEnabled

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

getEnabled

public boolean getEnabled()
Specified by:
getEnabled in interface XComponent
Returns:

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: XComponent
Set the bounds of Container

Specified by:
setBounds in interface XComponent
Parameters:
x - X location
y - X location
width - X location
height - X location

getX

public int getX()
Specified by:
getX in interface XComponent
Returns:
The original coordinated, and the default size of component

getY

public int getY()
Specified by:
getY in interface XComponent

getWidth

public int getWidth()
Specified by:
getWidth in interface XComponent

getHeight

public int getHeight()
Specified by:
getHeight in interface XComponent

setHintText

public void setHintText(java.lang.String text)
Description copied from interface: XComponent
set the hint text

Specified by:
setHintText in interface XComponent

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
Parameters:
al - Add the actionlistener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener al)
Specified by:
removeActionListener in interface XComponent

addFocusListener

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

removeFocusListener

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

addMouseListener

public void addMouseListener(java.awt.event.MouseListener fl)
Specified by:
addMouseListener in interface XComponent

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener fl)
Specified by:
removeMouseListener in interface XComponent

addHelpListener

public void addHelpListener(java.awt.event.ActionListener fl)
Description copied from interface: XComponent
add a listener for help events

Specified by:
addHelpListener in interface XComponent

removeHelpListener

public void removeHelpListener(java.awt.event.ActionListener fl)
Description copied from interface: XComponent
remove a listener for help events

Specified by:
removeHelpListener in interface XComponent

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

getSize

public java.awt.Dimension getSize()
Description copied from interface: XComponent
Returns the approximate size of this extension element

Specified by:
getSize in interface XComponent

setZoom

public void setZoom(double zoom)
Description copied from interface: XComponent
set the zoom level (1.0 is the normal)

Specified by:
setZoom in interface XComponent

setBackground

public void setBackground(java.awt.Color bg)
Description copied from interface: XComponent
set the background, if null, then reset to default

Specified by:
setBackground in interface XComponent

setForeground

public void setForeground(java.awt.Color fg)
Specified by:
setForeground in interface XComponent

setInputMode

public void setInputMode(java.lang.String inputmode)
Description copied from interface: XComponent
set the input mode attribute (from XForms)

Specified by:
setInputMode in interface XComponent

setFocus

public void setFocus()
Description copied from interface: XComponent
set the focus to this control

Specified by:
setFocus in interface XComponent


X-Smiles 1.2