<commit_before>"use strict";

define(['logManager',
        'clientUtil',
        'js/DiagramDesigner/DesignerCanvas'], function (logManager,
                                                            clientUtil,
                                                            DesignerCanvas) {

    var MetaDesignerCanvas,
        __parent__ = DesignerCanvas,
        __parent_proto__ = DesignerCanvas.prototype;

    MetaDesignerCanvas = function (opts) {
        var options = {};

        if (typeof opts === "string") {
            options.containerElement = opts;
        }
        options.loggerName = options.loggerName || "MetaDesignerCanvas";

        __parent__.apply(this, [options]);

        this.logger.debug("MetaDesignerCanvas ctor");
    };

    _.extend(MetaDesignerCanvas.prototype, DesignerCanvas.prototype);

    MetaDesignerCanvas.prototype.initializeUI = function () {
        __parent_proto__.initializeUI.apply(this, arguments);
        this.logger.debug("MetaDesignerCanvas.initializeUI");

        this.skinParts.SVGPaper.text(this._actualSize.w / 2, this._actualSize.h / 2, "MetaDesignerCanvas");
    };

    return MetaDesignerCanvas;
});<commit_msg>in meta mode support Containment and Inheritance type connections<commit_after>"use strict";

define(['logManager',
        'clientUtil',
        'js/DiagramDesigner/DesignerCanvas'], function (logManager,
                                                            clientUtil,
                                                            DesignerCanvas) {

    var MetaDesignerCanvas,
        __parent__ = DesignerCanvas,
        __parent_proto__ = DesignerCanvas.prototype,
        CONTAINMENT_TYPE_LINE_END = "diamond-wide-long",
        INHERITANCE_TYPE_LINE_END = "block-wide-long";

    MetaDesignerCanvas = function (opts) {
        var options = {};

        if (typeof opts === "string") {
            options.containerElement = opts;
        }
        options.loggerName = options.loggerName || "MetaDesignerCanvas";

        __parent__.apply(this, [options]);

        this._setMetaConnectionType("containment");

        this.logger.debug("MetaDesignerCanvas ctor");
    };

    _.extend(MetaDesignerCanvas.prototype, DesignerCanvas.prototype);

    MetaDesignerCanvas.prototype.initializeUI = function () {
        var self = this;

        __parent_proto__.initializeUI.apply(this, arguments);
        this.logger.debug("MetaDesignerCanvas.initializeUI");

        this.skinParts.SVGPaper.text(this._actualSize.w / 2, this._actualSize.h / 2, "MetaDesignerCanvas");

        //META SPECIFIC parts

        // #1: create connection types are "connection" and "inheritance"
        this.skinParts.$btnGroupConnectionType = this.addButtonGroup(function (event) {
            event.stopPropagation();
            event.preventDefault();
            self._setMetaConnectionType($(this).attr("data-mode"));
        });

        this.addButton({ "title": "Containment",
                         "icon": "icon-meta-containment",
                         "data": { "mode": "containment" }}, this.skinParts.$btnGroupConnectionType );

        this.addButton({ "title": "Inheritance",
            "icon": "icon-meta-inheritance",
            "data": { "mode": "inheritance" }}, this.skinParts.$btnGroupConnectionType );
    };

    MetaDesignerCanvas.prototype._setMetaConnectionType = function (mode) {
        var params = {};

        if (this._connectionType !== mode) {
            this.skinParts.$btnGroupConnectionType.find('.btn.active').removeClass('active');
            this.skinParts.$btnGroupConnectionType.find('.btn[data-mode="' + mode + '"]').addClass('active');

            params = {"connectionType": mode };

            switch (mode) {
                case "containment":
                    params.arrowStart = CONTAINMENT_TYPE_LINE_END;
                    params.width = "5";
                    params.color = "#FF0000";
                    break;
                case "inheritance":
                    params.arrowStart = INHERITANCE_TYPE_LINE_END;
                    params.width = "3";
                    params.color = "#0000FF";
                    break;
                default:
                    params.arrowStart = "none";
                    params.width = "2";
                    params.color = "#000000";
                    break;
            }
            this.connectionDrawingManager.setConnectionInDrawProperties(params);
        }
    };

    return MetaDesignerCanvas;
});
{'fraction_non_alphanumeric': 0.11333333333333333, 'fraction_numerical': 0.004888888888888889, 'mean_word_length': 1.970957095709571, 'pattern_counts': {'":': 11, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2891079', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1108, 'n_words': 189}