fi.hut.tml.xsmiles.mlfc.gps
Class AreaElementImpl
java.lang.Object
org.apache.xerces.dom.NodeImpl
org.apache.xerces.dom.ChildNode
org.apache.xerces.dom.ParentNode
org.apache.xerces.dom.ElementImpl
org.apache.xerces.dom.ElementNSImpl
fi.hut.tml.xsmiles.dom.XSmilesElementImpl
fi.hut.tml.xsmiles.mlfc.gps.AreaElementImpl
- All Implemented Interfaces:
- AnimationService, java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.events.EventTarget, InitializableElement, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.io.Serializable, StylableElement, org.w3c.dom.TypeInfo
- public class AreaElementImpl
- extends XSmilesElementImpl
- implements AnimationService
Area Element send dom changed events to inform
changes in coordinate data - that a particular area has been entered/exited.
Area element has all coordinates in format "2400000", no floating points.
This enables SMIL Animation module to animate the area locations.
Also, the distance is in form "120", which denotes meters.
- Author:
- Kari
- See Also:
- Serialized Form
| 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 |
AreaElementImpl(org.apache.xerces.dom.DocumentImpl owner,
GPSMLFC gps,
java.lang.String namespace,
java.lang.String tag)
Constructor - Set the owner, name and namespace. |
|
Method Summary |
float |
convertStringToUnitless(java.lang.String attr,
java.lang.String value)
Convert String attribute to an float value |
java.lang.String |
convertUnitlessToString(java.lang.String attr,
float value)
|
void |
destroy()
Destroy this element. |
java.lang.String |
getAnimAttribute(java.lang.String attr)
The attribute value got with this method takes precedence over
the DOM attribute value. |
void |
gpsDataReceived(java.lang.String lat,
java.lang.String longi,
java.lang.String speed,
java.lang.String utcd,
java.lang.String utct,
java.lang.String course)
When GPS data is received, the attributes of this element change,
and a DOM event is sent |
void |
init()
Initialize this element. |
boolean |
isWithinArea(java.lang.String latitude,
java.lang.String longitude)
Test if the given coordinates are within this area element. |
void |
refreshAnimation()
Refresh element with all the animation values. |
void |
removeAnimAttribute(java.lang.String attr)
The anim attribute value removed with this method allows
the DOM attribute value be visible. |
void |
setAnimAttribute(java.lang.String attr,
java.lang.String value)
The attribute value set with this method should take precedence over
the DOM attribute value. |
| Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl |
addBinding, addUndistributedChild, clone, clonePseudoElements, cloneSubtree, debugNode, debugNode, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getId, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getStyleAttrValue, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, initFinalFlattenedTree, initStyle, isInitedForReset, isPseudoClass, 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, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, 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, insertBefore, item, removeChild, replaceChild, 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.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 |
AreaElementImpl
public AreaElementImpl(org.apache.xerces.dom.DocumentImpl owner,
GPSMLFC gps,
java.lang.String namespace,
java.lang.String tag)
- Constructor - Set the owner, name and namespace.
init
public void init()
- Initialize this element.
This requires that the DOM tree is available.
- Specified by:
init in interface InitializableElement- Overrides:
init in class XSmilesElementImpl
isWithinArea
public boolean isWithinArea(java.lang.String latitude,
java.lang.String longitude)
- Test if the given coordinates are within this area element. If the area
is at the given location, true is returned. This element will also send
gpsAreaEntered and gpsAreaExited events, when the area is entered or exited.
- Parameters:
latitude - A string in form "24.00000"longitude - A string in form "61.00000"
- Returns:
- true if the area is covered.
gpsDataReceived
public void gpsDataReceived(java.lang.String lat,
java.lang.String longi,
java.lang.String speed,
java.lang.String utcd,
java.lang.String utct,
java.lang.String course)
- When GPS data is received, the attributes of this element change,
and a DOM event is sent
destroy
public void destroy()
- Destroy this element.
- Overrides:
destroy in class XSmilesElementImpl
convertStringToUnitless
public float convertStringToUnitless(java.lang.String attr,
java.lang.String value)
- Convert String attribute to an float value
- Specified by:
convertStringToUnitless in interface AnimationService
convertUnitlessToString
public java.lang.String convertUnitlessToString(java.lang.String attr,
float value)
- Specified by:
convertUnitlessToString in interface AnimationService
getAnimAttribute
public java.lang.String getAnimAttribute(java.lang.String attr)
- The attribute value got with this method takes precedence over
the DOM attribute value.
- Specified by:
getAnimAttribute in interface AnimationService
- Parameters:
attr - Animated attribute
setAnimAttribute
public void setAnimAttribute(java.lang.String attr,
java.lang.String value)
- The attribute value set with this method should take precedence over
the DOM attribute value.
- Specified by:
setAnimAttribute in interface AnimationService
- Parameters:
attr - Attribute to be animatedvalue - Animation value to be set
removeAnimAttribute
public void removeAnimAttribute(java.lang.String attr)
- The anim attribute value removed with this method allows
the DOM attribute value be visible.
- Specified by:
removeAnimAttribute in interface AnimationService
- Parameters:
attr - Attribute to be animated (animation removed)
refreshAnimation
public void refreshAnimation()
- Refresh element with all the animation values. This is called after
several calls to setAnimAttribute() and removeAttribute().
- Specified by:
refreshAnimation in interface AnimationService
X-Smiles 1.2