fi.hut.tml.xsmiles.gui.gui2.awt
Class SimpleAWTGUI

java.lang.Object
  extended byfi.hut.tml.xsmiles.gui.gui2.awt.SimpleAWTGUI
All Implemented Interfaces:
GUIEventListener, GUIInterface
Direct Known Subclasses:
SimpleSwingGUI

public class SimpleAWTGUI
extends java.lang.Object
implements GUIEventListener, GUIInterface

This is a simple ABSTRACT GUI that does not use the OLD gui system. The idea is that it creates a browser window without a OLD gui system and then just gets the content area and adds it to itself. Actually the old GUI system is still created under the hoods, but it is only used to get events back... Anyway, this should show that it is easy to use the browser inside a container in a Java project. Note that some settings (e.g. the ComponentFactory) are set in the config.xml file. Currently this does not support tabs, so it is always one main BrowserWindow inside a AWTGUI. This should be Swing-independent. NOTE: SwingGUI extends this GUI, so that all changes here will be incorporated in both versions

Author:
Mikko Honkala

Nested Class Summary
protected  class SimpleAWTGUI.LocationFieldListener
           
 
Field Summary
static java.lang.String aboutHelpMenu
           
 java.awt.Container actionContainer
          The structure of the containers : ------------------------------------------------- Menu ------------------------------------------------- actionContainer (BorderLayout.NORTH) ------------------------------------------------ BrowserWindow.contentArea() (BorderLayout.CENTER) ------------------------------------------------ statusContainer (BorderLayout.SOUTH)
static java.lang.String backCommand
           
protected  XMenu bookmarksMenu
           
 Browser browserWindow
           
static java.lang.String configMenu
           
protected  XSmilesDialog dialog
           
static java.lang.String dialogClass
           
static java.lang.String editBookmarksMenu
           
protected  XMenu editMenu
           
static java.lang.String exitMenu
           
protected  XMenu fileMenu
           
static java.lang.String forwardCommand
           
protected  java.awt.Frame frame
           
protected  XMenu goMenu
           
protected  XMenu helpMenu
           
static java.lang.String homeCommand
           
 XLink initialURL
           
protected  XInput locationField
           
protected  XMenuBar menuBar
           
static java.lang.String openFileMenu
           
static java.lang.String reloadCommand
           
protected  java.awt.Container rootContainer
           
static java.lang.String sethomepageMenu
           
 XCaption status
           
 java.awt.Container statusContainer
           
static java.lang.String title
           
protected  java.awt.Container topContainer
           
static java.lang.String viewBookmarksMenu
           
static java.lang.String viewHideGUIMenu
           
protected  XMenu viewMenu
           
static java.lang.String viewShowGUIMenu
           
static java.lang.String viewSpeechMenu
           
static java.lang.String viewXMLSourceMenu
           
static java.lang.String xsmilesCommand
           
protected  double zoomFactor
           
static java.lang.String zoomMinusMenu
           
static java.lang.String zoomPlusMenu
           
 
Constructor Summary
SimpleAWTGUI()
           
 
Method Summary
 void action(java.lang.Object action)
           
protected  void addMenuBar()
           
 void browserReady()
           
 void browserWorking()
           
protected  XComponent createActionButton(java.lang.String name, java.lang.String icon, java.lang.String actionCommand)
           
 void createActionContainer()
           
 void createBrowserListeners()
           
protected  void createBrowserWindow()
           
protected  java.awt.Container createContainer()
           
protected  void createListeners()
           
protected  java.awt.Component createLocation()
           
protected  XMenuItem createMenuItem(java.lang.String name, java.lang.String actionCommand)
           
 void createMenus()
          menus
protected  java.awt.Container createRootContainer()
           
 void createStatusContainer()
           
 void decorateGUI()
           
 void destroy()
           
protected  java.awt.Font getActionFont()
           
 Browser getBrowser()
           
protected  java.lang.String getComponentFactoryClassName()
           
 java.awt.Container getContentArea()
           
