fi.hut.tml.xsmiles.mlfc.smil.viewer.swing
Class JSMILPlayerCore

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.smil.viewer.swing.JSMILPlayerCore
All Implemented Interfaces:
Viewer

public class JSMILPlayerCore
extends java.lang.Object
implements Viewer

This is the hidden functionality of the SMILComponent class, which is a wrapper to hide all public methods in this class.


Constructor Summary
protected JSMILPlayerCore()
           
 
Method Summary
 void addTimePoint(java.lang.String elementId)
          Called from the SMILDocument, when a new time point is found during prefetching.
 void destroy()
          Clears all resources and frees memory.
 void displayStatusText(java.lang.String txt)
          Displays a status text, SMILDocument calls this.
 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)
          Creates a new DrawingArea.
 MediaHandler getNewForeignHandler(org.w3c.dom.Element e)
          Returns a new ForeignHandler for SMIL core logic.
 LinkHandler getNewLinkHandler()
          Creates a new LinkHandler.
 MediaHandler getNewMediaHandler()
          Creates a new MediaHandler.
 boolean getPlayAudio()
          Returns true if audio should be played.
 boolean getPlayImage()
          Returns true if images should be played.
 boolean getPlayVideo()
          Returns true if video should be played.
 SMILDocument getSMILDoc()
          Get the SMILDocument.
 java.lang.String getSystemAudioDesc()
          Returns a system attribute for the SMILDocument.
 java.lang.String getSystemBitrate()
          Returns a system attribute for the SMILDocument.
 java.lang.String getSystemCaptions()
          Returns a system attribute for the SMILDocument.
 boolean getSystemComponent(java.lang.String component)
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemCPU()
          Returns a system attribute for the SMILDocument.
 java.lang.String getSystemLanguage()
          Returns a system attribute for the SMILDocument.
 java.lang.String getSystemOperatingSystem()
          Returns a system attribute for the SMILDocument.
 java.lang.String getSystemOverdubOrCaption()
          Returns a system attribute for the SMILDocument.
 java.lang.String getSystemOverdubOrSubtitle()
          Returns a system attribute for the SMILDocument.
 boolean getSystemRequired(java.lang.String prefix)
          Returns the value of systemAttribute for the SMIL core logic.
 int getSystemScreenDepth()
          Returns a system attribute for the SMILDocument.
 int getSystemScreenHeight()
          Returns a system attribute for the SMILDocument.
 int getSystemScreenWidth()
          Returns a system attribute for the SMILDocument.
 java.lang.String getTitle()
          Get the title of the presentation.
 int getWindowHeight()
          Returns window height for the SMILDocument.
 int getWindowWidth()
          Returns window width for the SMILDocument.
 void gotoExternalLink(java.lang.String url)
          Called from SMILDocument when an external link is activated.
 void gotoExternalLinkNewWindow(java.lang.String url)
          Open external link in a new window
 void gotoExternalLinkTarget(java.lang.String url, java.lang.String target)
          Open external link replacing/opening new target
protected  boolean init(java.awt.Container c, java.io.Reader reader, java.lang.String path)
          Initializes the SMIL presentation for playing.
 boolean isHost()
          SMILDoc requires this from the SMILMLFC, which may return true or false.
 void setDocumentBaseURI(java.lang.String base)
           
 void setTitle(java.lang.String title)
          Set the title for the presentation.
 void start()
          Start the presentation.
 void stop()
          Stop the presentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSMILPlayerCore

protected JSMILPlayerCore()
Method Detail

init

protected boolean init(java.awt.Container c,
                       java.io.Reader reader,
                       java.lang.String path)
Initializes the SMIL presentation for playing.

Parameters:
c - Root-layout container
reader - Reader, where the presentation is loaded from
path - Path to the file (can be a URL)

start

public void start()
Start the presentation.


stop

public void stop()
Stop the presentation.


destroy

public void destroy()
Clears all resources and frees memory. The presentation cannot be played after this call.


getBaseURL

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

Specified by:
getBaseURL in interface Viewer

gotoExternalLink

public void gotoExternalLink(java.lang.String url)
Called from SMILDocument when an external link is activated.

