Tools/ActionsBuilder/Sources/actionsbuilder.max.js
/*
        * Constructor
        * @param type: the root type object (OBJECT or SCENE)
        */
Constructor
@param type: the root type object (OBJECT or SCENE)
Constructor @param type : the root type object ( OBJECT or SCENE )
function Viewer(type) {
            var _this = this;
            this.objectName = "Unnamed Object";
            this.zoom = 1.0;
            this._firstUpdate = true;
            this.viewerContainer = document.getElementById("GraphContainerID");
            this.viewerElement = document.getElementById("GraphElementID");
            this.paper = Raphael("GraphElementID", screen.width, screen.height);
            this.root = this.addAction(null, type, { name: this.objectName, text: this.objectName, properties: [], description: "" });
            this.selectedNode = null;
            window.addEventListener("resize", function (event) {
                _this.onResize(event);
            });
            window.addEventListener("mousemove", function (event) {
                _this.onMove(event);
            });
            this.paper.canvas.addEventListener("click", function (event) {
                _this.onClick(event);
            });
            this._toolbar = new ActionsBuilder.Toolbar(this);
            this._contextMenu = new ActionsBuilder.ContextMenu(this);
            this.parameters = new ActionsBuilder.Parameters(this);
            this.utils = new ActionsBuilder.Utils(this);
            this.parameters.parametersHelpElement.textContent = Viewer._DEFAULT_INFO_MESSAGE;
            this.onResize(null);
        }
function Viewer ( type ) { var _this = this ; this . objectName = "Unnamed Object" ; this . zoom = 1.0 ; this . _firstUpdate = true ; this . viewerContainer = document . getElementById ( "GraphContainerID" ) ; this . viewerElement = document . getElementById ( "GraphElementID" ) ; this . paper = Raphael ( "GraphElementID" , screen . width , screen . height ) ; this . root = this . addAction ( null , type , { name : this . objectName , text : this . objectName , properties : [ ] , description : "" } ) ; this . selectedNode = null ; window . addEventListener ( "resize" , function ( event ) { _this . onResize ( event ) ; } ) ; window . addEventListener ( "mousemove" , function ( event ) { _this . onMove ( event ) ; } ) ; this . paper . canvas . addEventListener ( "click" , function ( event ) { _this . onClick ( event ) ; } ) ; this . _toolbar = new ActionsBuilder . Toolbar ( this ) ; this . _contextMenu = new ActionsBuilder . ContextMenu ( this ) ; this . parameters = new ActionsBuilder . Parameters ( this ) ; this . utils = new ActionsBuilder . Utils ( this ) ; this . parameters . parametersHelpElement . textContent = Viewer . _DEFAULT_INFO_MESSAGE ; this . onResize ( null ) ; }
Constructor
 @param type: the root type object (OBJECT or SCENE)
Constructor @param type : the root type object ( OBJECT or SCENE )
// Get HTML elements // Create element // Configure this //var name = type === Type.OBJECT ? "Unnamed object" : "Scene"; // Configure events // Load modules // Finish