|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfi.hut.tml.xsmiles.Browser
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
| 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 |
public static BrowserTable browserTable
public BrowserID browserID
public static final java.lang.String version
public static BrowserID rootBrowserID
protected boolean hasGUI
public static final short STATE_INITIALIZED
public static final short STATE_UNINITIALIZED
protected short initstate
protected GUIManager guiManager
protected EventBroker eventBroker
protected MLFCListener fMLFCListener
public static XMLParser xmlParser
protected static XSLTEngine xslEngine
protected DocumentHistory documentHistory
protected static XMLConfigurer browserConfigurer
protected ContentManager fContentManager
protected BrowserLogic state
protected ComponentFactory componentFactory
protected java.awt.Container contentArea
protected java.awt.Container controlsArea
protected XLink currentPage
protected java.lang.String lastTried
protected XMLDocument currentDocument
protected java.lang.String currentView
protected int viewType
protected java.lang.String preferredStylesheetTitle
public Messaging MessageHandler
public static boolean mappingsSet
public static final java.lang.String resourceLocation
protected int errorCount
protected static boolean firstLoad
public static java.lang.String componentFactoryClassName
protected long threadID
protected java.lang.Thread currentThread
| Constructor Detail |
public Browser()
public Browser(java.lang.String uri,
java.lang.String id,
boolean showGUI,
java.lang.String name)
showGUI - If no main GUI is to be shown, then showGUI=falseuri - the initial uri to loadid - the id of the new browsername - The title of the GUI constraints to use (see config.xml)
public Browser(XLink uri,
java.lang.String id,
boolean showGUI,
java.lang.String name)
public Browser(XLink uri,
java.lang.String id,
boolean showGUI,
java.lang.String name,
boolean loadInitialDoc)
public Browser(java.lang.String uri,
java.lang.String id)
uri - the initial uri to loadid - the id of the new browser
public Browser(XLink uri,
java.lang.String id)
uri - the initial uri to loadid - the id of the new browser
public Browser(java.lang.String uri,
java.lang.String id,
BrowserWindow parent)
uri - the initial uri to loadid - the id of the new browserparent - The parent BW
public Browser(java.lang.String uri,
java.lang.String title,
java.lang.String id,
BrowserWindow parent,
boolean show)
uri - Initial URI to loadtitle - The title of the GUI constraints (@see config.xml)id - The id for the browserparent - The parent of this browsershow - Show a gui or not (if no GUI is shown, functions more as a
gui Componentthis.getConentArea())| Method Detail |
public static java.net.URL getXResource(java.lang.String id)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static void setXMLConfigurerStatic(XMLConfigurer config)
public java.lang.String getResourceLocation()
getResourceLocation in interface BrowserWindow
public void initBrowser(XLink initialURL,
java.lang.String guiTitle,
java.lang.String id,
BrowserWindow parent,
boolean showGUI,
boolean loadInitialDoc)
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.protected java.awt.Container createContentArea()
public static void printParserVersions()
public java.lang.String getVersion()
getVersion in interface BrowserWindowpublic XMLDocument getXMLDocument()
getXMLDocument in interface BrowserWindowpublic Messaging getMessageHandler()
getMessageHandler in interface BrowserWindowpublic void openLog()
openLog in interface BrowserWindowpublic static void openStaticLog()
protected long enterFetcher()
protected void exitFetcher(long threadnumber)
public XSmilesContentHandler createContentHandler(XLink link,
java.awt.Container cArea,
boolean primary)
throws java.lang.Exception
createContentHandler in interface BrowserWindowjava.lang.Exception
public XSmilesContentHandler createContentHandler(XLink link,
java.awt.Container cArea,
boolean primary,
ContentLoaderListener list)
throws java.lang.Exception
createContentHandler in interface BrowserWindowjava.lang.Exception
public XSmilesContentHandler createContentHandler(java.lang.String contentType,
XLink link,
java.awt.Container cArea,
boolean primary)
throws java.io.IOException,
java.lang.Exception
createContentHandler in interface BrowserWindowcontentType - cArea -
java.io.IOException
java.lang.Exceptionpublic void waitState(int state)
BrowserWindow
waitState in interface BrowserWindowstate - the state to wait for
protected void fetchProcessAndForkDocument(XLink l,
boolean s,
boolean d)
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
public XSmilesContentHandler displayDocumentInContainer(XLink l,
java.awt.Container c)
displayDocumentInContainer in interface BrowserWindowl - XLink object containing the URL of the required documentc - the Container in which to display the secondary MLFCXMLDocument
public XSmilesContentHandler displayDocumentInContainer(XLink l,
java.awt.Container c,
ContentLoaderListener list)
displayDocumentInContainer in interface BrowserWindowl - XLink object containing the URL of the required documentc - the Container in which to display the secondary MLFClist - this listener can stop the loading of the contentXMLDocumentpublic int getState()
getState in interface BrowserWindowstate of the browserBrowserLogic
public void showErrorDialog(java.lang.String heading,
java.lang.String description)
showErrorDialog in interface BrowserWindowheading - The headingdescription - Description of the error.
public void showErrorDialog(java.lang.String heading,
java.lang.String description,
boolean popup)
showErrorDialog in interface BrowserWindowheading - a short cause for the error situationdescription - a more detailed description of the error
public void showErrorDialog(java.lang.String heading,
java.lang.String description,
boolean popup,
java.lang.Throwable exception)
showErrorDialog in interface BrowserWindowheading - a short cause for the error situationdescription - a more detailed description of the errorpublic MLFCController getMLFCController()
MLFCManager.
getMLFCController in interface BrowserWindowMLFCManagerMLFCManagerpublic ContentManager getContentManager()
ContentManager.
getContentManager in interface BrowserWindowContentManagerMLFCManagerpublic EventBroker getEventBroker()
EventBroker.
getEventBroker in interface BrowserWindowEventBrokerEventBrokerpublic GUIManager getGUIManager()
GUI.
getGUIManager in interface BrowserWindowGUIpublic GUI getCurrentGUI()
GUI.
getCurrentGUI in interface BrowserWindowGUIpublic java.awt.Container getContentArea()
getContentArea in interface BrowserWindowpublic java.awt.Container getControlsArea()
public ComponentFactory getComponentFactory()
getComponentFactory in interface BrowserWindowpublic MLFCControls getMLFCControls()
getMLFCControls in interface BrowserWindowpublic DocumentHistory getDocumentHistory()
DocumentHistory.
getDocumentHistory in interface BrowserWindowDocumentHistoryDocumentHistorypublic XMLConfigurer getBrowserConfigurer()
XMLConfigurer.
getBrowserConfigurer in interface BrowserWindowXMLConfigurerpublic XMLParser getXMLParser()
XMLParser.
getXMLParser in interface BrowserWindowXMLParserpublic XSLTEngine getXSLEngine()
XSLEngine .
getXSLEngine in interface BrowserWindowXSLEnginepublic void closeBrowser()
closeBrowser in interface BrowserWindowpublic 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.
navigate in interface BrowserWindowbrowserCommandEventNumber - Browser Command object associated with the GUIActionEventNavigationStatepublic void resetCurrenURI(XLink l)
resetCurrentURI has no effect, because documentHistory is
sacred, and it can not be modified, otherwise you will destroy the
future!
public void openLocation(java.lang.String s)
openLocation in interface BrowserWindows - Surf to the URIpublic void openLocation(java.net.URL u)
openLocation in interface BrowserWindowu - Surf to the URI
public void openLocation(java.net.URL u,
boolean save)
openLocation in interface BrowserWindowu - Surf to the URIsave - Save in document history
public void openLocation(XLink u,
boolean save)
openLocation in interface BrowserWindowu - Surf to the Xlinksave - Save in document history
public void openLocation(java.net.URL u,
boolean c,
boolean b)
u - The URLc - Save in historyb - Display in GUIpublic java.lang.String getCurrentView()
public int getViewType()
getViewType in interface BrowserWindowfor valid viewtypespublic double getJavaVersion()
getJavaVersion in interface BrowserWindowpublic XLink getCurrentPage()
getCurrentPage in interface BrowserWindowpublic BrowserLogic getBrowserLogic()
getBrowserLogic in interface BrowserWindowpublic void newBrowserWindow()
newBrowserWindow in interface BrowserWindowpublic BrowserWindow getBrowserWindow(java.lang.String id)
getBrowserWindow in interface BrowserWindow
public void openLocation(XLink url,
java.lang.String id)
BrowserWindow
openLocation in interface BrowserWindowurl - The URL to openid - The ID of the browser to open the url in. If BW with that id
is not found, a new one is spawnedpublic java.lang.String getDefaultGUIName()
getDefaultGUIName in interface BrowserWindow
public void newBrowserWindow(java.lang.String url,
java.lang.String id)
url - The initial uri to open in the brand new BWid - The id of the new BWpublic void newBrowserWindow(java.lang.String url)
BrowserWindow
newBrowserWindow in interface BrowserWindowurl - intial url to load
public BrowserWindow newBrowserWindow(java.lang.String uri,
java.lang.String id,
boolean displayGUI,
BrowserWindow parent)
The following target names are reserved and have special meanings.
displayGUI - Does the browser have a GUIuri - Initial URIid - of the guiparent - The parent for the new browserWindow
public BrowserWindow newBrowserWindow(java.lang.String uri,
java.lang.String id,
boolean displayGUI)
newBrowserWindow in interface BrowserWindowdisplayGUI - Does the browser have a GUIuri - Initial URIid - The id of the new window
public BrowserWindow newBrowserWindow(java.lang.String uri,
boolean displayGUI)
newBrowserWindow in interface BrowserWindowdisplayGUI - Does the browser have a GUIuri - Initial URI
public BrowserWindow newBrowserWindowWithGUI(java.lang.String uri,
java.lang.String guiName,
boolean loadInitialDoc)
newBrowserWindowWithGUI in interface BrowserWindowguiName - The name of the GUI to be useduri - Initial URIloadInitialDoc - Load the initial document
public void newBrowserWindow(XLink uri)
newBrowserWindow in interface BrowserWindowuri - Initial URI
public void setPreferredStylesheetTitle(java.lang.String title)
setPreferredStylesheetTitle in interface BrowserWindowtitle - Sets the preferred stylesheet title.public java.lang.String getPreferredStylesheetTitle()
getPreferredStylesheetTitle in interface BrowserWindowpublic BrowserWindow newBrowserWindow(boolean displayGUI)
newBrowserWindow in interface BrowserWindowdisplayGUI - Does the browser have a GUI
public void closeBrowserWindow()
BrowserWindow
closeBrowserWindow in interface BrowserWindowpublic BrowserID getID()
getID in interface BrowserWindowBrowserIDpublic static void setMLFCMappings()
public double getDocumentLoadDuration()
getDocumentLoadDuration in interface BrowserWindow
public XSmilesConnection openConnection(XLink link)
throws java.lang.Exception
openConnection in interface BrowserWindowlink - open a new URLCOnnection to this XLink url
java.lang.Exceptionpublic void checkButtons()
public MLFCListener getMLFCListener()
getMLFCListener in interface BrowserWindowpublic void setMLFCListener(MLFCListener l)
setMLFCListener in interface BrowserWindowl - Set the mlfclistener associated with this browserwindowpublic double getZoom()
getZoom in interface BrowserWindowpublic void setZoom(double zoom)
setZoom in interface BrowserWindowpublic void registerFocusPointProvider(FocusPointsProvider fpp)