Up to cover page | Back to Conformance | On to Application configuration

WebCGM 2.1 — ECMAScript binding


8. ECMAScript binding

This chapter is normative.

Prototype Object WebCGMException
    The WebCGMException class has the following constants:
        WebCGMException.INDEX_SIZE_ERR
            This constant is of type Number and its value is 1.
        WebCGMException.WEBCGMSTRING_SIZE_ERR
            This constant is of type Number and its value is 2.
        WebCGMException.INVALID_CHARACTER_ERR
            This constant is of type Number and its value is 3.
        WebCGMException.NO_DATA_ALLOWED_ERR
            This constant is of type Number and its value is 4.
        WebCGMException.NO_MODIFICATION_ALLOWED_ERR
            This constant is of type Number and its value is 5.
        WebCGMException.NOT_SUPPORTED_ERR
            This constant is of type Number and its value is 6.
        WebCGMException.INVALID_ACCESS_ERR
            This constant is of type Number and its value is 7.
        WebCGMException.FILE_NOT_FOUND_ERR
            This constant is of type Number and its value is 8.
        WebCGMException.FILE_INVALID_ERR
            This constant is of type Number and its value is 9.

Object WebCGMException
    The WebCGMException object has the following properties:
        code
            This property is of type Number.

Object WebCGMRect
    The WebCGMRect object has the following properties:
        xll
            This property is of type Number.
        yll
            This property is of type Number.
        xur
            This property is of type Number.
        yur
            This property is of type Number.

    The WebCGMRect object has the following methods:
        union(r)
            This method returns a WebCGMRect.
            The r parameter is of type WebCGMRect.

Object WebCGMMatrix
    The WebCGMMatrix object has the following properties:
        a
            This property is of type Number.
        b
            This property is of type Number.
        c   
            This property is of type Number.
        d
            This property is of type Number.
        e
            This property is of type Number.
        f
            This property is of type Number.
        
The WebCGMMatrix object has the following methods:
        multiply(m)
            This method returns a WebCGMMatrix.
            The m parameter is of type WebCGMMatrix.
        inverse()
            This method returns a WebCGMMatrix.  // Raises WebCGMException if matrix is not invertible.
        translate(x,y)
            This method returns a WebCGMMatrix.
            The x parameter is of type Number.
            The y parameter is of type Number.
        scale(sx,sy)     
            This method returns a WebCGMMatrix.
            The sx parameter is of type Number.
            The sy parameter is of type Number.
        rotate(angle,rx,ry)
            This method returns a WebCGMMatrix.
            The angle parameter is of type Number.        
            The rx parameter is of type Number.
            The ry parameter is of type Number.
        
Object GetWebCGMDocument
    The GetWebCGMDocument object has the following methods:
        getWebCGMDocument()
            This method returns a WebCGMMetafile.
    getAppName()
            This method returns a String.
    getAppVersion()
            This method returns a String.

Object WebCGMMetafile
    The WebCGMMetafile object has the following properties:
        metafileDescription
            This read-only property is of type String.
        firstPicture
            This read-only property is a WebCGMPicture object.
        metafileID
            This read-only property is of type String.
        metafileVersion
            This read-only property is of type Number.
        src
            This property is of type String.

    The WebCGMMetafile object has the following methods:
        addEventListener(type,listener);
            The type parameter is of type String.
            The listener parameter is a WebCGMEventListener object.
        removeEventListener(type,listener);
            The type parameter is of type String.
            The listener parameter is a WebCGMEventListener object.
        setRedraw(value);
            The value parameter is of type String.

Prototype Object WebCGMNode
    The WebCGMNode class has the following constants:
        WebCGMNode.PICTURE_NODE
            This constant is of type Number and its value is 1.
        WebCGMNode.APP_STRUCTURE_NODE
            This constant is of type Number and its value is 2.
        WebCGMNode.XML_METADATA_NODE
            This constant is of type Number and its value is 3.
        WebCGMNode.TEXT_NODE
            This constant is of type Number and its value is 4.
        WebCGMNode.ATTR_NODE
            This constant is of type Number and its value is 5.

Object WebCGMNode
    The WebCGMNode object has the following properties:
        nodeName
            This read-only property is of type String.
        nodeValue
            This read-only property is of type String, can raise a WebCGMException object on retrieval.
        nodeType
            This read-only property is of type Number.
        parentNode
            This read-only property is a WebCGMNode object.
        childNodes
            This read-only property is a WebCGMNodeList object.
        firstChild
            This read-only property is a WebCGMNode object.
        lastChild
            This read-only property is a WebCGMNode object.
        previousSibling
            This read-only property is a WebCGMNode object.
        nextSibling
            This read-only property is a WebCGMNode object.
        attributes
            This read-only property is a WebCGMNodeList object.
        ownerPicture
            This read-only property is a WebCGMPicture object.
        namespaceIRI
            This read-only property is of type String.
        prefix
            This read-only property is of type String.
        localName
            This read-only property is of type String.

    The WebCGMNode object has the following methods:
        hasChildNodes()
            This method returns a Boolean.
        hasAttributes()
            This method returns a Boolean.
        getAttributeNS(namespaceIRI, localName)
            This method returns a String.
            The namespaceIRI parameter is of type String.
            The localName parameter is of type String.
        setAttributeNS(namespaceIRI, qualifiedName, value)
            This method has no return value.
            The namespaceIRI parameter is of type String.
            The qualifiedName parameter is of type String.
            The value parameter is of type String.
        getElementsByTagNameNS(namespaceIRI, localName)
            This method returns a WebCGMNodeList object.
        The namespaceIRI parameter is of type String.
            The localName parameter is of type String.

