fi.hut.tml.xsmiles
Class Browser

java.lang.Object
  extended byfi.hut.tml.xsmiles.Browser
All Implemented Interfaces:
BrowserWindow

public class Browser
extends java.lang.Object
implements BrowserWindow

Browser ties together all components, provides access to them and offers some general functionality such as error dialog and document retrieval. The Browser implements the BrowserWindow interface, which it is referred as from the rest of the browser. To integrate the Browser in your own project, just use the constructors. e.g. Browser b=new Browser

Author:
Jukka Heinonen, Mikko Honkala, Juha Vierinen

Field Summary
protected static XMLConfigurer browserConfigurer
           
 BrowserID browserID
           
static BrowserTable browserTable
           
protected  ComponentFactory componentFactory
           
static java.lang.String componentFactoryClassName
           
protected  java.awt.Container contentArea
           
protected  java.awt.Container controlsArea
           
protected  XMLDocument currentDocument
           
protected  XLink currentPage
           
protected  java.lang.Thread currentThread
           
protected  java.lang.String currentView
           
protected  DocumentHistory documentHistory
           
protected  int errorCount
           
protected  EventBroker eventBroker
           
protected  ContentManager fContentManager
          the content manager is used to register content handlers and to destroy them
protected static boolean firstLoad
           
protected  MLFCListener fMLFCListener
          the MLFCListener listens to events from the MLFC
protected  GUIManager guiManager
           
protected  boolean hasGUI
           
protected  short initstate
           
protected  java.lang.String lastTried
           
static boolean mappingsSet
           
 Messaging MessageHandler
           
protected  java.lang.String preferredStylesheetTitle
           
static java.lang.String resourceLocation
           
static BrowserID rootBrowserID
           
protected  BrowserLogic state
           
static short STATE_INITIALIZED
           
static short STATE_UNINITIALIZED
           
protected  long threadID
           
static java.lang.String version
           
protected  int viewType
           
static XMLParser xmlParser
           
protected static XSLTEngine xslEngine
           
 
Constructor Summary
Browser()
          Create the browser object, but do not initialize it
Browser(java.lang.String uri, java.lang.String id)
          Create a new browser with GUI, id and initial URI
Browser(java.lang.String uri, java.lang.String id, boolean showGUI, java.lang.String name)
          Create a browser instance, optionally with a GUI.
Browser(java.lang.String uri, java.lang.String id, BrowserWindow parent)
          Create a new browser with, id and initial URI, and default GUI
Browser(java.lang.String uri, java.lang.String title, java.lang.String id, BrowserWindow parent, boolean show)
          Expert constructor.
Browser(XLink uri, java.lang.String id)
          Create a new browser with GUI, id and initial URI
Browser(XLink uri, java.lang.String id, boolean showGUI, java.lang.String name)
           
Browser(XLink uri, java.lang.String id, boolean showGUI, java.lang.String name, boolean loadInitialDoc)
           
 
Method Summary
 void checkButtons()
          Enables and disables main browser window's Back and Forward buttons as necessary.
 void closeBrowser()
          The browser is shut down.
 void closeBrowserWindow()
          Close this BrowserWindow
protected  java.awt.Container createContentArea()
          we do not want swing dependency, so this method creates the content area by reflection
 XSmilesContentHandler createContentHandler(java.lang.String contentType, XLink link, java.awt.Container cArea, boolean primary)
          This method creates a contenthandler based on the contentType parameter, without reading the media type from the connection
 XSmilesContentHandler createContentHandler(XLink link, java.awt.Container cArea, boolean primary)
          This function is used both in primary and secondary MLFC loading SMIL uses this to have better control over media This method takes care of opening the HTTP connection and reading the media type
 XSmilesContentHandler createContentHandler(XLink link, java.awt.Container cArea, boolean primary, ContentLoaderListener list)
          This function is used both in primary and secondary MLFC loading SMIL uses this to have better control over media This method takes care of opening the HTTP connection and reading the media type
 XSmilesContentHandler displayDocumentInContainer(XLink l, java.awt.Container c)
          SECONDARY MLFC Causes an secondary XML document to be retrieved and parsed, and displayed in a container.
 XSmilesContentHandler displayDocumentInContainer(XLink l, java.awt.Container c, ContentLoaderListener list)
          SECONDARY MLFC Causes an secondary XML document to be retrieved and parsed, and displayed in a container.
