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

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.components.swing.SwingContainer
All Implemented Interfaces:
XComponent, XContainer

public class SwingContainer
extends java.lang.Object
implements XContainer

The only addition is add and remove Utilize the componentWithcontainer


Field Summary
protected  java.awt.Container container
           
 
Constructor Summary
SwingContainer()
           
 
Method Summary
 void add(java.awt.Component c)
           
 void add(XComponent comp)
           
 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)
           
 boolean getActionable()
          By default components are inactive
 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 remove(java.awt.Component c)
           
 void remove(XComponent c)
           
 void removeActionListener(java.awt.event.ActionListener al)
           
 void removeAll()
          Remove all components from conatiner.
 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 setActionable(boolean a)
           
 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)
          Returns the approximate size of this extension element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected java.awt.Container container
Constructor Detail

SwingContainer

public SwingContainer()
Method Detail

getActionable

public boolean getActionable()
By default components are inactive

Returns:
Is can compnent be active?

setActionable

public void setActionable(boolean a)
Parameters:
a - The value of actionable

remove

public void remove(XComponent c)
Specified by:
remove in interface XContainer
Parameters:
c - Remove component c

removeAll

public void removeAll()
Remove all components from conatiner.

Specified by:
removeAll in interface XContainer

add

public void add(XComponent comp)
Specified by:
add in interface XContainer
Parameters:
comp - The component to be added

setZoom

public void setZoom(double zoom)
Returns the approximate size of this extension element

Specified by:
setZoom in interface XComponent

add

public void add(java.awt.Component c)
Specified by:
add in interface XContainer
Parameters:
c - The component to be added

remove

public void remove(java.awt.Component c)
Specified by:
remove in interface XContainer
Parameters:
c - The component to be added

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

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

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

getEnabled

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


X-Smiles 1.2