protected  java.lang.String getGUIName()
           
protected  java.awt.Container getRootContainer()
           
protected  java.awt.Font getStatusFont()
           
 void GUIEvent(GUIEvent ev)
           
protected  void listenForWindowClose(java.awt.Window w)
           
 void loadLocation(java.lang.String location)
           
 void openInNewTab(XLink l, java.lang.String id)
           
 void openInNewWindow(XLink l, java.lang.String id)
           
 void setDefaultWindowSize()
          subclasses can override this
protected  void setDoubleBuffering(boolean b)
           
 void setEnabledBack(boolean value)
           
 void setEnabledForward(boolean value)
           
 void setEnabledHome(boolean value)
           
 void setEnabledReload(boolean value)
           
 void setEnabledStop(boolean value)
           
 void setInitialURL(XLink url)
           
 void setLocation(java.lang.String s)
           
 void setStatusText(java.lang.String statusText)
           
 void setTitle(java.lang.String title)
           
 void setXMLConfigurer(XMLConfigurer c)
           
 void show()
           
 void start()
          the GUI event listener interface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dialogClass

public static final java.lang.String dialogClass
See Also:
Constant Field Values

title

public static final java.lang.String title
See Also:
Constant Field Values

initialURL

public XLink initialURL

dialog

protected XSmilesDialog dialog

browserWindow

public Browser browserWindow

actionContainer

public java.awt.Container actionContainer
The structure of the containers : ------------------------------------------------- Menu ------------------------------------------------- actionContainer (BorderLayout.NORTH) ------------------------------------------------ BrowserWindow.contentArea() (BorderLayout.CENTER) ------------------------------------------------ statusContainer (BorderLayout.SOUTH)


statusContainer

public java.awt.Container statusContainer

status

public XCaption status

backCommand

public static final java.lang.String backCommand
See Also:
Constant Field Values

forwardCommand

public static final java.lang.String forwardCommand
See Also:
Constant Field Values

homeCommand

public static final java.lang.String homeCommand
See Also:
Constant Field Values

reloadCommand

public static final java.lang.String reloadCommand
See Also:
Constant Field Values

xsmilesCommand

public static final java.lang.String xsmilesCommand
See Also:
Constant Field Values

menuBar

protected XMenuBar menuBar

editMenu

protected XMenu editMenu

fileMenu

protected XMenu fileMenu

bookmarksMenu

protected XMenu bookmarksMenu

viewMenu

protected XMenu viewMenu

helpMenu

protected XMenu helpMenu

goMenu

protected XMenu goMenu

frame

protected java.awt.Frame frame

rootContainer

protected java.awt.Container rootContainer

configMenu

public static final java.lang.String configMenu
See Also:
Constant Field Values

sethomepageMenu

public static final java.lang.String sethomepageMenu
See Also:
Constant Field Values

exitMenu

public static final java.lang.String exitMenu
See Also:
Constant Field Values

openFileMenu

public static final java.lang.String openFileMenu
See Also:
Constant Field Values

aboutHelpMenu

public static final java.lang.String aboutHelpMenu
See Also:
Constant Field Values

viewBookmarksMenu

public static final java.lang.String viewBookmarksMenu
See Also:
Constant Field Values

viewSpeechMenu

public static final java.lang.String viewSpeechMenu
See Also:
Constant Field Values

viewXMLSourceMenu

public static final java.lang.String viewXMLSourceMenu
See Also:
Constant Field Values

viewShowGUIMenu

public static final java.lang.String viewShowGUIMenu
See Also:
Constant Field Values

viewHideGUIMenu

public static final java.lang.String viewHideGUIMenu
See Also:
Constant Field Values

editBookmarksMenu

public static final java.lang.String editBookmarksMenu
See Also:
Constant Field Values

zoomPlusMenu

public static final java.lang.String zoomPlusMenu
See Also:
Constant Field Values

