fi.hut.tml.xsmiles
Class BrowserMLFCListener

java.lang.Object
  extended byfi.hut.tml.xsmiles.BrowserMLFCListener
All Implemented Interfaces:
MLFCListener

public class BrowserMLFCListener
extends java.lang.Object
implements MLFCListener

A Realization of the MLFCListener interface which ties MLFCs to the Browser.


Field Summary
protected  BrowserSubscriber browserSubscriber
           
protected  BrowserWindow fBrowser
           
 
Constructor Summary
BrowserMLFCListener(BrowserWindow browser)
           
 
Method Summary
 void closeView()
          When MLFC stops, it closes a View from Wesahmi system.
 XSmilesContentHandler createContentHandler(java.lang.String contentType, XLink link, java.awt.Container cArea, boolean primary)
          Uses the specified contentType, ie.
 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 displayDocumentInContainer(XLink l, java.awt.Container c)
          Render embedded document in container provided.
 ComponentFactory getComponentFactory()
           
 java.awt.Container getContentArea()
           
 java.lang.String getGUIProperty(java.lang.String prop)
           
 boolean getIsTabbedGUI()
           
 double getJavaVersion()
           
 MLFCControls getMLFCControls()
           
 java.lang.String getProperty(java.lang.String prop)
          ?@param prop XPath to property
 BrowserSubscriber getSubscriber()
           
 double getZoom()
          get the current zoom level
 boolean isNamespaceSupported(java.lang.String namespace)
          Checks if there is a MLFC available for the given namespace URI.
 void navigate(int command)
          Navigate back, forward, reload, change view, stop etc.
 void openInNewTab(XLink l, java.lang.String id)
          opens link in new tab
 void openLocation(java.lang.String s)
           
 void openLocation(java.net.URL l)
          Open URL in browser
 void openLocationTop(java.lang.String url)
          open in new browserwindow
 void openLocationTop(XLink link, java.lang.String id)
          open in new browserwindow
 void openURLFromExternalProgram(BrowserSubscriber browserSubscriber, java.lang.String url, java.lang.String id)
          Opens link from external program with id.
 void openURLFromExternalProgram(java.lang.String url)
          Opens link from external program.
 void openURLFromExternalProgram(java.lang.String url, java.lang.String id)
          Opens link from external program with id.
 void reloadCurrentPage()
           
 void setBrowserState(int i)
          If stand-alone.
 void setStatusText(java.lang.String status)
           
 void setSubscriber(BrowserSubscriber s)
           
 void setTitle(java.lang.String title)
           
 void showErrorDialog(java.lang.String title, java.lang.String message)
          Show an error.
 void showLinkPopup(java.net.URL url, XMLDocument doc, java.awt.event.MouseEvent e)
          open a link popup
 void showSource(XMLDocument doc, int mode, java.lang.String heading)
          The modes are from XSmilesView class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fBrowser

protected BrowserWindow fBrowser

browserSubscriber

protected BrowserSubscriber browserSubscriber
Constructor Detail

BrowserMLFCListener

public BrowserMLFCListener(BrowserWindow browser)
Method Detail

setTitle

public void setTitle(java.lang.String title)
Specified by:
setTitle in interface MLFCListener
Parameters:
title - Set the title of the current GUI to title.

openLocationTop

public void openLocationTop(java.lang.String url)
open in new browserwindow

Specified by:
openLocationTop in interface MLFCListener
Parameters:
url -

openLocationTop

public void openLocationTop(XLink link,
                            java.lang.String id)
open in new browserwindow

Specified by:
openLocationTop in interface MLFCListener
Parameters:
link -
id - id of the window to open url in

getZoom

public double getZoom()
get the current zoom level

Specified by:
getZoom in interface MLFCListener

openInNewTab

public void openInNewTab(XLink l,
                         java.lang.String id)
opens link in new tab

Specified by:
openInNewTab in interface MLFCListener

getIsTabbedGUI

public boolean getIsTabbedGUI()
Specified by:
getIsTabbedGUI in interface MLFCListener
Returns:
true if GUI can open new tabs

openLocation

public void openLocation(java.net.URL l)
Open URL in browser

Specified by:
openLocation in interface MLFCListener
Parameters:
l - Open document l, in browser.

openLocation

public void openLocation(java.lang.String s)
Specified by:
openLocation in interface MLFCListener
Parameters:
s - Open document with the URL string s

getProperty

public java.lang.String getProperty(java.lang.String prop)
Description copied from interface: MLFCListener
?@param prop XPath to property