protected  long enterFetcher()
          this method is called in the start of the fetcher thread to get a ticket number.
protected  void exitFetcher(long threadnumber)
          this method is called in the end of the fetcher.
protected  void fetchProcessAndForkDocument(XLink l, boolean s, boolean d)
          FETCH AND CREATE PRIMARY MLFCs
 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()
          The contentArea of the browser
 ContentManager getContentManager()
          The accessor method for the ContentManager.
 java.awt.Container getControlsArea()
          The MLFC Controls for the current document
 GUI getCurrentGUI()
          The accessor method for the GUI.
 XLink getCurrentPage()
           
 java.lang.String getCurrentView()
           
 java.lang.String getDefaultGUIName()
          which type of gui we should open when a new window is requested
 DocumentHistory getDocumentHistory()
          The accessor method for the DocumentHistory.
 double getDocumentLoadDuration()
           
 EventBroker getEventBroker()
          The accessor method for the EventBroker.
 GUIManager getGUIManager()
          Deprecated.  
 BrowserID getID()
           
 double getJavaVersion()
           
 Messaging getMessageHandler()
           
 MLFCController getMLFCController()
          The accessor method for the MLFCManager.
 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()
           
 XMLDocument getXMLDocument()
          Gets the primary document that is currently shown in the browser's main window.
 XMLParser getXMLParser()
          The accessor method for the XMLParser.
static java.net.URL getXResource(java.lang.String id)
           
 XSLTEngine getXSLEngine()
          The accesor method for the XSLEngine .
 double getZoom()
          return the current zoom level
 void initBrowser(XLink initialURL, java.lang.String guiTitle, java.lang.String id, BrowserWindow parent, boolean showGUI, boolean loadInitialDoc)
          The main init()^(TM) method of the browser.
 void navigate(int browserCommandEventNumber)
          Browser's reaction to the Browser Commands events.
 void newBrowserWindow()
          a new browser window created with default GUI
 BrowserWindow newBrowserWindow(boolean displayGUI)
          Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs
 void newBrowserWindow(java.lang.String url)
          With GUI and the initial URL url
 BrowserWindow newBrowserWindow(java.lang.String uri, boolean displayGUI)
          Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs
 void newBrowserWindow(java.lang.String url, java.lang.String id)
          Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs
 BrowserWindow newBrowserWindow(java.lang.String uri, java.lang.String id, boolean displayGUI)
          Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs
 BrowserWindow newBrowserWindow(java.lang.String uri, java.lang.String id, boolean displayGUI, BrowserWindow parent)
          Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs
 void newBrowserWindow(XLink uri)
          Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs
 BrowserWindow newBrowserWindowWithGUI(java.lang.String uri, java.lang.String guiName, boolean loadInitialDoc)
          Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs
 XSmilesConnection openConnection(XLink link)
           
 void openLocation(java.lang.String s)
           
 void openLocation(java.net.URL u)
           
 void openLocation(java.net.URL u, boolean save)
           
 void openLocation(java.net.URL u, boolean c, boolean b)
          Open URL
 void openLocation(XLink u, boolean save)
           
 void openLocation(XLink url, java.lang.String id)
          Open location in the window with the correct id.
 void openLog()
          Open the Log window, to output debug data
static void openStaticLog()
          Open the Log window, to output debug data, using static method.
static void printParserVersions()
           
 void registerFocusPointProvider(FocusPointsProvider fpp)
           
 void resetCurrenURI(XLink l)
          Reset current URI.
 void setMLFCListener(MLFCListener l)
           
static void setMLFCMappings()
          Sets the MLFC mappings
 void setPreferredStylesheetTitle(java.lang.String title)
           
