fi.hut.tml.xsmiles.gui.gui2.awt
Class AWTGUI
java.lang.Object
fi.hut.tml.xsmiles.gui.gui2.awt.AWTGUI
- All Implemented Interfaces:
- java.util.EventListener, GUIInterface, java.awt.event.KeyListener, XChangeListener
- Direct Known Subclasses:
- FTVGUI, SwingGUI
- public class AWTGUI
- extends java.lang.Object
- implements XChangeListener, java.awt.event.KeyListener, 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.
Tabs are also supported through GUITab and XTabbedPane classes.
This class is completely Swing-independent.
NOTE: SwingGUI extends this GUI, so that all changes here will be incorporated in both
versions
- Author:
- Mikko Honkala
|
Method Summary |
void |
action(java.lang.Object action)
|
protected void |
addMenuBar()
|
void |
browserReady()
|
protected void |
closeAllTabs()
|
protected void |
closeCurrentTab()
|
protected java.awt.Container |
createContainer()
|
protected FocusPointsProvider |
createContentFocusProvider()
|
protected FocusPointsProvider |
createFocusPointsProvider()
|
protected XMenu |
createGUIMenu()
|
protected GUITab |
createGUITab(XLink urli,
java.lang.String id,
boolean activate)
|
protected GUITab |
createGUITabInternal()
|
protected void |
createListeners()
|
protected XMenu |
createMediaMenu()
|
protected XMenuItem |
createMenuItem(java.lang.String name,
java.lang.String actionCommand)
|
void |
createMenus()
menus |
protected void |
createNewTab(java.net.URL url,
java.lang.String id,
boolean activate)
|
protected java.awt.Container |
createRootContainer()
|
protected XMenu |
createStylesheetMenu()
|
protected XMenu |
createZoomMenu()
|
void |
decorateGUI()
|
protected void |
disposeWindow()
|
Browser |
getBrowser()
|
BrowserWindow |
getBrowserWindow()
|
protected ComponentFactory |
getComponentFactory()
|
protected java.lang.String |
getComponentFactoryClassName()
|
protected GUITab |
getCurrentTab()
|
protected java.lang.String |
getGUIName()
|
protected GUITab |
getGUITabForComponent(java.awt.Component c)
|
java.awt.Container |
getRootContainer()
|
XTabbedPane |
getTabbedPane()
|
protected java.awt.Container |
getWindow()
|
protected void |
initFocusManager()
|
boolean |
isTabbed()
|
void |
keyPressed(java.awt.event.KeyEvent evt)
|
void |
keyReleased(java.awt.event.KeyEvent evt)
|
void |
keyTyped(java.awt.event.KeyEvent evt)
|
protected void |
listenForWindowClose(java.awt.Window w)
|
void |
newBrowserWindow(XLink urli,
java.lang.String id)
|
void |
openInNewTab(XLink l,
java.lang.String id)
|
void |
openInNewWindow(XLink l,
java.lang.String id)
|
protected void |
saveContent()
|
void |
setDefaultWindowSize()
subclasses can override this |
protected void |
setFullScreen(boolean fs)
|
void |
setID(java.lang.String i)
|
void |
setInitialURL(XLink url)
|
void |
setTitle(java.lang.String title2)
|
void |
setXMLConfigurer(XMLConfigurer c)
|
void |
show()
|
protected void |
showSource(int type,
java.lang.String addtitle)
|
protected void |
updateStylesheetMenu()
|
void |
valueChanged(boolean valueChanging,
java.lang.Object source)
ChangeListener method that notifies that the user has changed the value of the control. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
defaultSizeX
protected int defaultSizeX
defaultSizeY
protected int defaultSizeY
initialURL
public XLink initialURL
dialog
protected XSmilesDialog dialog
tabs
public java.util.Vector tabs
currentTab
public GUITab currentTab
gui_provider
public FocusPointsProvider gui_provider
content_provider
public FocusPointsProvider content_provider
focusManager
public XFocusManager focusManager
config
protected XMLConfigurer config
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
stopCommand
public static final java.lang.String stopCommand
- 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
stylesheetMenu
protected XMenu stylesheetMenu
rootContainer
protected java.awt.Container rootContainer
changeGUIMenu
public static final java.lang.String changeGUIMenu
- See Also:
- Constant Field Values
changeStyleMenu
public static final java.lang.String changeStyleMenu
- See Also:
- Constant Field Values
changeMediaMenu
public static final java.lang.String changeMediaMenu
- See Also:
- Constant Field Values
changeZoomMenu
public static final java.lang.String changeZoomMenu
- See Also:
- Constant Field Values
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
fileNewTabMenu
public static final java.lang.String fileNewTabMenu
- See Also:
- Constant Field Values
fileCloseTabMenu
public static final java.lang.String fileCloseTabMenu
- See Also:
- Constant Field Values
fileNewWindowMenu
public static final java.lang.String fileNewWindowMenu
- See Also:
- Constant Field Values
openFileMenu
public static final java.lang.String openFileMenu
- See Also:
- Constant Field Values
saveFileMenu
public static final java.lang.String saveFileMenu
- See Also:
- Constant Field Values
aboutHelpMenu
public static final java.lang.String aboutHelpMenu
- See Also:
- Constant Field Values
platformHelpMenu
public static final java.lang.String platformHelpMenu
- 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
viewXSLSourceMenu
public static final java.lang.String viewXSLSourceMenu
- See Also:
- Constant Field Values
viewSourceMenu
public static final java.lang.String viewSourceMenu
- See Also:
- Constant Field Values
viewTreeMenu
public static final java.lang.String viewTreeMenu
- 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
viewLogMenu
public static final java.lang.String viewLogMenu
- See Also:
- Constant Field Values
editBookmarksMenu
public static final java.lang.String editBookmarksMenu
- See Also:
- Constant Field Values
editWebsearchMenu
public static final java.lang.String editWebsearchMenu
- 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
searchURL
public static final java.lang.String searchURL
- See Also:
- Constant Field Values
zoomFactor
protected double zoomFactor
AWTGUI
public AWTGUI()
getCurrentTab
protected GUITab getCurrentTab()
getTabbedPane
public XTabbedPane getTabbedPane()
setXMLConfigurer
public void setXMLConfigurer(XMLConfigurer c)
- Specified by:
setXMLConfigurer in interface GUIInterface
createRootContainer
protected java.awt.Container createRootContainer()
listenForWindowClose
protected void listenForWindowClose(java.awt.Window w)
getComponentFactory
protected ComponentFactory getComponentFactory()
getBrowserWindow
public BrowserWindow getBrowserWindow()
closeCurrentTab
protected void closeCurrentTab()
disposeWindow
protected void disposeWindow()
closeAllTabs
protected void closeAllTabs()
getRootContainer
public java.awt.Container getRootContainer()
saveContent
protected void saveContent()
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
show
public void show()
- Specified by:
show in interface GUIInterface
setDefaultWindowSize
public void setDefaultWindowSize()
- subclasses can override this
decorateGUI
public void decorateGUI()
initFocusManager
protected void initFocusManager()
createFocusPointsProvider
protected FocusPointsProvider createFocusPointsProvider()
createContentFocusProvider
protected FocusPointsProvider createContentFocusProvider()
createGUITab
protected GUITab createGUITab(XLink urli,
java.lang.String id,
boolean activate)
createGUITabInternal
protected GUITab createGUITabInternal()
addMenuBar
protected void addMenuBar()
createMenus
public void createMenus()
- menus
createGUIMenu
protected XMenu createGUIMenu()
createStylesheetMenu
protected XMenu createStylesheetMenu()
createMediaMenu
protected XMenu createMediaMenu()
createZoomMenu
protected XMenu createZoomMenu()
createMenuItem
protected XMenuItem createMenuItem(java.lang.String name,
java.lang.String actionCommand)
createContainer
protected java.awt.Container createContainer()
setInitialURL
public void setInitialURL(XLink url)
- Specified by:
setInitialURL in interface GUIInterface
setID
public void setID(java.lang.String i)
getComponentFactoryClassName
protected java.lang.String getComponentFactoryClassName()
getGUIName
protected java.lang.String getGUIName()
getBrowser
public Browser getBrowser()
- Specified by:
getBrowser in interface GUIInterface
createListeners
protected void createListeners()
getWindow
protected java.awt.Container getWindow()
setFullScreen
protected void setFullScreen(boolean fs)
action
public void action(java.lang.Object action)
showSource
protected void showSource(int type,
java.lang.String addtitle)
newBrowserWindow
public void newBrowserWindow(XLink urli,
java.lang.String id)
openInNewTab
public void openInNewTab(XLink l,
java.lang.String id)
openInNewWindow
public void openInNewWindow(XLink l,
java.lang.String id)
createNewTab
protected void createNewTab(java.net.URL url,
java.lang.String id,
boolean activate)
updateStylesheetMenu
protected void updateStylesheetMenu()
valueChanged
public void valueChanged(boolean valueChanging,
java.lang.Object source)
- Description copied from interface:
XChangeListener
- ChangeListener method that notifies that the user has changed the value of the control.
- Specified by:
valueChanged in interface XChangeListener
getGUITabForComponent
protected GUITab getGUITabForComponent(java.awt.Component c)
setTitle
public void setTitle(java.lang.String title2)
- Parameters:
title2 -
isTabbed
public boolean isTabbed()
- Returns:
keyReleased
public void keyReleased(java.awt.event.KeyEvent evt)
- Specified by:
keyReleased in interface java.awt.event.KeyListener
keyTyped
public void keyTyped(java.awt.event.KeyEvent evt)
- Specified by:
keyTyped in interface java.awt.event.KeyListener
keyPressed
public void keyPressed(java.awt.event.KeyEvent evt)
- Specified by:
keyPressed in interface java.awt.event.KeyListener
browserReady
public void browserReady()
X-Smiles 1.2