Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
999 bytes
|
Line | |
---|
1 | function 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 | |
---|
9 | NeuroClass.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 | |
---|
28 | NeuroClass.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 | |
---|
41 | NeuroClass.prototype.getScheme = function(){ |
---|
42 | return this.class["SYMBOL"].split(',').map(Number); |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.