fi.hut.tml.xsmiles.mlfc
Class MLFC

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.MLFC
All Implemented Interfaces:
ResourceFetcher
Direct Known Subclasses:
AAMLFC, COMMLFC, CommMLFC, CoreMLFC, DRMLFC, EncryptionMLFC, EventsMLFC, GPSMLFC, IOMLFC, JAXMLFC, SignatureMLFC, SIPMLFC, SMILMLFC, SourceMLFC, X3DMLFC, XBLMLFC, XFormsMLFC, XMLCSSMLFC, XSLFOMLFC

public abstract class MLFC
extends java.lang.Object
implements ResourceFetcher

ALL MLFCs derive this abstract base class. Class provides default functionality for generic MLFC functionalities. The MLFCs can easily be used as beans. They are controlled with MLFCController. The MLFCListener interface defines services, that are needed by MLFCs. Use the MLFC interface, if your MLFC is not tightly coupled to the browser. If you need to use the BrowserWindow class in your MLFC, you should use the extend the CoreMLFC class. Only use the BrowserWindow, if you do not intend to reuse the MLFC in some other project.

Version:
$Revision: 5651 $
Author:
Aki Teppo, Juha
See Also:
CoreMLFC

Field Summary
protected  XSmilesContentHandler contentHandler
           
protected  boolean controlsShown
           
protected  java.lang.String title
           
 
Constructor Summary
MLFC()
           
 
Method Summary
 void commitUpdateTransaction()
          Informs the container that it is free to repaint itself, and should do it right now.
 org.w3c.dom.Attr createAttributeNS(org.apache.xerces.dom.DocumentImpl doc, java.lang.String namespaceURI, java.lang.String qualifiedName)
          Create a DOM attribute.
 org.w3c.dom.Element createElementNS(org.apache.xerces.dom.DocumentImpl doc, java.lang.String URI, java.lang.String tagname)
           
 XSmilesConnection get(java.net.URL dest, short type)
          Retrieve a resource via an URL using authenticated HTTP get and store it as a resource under this contenthandler.
 java.awt.Container getContainer()
           
 XSmilesContentHandler getContentHandler()
           
 java.lang.String getLocalname(java.lang.String tagname)
          Get local name of a node.
 MLFCController getMLFCController()
           
 MLFCListener getMLFCListener()
          All traffic to the browser, such as openLocation, etc goes through this listener.
 java.util.Hashtable getMLFCParameters()
          parameters are set BEFORE initialization of the elements
 ResourceReferencer getResourceReferencer()
           
 java.lang.String getTitle()
           
 java.lang.String getVersion()
          Get the version of the MLFC.
 XMLDocument getXMLDocument()
           
 void init()
          Initialize the MLFC.
 void initMLFC(XMLDocument a_doc, java.awt.Container cont)
          Displays document in the MLFC area of the GUI window.
 boolean isHost()
           
 boolean isPrimary()
           
 void pause()
          Pauses or unpauses the MLFC.
 void rollbackUpdateTransaction()
          Informs the container that it is free to repaint itself, but it shouldn't do it now.
 void setContainer(java.awt.Container c)
           
 void setContentHandler(XSmilesContentHandler h)
           
 void setHost(boolean flag)
           
 void setMLFCListener(MLFCListener l)
          All traffic to the browser, such as openLocation, etc goes through this listener.
 void setMLFCParameters(java.util.Hashtable p)
          parameters are set BEFORE initialization of the elements
 void setTitle(java.lang.String t)
           
 void setXMLDocument(XMLDocument doc)
           
 void setZoom(double zoom)
          notify that the zoom level has changed.
abstract  void start()
          Start the MLFC.
 void startMLFC(XMLDocument a_doc, java.awt.Container cont)
          Displays document in the MLFC area of the GUI window.
 void startUpdateTransaction()
          Informs the container that there is going to be a lot of concurrent updates to the document and the container shouldn't repaint itself until commit is called.
abstract  void stop()
          Stop the MLFC.
 void stopMLFC()
          Displays document in the MLFC area of the GUI window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlsShown

protected boolean controlsShown

contentHandler

protected XSmilesContentHandler contentHandler

title

protected java.lang.String title
Constructor Detail

MLFC

public MLFC()
Method Detail

init

public void init()
Initialize the MLFC. This function is called just before the elements are initialized. There is no pair to this method.


start

public abstract void start()
Start the MLFC. This function is the pair to stop().


