fi.hut.tml.xsmiles.mlfc.smil.viewer.awt
Class SMILViewer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byfi.hut.tml.xsmiles.mlfc.smil.viewer.awt.SMILViewer
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable, Viewer, java.awt.event.WindowListener

public class SMILViewer
extends java.awt.Container
implements java.awt.event.WindowListener, java.lang.Runnable, Viewer, java.awt.event.ActionListener

This is a sample class that shows how to view a smil document and play it using awt.

NOTE: THIS VIEWER IS NOT COMPLETE AND WON'T WORK CORRECTLY.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static long initMem
           
static long initTime
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SMILViewer()
           
SMILViewer(java.lang.String url)
           
SMILViewer(java.net.URL url)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Playback buttons.
 void addTimePoint(java.lang.String elementId)
           
 void displayStatusText(java.lang.String url)
           
 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 drawing area, of type DrawingArea.ROOTLAYOUT or DrawingArea.TOPLAYOUT
 MediaHandler getNewForeignHandler(org.w3c.dom.Element e)
          Returns a new ForeignHandler for SMIL core logic.
 LinkHandler getNewLinkHandler()
          Creates a new link handler.
 MediaHandler getNewMediaHandler()
           
 boolean getPlayAudio()
           
 boolean getPlayImage()
           
 boolean getPlayVideo()
           
 SMILDocument getSMILDoc()
           
 java.lang.String getSystemAudioDesc()
           
 java.lang.String getSystemBitrate()
           
 java.lang.String getSystemCaptions()
           
 boolean getSystemComponent(java.lang.String component)
          Returns the value of systemAttribute for the SMIL core logic.
 java.lang.String getSystemCPU()
           
 java.lang.String getSystemLanguage()
           
 java.lang.String getSystemOperatingSystem()
           
 java.lang.String getSystemOverdubOrCaption()
           
 java.lang.String getSystemOverdubOrSubtitle()
           
 boolean getSystemRequired(java.lang.String prefix)
          Returns the value of systemAttribute for the SMIL core logic.
 int getSystemScreenDepth()
           
 int getSystemScreenHeight()
           
 int getSystemScreenWidth()
           
 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)
          Open external link replacing the existing presentation
 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
 void init(SMILViewer viewer, java.io.Reader reader, java.lang.String path)
           
 boolean isHost()
          SMILDoc requires this from the SMILMLFC, which may return true or false.
static void main(java.lang.String[] args)
           
 void run()
           
 void setDocumentBaseURI(java.lang.String base)
           
 void setTitle(java.lang.String t)
          Set the title for the presentation.
 void start()
           
 void stop()
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          Window closed.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initTime

public static long initTime

initMem

public static long initMem
Constructor Detail

SMILViewer

public SMILViewer()

SMILViewer

public SMILViewer(java.net.URL url)

SMILViewer

public SMILViewer(java.lang.String url)
Method Detail

main

public static void main(java.lang.String[] args)

init

public void init(SMILViewer viewer,
                 java.io.Reader reader,
                 java.lang.String path)

start

public void start()

stop

public void stop()

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)
Description copied from interface: Viewer
Open external link replacing the existing presentation

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

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 url)
Specified by:
displayStatusText in interface Viewer

getNewMediaHandler

public MediaHandler getNewMediaHandler()
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()
Description copied from interface: Viewer
Creates a new link handler.

Specified by:
getNewLinkHandler in interface Viewer

setDocumentBaseURI

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

getSMILDoc

public SMILDocument getSMILDoc()
Specified by:
getSMILDoc in interface Viewer

getNewDrawingArea

public DrawingArea getNewDrawingArea(int type,
                                     boolean block)
Description copied from interface: Viewer
Returns a new drawing area, of type DrawingArea.ROOTLAYOUT or DrawingArea.TOPLAYOUT

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

addTimePoint

public void addTimePoint(java.lang.String elementId)
Specified by:
addTimePoint 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()
Specified by:
getSystemBitrate in interface Viewer

getSystemCaptions

public java.lang.String getSystemCaptions()
Specified by:
getSystemCaptions in interface Viewer

getSystemLanguage

public java.lang.String getSystemLanguage()
Specified by:
getSystemLanguage in interface Viewer

getSystemOverdubOrCaption

public java.lang.String getSystemOverdubOrCaption()
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()
Specified by:
getSystemScreenWidth in interface Viewer

getSystemScreenHeight

public int getSystemScreenHeight()
Specified by:
getSystemScreenHeight in interface Viewer

getSystemScreenDepth

public int getSystemScreenDepth()
Specified by:
getSystemScreenDepth in interface Viewer

getSystemOverdubOrSubtitle

public java.lang.String getSystemOverdubOrSubtitle()
Specified by:
getSystemOverdubOrSubtitle in interface Viewer

getSystemAudioDesc

public java.lang.String getSystemAudioDesc()
Specified by:
getSystemAudioDesc in interface Viewer

getSystemOperatingSystem

public java.lang.String getSystemOperatingSystem()
Specified by:
getSystemOperatingSystem in interface Viewer

getSystemCPU

public java.lang.String getSystemCPU()
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()
Specified by:
getPlayImage in interface Viewer

getPlayAudio

public boolean getPlayAudio()
Specified by:
getPlayAudio in interface Viewer

getPlayVideo

public boolean getPlayVideo()
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 t)
Set the title for the presentation.

Specified by:
setTitle in interface Viewer
Parameters:
t - 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

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Playback buttons.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Window closed.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

run

public void run()
Specified by:
run in interface java.lang.Runnable

getDecorator

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


X-Smiles 1.2