fi.hut.tml.xsmiles.gui.components
Interface ComponentFactory

All Known Implementing Classes:
AWTComponentFactory, DefaultComponentFactory, HaviComponentFactory

public interface ComponentFactory

A ComponentFactory is a XContainer, with the functionality to deal out components. The default ComponentFactory which produces components, based on the GUI which is active. This enables the MLFC's to use generic components, whenever it is possible. Each GUI should override these methods, to produce wanted components. Interfaces for all components exist in fi.hut.tml.xsmiles.gui.components The add methods provide a way to move components to the browser GUI. Some more component access methods will be added in the future The generic abstract component library is somewhat based on XForms All copmonents are based on XComponent. Components can also be styled. Although the standard for styling is not specified, in visual platforms it will likely be CSS. For sound based systems, another styling methodology can be used. e.g. Aural Style sheets (ASS).

Version:
0
Author:
Juha, Mikko Honkala

Field Summary
static int VERTICAL_SCROLLBAR_ALWAYS
           
static int VERTICAL_SCROLLBAR_AS_NEEDED
           
static int VERTICAL_SCROLLBAR_NEVER
           
 
Method Summary
 void addHelpListener(java.awt.Component component, java.awt.event.ActionListener listener)
          listen for all help keypresses etc, for this component and its ancestors
 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, int policy)
          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)
           
 XCaption getXCaption(java.lang.String captText)
           
 XConfirmDialog getXConfirmDialog()
           
 XContainer getXContainer()
           
 XDocument getXDocument(XLink doc)
          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 n)
          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 removeHelpListener(java.awt.Component component, java.awt.event.ActionListener listener)
          remove a help listener
 void setScrollBar(java.awt.Container con, int x, int y)
          Set scroll bar to a given position
 void showError(java.lang.String title, java.lang.String explanation)
           
 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)
           
 

Field Detail

VERTICAL_SCROLLBAR_AS_NEEDED

public static final int VERTICAL_SCROLLBAR_AS_NEEDED
See Also:
Constant Field Values

VERTICAL_SCROLLBAR_NEVER

public static final int VERTICAL_SCROLLBAR_NEVER
See Also:
Constant Field Values

VERTICAL_SCROLLBAR_ALWAYS

public static final int VERTICAL_SCROLLBAR_ALWAYS
See Also:
Constant Field Values
Method Detail

getXLinkComponent

public XLinkComponent getXLinkComponent(java.lang.String n)
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


getXContainer

public XContainer getXContainer()
Returns:
a container for components

getXPanel

public XPanel getXPanel()

getXDocument

public XDocument getXDocument(XLink doc)
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

Parameters:
doc - The document
Returns:
the visual component that contains rendered xmldocument. Null is returned if rendering is not possible.

getCSSFormatter

public CSSFormatter getCSSFormatter()

getXTabbedPane

public XTabbedPane getXTabbedPane()

getXTextArea

public XTextArea getXTextArea(java.lang.String s)
Parameters:
s - The intial text
Returns:
a textarea

getXSecret

public XSecret getXSecret(char c)
Returns:
A secret input control

getXInput

public XInput getXInput()
Returns:
one line input

getXRange

public XRange getXRange(int from,
                        int to,
                        int step,
                        int orientation)
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.


getXSelectOne

public XSelectOne getXSelectOne(java.lang.String appearance,
                                boolean open)
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()
Returns:
a XSelectBoolean, which is used to select true / false

getXSelectMany

public XSelectMany getXSelectMany(java.lang.String appearance,
                                  boolean open)
Returns:
A selectMany control.

getXUpload

public XUpload getXUpload(java.lang.String caption)
Returns:
an upload control.

getXFileDialog

public XFileDialog getXFileDialog(boolean save)
Returns:
an file chooser control.

getXFileDialog

public XFileDialog getXFileDialog(boolean save,
                                  java.lang.String filename)
Returns:
an file chooser control.

getXAuthDialog

public XAuthDialog getXAuthDialog()
Returns:
an authenticator control.

getXConfirmDialog

public XConfirmDialog getXConfirmDialog()
Returns:
an confirmation control.

getXButton

public XButton getXButton(java.lang.String label,
                          java.lang.String iconUrl)
Returns:
a button w a label

getXCaption

public XCaption getXCaption(java.lang.String captText)
Returns:
a caption (label) component

getXButton

public XButton getXButton(java.lang.String iconUrl)
Returns:
a icon button

getXButton

public XButton getXButton(java.lang.String imageUrl,
                          java.lang.String focusedImage,
                          java.lang.String disabledImage)
Returns:
a button with images

getXMenuBar

public XMenuBar getXMenuBar()

getXMenu

public XMenu getXMenu(java.lang.String name)

getXMenuItem

public XMenuItem getXMenuItem(java.lang.String name)

getXLabelCompound

public XLabelCompound getXLabelCompound(XComponent comp,
                                        XCaption capt,
                                        java.lang.String captSide)

showError

public void showError(java.lang.String title,
                      java.lang.String explanation)

showLinkPopup

public void showLinkPopup(java.net.URL url,
                          XMLDocument doc,
                          java.awt.event.MouseEvent e,
                          MLFCListener listener)

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


removeHelpListener

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


createContentPanel

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


createScrollPane

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


showMessageDialog

public void showMessageDialog(boolean isModal,
                              java.lang.String title,
                              java.lang.String message,
                              long timeToLiveMillis)

hasExtension

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


getExtension

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


setScrollBar

public void setScrollBar(java.awt.Container con,
                         int x,
                         int y)
Set scroll bar to a given position

Parameters:
con -
x -
y -

getXFocusManager

public XFocusManager getXFocusManager()
Returns a Toolkit dependent FocusProvider

Returns:
XFocusManager


X-Smiles 1.2