fi.hut.tml.xsmiles.gui
Class XSmilesUIAWT

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.XSmilesUIAWT
All Implemented Interfaces:
GUI
Direct Known Subclasses:
NullGUIAWT, NullGUIHavi, XSmilesUI

public abstract class XSmilesUIAWT
extends java.lang.Object
implements GUI

very stripped down GUI base class that does not use swing at all All it does, is dispatch events to possible listeners


Field Summary
protected  BrowserWindow browserWindow
           
protected  ContentHandlerFactory contentHandlerFactory
           
protected  java.util.Hashtable focusPointProviders
           
protected  java.util.Vector guiEventListeners
           
protected  java.lang.String latestLoc
           
protected  java.lang.String latestTitle
           
 
Constructor Summary
XSmilesUIAWT(BrowserWindow b)
           
XSmilesUIAWT(BrowserWindow b, java.awt.Container c)
           
 
Method Summary
 void addGUIEventListener(GUIEventListener e)
          These are only to be used by the Browser class.
 void browserReady()
          Stop animating.
 void browserWorking()
          If a GUI has some "i'm-working-please-wait-animator", then inform the GUI, that now is a good time to start animating.
 void destroy()
          Destroy The GUI (delete frame, etc)
 void displayKeypad(java.awt.Component target, java.lang.String mode)
           
 void fireLatestEvents()
           
abstract  ComponentFactory getComponentFactory()
          Default components.
 ContentHandlerFactory getContentHandlerFactory()
           
abstract  MLFCControls getMLFCControls()
           
