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

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.smil.viewer.awt.AWTForeignMediaHandler
All Implemented Interfaces:
MediaHandler
Direct Known Subclasses:
SMILMLFCForeignHandler

public class AWTForeignMediaHandler
extends java.lang.Object
implements MediaHandler

This class takes care of ForeignElements resizing in the SMIL documents. This SMILMLFC class is a full implementation. This class implements MediaHandler interface, so that SMILREgionElementImpl can control this component.


Field Summary
 java.lang.String alt
           
protected  java.awt.Container container
           
protected  DrawingArea drawingArea
           
protected  int height
           
protected  int left
           
protected  MediaListener mediaListener
           
protected  java.lang.String mimeType
           
protected  boolean playing
           
protected  boolean prefetched
           
protected  SMILDocumentImpl smilDoc
           
protected  int top
           
 java.lang.String url
           
protected  Viewer viewer
           
protected  java.awt.Component visualComponent
           
protected  int width
           
 
Constructor Summary
AWTForeignMediaHandler()
          Create a new ForeignHandler.
AWTForeignMediaHandler(org.w3c.dom.Element e)
          Create a new ForeignHandler for SMIL MLFC.
 
Method Summary
 void addListener(MediaListener mediaListener)
          Add a media listener (currently supports only one listener) ForeignElement does not support links.
 void close()
           
 void freeze()
           
 java.lang.Object getComponent()
          get the possible component (only used when run in x-smiles
 int getHeight()
           
 int getLeft()
           
 int getOriginalHeight()
          Get the real height of the media.
 int getOriginalWidth()
          Get the real width of the media.
 int getTop()
           
 int getWidth()
           
 boolean isStatic()
          Checks if this media is static or continuous.
 void pause()
           
 void play()
           
 void prefetch()
           
 void setAlt(java.lang.String alt)
          Sets the alt text for the media.
 void setAudioVolume(int percentage)
          Set the volume of audio (if available).
 void setBounds(int x, int y, int w, int h)
           
 void setDrawingArea(DrawingArea d)
          Set the drawing area.
 void setMediaTime(int millisecs)
          Set the media time position.
 void setMIMEType(java.lang.String type)
          Force this media to use this media type
 void setRootLayoutSize(int width, int height)
          This media handler will know the rootlayout size after this is called.
 void setURL(java.lang.String url)
          Sets the URL of the media.
 void setViewer(Viewer v)
          Set the viewer - required for prefetch, URL creation etc.
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alt

public java.lang.String alt

url

public java.lang.String url

mediaListener

protected MediaListener mediaListener

drawingArea

protected DrawingArea drawingArea

container

protected java.awt.Container container

smilDoc

protected SMILDocumentImpl smilDoc

viewer

protected Viewer viewer

prefetched

protected boolean prefetched

playing

protected boolean playing

mimeType

protected java.lang.String mimeType

top

protected int top

left

protected int left

width

protected int width

height

protected int height

visualComponent

protected java.awt.Component visualComponent
Constructor Detail

AWTForeignMediaHandler

public AWTForeignMediaHandler()
Create a new ForeignHandler.


AWTForeignMediaHandler

public AWTForeignMediaHandler(org.w3c.dom.Element e)
Create a new ForeignHandler for SMIL MLFC.

Parameters:
e - The foreign element implementing VisualComponentService.
Method Detail

setViewer

public void setViewer(Viewer v)
Description copied from interface: MediaHandler
Set the viewer - required for prefetch, URL creation etc.

Specified by:
setViewer in interface MediaHandler

setDrawingArea

public void setDrawingArea(DrawingArea d)
Set the drawing area. The given drawing area MUST be a SMILMLFCDrawingArea.

Specified by:
setDrawingArea in interface MediaHandler

addListener

public void addListener(MediaListener mediaListener)
Add a media listener (currently supports only one listener) ForeignElement does not support links.

Specified by:
addListener in interface MediaHandler

isStatic

public boolean isStatic()
Checks if this media is static or continuous. Static for Foreign Elements.

Specified by:
isStatic in interface MediaHandler
Returns:
true if media is static.

setRootLayoutSize

public void setRootLayoutSize(int width,
                              int height)
This media handler will know the rootlayout size after this is called.

Specified by:
setRootLayoutSize in interface MediaHandler
Parameters:
width - RootLayout width
height - RootLayout height

setAlt

public void setAlt(java.lang.String alt)
Description copied from interface: MediaHandler
Sets the alt text for the media.

Specified by:
setAlt in interface MediaHandler

setURL

public void setURL(java.lang.String url)
Description copied from interface: MediaHandler
Sets the URL of the media.

Specified by:
setURL in interface MediaHandler

setMIMEType

public void setMIMEType(java.lang.String type)
Description copied from interface: MediaHandler
Force this media to use this media type

Specified by:
setMIMEType in interface MediaHandler

prefetch

public void prefetch()
Specified by:
prefetch in interface MediaHandler

play

public void play()
Specified by:
play in interface MediaHandler

pause

public void pause()
Specified by:
pause in interface MediaHandler

stop

public void stop()
Specified by:
stop in interface MediaHandler

freeze

public void freeze()
Specified by:
freeze in interface MediaHandler

close

public void close()
Specified by:
close in interface MediaHandler

setMediaTime

public void setMediaTime(int millisecs)
Set the media time position. Usually used to skip the beginning of media.

Specified by:
setMediaTime in interface MediaHandler
Parameters:
millisecs - Time in milliseconds

getTop

public int getTop()
Specified by:
getTop in interface MediaHandler

getLeft

public int getLeft()
Specified by:
getLeft in interface MediaHandler

getWidth

public int getWidth()
Specified by:
getWidth in interface MediaHandler

getHeight

public int getHeight()
Specified by:
getHeight in interface MediaHandler

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)
Specified by:
setBounds in interface MediaHandler

getOriginalWidth

public int getOriginalWidth()
Get the real width of the media.

Specified by:
getOriginalWidth in interface MediaHandler

getOriginalHeight

public int getOriginalHeight()
Get the real height of the media.

Specified by:
getOriginalHeight in interface MediaHandler

setAudioVolume

public void setAudioVolume(int percentage)
Set the volume of audio (if available).

Specified by:
setAudioVolume in interface MediaHandler
Parameters:
percentage - 0-100-oo , 100 giving normal sound level.

getComponent

public java.lang.Object getComponent()
Description copied from interface: MediaHandler
get the possible component (only used when run in x-smiles

Specified by:
getComponent in interface MediaHandler


X-Smiles 1.2