zoomMinusMenu

public static final java.lang.String zoomMinusMenu
See Also:
Constant Field Values

locationField

protected XInput locationField

topContainer

protected java.awt.Container topContainer

zoomFactor

protected double zoomFactor
Constructor Detail

SimpleAWTGUI

public SimpleAWTGUI()
Method Detail

openInNewWindow

public void openInNewWindow(XLink l,
                            java.lang.String id)
Specified by:
openInNewWindow in interface GUIEventListener

createRootContainer

protected java.awt.Container createRootContainer()

listenForWindowClose

protected void listenForWindowClose(java.awt.Window w)

getRootContainer

protected java.awt.Container getRootContainer()

setDoubleBuffering

protected void setDoubleBuffering(boolean b)

show

public void show()
Specified by:
show in interface GUIInterface

setDefaultWindowSize

public void setDefaultWindowSize()
subclasses can override this


decorateGUI

public void decorateGUI()

addMenuBar

protected void addMenuBar()

createMenus

public void createMenus()
menus


createMenuItem

protected XMenuItem createMenuItem(java.lang.String name,
                                   java.lang.String actionCommand)

createContainer

protected java.awt.Container createContainer()

createLocation

protected java.awt.Component createLocation()

loadLocation

public void loadLocation(java.lang.String location)

createActionContainer

public void createActionContainer()

getActionFont

protected java.awt.Font getActionFont()

getStatusFont

protected java.awt.Font getStatusFont()

createStatusContainer

public void createStatusContainer()

createActionButton

protected XComponent createActionButton(java.lang.String name,
                                        java.lang.String icon,
                                        java.lang.String actionCommand)

setInitialURL

public void setInitialURL(XLink url)
Specified by:
setInitialURL in interface GUIInterface

getComponentFactoryClassName

protected java.lang.String getComponentFactoryClassName()

getGUIName

protected java.lang.String getGUIName()

createBrowserWindow

protected void createBrowserWindow()

getBrowser

public Browser getBrowser()
Specified by:
getBrowser in interface GUIInterface

getContentArea

public java.awt.Container getContentArea()

createBrowserListeners

public void createBrowserListeners()

createListeners

protected void createListeners()

action

public void action(java.lang.Object action)

start

public void start()
the GUI event listener interface

Specified by:
start in interface GUIEventListener

destroy

public void destroy()
Specified by:
destroy in interface GUIEventListener

openInNewTab

public void openInNewTab(XLink l,
                         java.lang.String id)
Specified by:
openInNewTab in interface GUIEventListener

setStatusText

public void setStatusText(java.lang.String statusText)
Specified by:
setStatusText in interface GUIEventListener

setEnabledBack

public void setEnabledBack(boolean value)
Specified by:
setEnabledBack in interface GUIEventListener

setEnabledForward

public void setEnabledForward(boolean value)
Specified by:
setEnabledForward in interface GUIEventListener

setEnabledHome

public void setEnabledHome(boolean value)
Specified by:
setEnabledHome in interface GUIEventListener

setEnabledStop

public void setEnabledStop(boolean value)
Specified by:
setEnabledStop in interface GUIEventListener

setEnabledReload

public void setEnabledReload(boolean value)
Specified by:
setEnabledReload in interface GUIEventListener

setTitle

public void setTitle(java.lang.String title)
Specified by:
setTitle in interface GUIEventListener

setLocation

public void setLocation(java.lang.String s)
Specified by:
setLocation in interface GUIEventListener

browserWorking

public void browserWorking()
Specified by:
browserWorking in interface GUIEventListener

GUIEvent

public void GUIEvent(GUIEvent ev)
Specified by:
GUIEvent in interface GUIEventListener

browserReady

public void browserReady()
Specified by:
browserReady in interface GUIEventListener

setXMLConfigurer

public void setXMLConfigurer(XMLConfigurer c)
Specified by:
setXMLConfigurer in interface GUIInterface


X-Smiles 1.2