new webCGMAppStruct()
webCGMAppStructure constructor
Methods
clearHighlight()
Clears highlighting for this Application Structure (APS). (This is an extension WebCGM DOM specification)
getAppStructureAttr(attr) → {string}
Retrieves an Application Structure attribute value by name. Please refer to the
Application Structure Attributes table
for more detailed information on retrievable and modifiable Application Structure attributes.
Parameters:
Name | Type | Description |
---|---|---|
attr |
string | The name of the Application Structure attribute to retrieve. |
Returns:
the Application Structure attribute value as a string, or the empty string if that attribute does not have an explicitly set value (see the inheritance model for further related discussion). The value may be a Delimited String. Always the empty string if the APS is of type 'grnode'.
Type: string
getApsId() → {string}
Returns the unique identifier of the Application Structure. Always the empty string if the APS is of type 'grnode'.
Returns:
apsId
Type: string
getAttributeNS(namespaceIRI, localName) → {string}
Returns the node attribute value by local name and namespace IRI.
Parameters:
Name | Type | Description |
---|---|---|
namespaceIRI |
string | The namespace IRI of the attribute to retrieve. |
localName |
string | The local name of the attribute to retrieve. |
Returns:
the webCGMAttr value as a string, or the empty string if that attribute does not have a specified value.
Type: string
getAttributes() → {webCGMNodeList}
Returns a webCGMNodeList that contains all attributes of this Application Structure node. If there are no attributes, this returns null.
Returns:
attributes
Type: webCGMNodeList
getChildNodes() → {webCGMNodeList}
Returns a webCGMNodeList that contains all children of this node. If there are no children, this returns null.
Returns:
childNodes
Type: webCGMNodeList
getElementsByTagNameNS(namespaceIRI, localName) → {string}
Returns a webCGMNodeList of all the descendant XML companion file elements(application specific metadata) with a given local name and namespace IRI in the order in which they are encountered in a preorder traversal of the webCGMNode tree. Returns null if there are no such elements.
Parameters:
Name | Type | Description |
---|---|---|
namespaceIRI |
string | The namespace IRI of the XML elements to match on. |
localName |
string | The local name of the XML elements to match on. |
Returns:
Type: string
getFirstChild() → {webCGMNode}
Returns The first child of this node. If there is no such node, this returns null.
Returns:
lastChild
Type: webCGMNode
getLastChild() → {webCGMNode}
Returns The last child of this node. If there is no such node, this returns null.
Returns:
lastChild
Type: webCGMNode
getLinkuriCount() → {string}
Returns the number of 'linkuri' attribute values present on this Application Structure. Always zero if the APS is of type 'grnode'..
Returns:
linkuriCount
Type: string
getLocalName() → {string}
Returns the local part of the qualified name of this node (e.g., foo:elementName, returns "elementName"). This returns empty string if the webCGMNode is not of type XML_METADATA_NODE or ATTR_NODE.
Returns:
localName
Type: string
getNameCount() → {string}
Returns the number of 'name' attribute values present on this Application Structure. Always zero if the APS is of type 'grnode'.
Returns:
apsId
Type: string
getNamespaceIRI() → {string}
Returns The namespace IRI of this node. For example, on the element foo:someElement, returns the IRI of the (xmlns) namespace declaration that associates the prefix foo with the namespace. This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is the namespace IRI given at creation time. This returns empty string if the webCGMNode is not of type XML_METADATA_NODE or ATTR_NODE.
Returns:
namespaceIRI
Type: string
getNextSibling() → {webCGMNode}
Returns the node immediately following this node. If there is no such node, this returns null.
Returns:
nextSibling
Type: webCGMNode
getNodeName() → {string}
Returns the name of this node, depending on its type; see table
Returns:
nodeName
Type: string
getNodeType() → {int}
Returns a code representing the type of the underlying object.
Returns:
type
Type: int
getNodeValue() → {string}
Returns the value of this node, depending on its type; see table
Returns:
nodeValue
Type: string
getObjectExtent() → {webCGMRect}
Retrieves the axis-aligned bounding box rectangle of the Graphical Primitive elements within an APS.
Returns:
bounding rectangle of the APS, or null if the APS has no Graphical Primitive elements. Always the null if the APS is of type 'grnode'.
Type: webCGMRect
getOwnerPicture() → {webCGMNode}
Returns the webCGMPicture object associated with this node. When the node is a webCGMPicture node, this returns null
Returns:
ownerPicture
Type: webCGMNode
getParentNode() → {webCGMNode}
Returns The parent (immediate ancestor node) of this node. All nodes, except webCGMPicture and webCGMAttr, may have a parent.
Returns:
parentNode
Type: webCGMNode
getPrefix() → {string}
Returns the namespace prefix of this node (e.g., foo:elementName, returns "foo"). This returns empty string if the webCGMNode is not of type XML_METADATA_NODE or ATTR_NODE.
Returns:
prefix
Type: string
getPreviousSibling() → {webCGMNode}
Returns the node immediately preceding this node. If there is no such node, this returns null.
Returns:
previousSibling
Type: webCGMNode
hasAttributes() → {boolean}
Returns whether this Application Structure node has any attributes.
Returns:
true if this node has any attributes, false otherwise.
Type: boolean
hasChildNodes() → {boolean}
Returns whether this node has any children.
Returns:
true if this node has any children, false otherwise.
Type: boolean
highlight(type)
Highlights this Application Structure (APS). The highlight method provides a way for webCGM script writers to highlight APS's in the same way a IRI fragment would. It also allows for highlighting of entire layers. Highlighting is not defined for webCGMPicture nodes. See the 'visibility' APS Attribute for discussion of its effect on execution of the highlight method.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Denotes a behavior identical to the corresponding highlighting object behavior keywords of the fragment syntax. Values: { add | new }. |
removeAppStructureAttr(attr)
Removes an Application Structure attribute. Please refer to the Application Structure Attributes table for more detailed information on retrievable and modifiable Application Structure attributes. If the APS is of type 'grnode', this method shall have no effect, neither on the viewed image nor the DOM tree.
Parameters:
Name | Type | Description |
---|---|---|
attr |
string | The name of the Application Structure attribute to remove. |
setAppStructureAttr(attr, value)
Adds a new Application Structure attribute. If an attribute with that name is already present in the APS, its value is changed to be that of the value parameter. Please refer to the
Application Structure Attributes table
for more detailed information on retrievable and modifiable Application Structure attributes. If the APS is of type 'grnode', this method shall have no effect, neither on the viewed image nor the DOM tree.
Parameters:
Name | Type | Description |
---|---|---|
attr |
string | The name of the Application Structure attribute to create or alter. |
value |
string | Value to set in string form. The value may be a delimited string. |
setAttributeNS(namespaceIRI, qualifiedName, value)
Adds a new attribute. If an attribute with that name is already present on the node, its value is changed to be that of the value parameter
Parameters:
Name | Type | Description |
---|---|---|
namespaceIRI |
string | The namespace IRI of the attribute to create or alter. |
qualifiedName |
string | The qualified name of the attribute to create or alter. |
value |
string | The value to set, in string form. |
setStyleProperty(name, value)
Set a style property by name on the given Application Structure. Please refer to the
Style Properties Tablefor more detailed information on style properties. If the APS is of type 'grnode', this methodshall have no effect, neither on the viewed image nor the DOM tree.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the Application Structure attribute to create or alter. |
value |
string | Value to set in string form. The value may be a delimited string. |
toNodeList() → {object}
Returns a webCGMNodeList that contains one element (the current webCGMAppStruct)
Returns:
webCGMNodeList
Type: object