fi.hut.tml.xsmiles.mlfc.smil.basic
Class SMILLayoutElementImpl

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.ElementImpl
                  extended byorg.apache.xerces.dom.ElementNSImpl
                      extended byfi.hut.tml.xsmiles.dom.XSmilesElementImpl
                          extended byfi.hut.tml.xsmiles.dom.VisualElementImpl
                              extended byfi.hut.tml.xsmiles.mlfc.smil.basic.SMILElementImpl
                                  extended byfi.hut.tml.xsmiles.mlfc.smil.basic.SMILLayoutElementImpl
All Implemented Interfaces:
java.lang.Cloneable, CSSStyleChangeListener, org.w3c.dom.Element, org.w3c.dom.events.EventListener, org.w3c.dom.events.EventTarget, InitializableElement, LayoutCalc, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.io.Serializable, SMILElement, SMILLayoutElement, StylableElement, org.w3c.dom.TypeInfo, VisualElement, XSmilesLayoutReference

public class SMILLayoutElementImpl
extends SMILElementImpl
implements SMILLayoutElement, LayoutCalc

Declares layout type for the document. See the LAYOUT element definition .

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.smil.basic.SMILElementImpl
smilDoc
 
Fields inherited from class fi.hut.tml.xsmiles.dom.VisualElementImpl
views
 
Fields inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
DESTROYED, elementStatus, INITIALIZED, INITIALIZING, setPseudoClasses, style, UNINITIALIZED, xblpropname
 
Fields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURI
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE, UNNORMALIZED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
SMILLayoutElementImpl(org.apache.xerces.dom.DocumentImpl owner, SMILDocumentImpl smil, java.lang.String ns)
          Constructor with owner doc
 
Method Summary
 void addRegion(SMILRegionElementImpl region)
          Add region to this region.
 int calcBottom()
          Returns the root-layout height.
 int calcLeft()
          Returns zero as the root-layout left coord.
 int calcRight()
          Returns the root-layout width.
 int calcTop()
          Returns zero as the root-layout top coord.
 DrawingArea getDrawingArea()
          Get the drawing area for this region.
 SMILRegionElement getRegionElement(java.lang.String name, org.w3c.dom.Element elem)
          Get a region from the elements under this layout element.
 boolean getResolved()
          true if the player can understand the mime type, false otherwise.
 SMILRootLayoutElement getRootLayoutElement()
          Return the root-layout element.
 int getRootLayoutHeight()
          Return the height of the root-layout or if null, then largest region.
 int getRootLayoutWidth()
          Return the width of the root-layout or if null, then largest region.
 java.lang.String getType()
          The mime type of the layout langage used in this layout element.The default value of the type attribute is "text/smil-basic-layout".
 void init()
          Calls init() for the first root-layout, sets the size and sets the view to be visible.
 void removeRegion(SMILRegionElementImpl region)
          Remove region from this region.
 SMILRegionElementImpl retrieveRegion(org.w3c.dom.Element e, SMILRegionElementImpl parentReg, DrawingArea da, boolean linefeeds)
          CSS: Retrieves or creates a region for element e.
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.smil.basic.SMILElementImpl
dispatch, getAlt, getClassName, getId, getLongdesc, getOwnerDoc, getSMILDoc, getTitle, setAlt, setClassName, setId, setLongdesc, setTitle
 
Methods inherited from class fi.hut.tml.xsmiles.dom.VisualElementImpl
addView, belongsToTree, getViews, handleEvent, insertBefore, isCurrentlyVisible, isFocusPoint, isPseudoClass, isVisibleByCSSProperties, notifyPseudoRemoved, removeAllViews, removeAttribute, removeChild, replaceChild, setAttribute, setStatus, styleChanged, updateViews
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, clone, clonePseudoElements, cloneSubtree, debugNode, debugNode, destroy, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getStyleAttrValue, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, initFinalFlattenedTree, initStyle, isInitedForReset, removeBinding, removeUndistributedChild, replaceNode, resetFinalFlattenedTree, resolveURI, searchElementWithId, searchElementWithId, setApplyBindingSheets, setAuthorSheets, setPseudoClass, setRuleNode, setStyle, updateStyle
 