static void setXMLConfigurerStatic(XMLConfigurer config)
           
 void setZoom(double zoom)
          set the current zoom level
 void showErrorDialog(java.lang.String heading, java.lang.String description)
          Show error page as an XSL-FO document.
 void showErrorDialog(java.lang.String heading, java.lang.String description, boolean popup)
          The general error dialog service.
 void showErrorDialog(java.lang.String heading, java.lang.String description, boolean popup, java.lang.Throwable exception)
          The general error dialog service.
 void unRegisterFocusPointProvider(FocusPointsProvider fpp)
           
 void waitState(int state)
          Wait for the browser to achieve a certain state, ie.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

browserTable

public static BrowserTable browserTable

browserID

public BrowserID browserID

version

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

rootBrowserID

public static BrowserID rootBrowserID

hasGUI

protected boolean hasGUI

STATE_INITIALIZED

public static final short STATE_INITIALIZED
See Also:
Constant Field Values

STATE_UNINITIALIZED

public static final short STATE_UNINITIALIZED
See Also:
Constant Field Values

initstate

protected short initstate

guiManager

protected GUIManager guiManager

eventBroker

protected EventBroker eventBroker

fMLFCListener

protected MLFCListener fMLFCListener
the MLFCListener listens to events from the MLFC


xmlParser

public static XMLParser xmlParser

xslEngine

protected static XSLTEngine xslEngine

documentHistory

protected DocumentHistory documentHistory

browserConfigurer

protected static XMLConfigurer browserConfigurer

fContentManager

protected ContentManager fContentManager
the content manager is used to register content handlers and to destroy them


state

protected BrowserLogic state

componentFactory

protected ComponentFactory componentFactory

contentArea

protected java.awt.Container contentArea

controlsArea

protected java.awt.Container controlsArea

currentPage

protected XLink currentPage

lastTried

protected java.lang.String lastTried

currentDocument

protected XMLDocument currentDocument

currentView

protected java.lang.String currentView

viewType

protected int viewType

preferredStylesheetTitle

protected java.lang.String preferredStylesheetTitle

MessageHandler

public Messaging MessageHandler

mappingsSet

public static boolean mappingsSet

resourceLocation

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

errorCount

protected int errorCount

firstLoad

protected static boolean firstLoad

componentFactoryClassName

public static java.lang.String componentFactoryClassName

threadID

protected long threadID

currentThread

protected java.lang.Thread currentThread
Constructor Detail

Browser

public Browser()
Create the browser object, but do not initialize it


Browser

public Browser(java.lang.String uri,
               java.lang.String id,
               boolean showGUI,
               java.lang.String name)
Create a browser instance, optionally with a GUI. If you do not use a GUI, you still have to supply the title of the GUI, so that content adaptation, such as CC/PP and Media Query will work. If name is left null, the default desktop constraints will apply.

Parameters:
showGUI - If no main GUI is to be shown, then showGUI=false
uri - the initial uri to load
id - the id of the new browser
name - The title of the GUI constraints to use (see config.xml)

Browser

public Browser(XLink uri,
               java.lang.String id,
               boolean showGUI,
               java.lang.String name)

Browser

public Browser(XLink uri,
               java.lang.String id,
               boolean showGUI,
               java.lang.String name,
               boolean loadInitialDoc)

Browser

public Browser(java.lang.String uri,
               java.lang.String id)
Create a new browser with GUI, id and initial URI

Parameters:
uri - the initial uri to load
id - the id of the new browser

Browser

public Browser(XLink uri,
               java.lang.String id)
Create a new browser with GUI, id and initial URI

Parameters:
uri - the initial uri to load
id - the id of the new browser

Browser

public Browser(java.lang.String uri,
               java.lang.String id,
               BrowserWindow parent)
Create a new browser with, id and initial URI, and default GUI

Parameters:
uri - the initial uri to load
id - the id of the new browser
parent - The parent BW

Browser

public Browser(java.lang.String uri,
               java.lang.String title,
               java.lang.String id,
               BrowserWindow parent,
               boolean show)
Expert constructor. All possible parameters.

Parameters:
uri - Initial URI to load
title - The title of the GUI constraints (@see config.xml)
id - The id for the browser
parent - The parent of this browser
show - Show a gui or not (if no GUI is shown, functions more as a gui Component
See Also:
this.getConentArea())
Method Detail

getXResource

