source: js/viewer-f0/js/Structures/NeuroClass.js @ 159

Last change on this file since 159 was 159, checked in by mmichalski, 10 years ago

Solve poblem for older Chrome

File size: 999 bytes
Line 
1function NeuroClass() {
2    this.class = {};//obiekt z cechami klasy
3    this._properties = {};//obiekt z propertisami
4}
5
6//pobranie danych o klasie
7//pobranie danych o propertisach
8
9NeuroClass.prototype.setModel = function(data)
10{
11    var self = this;
12    $(data).each(function () {
13        $.each(this.attributes, function () {
14            self.class[this.name] = this.value;
15        });
16    });
17
18    var nodes = data[0].childNodes;
19
20    for (var i = 0; i < nodes.length; i++) {
21        if(nodes[i].nodeType == 3)
22            continue;
23        var node = $(nodes[i]);
24        this.addProperties(node);
25    }
26}
27
28NeuroClass.prototype.addProperties = function (data) {
29    var properties = {};
30
31    $(data).each(function () {
32        $.each(this.attributes, function () {
33            properties[this.name] = this.value;
34        });
35
36    });
37
38    this._properties[properties["ID"]] = properties;
39}
40
41NeuroClass.prototype.getScheme = function(){
42    return this.class["SYMBOL"].split(',').map(Number);
43}
Note: See TracBrowser for help on using the repository browser.