fi.hut.tml.xsmiles.mlfc.smil
Class SMILMLFC

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.MLFC
      extended byfi.hut.tml.xsmiles.mlfc.smil.SMILMLFC
All Implemented Interfaces:
ResourceFetcher, Viewer
Direct Known Subclasses:
SMILMLFCAWT

public class SMILMLFC
extends MLFC
implements Viewer

SMILMLFC is the SMIL Viewer for X-Smiles browser. It controls the SMIL core functionality and handles the data exchange between the SMIL player and the broswer. This is also a factory for MLFC specific MediaHandlers, LinkHandlers and DrawingAreas.


Field Summary
protected  Decorator decorator
           
static java.lang.String decorClassName
          the decorator class name, this is changed e.g.
static long initMem
           
static long initTime
           
static long startMem
           
static long startTime
           
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.MLFC
contentHandler, controlsShown, title
 
Constructor Summary
SMILMLFC()
          Constructor.
 
Method Summary
 void addTimePoint(java.lang.String elementId)
          Adds a timepoint, which can be used to jump to some specific location in the presentation.
protected  void createDecorator()
           
 org.w3c.dom.Element createElementNS(org.apache.xerces.dom.DocumentImpl doc, java.lang.String URI, java.lang.String tagname)
          Create a DOM element.
 java.net.URL createURL(java.lang.String partURL)
          Append the given URL to be a full URL.
 void displayStatusText(java.lang.String url)
          Display status text in the broswer.
 java.net.URL getBaseURL()
          Return the base URL of the document.
 Decorator getDecorator()
           
 BrushHandler getNewBrushHandler()
          Returns a new BrushHandler for SMIL core logic.
 DrawingArea getNewDrawingArea(int type, boolean block)
          Returns a new DrawingArea for SMIL core logic.
 MediaHandler getNewForeignHandler(org.w3c.dom.Element e)
          Returns a new ForeignHandler for SMIL core logic.
 LinkHandler getNewLinkHandler()
          Returns a new LinkHandler for SMIL core logic.
 MediaHandler getNewMediaHandler()
          Returns a new MediaHandler for SMIL core logic.
 boolean getPlayAudio()
          Tests if audio should be played.
 boolean getPlayImage()
          Tests if images should be shown.
 boolean getPlayVideo()
          Tests if video should be played.
 SMILDocument getSMILDoc()
          Returns the SMILDocument (SMIL-DOM).
 java.lang.String getSystemAudioDesc()
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemBitrate()
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemCaptions()
          Returns the value of systemAttribute for the SMIL core logic.
 boolean getSystemComponent(java.lang.String component)
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemCPU()
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemLanguage()
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemOperatingSystem()
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemOverdubOrCaption()
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemOverdubOrSubtitle()
          Returns the value of systemAttribute for the SMIL core logic.
 boolean getSystemRequired(java.lang.String url)
          Returns the value of systemAttribute for the SMIL core logic.
 int getSystemScreenDepth()
          Returns the value of systemAttribute for the SMIL core logic.
 int getSystemScreenHeight()
          Returns the value of systemAttribute for the SMIL core logic.
 int getSystemScreenWidth()
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getTitle()
          Get the title of this presentation.
 java.lang.String getVersion()
          Get the version of the MLFC.
 int getWindowHeight()
          Returns the visible container height.
 int getWindowWidth()
          Returns the visible container width.
 void gotoExternalLink(java.lang.String url)
          Called from the LinkHandler - this method asks the browser to go to this external link.
 void gotoExternalLinkNewWindow(java.lang.String url)
          Open external link in a new window - this method asks the browser to go to this external link.
 void gotoExternalLinkTarget(java.lang.String url, java.lang.String target)
          Open external link replacing/opening new target - this method asks the browser to go to this external link.
 void refresh()
           
 void setDocumentBaseURI(java.lang.String base)
           
 void setTitle(java.lang.String title)
          Set the title for the presentation.
 void showLinkPopup(java.lang.String urlStr, java.awt.event.MouseEvent e)
          open a link popup
 void start()
          Displays the presentation.
 void startup(XMLDocument doc)
          Common starter for primary and secondary MLFC.
 void stop()
          Deactivate the MLFC.
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.MLFC
commitUpdateTransaction, createAttributeNS, get, getContainer, getContentHandler, getLocalname, getMLFCController, getMLFCListener, getMLFCParameters, getResourceReferencer, getXMLDocument, init, initMLFC, isHost, isPrimary, pause, rollbackUpdateTransaction, setContainer, setContentHandler, setHost, setMLFCListener, setMLFCParameters, setXMLDocument, setZoom, startMLFC, startUpdateTransaction, stopMLFC
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fi.hut.tml.xsmiles.mlfc.smil.viewer.Viewer
isHost
 

