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

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.components.havi.HaviComponentFactory
All Implemented Interfaces:
ComponentFactory

public class HaviComponentFactory
extends java.lang.Object
implements ComponentFactory

component factory implementation for HAVI

Version:
0
Author:
Mikko Honkala

Nested Class Summary
static class HaviComponentFactory.MyContainer
          this container also paints the background before painting children
 
Field Summary
 
Fields inherited from interface fi.hut.tml.xsmiles.gui.components.ComponentFactory
VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER
 
Constructor Summary
HaviComponentFactory()
           
HaviComponentFactory(BrowserWindow b)
           
 
Method Summary
 void add(XComponent c)
           
 void addHelpListener(java.awt.Component component, java.awt.event.ActionListener listener)
          listen for all help keypresses etc, for this component and its ancestors
static java.awt.Container createContainer()
           
 java.awt.Container createContentPanel()
          create a content panel for the browser, add also maybe a layout manager
 java.awt.Container createScrollPane(java.awt.Component comp)
          create a scroll pane for this components.
 java.awt.Container createScrollPane(java.awt.Component arg0, int arg1)
          create a scroll pane for this components.
 CSSFormatter getCSSFormatter()
           
 java.lang.Object getExtension(java.lang.Class c)
          return an extension control.
 XAuthDialog getXAuthDialog()
           
 XButton getXButton(java.lang.String iconUrl)
           
 XButton getXButton(java.lang.String label, java.lang.String iconUrl)
           
 XButton getXButton(java.lang.String imageUrl, java.lang.String focusedImage, java.lang.String disabledImage)
           
 XCalendar getXCalendar()
           
 XCaption getXCaption(java.lang.String captText)
           
 XConfirmDialog getXConfirmDialog()
           
 XContainer getXContainer()
           
 XDocument getXDocument(XLink link)
          Give a XMLDocument, and get a rendered document If you are in for events, just add an actionListener and receive the XMLEvents from the component
 XFileDialog getXFileDialog(boolean save)
           
 XFileDialog getXFileDialog(boolean save, java.lang.String filename)
           
 XFocusManager getXFocusManager()
          Returns a Toolkit dependent FocusProvider
 XInput getXInput()
           
 XLabelCompound getXLabelCompound(XComponent comp, XCaption capt, java.lang.String captSide)
           
 XLinkComponent getXLinkComponent(java.lang.String dest)
          Different GUIs have different ways of showing focus etc.
 XMedia getXMedia(java.net.URL u)
          Give an URL and receive the mediaelement.
 XMenu getXMenu(java.lang.String name)
           
 XMenuBar getXMenuBar()
           
 XMenuItem getXMenuItem(java.lang.String name)
           
 XPanel getXPanel()
           
 XRange getXRange(int from, int to, int step, int orientation)
           
 XSecret getXSecret(char c)
           
 XSelectBoolean getXSelectBoolean()
           
 XSelectMany getXSelectMany(java.lang.String appearance, boolean open)
           
 XSelectOne getXSelectOne(java.lang.String appearance, boolean open)
           
 XTabbedPane getXTabbedPane()
           
 XTextArea getXTextArea(java.lang.String s)
           
 XUpload getXUpload(java.lang.String caption)
           
 boolean hasExtension(java.lang.Class c)
          query for extension availability.
 void remove(XComponent c)
           
 void removeAll()
           
 void removeHelpListener(java.awt.Component component, java.awt.event.ActionListener listener)
          remove a help listener
 void setScrollBar(java.awt.Container arg0, int arg1, int arg2)
          Set scroll bar to a given position
 void showError(java.lang.String title, java.lang.String explanation)
          show an error dialog
 void showLinkPopup(java.net.URL url, XMLDocument doc, java.awt.event.MouseEvent e, MLFCListener listener)
           
 void showMessageDialog(boolean isModal, java.lang.String title, java.lang.String message, long timeToLiveMillis)
           
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HaviComponentFactory

public HaviComponentFactory(BrowserWindow b)