abstract  java.awt.Window getWindow()
           
 void hideKeypad()
           
 boolean isTabbed()
          Can gui accommodate several content areas within one frame
 void moveActiveLinkDown()
          Move the highlight of the selected link down
 void moveActiveLinkUp()
          Move the highlight of the selected link up
 void openInNewTab(XLink l, java.lang.String id)
          Open up a link in a new tab
 void openInNewWindow(XLink link, java.lang.String id)
          Open up a link in a new tab
 void reDrawGUI()
          Cleanup GUI
 void registerFocusPointProvider(FocusPointsProvider fpp, BrowserWindow bw)
           
 void removeGUIEventListener(GUIEventListener e)
           
 void setEnabledBack(boolean value)
           
 void setEnabledForward(boolean value)
           
 void setEnabledHome(boolean value)
           
 void setEnabledReload(boolean value)
           
 void setEnabledStop(boolean value)
           
 void setLocation(java.lang.String s)
           
 void setSkinsIfNeeded()
          All this stuph is needed for modular skins plugin.
 void setSkinsIfNeeded(java.lang.String skin)
          Set the skin in browser configuration file
 void setStatusText(java.lang.String statusText)
          A refrence to the MLFCMenu (i.e.
 void setTitle(java.lang.String title)
           
 boolean shouldReloadAtStartup()
           
 void showErrorDialog(boolean isModal, java.lang.String heading, java.lang.String description)
          Show a popup dialog, whenever something fatal occurs..
 void showMessageDialog(boolean isModal, java.lang.String title, java.lang.String message, long timeToLiveMillis)
          GUI shows a popup error dialog.
 void showSource(XMLDocument doc, int mode, java.lang.String heading)
          The modes are from XSmilesView class
static void showSourceStatic(XMLDocument doc, int mode, java.lang.String heading)
          The modes are from XSmilesView class
 void start()
          After browser is ready, then start is called.
 void unRegisterFocusPointProvider(FocusPointsProvider fpp, BrowserWindow bw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentHandlerFactory

protected ContentHandlerFactory contentHandlerFactory

browserWindow

protected BrowserWindow browserWindow

guiEventListeners

protected java.util.Vector guiEventListeners

latestLoc

protected java.lang.String latestLoc

latestTitle

protected java.lang.String latestTitle

focusPointProviders

protected java.util.Hashtable focusPointProviders
Constructor Detail

XSmilesUIAWT

public XSmilesUIAWT(BrowserWindow b,
                    java.awt.Container c)

XSmilesUIAWT

public XSmilesUIAWT(BrowserWindow b)
Method Detail

start

public void start()
Description copied from interface: GUI
After browser is ready, then start is called. Not neccesary to implement

Specified by:
start in interface GUI

destroy

public void destroy()
Description copied from interface: GUI
Destroy The GUI (delete frame, etc)

Specified by:
destroy in interface GUI

isTabbed

public boolean isTabbed()
Description copied from interface: GUI
Can gui accommodate several content areas within one frame

Specified by:
isTabbed in interface GUI

openInNewTab

public void openInNewTab(XLink l,
                         java.lang.String id)
Description copied from interface: GUI
Open up a link in a new tab

Specified by:
openInNewTab in interface GUI
Parameters:
id - the id of the browser to be

openInNewWindow

public void openInNewWindow(XLink link,
                            java.lang.String id)
Open up a link in a new tab

Specified by:
openInNewWindow in interface GUI
Parameters:
id - the id of the browser to be

getComponentFactory

public abstract ComponentFactory getComponentFactory()
Default components. If GUI has a special component deployment sceme, then they should override the fi.hut.tml.xsmiles.gui.components.ComponentFactory in neccecary places.

Specified by:
getComponentFactory in interface GUI
Returns:
A ComponentFactory which is capable of returning all components needed by MLFCs, or any other non-GUI package classes.
See Also:
ComponentFactory

getMLFCControls

public abstract MLFCControls getMLFCControls()
Specified by:
getMLFCControls in interface GUI

getContentHandlerFactory

public ContentHandlerFactory getContentHandlerFactory()
Specified by:
getContentHandlerFactory in interface GUI
Returns:
ContentHandler creates players for certain mime types
See Also:
ContentHandlerFactory

addGUIEventListener

public void addGUIEventListener(GUIEventListener e)
These are only to be used by the Browser class. Add eventListeners with the BrowserWindow addGUIEventListener method.

Specified by:
addGUIEventListener in interface GUI
Parameters:
e - Attach GUIEventListener to the EventBroker.

removeGUIEventListener

public void removeGUIEventListener(GUIEventListener e)
Specified by:
removeGUIEventListener in interface GUI

setStatusText

public void setStatusText(java.lang.String statusText)
A refrence to the MLFCMenu (i.e. the "Document"-menu of the GUI)

Specified by:
setStatusText in interface GUI
Parameters:
statusText - The text to put in status bar
Returns:
null if no menu exists (mlfc's will handle the null checking)

setEnabledBack

public void setEnabledBack(boolean value)
Specified by:
setEnabledBack in interface GUI
Parameters:
value - Set state of back widget

setEnabledForward

public void setEnabledForward(boolean value)
Specified by:
setEnabledForward in interface GUI
Parameters:
value - Set state of forward widget

setEnabledHome

public void setEnabledHome(boolean value)
Specified by:
setEnabledHome in interface GUI
Parameters:
value - Set state of home widget

setEnabledStop

public void setEnabledStop(boolean value)
Specified by:
setEnabledStop in interface GUI
Parameters:
value - Set state of top widget

setEnabledReload

public void setEnabledReload(boolean value)
Specified by:
setEnabledReload in interface GUI
Parameters:
value - Set state of reload widget

setTitle

public void setTitle(java.lang.String title)
Specified by:
setTitle in interface GUI
Parameters:
title - Set title of UI frame

setLocation

public void setLocation(java.lang.String s)
Specified by:
setLocation in interface GUI
Parameters:
s - The location that is beeing loaded

moveActiveLinkUp

public void moveActiveLinkUp()
Description copied from interface: GUI
Move the highlight of the selected link up

Specified by:
moveActiveLinkUp in interface GUI

moveActiveLinkDown

public void moveActiveLinkDown()
Description copied from interface: GUI
Move the highlight of the selected link down

Specified by:
moveActiveLinkDown in interface GUI

displayKeypad

public void displayKeypad(java.awt.Component target,
                          java.lang.String mode)
Specified by:
displayKeypad in interface GUI
Parameters:
target - JTextComponent to receive "virtual" key presses
mode - inputMode for text element

hideKeypad

public void hideKeypad()
Specified by:
hideKeypad in interface GUI

showMessageDialog

public void showMessageDialog(boolean isModal,
                              java.lang.String title,
                              java.lang.String message,
                              long timeToLiveMillis)
Description copied from interface: GUI
GUI shows a popup error dialog. ErrorHandling should call the Browser's showErrorDialog instead of this.

Specified by:
showMessageDialog in interface GUI
Parameters:
isModal - Modality
title - Headline of error ?@param description Description of error

showErrorDialog

public void showErrorDialog(boolean isModal,
                            java.lang.String heading,
                            java.lang.String description)
Show a popup dialog, whenever something fatal occurs.. (with xsmiles this happens quite often ;)

Specified by:
showErrorDialog in interface GUI
Parameters:
isModal - Modality
heading - Headline of error ?@param description Description of error

getWindow

public abstract java.awt.Window getWindow()
Specified by:
getWindow in interface GUI
Returns:
the Frame of the GUI.

browserWorking

public void browserWorking()
If a GUI has some "i'm-working-please-wait-animator", then inform the GUI, that now is a good time to start animating. You might want to also use some kind of semaphore system, i.e. workCount.

Specified by:
browserWorking in interface GUI

browserReady

public void browserReady()
Stop animating.

Specified by:
browserReady in interface GUI

showSource

public void showSource(XMLDocument doc,
                       int mode,
                       java.lang.String heading)
The modes are from XSmilesView class

Specified by:
showSource in interface GUI

showSourceStatic

public static void showSourceStatic(XMLDocument doc,
                                    int mode,
                                    java.lang.String heading)
The modes are from XSmilesView class


reDrawGUI

public void reDrawGUI()
Cleanup GUI

Specified by:
reDrawGUI in interface GUI

setSkinsIfNeeded

public void setSkinsIfNeeded(java.lang.String skin)
Set the skin in browser configuration file

Specified by:
setSkinsIfNeeded in interface GUI
Parameters:
skin - Set the skin to n, if possible

setSkinsIfNeeded

public void setSkinsIfNeeded()
All this stuph is needed for modular skins plugin. The skin library doesn't need to be resident, if skins aren't used


shouldReloadAtStartup

public boolean shouldReloadAtStartup()
Specified by:
shouldReloadAtStartup in interface GUI
Returns:
whether or not this gui should be instructed to reload. XMLGUI should return false, since it creates an extra content area and browser for the content

fireLatestEvents

public void fireLatestEvents()
Specified by:
fireLatestEvents in interface GUI

registerFocusPointProvider

public void registerFocusPointProvider(FocusPointsProvider fpp,
                                       BrowserWindow bw)
Specified by:
registerFocusPointProvider in interface GUI

unRegisterFocusPointProvider

public void unRegisterFocusPointProvider(FocusPointsProvider fpp,
                                         BrowserWindow bw)
Specified by:
unRegisterFocusPointProvider in interface GUI


X-Smiles 1.2