Field Detail

initTime

public static long initTime

initMem

public static long initMem

startTime

public static long startTime

startMem

public static long startMem

decorator

protected Decorator decorator

decorClassName

public static java.lang.String decorClassName
the decorator class name, this is changed e.g. by the HAVI SMIL viewer

Constructor Detail

SMILMLFC

public SMILMLFC()
Constructor.

Method Detail

createDecorator

protected void createDecorator()

getVersion

public final java.lang.String getVersion()
Get the version of the MLFC. This version number is updated with the browser version number at compilation time. This version number indicates the browser version this MLFC was compiled with and should be run with.

Overrides:
getVersion in class MLFC
Returns:
MLFC version number.

createElementNS

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

Overrides:
createElementNS in class MLFC

start

public void start()
Displays the presentation. Prefetches and plays the presentation.

Specified by:
start in class MLFC

getDecorator

public Decorator getDecorator()
Specified by:
getDecorator in interface Viewer

startup

public void startup(XMLDocument doc)
Common starter for primary and secondary MLFC.


stop

public void stop()
Deactivate the MLFC. The presentation needs to be stopped.

Specified by:
stop in class MLFC

setDocumentBaseURI

public void setDocumentBaseURI(java.lang.String base)
Specified by:
setDocumentBaseURI in interface Viewer

createURL

public java.net.URL createURL(java.lang.String partURL)
Append the given URL to be a full URL.

Parameters:
partURL - Partial URL, e.g. fanfaari.wav
Returns:
Full URL, e.g. http://www.x-smiles.org/demo/fanfaari.wav

getBaseURL

public java.net.URL getBaseURL()
Return the base URL of the document.

Specified by:
getBaseURL in interface Viewer

showLinkPopup

public void showLinkPopup(java.lang.String urlStr,
                          java.awt.event.MouseEvent e)
open a link popup


gotoExternalLink

public void gotoExternalLink(java.lang.String url)
Called from the LinkHandler - this method asks the browser to go to this external link.

Specified by:
gotoExternalLink in interface Viewer
Parameters:
url - URL to jump to.

gotoExternalLinkTarget

public void gotoExternalLinkTarget(java.lang.String url,
                                   java.lang.String target)
Open external link replacing/opening new target - this method asks the browser to go to this external link.

Specified by:
gotoExternalLinkTarget in interface Viewer
Parameters:
url - URL to open
target - target frame/window

gotoExternalLinkNewWindow

public void gotoExternalLinkNewWindow(java.lang.String url)
Open external link in a new window - this method asks the browser to go to this external link.

Specified by:
gotoExternalLinkNewWindow in interface Viewer
Parameters:
url - URL to open

displayStatusText

public void displayStatusText(java.lang.String url)
Display status text in the broswer. Usually shows the link destination.

Specified by:
displayStatusText in interface Viewer

getWindowWidth

public int getWindowWidth()
Returns the visible container width.

Specified by:
getWindowWidth in interface Viewer

getWindowHeight

public int getWindowHeight()
Returns the visible container height.

Specified by:
getWindowHeight in interface Viewer

getNewMediaHandler

public MediaHandler getNewMediaHandler()
Returns a new MediaHandler for SMIL core logic.