Specified by:
gotoExternalLink in interface Viewer
Parameters:
url - Link destination

gotoExternalLinkTarget

public void gotoExternalLinkTarget(java.lang.String url,
                                   java.lang.String target)
Open external link replacing/opening new target

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

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

displayStatusText

public void displayStatusText(java.lang.String txt)
Displays a status text, SMILDocument calls this.

Specified by:
displayStatusText in interface Viewer

addTimePoint

public void addTimePoint(java.lang.String elementId)
Called from the SMILDocument, when a new time point is found during prefetching.

Specified by:
addTimePoint in interface Viewer

getSMILDoc

public SMILDocument getSMILDoc()
Get the SMILDocument. Called from other Swing handlers.

Specified by:
getSMILDoc in interface Viewer
Returns:
Currently opened SMIL document.

setDocumentBaseURI

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

getNewMediaHandler

public MediaHandler getNewMediaHandler()
Creates a new MediaHandler. Works as a factory for SMILDocument.

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()
Creates a new LinkHandler. Works as a factory for SMILDocument.

Specified by:
getNewLinkHandler in interface Viewer

getNewDrawingArea

public DrawingArea getNewDrawingArea(int type,
                                     boolean block)
Creates a new DrawingArea. Works as a factory for SMILDocument.

Specified by:
getNewDrawingArea in interface Viewer

getNewForeignHandler

public MediaHandler getNewForeignHandler(org.w3c.dom.Element e)
Returns a new ForeignHandler for SMIL core logic. NOT IMPLEMENTED IN STANDALONE PLAYER.

Specified by:
getNewForeignHandler in interface Viewer

getWindowWidth

public int getWindowWidth()
Returns window width for the SMILDocument.

Specified by:
getWindowWidth in interface Viewer

getWindowHeight

public int getWindowHeight()
Returns window height for the SMILDocument.

Specified by:
getWindowHeight in interface Viewer

getSystemBitrate

public java.lang.String getSystemBitrate()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemBitrate in interface Viewer

getSystemCaptions

public java.lang.String getSystemCaptions()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemCaptions in interface Viewer

getSystemLanguage

public java.lang.String getSystemLanguage()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemLanguage in interface Viewer

getSystemOverdubOrCaption

public java.lang.String getSystemOverdubOrCaption()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemOverdubOrCaption in interface Viewer

getSystemRequired

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

Specified by:
getSystemRequired in interface Viewer

getSystemScreenWidth

public int getSystemScreenWidth()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemScreenWidth in interface Viewer

getSystemScreenHeight

public int getSystemScreenHeight()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemScreenHeight in interface Viewer

getSystemScreenDepth

public int getSystemScreenDepth()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemScreenDepth in interface Viewer

getSystemOverdubOrSubtitle

public java.lang.String getSystemOverdubOrSubtitle()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemOverdubOrSubtitle in interface Viewer

getSystemAudioDesc

public java.lang.String getSystemAudioDesc()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemAudioDesc in interface Viewer

getSystemOperatingSystem

public java.lang.String getSystemOperatingSystem()
Returns a system attribute for the SMILDocument.

Specified by:
getSystemOperatingSystem in interface Viewer

getSystemCPU

public java.lang.String getSystemCPU()
Returns a system attribute for the SMILDocument.

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()
Returns true if images should be played. Called from handlers.

Specified by:
getPlayImage in interface Viewer

getPlayAudio

public boolean getPlayAudio()
Returns true if audio should be played. Called from handlers.

Specified by:
getPlayAudio in interface Viewer

getPlayVideo

public boolean getPlayVideo()
Returns true if video should be played. Called from handlers.

Specified by:
getPlayVideo in interface Viewer

getTitle

public java.lang.String getTitle()
Get the title of the presentation. null if no title present.

Specified by:
getTitle in interface Viewer

setTitle

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

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

isHost

public boolean isHost()
Description copied from interface: Viewer
SMILDoc requires this from the SMILMLFC, which may return true or false. Other viewers always return true.

Specified by:
isHost in interface Viewer

getDecorator

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


X-Smiles 1.2