<commit_before>/**
 * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

var lifeLineOptions = {};
lifeLineOptions.class = "lifeline";
// Lifeline rectangle options
lifeLineOptions.rect = {};
lifeLineOptions.rect.width = 100;
lifeLineOptions.rect.height = 30;
lifeLineOptions.rect.roundX = 20;
lifeLineOptions.rect.roundY = 20;
lifeLineOptions.rect.class = "lifeline-rect";

// Lifeline middle-rect options
lifeLineOptions.middleRect = {};
lifeLineOptions.middleRect.width = 100;
lifeLineOptions.middleRect.height = 500;
lifeLineOptions.middleRect.roundX = 1;
lifeLineOptions.middleRect.roundY = 1;
lifeLineOptions.middleRect.class = "lifeline-middleRect";

// Lifeline options
lifeLineOptions.line = {};
lifeLineOptions.line.height = 500;
lifeLineOptions.line.class = "lifeline-line";
// Lifeline text options
lifeLineOptions.text = {};
lifeLineOptions.text.class = "lifeline-title";

var createPoint = function (x, y) {
    return new GeoCore.Models.Point({'x': x, 'y': y});
};

var createLifeLine = function (title, center) {
    return new SequenceD.Models.LifeLine({title: title, centerPoint: center});
};

var createFixedSizedMediator = function (title, center) {
    return new SequenceD.Models.FixedSizedMediator({title: title, centerPoint: center});
};

var createMessage = function (start, end) {
    return new SequenceD.Models.Message({source: start, destination: end});
};

// Create tool palette elements
var lifeline = new Tools.Models.Tool({
    id: "tool1",
    title: "Lifeline",
    icon: "images/icon1.png"
});

// Create tool group
var group = new Tools.Models.ToolGroup();
group.add(lifeline);
for (var manipulator in Processors.manipulators) {
    var tool = new Tools.Models.Tool(Processors.manipulators[manipulator]);
    group.add(tool);
}
for (var flowController in Processors.flowControllers) {
    var tool = new Tools.Models.Tool(Processors.flowControllers[flowController]);
    group.add(tool);
}
var toolGroupWrapper = new Tools.Models.ToolGroupWrapper({
    toolGroupName: "Diagram Elements",
    toolGroupID: "diagram-elements",
    toolGroup: group
});

// Create tool palette
var toolPalette = new Tools.Models.ToolPalatte();
toolPalette.add(toolGroupWrapper);
var paletteView = new Tools.Views.ToolPalatteView({collection: toolPalette});
paletteView.render();

// Create the model for the diagram
var diagram = new Diagrams.Models.Diagram({});

// Create the diagram view
var diagramOptions = {selector: '.editor'};
var diagramView = new Diagrams.Views.DiagramView({model: diagram, options: diagramOptions});
diagramView.render();

lifeLineOptions.diagram = diagram;

// var lifeline1 = createLifeLine("LifeLine1",createPoint(250, 50));
// diagram.addElement(lifeline1, lifeLineOptions);
// var lifeline2 = createLifeLine("LifeLine2",createPoint(500, 50));
// diagram.addElement(lifeline2, lifeLineOptions);
// var lifeline3 = createLifeLine("LifeLine3",createPoint(750, 50));
// diagram.addElement(lifeline3, lifeLineOptions);

// var lf1Activation1 = new SequenceD.Models.Activation({owner:lifeline1});
// var lf2Activation1 = new SequenceD.Models.Activation({owner:lifeline2});
// var lf3Activation1 = new SequenceD.Models.Activation({owner:lifeline3});

// var messageOptions = {'class':'message'};
// var msg1 = new SequenceD.Models.Message({source: lf1Activation1, destination: lf3Activation1});
// diagram.addElement(msg1, messageOptions);
// var msg2 = new SequenceD.Models.Message({source: lf2Activation1, destination: lf3Activation1});
// diagram.addElement(msg2, messageOptions);
// var msg3 = new SequenceD.Models.Message({source: lf3Activation1, destination: lf1Activation1});
// diagram.addElement(msg3, messageOptions);
// var msg4 = new SequenceD.Models.Message({source: lf3Activation1, destination: lf2Activation1});
// diagram.addElement(msg4, messageOptions);
// var msg5 = new SequenceD.Models.Message({source: lf3Activation1, destination: lf1Activation1});
// diagram.addElement(msg5, messageOptions);
selected = "";
selectedModel = "";
var udcontrol = new Dialogs.Controls.UpdateDeleteControler({visible: false});
var udcontrolView = new Dialogs.Views.UpdateDeletedControlerView({model: udcontrol});
udcontrolView.render();

// Initialize the editor
var propertyPane = new JSONEditor(document.getElementById("propertyPane"),{
    schema: {
        "title": "Person",
        type: "object",
        properties: {
            name: { "type": "string" }
        }
    },
    no_additional_properties: true,
    disable_properties:true,
    disable_edit_json:true
});

// Set the value
propertyPane.setValue({
    name: "<NAME>"
});

// Get the value
var data = propertyPane.getValue();
console.log(data.name); // "<NAME>"<commit_msg>Temporarily commenting property pane initialization<commit_after>/**
 * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

var lifeLineOptions = {};
lifeLineOptions.class = "lifeline";
// Lifeline rectangle options
lifeLineOptions.rect = {};
lifeLineOptions.rect.width = 100;
lifeLineOptions.rect.height = 30;
lifeLineOptions.rect.roundX = 20;
lifeLineOptions.rect.roundY = 20;
lifeLineOptions.rect.class = "lifeline-rect";

// Lifeline middle-rect options
lifeLineOptions.middleRect = {};
lifeLineOptions.middleRect.width = 100;
lifeLineOptions.middleRect.height = 500;
lifeLineOptions.middleRect.roundX = 1;
lifeLineOptions.middleRect.roundY = 1;
lifeLineOptions.middleRect.class = "lifeline-middleRect";

// Lifeline options
lifeLineOptions.line = {};
lifeLineOptions.line.height = 500;
lifeLineOptions.line.class = "lifeline-line";
// Lifeline text options
lifeLineOptions.text = {};
lifeLineOptions.text.class = "lifeline-title";

var createPoint = function (x, y) {
    return new GeoCore.Models.Point({'x': x, 'y': y});
};

var createLifeLine = function (title, center) {
    return new SequenceD.Models.LifeLine({title: title, centerPoint: center});
};

var createFixedSizedMediator = function (title, center) {
    return new SequenceD.Models.FixedSizedMediator({title: title, centerPoint: center});
};

var createMessage = function (start, end) {
    return new SequenceD.Models.Message({source: start, destination: end});
};

// Create tool palette elements
var lifeline = new Tools.Models.Tool({
    id: "tool1",
    title: "Lifeline",
    icon: "images/icon1.png"
});

// Create tool group
var group = new Tools.Models.ToolGroup();
group.add(lifeline);
for (var manipulator in Processors.manipulators) {
    var tool = new Tools.Models.Tool(Processors.manipulators[manipulator]);
    group.add(tool);
}
for (var flowController in Processors.flowControllers) {
    var tool = new Tools.Models.Tool(Processors.flowControllers[flowController]);
    group.add(tool);
}
var toolGroupWrapper = new Tools.Models.ToolGroupWrapper({
    toolGroupName: "Diagram Elements",
    toolGroupID: "diagram-elements",
    toolGroup: group
});

// Create tool palette
var toolPalette = new Tools.Models.ToolPalatte();
toolPalette.add(toolGroupWrapper);
var paletteView = new Tools.Views.ToolPalatteView({collection: toolPalette});
paletteView.render();

// Create the model for the diagram
var diagram = new Diagrams.Models.Diagram({});

// Create the diagram view
var diagramOptions = {selector: '.editor'};
var diagramView = new Diagrams.Views.DiagramView({model: diagram, options: diagramOptions});
diagramView.render();

lifeLineOptions.diagram = diagram;

// var lifeline1 = createLifeLine("LifeLine1",createPoint(250, 50));
// diagram.addElement(lifeline1, lifeLineOptions);
// var lifeline2 = createLifeLine("LifeLine2",createPoint(500, 50));
// diagram.addElement(lifeline2, lifeLineOptions);
// var lifeline3 = createLifeLine("LifeLine3",createPoint(750, 50));
// diagram.addElement(lifeline3, lifeLineOptions);

// var lf1Activation1 = new SequenceD.Models.Activation({owner:lifeline1});
// var lf2Activation1 = new SequenceD.Models.Activation({owner:lifeline2});
// var lf3Activation1 = new SequenceD.Models.Activation({owner:lifeline3});

// var messageOptions = {'class':'message'};
// var msg1 = new SequenceD.Models.Message({source: lf1Activation1, destination: lf3Activation1});
// diagram.addElement(msg1, messageOptions);
// var msg2 = new SequenceD.Models.Message({source: lf2Activation1, destination: lf3Activation1});
// diagram.addElement(msg2, messageOptions);
// var msg3 = new SequenceD.Models.Message({source: lf3Activation1, destination: lf1Activation1});
// diagram.addElement(msg3, messageOptions);
// var msg4 = new SequenceD.Models.Message({source: lf3Activation1, destination: lf2Activation1});
// diagram.addElement(msg4, messageOptions);
// var msg5 = new SequenceD.Models.Message({source: lf3Activation1, destination: lf1Activation1});
// diagram.addElement(msg5, messageOptions);
selected = "";
selectedModel = "";
var udcontrol = new Dialogs.Controls.UpdateDeleteControler({visible: false});
var udcontrolView = new Dialogs.Views.UpdateDeletedControlerView({model: udcontrol});
udcontrolView.render();

// Initialize the editor
// var propertyPane = new JSONEditor(document.getElementById("propertyPane"),{
//     schema: {
//         "title": "Person",
//         type: "object",
//         properties: {
//             name: { "type": "string" }
//         }
//     },
//     no_additional_properties: true,
//     disable_properties:true,
//     disable_edit_json:true
// });

// // Set the value
// propertyPane.setValue({
//     name: "<NAME>"
// });

// // Get the value
// var data = propertyPane.getValue();
// console.log(data.name); // "<NAME>"
{'fraction_non_alphanumeric': 0.13276071328540753, 'fraction_numerical': 0.017925497152460088, 'mean_word_length': 4.796536796536796, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2753825', 'n_tokens_mistral': 3296, 'n_tokens_neox': 3175, 'n_words': 809}