Specified by:
getProperty in interface MLFCListener
Parameters:
prop - Parameter in XPath e.g. (main/parser)
Returns:
configuration property from browser's configurator.
See Also:
for different properties. An example could be of a property could be "gui/screensize".

getGUIProperty

public java.lang.String getGUIProperty(java.lang.String prop)
Specified by:
getGUIProperty in interface MLFCListener
Parameters:
prop - A GUI property requested.
Returns:
the value
See Also:
XMLConfigurator

displayDocumentInContainer

public XSmilesContentHandler displayDocumentInContainer(XLink l,
                                                        java.awt.Container c)
Description copied from interface: MLFCListener
Render embedded document in container provided. This can be used to embed XML documents in each other.

Specified by:
displayDocumentInContainer in interface MLFCListener
Parameters:
l - Display the document pointed to with link in
c - Container supplied.

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

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

createContentHandler

public XSmilesContentHandler createContentHandler(java.lang.String contentType,
                                                  XLink link,
                                                  java.awt.Container cArea,
                                                  boolean primary)
                                           throws java.lang.Exception
Description copied from interface: MLFCListener
Uses the specified contentType, ie. doesn't try to read it from the HTTP-connection

Specified by:
createContentHandler in interface MLFCListener
Parameters:
contentType -
link -
cArea -
primary -
Returns:
Throws:
java.lang.Exception

showErrorDialog

public void showErrorDialog(java.lang.String title,
                            java.lang.String message)
Description copied from interface: MLFCListener
Show an error. This will stop the MLFC, and show a error page.

Specified by:
showErrorDialog in interface MLFCListener

setStatusText

public void setStatusText(java.lang.String status)
Specified by:
setStatusText in interface MLFCListener
Parameters:
status - The status of the MLFC in string form

setBrowserState

public void setBrowserState(int i)
If stand-alone. Then this is ir-relevant.

Specified by:
setBrowserState in interface MLFCListener
See Also:
enumeration for valid states.

getComponentFactory

public ComponentFactory getComponentFactory()
Specified by:
getComponentFactory in interface MLFCListener
Returns:
the componentFactory

getJavaVersion

public double getJavaVersion()
Specified by:
getJavaVersion in interface MLFCListener
Returns:
Java version. Because some Javas, such as kaffe have problems with giving the correct Java version.
See Also:
for details

getContentArea

public java.awt.Container getContentArea()
Specified by:
getContentArea in interface MLFCListener
Returns:
the content area of the browser

navigate

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

Specified by:
navigate in interface MLFCListener
Parameters:
command - See NavigationState for static variables associated with commands
See Also:
NavigationState

isNamespaceSupported

public boolean isNamespaceSupported(java.lang.String namespace)
Checks if there is a MLFC available for the given namespace URI.

Specified by:
isNamespaceSupported in interface MLFCListener
Parameters:
namespace - URI for the namespace.
Returns:
true if namespace has an MLFC.

showSource

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

Specified by:
showSource in interface MLFCListener

showLinkPopup

public void showLinkPopup(java.net.URL url,
                          XMLDocument doc,
                          java.awt.event.MouseEvent e)
open a link popup

Specified by:
showLinkPopup in interface MLFCListener

getMLFCControls

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

openURLFromExternalProgram

public void openURLFromExternalProgram(java.lang.String url)
Description copied from interface: MLFCListener
Opens link from external program. The target is defined in configuration.

Specified by:
openURLFromExternalProgram in interface MLFCListener

openURLFromExternalProgram

public void openURLFromExternalProgram(java.lang.String url,
                                       java.lang.String id)
Description copied from interface: MLFCListener
Opens link from external program with id. The target is defined in configuration.

Specified by:
openURLFromExternalProgram in interface MLFCListener

reloadCurrentPage

public void reloadCurrentPage()
Specified by:
reloadCurrentPage in interface MLFCListener

openURLFromExternalProgram

public void openURLFromExternalProgram(BrowserSubscriber browserSubscriber,
                                       java.lang.String url,
                                       java.lang.String id)
Description copied from interface: MLFCListener
Opens link from external program with id. The target is defined in configuration.

Specified by:
openURLFromExternalProgram in interface MLFCListener

closeView

public void closeView()
Description copied from interface: MLFCListener
When MLFC stops, it closes a View from Wesahmi system.

Specified by:
closeView in interface MLFCListener

setSubscriber

public void setSubscriber(BrowserSubscriber s)
Specified by:
setSubscriber in interface MLFCListener

getSubscriber

public BrowserSubscriber getSubscriber()
Specified by:
getSubscriber in interface MLFCListener


X-Smiles 1.2