HaviComponentFactory

public HaviComponentFactory()
Method Detail

getXContainer

public XContainer getXContainer()
Specified by:
getXContainer in interface ComponentFactory
Returns:
a container for components

getXLinkComponent

public XLinkComponent getXLinkComponent(java.lang.String dest)
Description copied from interface: ComponentFactory
Different GUIs have different ways of showing focus etc. This is why Every GUI can have it's own kind of linkComponent.. Even voice browsers have links, and they are quite different from desktop link components

Specified by:
getXLinkComponent in interface ComponentFactory

getXDocument

public XDocument getXDocument(XLink link)
Give a XMLDocument, and get a rendered document If you are in for events, just add an actionListener and receive the XMLEvents from the component

Specified by:
getXDocument in interface ComponentFactory
Parameters:
link - The document
Returns:
the visual component that contains rendered xmldocument. Null is returned if rendering is not possible. XForms notice: (you might want to use this component to render XOutput)

getXTextArea

public XTextArea getXTextArea(java.lang.String s)
Specified by:
getXTextArea in interface ComponentFactory
Parameters:
s - The intial text
Returns:
a textarea

getXSecret

public XSecret getXSecret(char c)
Specified by:
getXSecret in interface ComponentFactory
Returns:
A secret input control

getXInput

public XInput getXInput()
Specified by:
getXInput in interface ComponentFactory
Returns:
one line input

getXRange

public XRange getXRange(int from,
                        int to,
                        int step,
                        int orientation)
Specified by:
getXRange in interface ComponentFactory
Parameters:
from - from what
to - to where
Returns:
a range control

getXMedia

public XMedia getXMedia(java.net.URL u)
Give an URL and receive the mediaelement.

Specified by:
getXMedia in interface ComponentFactory

getXSelectOne

public XSelectOne getXSelectOne(java.lang.String appearance,
                                boolean open)
Specified by:
getXSelectOne in interface ComponentFactory
Parameters:
appearance - The appearance of selectone: 'minimal','compact','full'
Returns:
a XSelectOne, which is used to select one item at a time

getXSelectBoolean

public XSelectBoolean getXSelectBoolean()
Specified by:
getXSelectBoolean in interface ComponentFactory
Returns:
a XSelectBoolean, which is used to select true / false

getXSelectMany

public XSelectMany getXSelectMany(java.lang.String appearance,
                                  boolean open)
Specified by:
getXSelectMany in interface ComponentFactory
Returns:
A selectMany control.

getXUpload

public XUpload getXUpload(java.lang.String caption)
Specified by:
getXUpload in interface ComponentFactory
Returns:
an upload control.

getXFileDialog

public XFileDialog getXFileDialog(boolean save)
Specified by:
getXFileDialog in interface ComponentFactory
Returns:
an file chooser control.

getXFileDialog

public XFileDialog getXFileDialog(boolean save,
                                  java.lang.String filename)
Specified by:
getXFileDialog in interface ComponentFactory
Returns:
an file chooser control.

getXAuthDialog

public XAuthDialog getXAuthDialog()
Specified by:
getXAuthDialog in interface ComponentFactory
Returns:
an authenticator control.

getXConfirmDialog

public XConfirmDialog getXConfirmDialog()
Specified by:
getXConfirmDialog in interface ComponentFactory
Returns:
an confirmation control.

getXButton

public XButton getXButton(java.lang.String label,
                          java.lang.String iconUrl)
Specified by:
getXButton in interface ComponentFactory
Returns:
a button w a label

getXButton

public XButton getXButton(java.lang.String iconUrl)
Specified by:
getXButton in interface ComponentFactory
Returns:
a iconned button

getXButton

public XButton getXButton(java.lang.String imageUrl,
                          java.lang.String focusedImage,
                          java.lang.String disabledImage)
Specified by:
getXButton in interface ComponentFactory
Returns:
a button with images

getXCalendar

public XCalendar getXCalendar()
Returns:
a new calender control

showError

