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

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.smil.viewer.awt.AwtBrushHandler
All Implemented Interfaces:
BrushHandler, java.util.EventListener, MediaHandler, java.awt.event.MouseListener, java.lang.Runnable

public class AwtBrushHandler
extends java.lang.Object
implements BrushHandler, java.awt.event.MouseListener, java.lang.Runnable

Awt Brush Handler. Displays a colored panel.


Field Summary
protected  java.lang.String alt
           
protected  java.awt.Container container
           
protected  AwtDrawingArea drawingArea
           
protected  int height
           
protected  int left
           
protected  MediaListener mediaListener
           
protected  boolean prefetched
           
protected  int top
           
protected  java.lang.String url
           
protected  int width
           
 
Constructor Summary
AwtBrushHandler()
          Create a new BrushHandler.
 
Method Summary
 void addListener(MediaListener mediaListener)
          Add a media listener (currently supports only one listener)
 void close()
           
 void freeze()
          Brush freeze - won't do anything.
 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 mouseClicked(java.awt.event.MouseEvent e)
          Mouse listener...
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void pause()
           
 void play()
           
 void prefetch()
           
 void run()
           
 void setAlt(java.lang.String alt)
          Sets the alt text for the media.
 void setAudioVolume(int percentage)
          Set the sound volume for media.
 void setBounds(int x, int y, int w, int h)
           
 void setColor(java.lang.String color)
          Sets the color of the brush.
 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

protected java.lang.String alt

url

protected java.lang.String url

mediaListener

protected MediaListener mediaListener

drawingArea

protected AwtDrawingArea drawingArea

container

protected java.awt.Container container

prefetched

protected boolean prefetched

top

protected int top

left

protected int left

width

protected int width

height

protected int height
Constructor Detail

AwtBrushHandler

public AwtBrushHandler()
Create a new BrushHandler.

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 AwtDrawingArea.

Specified by:
setDrawingArea in interface MediaHandler

addListener

public void addListener(MediaListener mediaListener)
Add a media listener (currently supports only one listener)

Specified by:
addListener in interface MediaHandler

isStatic

public boolean isStatic()
Checks if this media is static or continuous.

Specified by:
isStatic in interface MediaHandler
Returns:
always true, because this is static brush.

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

setColor

public void setColor(java.lang.String color)
Description copied from interface: BrushHandler
Sets the color of the brush.

Specified by:
setColor in interface BrushHandler

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

run

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

pause

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

stop

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

freeze

public void freeze()
Brush freeze - won't do anything.

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. Not implemented for brushes.

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

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 sound volume for media. Does nothing for brushes.

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

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

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Mouse listener...

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

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