fi.hut.tml.xsmiles
Interface BrowserWindow

All Known Implementing Classes:
Browser

public interface BrowserWindow

BrowserWindowInterface is the interface for the browser core. It contains all relevant methods for controlling the instance of the browser. (note: now, there is only one browser window, so the browser class extends this interface, but in the future when there will be more browser windows, the BrowserWindow class will implement this interface)

Author:
Juha

Method Summary
 void closeBrowser()
          Shutdown all browser instances.
 void closeBrowserWindow()
          Close this BrowserWindow
 XSmilesContentHandler createContentHandler(java.lang.String contentType, XLink link, java.awt.Container cArea, boolean primary)
          same as displayDocumentInContainer, but will not call prefetch and play, so it is up to the user to call these functions
 XSmilesContentHandler createContentHandler(XLink link, java.awt.Container cArea, boolean primary)
          same as displayDocumentInContainer, but will not call prefetch and play, so it is up to the user to call these functions
 XSmilesContentHandler createContentHandler(XLink link, java.awt.Container cArea, boolean primary, ContentLoaderListener listener)
          same as displayDocumentInContainer, but will not call prefetch and play, so it is up to the user to call these functions
 XSmilesContentHandler displayDocumentInContainer(XLink aLink, java.awt.Container aContainer)
          Causes an secondary XML document to be retrieved and parsed.
 XSmilesContentHandler displayDocumentInContainer(XLink aLink, java.awt.Container aContainer, ContentLoaderListener listener)
          Causes an secondary XML document to be retrieved and parsed.
 XMLConfigurer getBrowserConfigurer()
          The accessor method for the XMLConfigurer.
 BrowserLogic getBrowserLogic()
           
 BrowserWindow getBrowserWindow(java.lang.String id)
          ?@param id the ID of the browser to get
 ComponentFactory getComponentFactory()
           
 java.awt.Container getContentArea()
           
 ContentManager getContentManager()
           
 GUI getCurrentGUI()
          The accessor method for the GUI.
 XLink getCurrentPage()
           
 java.lang.String getDefaultGUIName()
           
 DocumentHistory getDocumentHistory()
          The accessor method for the DocumentHistory.
 double getDocumentLoadDuration()
           
 EventBroker getEventBroker()
           
 GUIManager getGUIManager()
           
 BrowserID getID()
           
 double getJavaVersion()
           
 Messaging getMessageHandler()
          Deprecated. I guess jms has been broken for quite a while?
 MLFCController getMLFCController()
          MLFCManager is a toolkit, for rendering XML documents, using the MLFCs that are registered in the configuration file.
 MLFCControls getMLFCControls()
           
 MLFCListener getMLFCListener()
           
 java.lang.String getPreferredStylesheetTitle()
           
 java.lang.String getResourceLocation()
           
 int getState()
          Returns the state of the browser.
 java.lang.String getVersion()
          Gets the version of the X-smiles browser.
 int getViewType()
          Deprecated. There is no need for viewtype anymore
 XMLDocument getXMLDocument()
          Gets the document that has recently been valid (shown)
 XMLParser getXMLParser()
          The accessor method for the XMLParser.
 XSLTEngine getXSLEngine()
          The accesor method for the XSLEngine .
 double getZoom()
          return the current zoom level
 void navigate(int command)
          Navigate back, forward, reload, change view, stop etc.
 void newBrowserWindow()
          Open a new BrowserWindow with a GUI, loading the browser homepage initially
 BrowserWindow newBrowserWindow(boolean displayGUI)
           
 void newBrowserWindow(java.lang.String url)
          With GUI and the initial URL url
 BrowserWindow newBrowserWindow(java.lang.String uri, boolean displayGUI)
           
 BrowserWindow newBrowserWindow(java.lang.String uri, java.lang.String id, boolean displayGUI)
           
 void newBrowserWindow(XLink uri)
           
 BrowserWindow newBrowserWindowWithGUI(java.lang.String uri, java.lang.String guiName, boolean loadInitialDoc)
           
 XSmilesConnection openConnection(XLink u)
           
 void openLocation(java.lang.String s)
           
 void openLocation(java.net.URL u)
           
 void openLocation(java.net.URL u, boolean save)
           
 void openLocation(XLink u, boolean save)
           
 void openLocation(XLink link, java.lang.String windowID)
          Open location in the window with the correct id.
 void openLog()
          Open the Log window, to output debug data
 void registerFocusPointProvider(FocusPointsProvider fpp)
           
 void setMLFCListener(MLFCListener l)
           
 void setPreferredStylesheetTitle(java.lang.String title)
           
 void setZoom(double zoom)
          set the current zoom level
 void showErrorDialog(java.lang.String headline, java.lang.String message)
           
 void showErrorDialog(java.lang.String heading, java.lang.String description, boolean popup)
           
 void showErrorDialog(java.lang.String heading, java.lang.String description, boolean popup, java.lang.Throwable t)
           
 void unRegisterFocusPointProvider(FocusPointsProvider fpp)
           
 void waitState(int state)
          Wait for the browser to achieve a certain state, ie.
 

