<commit_before>/**
 * This Source Code is licensed under the MIT license. If a copy of the
 * MIT-license was not distributed with this file, You can obtain one at:
 * http://opensource.org/licenses/mit-license.html.
 *
 * @author: <NAME> (IjzerenHein)
 * @license MIT
 * @copyright Gloey Apps, 2014
 */

/*global define, console*/

/**
 * LayoutContext is the interface for a layout-function to enumerate the
 * `LayoutNode`'s' and to get the size of the parent.
 * @module
 */
define(function(require, exports, module) {

    /**
     * @class
     * @param {Object} options Options.
     * @alias module:LayoutContext
     */
    function LayoutContext() {
        // properties:
        // size
    }

    /**
     * Get the layout node for the next renderable in the data-source.
     *
     * @return {LayoutNode} layout-node or undefined
     */
    LayoutContext.prototype.nextNode = function() {
        // this function is overriden by LayoutController
        // which provides the implementation.
    };

    /**
     * Get the layout-node for a renderable with a specific id. The renderable
     * can be an array, in that case an array of elements is returned.
     * To access the `LayoutNode`s for those array-elements, use
     * `nodeByArrayElement` on each of the elements.
     *
     * @param {String} nodeId id of the renderable
     * @return {LayoutNode|Array} layout-node or undefined
     */
    LayoutContext.prototype.nodeById = function(nodeId) {
        // this function is overriden by LayoutController
        // which provides the implementation.
    };

    /**
     * Get the layout-node based on an array element.
     *
     * @param {Object} arrayElement array-element for which to return a `LayoutNode`
     * @return {LayoutNode} layout-node or undefined
     */
    LayoutContext.prototype.nodeByArrayElement = function(arrayElement) {
        // this function is overriden by LayoutController
        // which provides the implementation.
    };

    module.exports = LayoutContext;
});<commit_msg>Added new syntax for setting node-properties through Context<commit_after>/**
 * This Source Code is licensed under the MIT license. If a copy of the
 * MIT-license was not distributed with this file, You can obtain one at:
 * http://opensource.org/licenses/mit-license.html.
 *
 * @author: <NAME> (IjzerenHein)
 * @license MIT
 * @copyright Gloey Apps, 2014
 */

/*global define, console*/

/**
 * LayoutContext is the interface for a layout-function to enumerate the
 * `LayoutNode`'s' and to get the size of the parent.
 * @module
 */
define(function(require, exports, module) {

    /**
     * @class
     * @param {Object} options Options.
     * @alias module:LayoutContext
     */
    function LayoutContext() {
        // properties:
        // size
    }

    /**
     * Get the layout node for the next renderable in the data-source.
     *
     * @return {LayoutNode} layout-node or undefined
     */
    LayoutContext.prototype.nextNode = function() {
        // this function is overriden by LayoutController
        // which provides the implementation.
    };

    /**
     * Get the layout-node for a renderable with a specific id. The renderable
     * can be an array, in that case an array of elements is returned.
     * To access the `LayoutNode`s for those array-elements, use
     * `nodeByArrayElement` on each of the elements.
     *
     * @param {String} nodeId id of the renderable
     * @return {LayoutNode|Array} layout-node or undefined
     */
    LayoutContext.prototype.nodeById = function(nodeId) {
        // this function is overriden by LayoutController
        // which provides the implementation.
    };

    /**
     * Get the layout-node based on an array element.
     *
     * @param {Object} arrayElement array-element for which to return a `LayoutNode`
     * @return {LayoutNode} layout-node or undefined
     */
    LayoutContext.prototype.nodeByArrayElement = function(arrayElement) {
        // this function is overriden by LayoutController
        // which provides the implementation.
    };

    LayoutContext.prototype.setSize = function(node, size) {
        if (node) {
            node.setSize(size);
        }
    };
    LayoutContext.prototype.setAlign = function(node, align) {
        if (node) {
            node.setAlign(align);
        }
    };
    LayoutContext.prototype.setOrigin = function(node, origin) {
        if (node) {
            node.setOrigin(origin);
        }
    };
    LayoutContext.prototype.setTranslate = function(node, x, y, z) {
        if (node) {
            node.setTranslate(x, y, z);
        }
    };
    LayoutContext.prototype.setRotation = function(node, x, y, z) {
        if (node) {
            node.setRotation(x, y, z);
        }
    };
    LayoutContext.prototype.setSkew = function(node, x, y, z) {
        if (node) {
            node.setSkew(x, y, z);
        }
    };
    LayoutContext.prototype.setScale = function(node, x, y, z) {
        if (node) {
            node.setScale(x, y, z);
        }
    };

    module.exports = LayoutContext;
});
{'fraction_non_alphanumeric': 0.1044365920691009, 'fraction_numerical': 0.0015704750687082843, 'mean_word_length': 2.3741721854304636, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1264761', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1412, 'n_words': 469}