Specified by:
getNewMediaHandler in interface Viewer

getNewBrushHandler

public BrushHandler getNewBrushHandler()
Returns a new BrushHandler for SMIL core logic.

Specified by:
getNewBrushHandler in interface Viewer

getNewLinkHandler

public LinkHandler getNewLinkHandler()
Returns a new LinkHandler for SMIL core logic.

Specified by:
getNewLinkHandler in interface Viewer

getNewDrawingArea

public DrawingArea getNewDrawingArea(int type,
                                     boolean block)
Returns a new DrawingArea for SMIL core logic.

Specified by:
getNewDrawingArea in interface Viewer
Parameters:
type - ROOTLAYOUT for the broswer container, TOPLAYOUT for a new frame.
block - CSS: used to create a JBlockPanel (true) instead of JPanel (false)

getNewForeignHandler

public MediaHandler getNewForeignHandler(org.w3c.dom.Element e)
Returns a new ForeignHandler for SMIL core logic.

Specified by:
getNewForeignHandler in interface Viewer

getSMILDoc

public SMILDocument getSMILDoc()
Returns the SMILDocument (SMIL-DOM).

Specified by:
getSMILDoc in interface Viewer

addTimePoint

public void addTimePoint(java.lang.String elementId)
Adds a timepoint, which can be used to jump to some specific location in the presentation. The timepoints are actually the element ids in the XML file. This method is called for every element in the body section.

Specified by:
addTimePoint in interface Viewer
Parameters:
elementId - TImepoint, actually the id of the element

getSystemBitrate

public java.lang.String getSystemBitrate()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemBitrate in interface Viewer

getSystemCaptions

public java.lang.String getSystemCaptions()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemCaptions in interface Viewer

getSystemLanguage

public java.lang.String getSystemLanguage()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemLanguage in interface Viewer

getSystemOverdubOrCaption

public java.lang.String getSystemOverdubOrCaption()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemOverdubOrCaption in interface Viewer

getSystemRequired

public boolean getSystemRequired(java.lang.String url)
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemRequired in interface Viewer

getSystemScreenWidth

public int getSystemScreenWidth()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemScreenWidth in interface Viewer

getSystemScreenHeight

public int getSystemScreenHeight()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemScreenHeight in interface Viewer

getSystemScreenDepth

public int getSystemScreenDepth()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemScreenDepth in interface Viewer

getSystemOverdubOrSubtitle

public java.lang.String getSystemOverdubOrSubtitle()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemOverdubOrSubtitle in interface Viewer

getSystemAudioDesc

public java.lang.String getSystemAudioDesc()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemAudioDesc in interface Viewer

getSystemOperatingSystem

public java.lang.String getSystemOperatingSystem()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemOperatingSystem in interface Viewer

getSystemCPU

public java.lang.String getSystemCPU()
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemCPU in interface Viewer

getSystemComponent

public boolean getSystemComponent(java.lang.String component)
Returns the value of systemAttribute for the SMIL core logic.

Specified by:
getSystemComponent in interface Viewer

getPlayImage

public boolean getPlayImage()
Tests if images should be shown.

Specified by:
getPlayImage in interface Viewer
Returns:
true if images should be played.

getPlayAudio

public boolean getPlayAudio()
Tests if audio should be played.

Specified by:
getPlayAudio in interface Viewer
Returns:
true if audio should be played.

getPlayVideo

public boolean getPlayVideo()
Tests if video should be played.

Specified by:
getPlayVideo in interface Viewer
Returns:
true if video should be played.

setTitle

public void setTitle(java.lang.String title)
Set the title for the presentation.

Specified by:
setTitle in interface Viewer
Overrides:
setTitle in class MLFC
Parameters:
title - Title for the presentation

getTitle

public java.lang.String getTitle()
Get the title of this presentation.

Specified by:
getTitle in interface Viewer
Overrides:
getTitle in class MLFC
Returns:
The title of this presentation

refresh

public void refresh()


X-Smiles 1.2