Method Detail

newBrowserWindow

public void newBrowserWindow()
Open a new BrowserWindow with a GUI, loading the browser homepage initially


getID

public BrowserID getID()
Returns:
the BrowserID object of the browser.
See Also:
BrowserID

newBrowserWindow

public BrowserWindow newBrowserWindow(java.lang.String uri,
                                      java.lang.String id,
                                      boolean displayGUI)
Parameters:
displayGUI - Does the browser have a GUI
uri - Initial URI
id - The id of the new window
Returns:
a reference to the browser

newBrowserWindow

public BrowserWindow newBrowserWindow(java.lang.String uri,
                                      boolean displayGUI)
Parameters:
displayGUI - Does the browser have a GUI
uri - Initial URI
Returns:
a reference to the browser

newBrowserWindow

public void newBrowserWindow(XLink uri)
Parameters:
uri - Initial URI
Returns:
a reference to the browser

newBrowserWindowWithGUI

public BrowserWindow newBrowserWindowWithGUI(java.lang.String uri,
                                             java.lang.String guiName,
                                             boolean loadInitialDoc)
Parameters:
guiName - The name of the GUI to be used
uri - Initial URI
loadInitialDoc - Display initial page
Returns:
a reference to the browser

waitState

public void waitState(int state)
Wait for the browser to achieve a certain state, ie. wait for the browser to finish fetching the document by waiting BrowserLogic.READY. It helps the xframes to build the actual frames-layout before showing anything. There should be some other way to do it, though..

Parameters:
state - the state to wait for

newBrowserWindow

public BrowserWindow newBrowserWindow(boolean displayGUI)
Parameters:
displayGUI - Does the browser have a GUI
Returns:
a reference to the browser with initial page as the homepage

newBrowserWindow

public void newBrowserWindow(java.lang.String url)
With GUI and the initial URL url

Parameters:
url - intial url to load

closeBrowserWindow

public void closeBrowserWindow()
Close this BrowserWindow


closeBrowser

public void closeBrowser()
Shutdown all browser instances. (Exit browser)


getBrowserWindow

public BrowserWindow getBrowserWindow(java.lang.String id)
?@param id the ID of the browser to get

Returns:
the browser windows instance with the id

getMLFCListener

public MLFCListener getMLFCListener()
Returns:
the MLFC listener attached with this browserwindow instance

setMLFCListener

public void setMLFCListener(MLFCListener l)
Parameters:
l - Set the mlfclistener associated with this browserwindow

getEventBroker

public EventBroker getEventBroker()
Returns:
The EventBroker of the Browser

navigate

public void navigate(int command)
Navigate back, forward, reload, change view, stop etc.

Parameters:
command - See NavigationState for static variables associated with commands
See Also:
NavigationState

getXMLDocument

public XMLDocument getXMLDocument()
Gets the document that has recently been valid (shown)

Returns:
The recent valid document (previous document shown)

showErrorDialog

public void showErrorDialog(java.lang.String headline,
                            java.lang.String message)
Parameters:
headline - Display error page in browser with this headline, if no page can be rendered, a dialog is shown
message - And with this message.

openLog

public void openLog()
Open the Log window, to output debug data


getVersion

public java.lang.String getVersion()
Gets the version of the X-smiles browser.

Returns:
core's version

getViewType

public int getViewType()
Deprecated. There is no need for viewtype anymore

Returns:
The current viewtype.
See Also:
for valid viewtypes

getState

public int getState()
Returns the state of the browser.

Returns:
the current state of the browser
See Also:
BrowserLogic

getCurrentGUI

public GUI getCurrentGUI()
The accessor method for the GUI.

Returns:
a reference to the core's GUI component, null returned, if no GUI exists.
See Also:
GUI

getMLFCController

public MLFCController getMLFCController()
MLFCManager is a toolkit, for rendering XML documents, using the MLFCs that are registered in the configuration file.

Returns:
The MLFC Manager of browser
See Also:
MLFCManager

getMessageHandler

public Messaging getMessageHandler()
Deprecated. I guess jms has been broken for quite a while?

Returns:
The Java Messaging Handler

getDocumentHistory

public DocumentHistory getDocumentHistory()
The accessor method for the DocumentHistory.

Returns:
a reference to the system's DocumentHistory
See Also:
DocumentHistory

getBrowserConfigurer

public XMLConfigurer getBrowserConfigurer()
The accessor method for the XMLConfigurer.