pause

public void pause()
Pauses or unpauses the MLFC. Implementated if needed


stop

public abstract void stop()
Stop the MLFC. This function is the pair to start().


createElementNS

public org.w3c.dom.Element createElementNS(org.apache.xerces.dom.DocumentImpl doc,
                                           java.lang.String URI,
                                           java.lang.String tagname)

createAttributeNS

public org.w3c.dom.Attr createAttributeNS(org.apache.xerces.dom.DocumentImpl doc,
                                          java.lang.String namespaceURI,
                                          java.lang.String qualifiedName)
                                   throws org.w3c.dom.DOMException
Create a DOM attribute.

Throws:
org.w3c.dom.DOMException

getMLFCController

public MLFCController getMLFCController()
Returns:
The mlfcController object for this MLFC. Null returned, if no mlfcController defined in MLFC.
See Also:
MLFCController

getVersion

public java.lang.String getVersion()
Get the version of the MLFC. This should be overridden in the real MLFC with the real version number. Version number is the Browser version number this MLFC was compiled with and can be run with. See the existing MLFCs how to implement getVersion() so that it automatically updates the version number.

Returns:
MLFC version number.

initMLFC

public final void initMLFC(XMLDocument a_doc,
                           java.awt.Container cont)
Displays document in the MLFC area of the GUI window.


startMLFC

public final void startMLFC(XMLDocument a_doc,
                            java.awt.Container cont)
Displays document in the MLFC area of the GUI window.


stopMLFC

public final void stopMLFC()
Displays document in the MLFC area of the GUI window.


setMLFCListener

public final void setMLFCListener(MLFCListener l)
All traffic to the browser, such as openLocation, etc goes through this listener. If no listener supplied MLFCs should still function with some basic level.

Parameters:
l - The MLFCListener supplied by the browser
See Also:
MLFCListener

setContentHandler

public final void setContentHandler(XSmilesContentHandler h)

getContentHandler

public final XSmilesContentHandler getContentHandler()

getResourceReferencer

public final ResourceReferencer getResourceReferencer()

getMLFCListener

public final MLFCListener getMLFCListener()
All traffic to the browser, such as openLocation, etc goes through this listener. If no listener supplied MLFCs should still function with some basic level.

Returns:
The MLFCListener stored in the MLFC

get

public final XSmilesConnection get(java.net.URL dest,
                                   short type)
                            throws java.lang.Exception
Retrieve a resource via an URL using authenticated HTTP get and store it as a resource under this contenthandler. The XML signature process uses that resource list as the list of resources that are referenced by the document. Use type from the class content.Resource

Specified by:
get in interface ResourceFetcher
Throws:
java.lang.Exception

getXMLDocument

public final XMLDocument getXMLDocument()

setXMLDocument

public final void setXMLDocument(XMLDocument doc)

isPrimary

public final boolean isPrimary()

setHost

public final void setHost(boolean flag)

isHost

public final boolean isHost()

getContainer

public final java.awt.Container getContainer()

setContainer

public final void setContainer(java.awt.Container c)

startUpdateTransaction

public void startUpdateTransaction()
Informs the container that there is going to be a lot of concurrent updates to the document and the container shouldn't repaint itself until commit is called. By default this method does nothing, subclasses should implement it when needed.


commitUpdateTransaction

public void commitUpdateTransaction()
Informs the container that it is free to repaint itself, and should do it right now. By default this method does nothing, subclasses should implement it when needed.


rollbackUpdateTransaction

public void rollbackUpdateTransaction()
Informs the container that it is free to repaint itself, but it shouldn't do it now. By default this method does nothing, subclasses should implement it when needed.


getLocalname

public java.lang.String getLocalname(java.lang.String tagname)
Get local name of a node.

Parameters:
tagname - Tag name, including namspace prefix
Returns:
Tag name without namespace prefix

getMLFCParameters

public java.util.Hashtable getMLFCParameters()
parameters are set BEFORE initialization of the elements


setMLFCParameters

public void setMLFCParameters(java.util.Hashtable p)
parameters are set BEFORE initialization of the elements

Returns:
The parameters that might be passed to the MLFC, e.g., in the case of the experimental processing instruction

setZoom

public void setZoom(double zoom)
notify that the zoom level has changed. Note that some content may choose to not implement zooming.


getTitle

public java.lang.String getTitle()
Returns:

setTitle

public void setTitle(java.lang.String t)


X-Smiles 1.2