|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfi.hut.tml.xsmiles.content.BaseContentHandler
Base class for content handlers This class should be reusable for optimization purposes
| Field Summary | |
protected XSmilesConnection |
connection
the HTTP connection object (can be null) |
protected BrowserWindow |
fBrowser
|
protected boolean |
fClosed
has close() been called on this object |
protected java.awt.Container |
fContainer
|
protected XMLDocument |
fDoc
|
protected java.io.InputStream |
fInputStream
the possible input stream for this content object |
protected XLink |
fLink
the XLink for this content object |
protected MLFCListener |
fMLFCListener
|
protected boolean |
fPrefetched
has prefetch() been called on this object |
protected boolean |
fPrimary
|
protected boolean |
fShowControls
whether or not this content should show controls |
protected boolean |
fStopped
has stop() been called on this object |
protected java.util.Hashtable |
referencedResources
|
| Constructor Summary | |
BaseContentHandler()
|
|
| Method Summary | |
void |
addMediaListener(MediaListener listener)
Adds a MediaListener for this media. |
void |
addResource(Resource r)
|
void |
close()
This will freeze all memory and references to this media. |
protected void |
closeConnection()
|
XSmilesConnection |
get(java.net.URL dest,
short type)
Retrieve a resource via an URL using authenticated HTTP get and store it as a resource under this contenthandler |
java.awt.Container |
getContainer()
|
java.io.InputStream |
getContentStream()
get a stream to the content if possible This should read the contents from a cache if possible. |
int |
getOriginalDuration()
Get the duration of media. |
int |
getOriginalHeight()
Get the real height of the media. |
int |
getOriginalWidth()
Get the real width of the media. |
boolean |
getPrimary()
get the primary property for this content |
int |
getResourceCount()
|
ResourceReferencer |
getResourceReferencer()
get the list of referenced resources |
java.util.Enumeration |
getResources()
|
XMLDocument |
getXMLDocument()
for XML type of media, this returns the XML content holder object XMLDocument, otherwise null |
boolean |
isStatic()
Checks if this media is static or continuous. |
void |
pause()
Pauses the media. |
void |
play()
Plays the media. |
void |
prefetch()
Prefetches media. |
void |
setBounds(int x,
int y,
int width,
int height)
Set the coordinates for the media. |
void |
setBrowserWindow(BrowserWindow browser)
sets the browser window instance. |
void |
setConnection(XSmilesConnection conn)
the connection object, that should be manually closed ASAP |
void |
setContainer(java.awt.Container cont)
Sets the container the media will be rendered in. |
void |
setInputStream(java.io.InputStream stream)
sets the input stream where the media is fetched from. |
void |
setMediaTime(int millisecs)
This moves the time position in media. |
void |
setMLFCListener(MLFCListener listener)
All traffic to the browser, such as ComponentFactory, etc goes through this listener. |
void |
setPrimary(boolean primary)
set this content as primary or secondary. |
void |
setSoundVolume(int percentage)
Set the sound volume for media. |
void |
setUrl(java.net.URL url)
sets the XLink (url) for this media if only the link is set, then the input stream should be automatically opened by the media |
void |
setURL(XLink url)
sets the XLink (url) for this media if only the link is set, then the input stream should be automatically opened by the media |
void |
setZoom(double zoom)
notify that the zoom level has changed. |
void |
showControls(boolean visible)
Requests the media player to display a control panel for media. |
void |
stop()
Stops the media. |
| 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.content.XSmilesContentHandler |
getTitle |
| Field Detail |
protected BrowserWindow fBrowser
protected MLFCListener fMLFCListener
protected XMLDocument fDoc
protected java.awt.Container fContainer
protected boolean fPrimary
protected boolean fPrefetched
protected boolean fStopped
protected boolean fClosed
protected XLink fLink
protected java.io.InputStream fInputStream
protected boolean fShowControls
protected XSmilesConnection connection
protected java.util.Hashtable referencedResources
| Constructor Detail |
public BaseContentHandler()
| Method Detail |
public void setConnection(XSmilesConnection conn)
setConnection in interface XSmilesContentHandlerconn - protected void closeConnection()
public java.io.InputStream getContentStream()
getContentStream in interface XSmilesContentHandlerpublic void setBrowserWindow(BrowserWindow browser)
setBrowserWindow in interface XSmilesContentHandlerpublic XMLDocument getXMLDocument()
XSmilesContentHandler
getXMLDocument in interface XSmilesContentHandlerpublic void setContainer(java.awt.Container cont)
XSmilesContentHandler
setContainer in interface XSmilesContentHandlercont - This container will contain the media.public java.awt.Container getContainer()
public void setPrimary(boolean primary)
setPrimary in interface XSmilesContentHandlerprimary - boolean value denoting whether this content is primary or notpublic boolean getPrimary()
getPrimary in interface XSmilesContentHandlerpublic void setMLFCListener(MLFCListener listener)
setMLFCListener in interface XSmilesContentHandlerlistener - The MLFCListener supplied by the browserMLFCListenerpublic void setInputStream(java.io.InputStream stream)
setInputStream in interface XSmilesContentHandlerpublic void setURL(XLink url)
setURL in interface XSmilesContentHandlerpublic void setUrl(java.net.URL url)
setUrl in interface XSmilesContentHandlerpublic void showControls(boolean visible)
showControls in interface XSmilesContentHandlervisible - true=Display controls, false=don't display controls.
public void prefetch()
throws java.lang.Exception
prefetch in interface XSmilesContentHandlerjava.lang.Exception
public void play()
throws java.lang.Exception
If the media is not yet prefetched, it will first be prefetched.
play in interface XSmilesContentHandlerjava.lang.Exceptionpublic void stop()
stop in interface XSmilesContentHandlerpublic void close()
close in interface XSmilesContentHandlerpublic void setMediaTime(int millisecs)
setMediaTime in interface XSmilesContentHandlermillisecs - Time in millisecspublic void addMediaListener(MediaListener listener)
addMediaListener in interface XSmilesContentHandlerpublic boolean isStatic()
isStatic in interface XSmilesContentHandlerpublic int getOriginalDuration()
getOriginalDuration in interface XSmilesContentHandlerpublic int getOriginalWidth()
getOriginalWidth in interface XSmilesContentHandlerpublic int getOriginalHeight()
getOriginalHeight in interface XSmilesContentHandler
public void setBounds(int x,
int y,
int width,
int height)
setBounds in interface XSmilesContentHandlerpublic void setSoundVolume(int percentage)
setSoundVolume in interface XSmilesContentHandlerpercentage - Sound volume, 0-100- (0 is quiet, 100 is original loudness, 200 twice as loud;
dB change in signal level = 20 log10(percentage / 100) )public void pause()
pause in interface XSmilesContentHandlerpublic void setZoom(double zoom)
setZoom in interface XSmilesContentHandlerpublic void addResource(Resource r)
addResource in interface ResourceReferencerpublic int getResourceCount()
public java.util.Enumeration getResources()
getResources in interface ResourceReferencer
public XSmilesConnection get(java.net.URL dest,
short type)
throws java.lang.Exception
get in interface XSmilesContentHandlerjava.lang.Exceptionpublic ResourceReferencer getResourceReferencer()
getResourceReferencer in interface XSmilesContentHandler
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||