Returns:
a reference to the system's configurer
See Also:
XMLConfigurer

getXMLParser

public XMLParser getXMLParser()
The accessor method for the XMLParser.

Returns:
a reference to the XMLParser Class
See Also:
XMLParser

getXSLEngine

public XSLTEngine getXSLEngine()
The accesor method for the XSLEngine .

Returns:
a reference to the XSLEngine class
See Also:
XSLEngine

displayDocumentInContainer

public XSmilesContentHandler displayDocumentInContainer(XLink aLink,
                                                        java.awt.Container aContainer)
Causes an secondary XML document to be retrieved and parsed. Creates a thread for this action. Creates the secondary MLFC thru MLFCManager

See Also:
XMLDocument

displayDocumentInContainer

public XSmilesContentHandler displayDocumentInContainer(XLink aLink,
                                                        java.awt.Container aContainer,
                                                        ContentLoaderListener listener)
Causes an secondary XML document to be retrieved and parsed. Creates a thread for this action. Creates the secondary MLFC thru MLFCManager

See Also:
XMLDocument

createContentHandler

public XSmilesContentHandler createContentHandler(XLink link,
                                                  java.awt.Container cArea,
                                                  boolean primary)
                                           throws java.lang.Exception
same as displayDocumentInContainer, but will not call prefetch and play, so it is up to the user to call these functions

Throws:
java.lang.Exception

createContentHandler

public XSmilesContentHandler createContentHandler(java.lang.String contentType,
                                                  XLink link,
                                                  java.awt.Container cArea,
                                                  boolean primary)
                                           throws java.lang.Exception
same as displayDocumentInContainer, but will not call prefetch and play, so it is up to the user to call these functions

Throws:
java.lang.Exception

createContentHandler

public XSmilesContentHandler createContentHandler(XLink link,
                                                  java.awt.Container cArea,
                                                  boolean primary,
                                                  ContentLoaderListener listener)
                                           throws java.lang.Exception
same as displayDocumentInContainer, but will not call prefetch and play, so it is up to the user to call these functions

Throws:
java.lang.Exception

getJavaVersion

public double getJavaVersion()
Returns:
Java version.

getGUIManager

public GUIManager getGUIManager()
Returns:
the GUIManager, null if no GUI for this browser instance
See Also:
GUIManager

getDefaultGUIName

public java.lang.String getDefaultGUIName()
Returns:
the default GUI name

getResourceLocation

public java.lang.String getResourceLocation()
Returns:
The resourceLocation of Browser

getBrowserLogic

public BrowserLogic getBrowserLogic()
Returns:
BrowserLogic, which controls the states of the Browser

getContentArea

public java.awt.Container getContentArea()
Returns:
the content area of the browser

getComponentFactory

public ComponentFactory getComponentFactory()
Returns:
a componentFactory for cross-device gui components

getMLFCControls

public MLFCControls getMLFCControls()

getContentManager

public ContentManager getContentManager()

openLocation

public void openLocation(XLink link,
                         java.lang.String windowID)
Open location in the window with the correct id. Otherwise open new window with default GUI


openLocation

public void openLocation(java.lang.String s)
Parameters:
s - Surf to the URI

openLocation

public void openLocation(java.net.URL u)
Parameters:
u - Surf to the URI

openLocation

public void openLocation(java.net.URL u,
                         boolean save)
Parameters:
u - Surf to the URI
save - Save in document history

openLocation

public void openLocation(XLink u,
                         boolean save)
Parameters:
u - Surf to the XLink
save - Save in document history

openConnection

public XSmilesConnection openConnection(XLink u)
                                 throws java.lang.Exception
Parameters:
u - open a new URLCOnnection to this XLink url
Throws:
java.lang.Exception

getCurrentPage

public XLink getCurrentPage()
Returns:
current page as a XLink

showErrorDialog

public void showErrorDialog(java.lang.String heading,
                            java.lang.String description,
                            boolean popup,
                            java.lang.Throwable t)

showErrorDialog

public void showErrorDialog(java.lang.String heading,
                            java.lang.String description,
                            boolean popup)

getDocumentLoadDuration

public double getDocumentLoadDuration()
Returns:
the duration of last page load in secs

setPreferredStylesheetTitle

public void setPreferredStylesheetTitle(java.lang.String title)
Parameters:
title - Sets the preferred stylesheet title.

getPreferredStylesheetTitle

public java.lang.String getPreferredStylesheetTitle()

getZoom

public double getZoom()
return the current zoom level


setZoom

public void setZoom(double zoom)
set the current zoom level


registerFocusPointProvider

public void registerFocusPointProvider(FocusPointsProvider fpp)

unRegisterFocusPointProvider

public void unRegisterFocusPointProvider(FocusPointsProvider fpp)


X-Smiles 1.2