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

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.smil.viewer.swing.SwingDrawingArea
All Implemented Interfaces:
DrawingArea
Direct Known Subclasses:
SMILMLFCDrawingArea

public class SwingDrawingArea
extends java.lang.Object
implements DrawingArea

Class for Swing drawing area.


Field Summary
protected  java.awt.Container container
           
protected  java.awt.Container contentContainer
           
 
Fields inherited from interface fi.hut.tml.xsmiles.mlfc.smil.viewer.DrawingArea
REGION, REGIONSCROLL, ROOTLAYOUT, TOPLAYOUT
 
Constructor Summary
SwingDrawingArea(java.awt.Container c)
          Creates a new drawing area using container c.
SwingDrawingArea(int type)
          Creates a new drawing area of type ROOTLAYOUT, TOPLAYOUT or REGION.
 
Method Summary
 void addFrameListener(FrameListener frameListener)
          For toplayouts (frames), add a close listener.
 void addRegion(DrawingArea region, int zindex)
          Add a region to this drawing area.
 void bringToFront(DrawingArea region)
          Bring this region into front of other regions
 java.awt.Container getContainer()
          This is a Swing specific method to return the container to add this to other regions.
 java.awt.Container getContentContainer()
          This is a Swing specific method to return the container to draw media.
 int getHeight()
           
 int getLeft()
           
 int getTop()
           
 int getWidth()
           
 void setBackgroundColor(java.lang.String color)
          Set the background color for this drawing area.
 void setBounds(int x, int y, int w, int h)
           
 boolean setCSSStretch(java.lang.String awidth, java.lang.String aheight, org.w3c.dom.Element origElem)
           
 void setTitle(java.lang.String name)
          Set the title of this area (used for top-layout)
 void setVisible(boolean v)
          Set this drawing area visible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected java.awt.Container container

contentContainer

protected java.awt.Container contentContainer
Constructor Detail

SwingDrawingArea

public SwingDrawingArea(int type)
Creates a new drawing area of type ROOTLAYOUT, TOPLAYOUT or REGION.


SwingDrawingArea

public SwingDrawingArea(java.awt.Container c)
Creates a new drawing area using container c. Used for root-layout.

Parameters:
c - Container
Method Detail

getLeft

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

getTop

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

getWidth

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

getHeight

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

setBounds

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

addRegion

public void addRegion(DrawingArea region,
                      int zindex)
Add a region to this drawing area. A region can be added to root-layout, topLayout, or another region.

Specified by:
addRegion in interface DrawingArea
Parameters:
region - Region's drawing area to be added.

bringToFront

public void bringToFront(DrawingArea region)
Bring this region into front of other regions

Specified by:
bringToFront in interface DrawingArea
Parameters:
region - Region to be the top most

setBackgroundColor

public void setBackgroundColor(java.lang.String color)
Description copied from interface: DrawingArea
Set the background color for this drawing area.

Specified by:
setBackgroundColor in interface DrawingArea

setVisible

public void setVisible(boolean v)
Set this drawing area visible. Won't set the area invisible, if close mode is true.

Specified by:
setVisible in interface DrawingArea
Parameters:
v - true=visible, false=invisible

setTitle

public void setTitle(java.lang.String name)
Set the title of this area (used for top-layout)

Specified by:
setTitle in interface DrawingArea
Parameters:
name - Title name of the area

addFrameListener

public void addFrameListener(FrameListener frameListener)
For toplayouts (frames), add a close listener. Currently supports only one listener.

Specified by:
addFrameListener in interface DrawingArea

getContainer

public java.awt.Container getContainer()
This is a Swing specific method to return the container to add this to other regions. Returns either the container or container.getContentPane(). MediaHandler calls this to obtain the container of this DrawingArea.

Returns:
Container to draw media.

getContentContainer

public java.awt.Container getContentContainer()
This is a Swing specific method to return the container to draw media. Returns either the container or container.getContentPane(). MediaHandler calls this to obtain the container of this DrawingArea.

Specified by:
getContentContainer in interface DrawingArea
Returns:
Container to draw media.

setCSSStretch

public boolean setCSSStretch(java.lang.String awidth,
                             java.lang.String aheight,
                             org.w3c.dom.Element origElem)
Specified by:
setCSSStretch in interface DrawingArea


X-Smiles 1.2