public void showError(java.lang.String title,
                      java.lang.String explanation)
show an error dialog

Specified by:
showError in interface ComponentFactory

showLinkPopup

public void showLinkPopup(java.net.URL url,
                          XMLDocument doc,
                          java.awt.event.MouseEvent e,
                          MLFCListener listener)
Specified by:
showLinkPopup in interface ComponentFactory

getXCaption

public XCaption getXCaption(java.lang.String captText)
Specified by:
getXCaption in interface ComponentFactory
Returns:
a caption (label) component

getXLabelCompound

public XLabelCompound getXLabelCompound(XComponent comp,
                                        XCaption capt,
                                        java.lang.String captSide)
Specified by:
getXLabelCompound in interface ComponentFactory

addHelpListener

public void addHelpListener(java.awt.Component component,
                            java.awt.event.ActionListener listener)
listen for all help keypresses etc, for this component and its ancestors

Specified by:
addHelpListener in interface ComponentFactory

removeHelpListener

public void removeHelpListener(java.awt.Component component,
                               java.awt.event.ActionListener listener)
remove a help listener

Specified by:
removeHelpListener in interface ComponentFactory

createContentPanel

public java.awt.Container createContentPanel()
create a content panel for the browser, add also maybe a layout manager

Specified by:
createContentPanel in interface ComponentFactory

createContainer

public static java.awt.Container createContainer()

createScrollPane

public java.awt.Container createScrollPane(java.awt.Component comp)
create a scroll pane for this components. e.g. in swing, create a JScrollPane and put the component inside


add

public void add(XComponent c)
Parameters:
c - Add a component to the MLFC Controls container of the GUI.

remove

public void remove(XComponent c)
Parameters:
c - Remove a component to the MLFC Controls container of the GUI.

removeAll

public void removeAll()

validate

public void validate()

getXMenuBar

public XMenuBar getXMenuBar()
Specified by:
getXMenuBar in interface ComponentFactory

getXMenu

public XMenu getXMenu(java.lang.String name)
Specified by:
getXMenu in interface ComponentFactory

getXMenuItem

public XMenuItem getXMenuItem(java.lang.String name)
Specified by:
getXMenuItem in interface ComponentFactory

showMessageDialog

public void showMessageDialog(boolean isModal,
                              java.lang.String title,
                              java.lang.String message,
                              long timeToLiveMillis)
Specified by:
showMessageDialog in interface ComponentFactory

hasExtension

public boolean hasExtension(java.lang.Class c)
query for extension availability. For instance, calendar control is an extension

Specified by:
hasExtension in interface ComponentFactory

getExtension

public java.lang.Object getExtension(java.lang.Class c)
return an extension control. hasExtension must be called first

Specified by:
getExtension in interface ComponentFactory

createScrollPane

public java.awt.Container createScrollPane(java.awt.Component arg0,
                                           int arg1)
Description copied from interface: ComponentFactory
create a scroll pane for this components. e.g. in swing, create a JScrollPane and put the component inside

Specified by:
createScrollPane in interface ComponentFactory

setScrollBar

public void setScrollBar(java.awt.Container arg0,
                         int arg1,
                         int arg2)
Description copied from interface: ComponentFactory
Set scroll bar to a given position

Specified by:
setScrollBar in interface ComponentFactory
Parameters:
arg0 -
arg1 -
arg2 -

getXTabbedPane

public XTabbedPane getXTabbedPane()
Specified by:
getXTabbedPane in interface ComponentFactory

getXPanel

public XPanel getXPanel()
Specified by:
getXPanel in interface ComponentFactory

getXFocusManager

public XFocusManager getXFocusManager()
Description copied from interface: ComponentFactory
Returns a Toolkit dependent FocusProvider

Specified by:
getXFocusManager in interface ComponentFactory
Returns:
XFocusManager

getCSSFormatter

public CSSFormatter getCSSFormatter()
Specified by:
getCSSFormatter in interface ComponentFactory


X-Smiles 1.2