public static java.net.URL getXResource(java.lang.String id)
                                 throws java.net.MalformedURLException
Returns:
url to a browser resource
Throws:
java.net.MalformedURLException

setXMLConfigurerStatic

public static void setXMLConfigurerStatic(XMLConfigurer config)

getResourceLocation

public java.lang.String getResourceLocation()
Specified by:
getResourceLocation in interface BrowserWindow
Returns:
resourceLocation for external MLFC loading...

initBrowser

public void initBrowser(XLink initialURL,
                        java.lang.String guiTitle,
                        java.lang.String id,
                        BrowserWindow parent,
                        boolean showGUI,
                        boolean loadInitialDoc)
The main init()^(TM) method of the browser. Should eat almost any parameters, and still not spit anything out. creates: configurer, ccpp extensions, parser and prosessor, ContentManager, eventBroker, documentHistory, initial GUI, messaging, and stuff.

Parameters:
initialURL - The initial URI to load, if null, then homepage loaded.
guiTitle - The title of the gui configuration (see config.xml config/gui/devices/*), if null, then desktop is used.
id - The id for this browser, is null, then "default-id" is used.
showGUI - Show the GUI or not, if null, then true.
parent - The parent BW, if null, then treated as a top level browser.

createContentArea

protected java.awt.Container createContentArea()
we do not want swing dependency, so this method creates the content area by reflection


printParserVersions

public static void printParserVersions()

getVersion

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

Specified by:
getVersion in interface BrowserWindow
Returns:
core's version

getXMLDocument

public XMLDocument getXMLDocument()
Gets the primary document that is currently shown in the browser's main window.

Specified by:
getXMLDocument in interface BrowserWindow
Returns:
The document that is currentyl shown. null, if problems have occured.

getMessageHandler

public Messaging getMessageHandler()
Specified by:
getMessageHandler in interface BrowserWindow
Returns:
Java Messaging Handler

openLog

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

Specified by:
openLog in interface BrowserWindow

openStaticLog

public static void openStaticLog()
Open the Log window, to output debug data, using static method.


enterFetcher

protected long enterFetcher()
this method is called in the start of the fetcher thread to get a ticket number. The ticket number is only valid if it is the same as last, otherwise the thread must terminate


exitFetcher

protected void exitFetcher(long threadnumber)
this method is called in the end of the fetcher. it currently does nothing


createContentHandler

public XSmilesContentHandler createContentHandler(XLink link,
                                                  java.awt.Container cArea,
                                                  boolean primary)
                                           throws java.lang.Exception
This function is used both in primary and secondary MLFC loading SMIL uses this to have better control over media This method takes care of opening the HTTP connection and reading the media type

Specified by:
createContentHandler in interface BrowserWindow
Throws:
java.lang.Exception

createContentHandler

public XSmilesContentHandler createContentHandler(XLink link,
                                                  java.awt.Container cArea,
                                                  boolean primary,
                                                  ContentLoaderListener list)
                                           throws java.lang.Exception
This function is used both in primary and secondary MLFC loading SMIL uses this to have better control over media This method takes care of opening the HTTP connection and reading the media type

Specified by:
createContentHandler in interface BrowserWindow
Throws:
java.lang.Exception

createContentHandler

public XSmilesContentHandler createContentHandler(java.lang.String contentType,
                                                  XLink link,
                                                  java.awt.Container cArea,
                                                  boolean primary)
                                           throws java.io.IOException,
                                                  java.lang.Exception
This method creates a contenthandler based on the contentType parameter, without reading the media type from the connection

Specified by:
createContentHandler in interface BrowserWindow
Parameters:
contentType -
cArea -
Returns:
Throws:
java.io.IOException
java.lang.Exception

waitState

public void waitState(int state)
Description copied from interface: BrowserWindow
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..

Specified by:
waitState in interface BrowserWindow
Parameters:
state - the state to wait for

fetchProcessAndForkDocument

protected void fetchProcessAndForkDocument(XLink l,
                                           boolean s,
                                           boolean d)
FETCH AND CREATE PRIMARY MLFCs

Parameters:
d - Display the URI in the GUI, i.e., show the URI in GUI combo-box. E.g., the error page wouldn't want to display the error page URI

displayDocumentInContainer

public XSmilesContentHandler displayDocumentInContainer(XLink l,
                                                        java.awt.Container c)
SECONDARY MLFC Causes an secondary XML document to be retrieved and parsed, and displayed in a container. A thread is created for this action. Creates the secondary MLFC thru MLFCManager

Specified by:
displayDocumentInContainer in interface BrowserWindow
Parameters:
l - XLink object containing the URL of the required document
c - the Container in which to display the secondary MLFC
See Also:
XMLDocument

displayDocumentInContainer

public XSmilesContentHandler displayDocumentInContainer(XLink l,
                                                        java.awt.Container c,
                                                        ContentLoaderListener list)
SECONDARY MLFC Causes an secondary XML document to be retrieved and parsed, and displayed in a container. A thread is created for this action. Creates the secondary MLFC thru MLFCManager

Specified by:
displayDocumentInContainer in interface BrowserWindow
Parameters:
l - XLink object containing the URL of the required document
c - the Container in which to display the secondary MLFC
list - this listener can stop the loading of the content
See Also:
XMLDocument

getState

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

Specified by:
getState in interface BrowserWindow
Returns:
the current state of the browser
See Also:
BrowserLogic

showErrorDialog

public void showErrorDialog(java.lang.String heading,
                            java.lang.String description)
Show error page as an XSL-FO document.

Specified by:
showErrorDialog in interface BrowserWindow
Parameters:
heading - The heading
description - Description of the error.

showErrorDialog

public void showErrorDialog(java.lang.String heading,
                            java.lang.String description,
                            boolean popup)
The general error dialog service. This is forwarded to the GUI, so GUI should not call this. Causes an error dialog to be shown. The dialog has only one button, OK. When pressed, closes the dialog.

Specified by:
showErrorDialog in interface BrowserWindow
Parameters:
heading - a short cause for the error situation
description - a more detailed description of the error

showErrorDialog

public void showErrorDialog(java.lang.String heading,
                            java.lang.String description,
                            boolean popup,
                            java.lang.Throwable exception)
The general error dialog service. This is forwarded to the GUI, so GUI should not call this. Causes an error dialog to be shown. The dialog has only one button, OK. When pressed, closes the dialog.

Specified by:
showErrorDialog in interface BrowserWindow
Parameters:
heading - a short cause for the error situation
description - a more detailed description of the error

getMLFCController

public MLFCController getMLFCController()
The accessor method for the MLFCManager.

Specified by:
getMLFCController in interface BrowserWindow
Returns:
a reference to the system's MLFCManager
See Also:
MLFCManager

getContentManager

public ContentManager getContentManager()
The accessor method for the ContentManager.

Specified by:
getContentManager in interface BrowserWindow
Returns:
a reference to the system's ContentManager
See Also:
MLFCManager

getEventBroker

public EventBroker getEventBroker()
The accessor method for the EventBroker.

Specified by:
getEventBroker in interface BrowserWindow
Returns:
a reference to the system's EventBroker
See Also:
EventBroker

getGUIManager

public GUIManager getGUIManager()
Deprecated.  

The accessor method for the GUI.

Specified by:
getGUIManager in interface BrowserWindow
Returns:
a reference to the core's GUI component
See Also:
GUI

getCurrentGUI

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

Specified by:
getCurrentGUI in interface BrowserWindow
Returns:
a reference to the core's GUI component
See Also:
GUI

getContentArea

public java.awt.Container getContentArea()
The contentArea of the browser

Specified by:
getContentArea in interface BrowserWindow
Returns:
the content area of the browser

getControlsArea

public java.awt.Container getControlsArea()
The MLFC Controls for the current document


getComponentFactory

public ComponentFactory getComponentFactory()
Specified by:
getComponentFactory in interface BrowserWindow
Returns:
a componentFactory for cross-device gui components

getMLFCControls

public MLFCControls getMLFCControls()
Specified by:
getMLFCControls in interface BrowserWindow

getDocumentHistory

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

Specified by:
getDocumentHistory in interface BrowserWindow
Returns:
a reference to the system's DocumentHistory
See Also:
DocumentHistory

getBrowserConfigurer

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

Specified by:
getBrowserConfigurer in interface BrowserWindow
Returns:
a reference to the system's configurer
See Also:
XMLConfigurer

getXMLParser

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

Specified by:
getXMLParser in interface BrowserWindow
Returns:
a reference to the XMLParser Class
See Also:
XMLParser

getXSLEngine

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

Specified by:
getXSLEngine in interface BrowserWindow
Returns:
a reference to the XSLEngine class
See Also:
XSLEngine

closeBrowser

public void closeBrowser()
The browser is shut down.

Specified by:
closeBrowser in interface BrowserWindow

navigate

public void navigate(int browserCommandEventNumber)
Browser's reaction to the Browser Commands events. This method is called when the toolbar buttons are pressed or equivalent menu items are selected.

Specified by:
navigate in interface BrowserWindow
Parameters:
browserCommandEventNumber - Browser Command object associated with the GUIActionEvent
See Also:
NavigationState

resetCurrenURI

public void resetCurrenURI(XLink l)
Reset current URI. This is a way for external modules to control the appeareance of the URI after it has been set in document history, after loading the document. If a page has been loaded as a result of back or forwards command, then resetCurrentURI has no effect, because documentHistory is sacred, and it can not be modified, otherwise you will destroy the future!


openLocation

public void openLocation(java.lang.String s)
Specified by:
openLocation in interface BrowserWindow
Parameters:
s - Surf to the URI

openLocation

public void openLocation(java.net.URL u)
Specified by:
openLocation in interface BrowserWindow
Parameters:
u - Surf to the URI

openLocation

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

openLocation

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

openLocation

public void openLocation(java.net.URL u,
                         boolean c,
                         boolean b)
Open URL

Parameters:
u - The URL
c - Save in history
b - Display in GUI

getCurrentView

public java.lang.String getCurrentView()
Returns:
String containing description of the current View.

getViewType

public int getViewType()
Specified by:
getViewType in interface BrowserWindow
Returns:
The current viewtype
See Also:
for valid viewtypes

getJavaVersion

public double getJavaVersion()
Specified by:
getJavaVersion in interface BrowserWindow
Returns:
Java version.

getCurrentPage

public XLink getCurrentPage()
Specified by:
getCurrentPage in interface BrowserWindow
Returns:
current page as a XLink

getBrowserLogic

public BrowserLogic getBrowserLogic()
Specified by:
getBrowserLogic in interface BrowserWindow
Returns:
BrowserLogic, which controls the states of the Browser

newBrowserWindow

public void newBrowserWindow()
a new browser window created with default GUI

Specified by:
newBrowserWindow in interface BrowserWindow

getBrowserWindow

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

Specified by:
getBrowserWindow in interface BrowserWindow
Returns:
the browser windows instance with the id, which resides closest in the browserWindow datastructure. If nothing found, then return null.

openLocation

public void openLocation(XLink url,
                         java.lang.String id)
Description copied from interface: BrowserWindow
Open location in the window with the correct id. Otherwise open new window with default GUI

Specified by:
openLocation in interface BrowserWindow
Parameters:
url - The URL to open
id - The ID of the browser to open the url in. If BW with that id is not found, a new one is spawned

getDefaultGUIName

public java.lang.String getDefaultGUIName()
which type of gui we should open when a new window is requested

Specified by:
getDefaultGUIName in interface BrowserWindow
Returns:
the default GUI name

newBrowserWindow

public void newBrowserWindow(java.lang.String url,
                             java.lang.String id)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Create a new top level browser, without parent.

Parameters:
url - The initial uri to open in the brand new BW
id - The id of the new BW

newBrowserWindow

public void newBrowserWindow(java.lang.String url)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Description copied from interface: BrowserWindow
With GUI and the initial URL url

Specified by:
newBrowserWindow in interface BrowserWindow
Parameters:
url - intial url to load

newBrowserWindow

public BrowserWindow newBrowserWindow(java.lang.String uri,
                                      java.lang.String id,
                                      boolean displayGUI,
                                      BrowserWindow parent)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Creates a new window. The id can be anything but the reserved words, for targets:

The following target names are reserved and have special meanings.

_blank
The user agent should load the designated document in a new, unnamed window.
_self
The user agent should load the document in the same frame as the element that refers to this target.
_parent
The user agent should load the document into the immediate FRAMESET parent of the current frame. This value is equivalent to _self if the current frame has no parent.
_top
The user agent should load the document into the full, original window (thus canceling all other frames). This value is equivalent to _self if the current frame has no parent.

Parameters:
displayGUI - Does the browser have a GUI
uri - Initial URI
id - of the gui
parent - The parent for the new browserWindow
Returns:
a reference to the browser

newBrowserWindow

public BrowserWindow newBrowserWindow(java.lang.String uri,
                                      java.lang.String id,
                                      boolean displayGUI)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Specified by:
newBrowserWindow in interface BrowserWindow
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)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Specified by:
newBrowserWindow in interface BrowserWindow
Parameters:
displayGUI - Does the browser have a GUI
uri - Initial URI
Returns:
a reference to the browser NOTE! this will launch the old gui system

newBrowserWindowWithGUI

public BrowserWindow newBrowserWindowWithGUI(java.lang.String uri,
                                             java.lang.String guiName,
                                             boolean loadInitialDoc)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Specified by:
newBrowserWindowWithGUI in interface BrowserWindow
Parameters:
guiName - The name of the GUI to be used
uri - Initial URI
loadInitialDoc - Load the initial document
Returns:
a reference to the browser

newBrowserWindow

public void newBrowserWindow(XLink uri)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Specified by:
newBrowserWindow in interface BrowserWindow
Parameters:
uri - Initial URI
Returns:
a reference to the browser

setPreferredStylesheetTitle

public void setPreferredStylesheetTitle(java.lang.String title)
Specified by:
setPreferredStylesheetTitle in interface BrowserWindow
Parameters:
title - Sets the preferred stylesheet title.

getPreferredStylesheetTitle

public java.lang.String getPreferredStylesheetTitle()
Specified by:
getPreferredStylesheetTitle in interface BrowserWindow
Returns:
the preferred stylesheet title, chosen by the user

newBrowserWindow

public BrowserWindow newBrowserWindow(boolean displayGUI)
Deprecated. In the new gui system, use MLFCListeners events to open new windows and tabs

Specified by:
newBrowserWindow in interface BrowserWindow
Parameters:
displayGUI - Does the browser have a GUI
Returns:
a reference to the browser with initial page as the homepage

closeBrowserWindow

public void closeBrowserWindow()
Description copied from interface: BrowserWindow
Close this BrowserWindow

Specified by:
closeBrowserWindow in interface BrowserWindow

getID

public BrowserID getID()
Specified by:
getID in interface BrowserWindow
Returns:
the BrowserID object of the browser.
See Also:
BrowserID

setMLFCMappings

public static void setMLFCMappings()
Sets the MLFC mappings


getDocumentLoadDuration

public double getDocumentLoadDuration()
Specified by:
getDocumentLoadDuration in interface BrowserWindow
Returns:
the duration of last page load in secs

openConnection

public XSmilesConnection openConnection(XLink link)
                                 throws java.lang.Exception
Specified by:
openConnection in interface BrowserWindow
Parameters:
link - open a new URLCOnnection to this XLink url
Throws:
java.lang.Exception

checkButtons

public void checkButtons()
Enables and disables main browser window's Back and Forward buttons as necessary. This method can be called to prevent incorrect access of the document history.


getMLFCListener

public MLFCListener getMLFCListener()
Specified by:
getMLFCListener in interface BrowserWindow
Returns:
the MLFC listener attached with this browserwindow instance

setMLFCListener

public void setMLFCListener(MLFCListener l)
Specified by:
setMLFCListener in interface BrowserWindow
Parameters:
l - Set the mlfclistener associated with this browserwindow

getZoom

public double getZoom()
return the current zoom level

Specified by:
getZoom in interface BrowserWindow

setZoom

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

Specified by:
setZoom in interface BrowserWindow

registerFocusPointProvider

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

unRegisterFocusPointProvider

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


X-Smiles 1.2