Object WebCGMPicture
    WebCGMPicture has all the properties and methods of the WebCGMNode object as well as the 
    properties and methods defined below.

    The WebCGMPicture object has the following properties:
        width
            This read-only property is of type Number.
        height
            This read-only property is of type Number.
        pictid
            This read-only property is of type String.

    The WebCGMPicture object has the following methods:
        applyCompanionFile(fileIRI)
            This method returns a Boolean.
            The fileIRI parameter is of type String.
        getAppStructureById(apsId)
            This method retuns a WebCGMAppStructure.
            The apsId parameter is of type String.
        getAppStructuresByName(apsName)
            This method retuns a WebCGMNodeList object.
            The apsName parameter is of type String.
        highlight(nodes,type)
            This method has no return value.
            The nodes parameter is a WebCGMNodeList object.
            The type parameter is of type WebCGMString.
        clearHighlight()
            This method has no return value.
            This method has no parameters.
        setPictureVisibility(visibility)
            This method has no return value.
            The visibility parameter is of type String.
        setStyleProperty(style,value)
            This method has no return value.
            The style parameter is of type String.
            The value parameter is of type String.
        reloadPicture()
            This method has no return value.
        getStyleProperty(style)
            This method returns a String.
            The style parameter is of type String.
        setView(view)
            This method has no return value.
            The view parameter is of type WebCGMRect.

Object WebCGMAppStructure
    WebCGMAppStructure has all the properties and methods of the WebCGMNode object as well as the 
    properties and methods defined below.

    The WebCGMAppStructure object has the following properties: 
        apsId
            This read-only property is of type String.
        nameCount
            This read-only property is of type Number.
        linkuriCount
            This read-only property is of type Number.

    The WebCGMAppStructure object has the following methods:
        getAppStructureAttr(name)
            This method returns a String.
            The name parameter is of type String.
        setAppStructureAttr(name,value)
            This method has no return value.
            The name parameter is of type String.
            The value parameter is of type String.
        removeAppStructureAttr(name)
            This method has no return value.
            The name parameter is of type String.
        setStyleProperty(style,value)
            This method has no return value.
            The style parameter is of type String.
            The value parameter is of type String.
        toNodeList()
            This method has no parameters.
            This method returns a WebCGMNodeList object.
        getObjectExtent()
            This method has no parameters.
            This method returns a WebCGMRect.
        getStyleProperty(style)
            This method returns a String.
            The style parameter is of type String.
        translate(dx,dy,replace)
            This method has no return value.
            The dx parameter is of type Number.
            The dy parameter is of type Number.
            The replace parameter is of type String.
        rotate(angle,cx,cy,replace)
            This method has no return value.
            The angle parameter is of type Number.
            The cx parameter is of type Number.
            The cy parameter is of type Number.
            The replace parameter is of type String.
        scale(sx,sy,replace)
            This method has no return value.
            The sx parameter is of type Number.
            The sy parameter is of type Number.
            The replace parameter is of type String.
        setTransform(matrix,replace)
            This method has no return value.
            The matrix parameter is of type WebCGMMatrix.
            The replace parameter is of type String.
        getTransform(type)
            This type parameter is of type String.
            This method returns a WebCGMMatrix.
   
Object WebCGMNodeList
    The WebCGMNodeList object has the following properties: 
        count
            This read-only property is of type Number.

    The WebCGMNodeList object has the following methods:
        item(index)
            This method returns a WebCGMNode object.
            The index parameter is of type Number.
        removeItem(index) // Raises WebCGMException when the list cannot be modified.
            This method returns a WebCGMNode object.
            The index parameter is of type Number.
        appendItem(newItem) // Raises WebCGMException when the list cannot be modified.
            This method returns a WebCGMNode object.
            The newItem parameter is a WebCGMNode object.


Object WebCGMAttr
    WebCGMAttr has all the properties and methods of the WebCGMNode object as well as the 
    properties and methods defined below.

    The WebCGMAttr object has the following properties: 
        name
            This read-only property is of type String.
        value
            This property is of type String.
        ownerNode
            This read-only property is a WebCGMNode object.

Object WebCGMEventListener
    This is an ECMAScript function reference. This method has no return value. The parameter 
    is a WebCGMEvent object.

Object WebCGMEvent
    The WebCGMEvent object has the following properties:
        type
            This read-only property is of type String.
        target
            This read-only property is a WebCGMNode object.
        button
            This read-only property is of type Number.
        numPressed
            This read-only property is of type Number.
        clientX
            This read-only property is of type Number.
        clientY
            This read-only property is of type Number.
        ctrlKey
            This read-only property is of type Boolean.
        shiftKey
            This read-only property is of type Boolean.
        altKey
            This read-only property is of type Boolean.
        metaKey
            This read-only property is of type Boolean.

    The WebCGMEvent object has the following methods:
        preventDefault()
            This method has no return value.

Back to top of chapter