Methods inherited from class org.apache.xerces.dom.ElementNSImpl
getBaseURI, getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, setPrefix, setType, setValues
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttributeNode, removeAttributeNS, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserData, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.smil20.SMILElement
destroy, getAlt, getClassName, getId, getLongdesc, getTitle, setAlt, setClassName, setId, setLongdesc, setTitle
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.VisualElement
getStyle
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.PseudoClassController
getPseudoClass, setPseudoClass
 

Constructor Detail

SMILLayoutElementImpl

public SMILLayoutElementImpl(org.apache.xerces.dom.DocumentImpl owner,
                             SMILDocumentImpl smil,
                             java.lang.String ns)
Constructor with owner doc

Method Detail

init

public void init()
Calls init() for the first root-layout, sets the size and sets the view to be visible. Also, calls init() for other children. One layout can only have one root-layout element (this uses the first instance). If root-layout element not found, then uses default root-layout, which is the maximum size of the regions. If no regions, or all have percentage values, a default root-layout is defined with the window size.
If type="text/css", then add the text content to the stylesheet.

Specified by:
init in interface SMILElement
Overrides:
init in class VisualElementImpl

getRootLayoutElement

public SMILRootLayoutElement getRootLayoutElement()
Return the root-layout element.

Specified by:
getRootLayoutElement in interface SMILLayoutElement
Returns:
root-layout element from the DOM or default root-layout element (not in DOM)

getRootLayoutWidth

public int getRootLayoutWidth()
Return the width of the root-layout or if null, then largest region.

Specified by:
getRootLayoutWidth in interface SMILLayoutElement

getRootLayoutHeight

public int getRootLayoutHeight()
Return the height of the root-layout or if null, then largest region.

Specified by:
getRootLayoutHeight in interface SMILLayoutElement

calcTop

public int calcTop()
Returns zero as the root-layout top coord.

Specified by:
calcTop in interface LayoutCalc

calcLeft

public int calcLeft()
Returns zero as the root-layout left coord.

Specified by:
calcLeft in interface LayoutCalc

calcRight

public int calcRight()
Returns the root-layout width.

Specified by:
calcRight in interface LayoutCalc

calcBottom

public int calcBottom()
Returns the root-layout height.

Specified by:
calcBottom in interface LayoutCalc

addRegion

public void addRegion(SMILRegionElementImpl region)
Add region to this region. This will cause the drawingarea to become visible.

Specified by:
addRegion in interface LayoutCalc

removeRegion

public void removeRegion(SMILRegionElementImpl region)
Remove region from this region. This may cause the drawingarea to become invisible, if this was the last region, and no medias either in the region.

Specified by:
removeRegion in interface LayoutCalc

getDrawingArea

public DrawingArea getDrawingArea()
Get the drawing area for this region.

Specified by:
getDrawingArea in interface LayoutCalc

getRegionElement

public SMILRegionElement getRegionElement(java.lang.String name,
                                          org.w3c.dom.Element elem)
Get a region from the elements under this layout element. If no matching region is found, returns the default region, which has the size of the roo-layout. The default region is not part of the DOM tree.

Specified by:
getRegionElement in interface SMILLayoutElement
Parameters:
name - The name for the region (regionName or id attr). Can be null, which returns default region.
elem - Element, who asks for the region (use to get the CSS values).
Returns:
Region element matching the name (either regionName or id attr). Or the default region.

retrieveRegion

public SMILRegionElementImpl retrieveRegion(org.w3c.dom.Element e,
                                            SMILRegionElementImpl parentReg,
                                            DrawingArea da,
                                            boolean linefeeds)
CSS: Retrieves or creates a region for element e.

Parameters:
e - element, that requires a dynamically created region
parentReg - Parent Region, to set parent regions visible/invisible (null for root-layout)
da - DrawingArea, which should contain the created region
linefeeds - true if this is a block, false for inline

getType

public java.lang.String getType()
The mime type of the layout langage used in this layout element.The default value of the type attribute is "text/smil-basic-layout".

Specified by:
getType in interface SMILLayoutElement

getResolved

public boolean getResolved()
true if the player can understand the mime type, false otherwise.

Specified by:
getResolved in interface SMILLayoutElement


X-Smiles 1.2