JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / jalview / datamodel / Annotation.js
1 Clazz.declarePackage ("jalview.datamodel");
2 Clazz.load (null, "jalview.datamodel.Annotation", ["java.lang.Float", "$.StringBuffer"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.displayCharacter = "";
5 this.description = "";
6 this.secondaryStructure = ' ';
7 this.value = 0;
8 this.colour = null;
9 Clazz.instantialize (this, arguments);
10 }, jalview.datamodel, "Annotation");
11 Clazz.makeConstructor (c$, 
12 function (displayChar, desc, ss, val) {
13 this.displayCharacter = displayChar;
14 this.description = desc;
15 this.secondaryStructure = ss;
16 this.value = val;
17 }, "~S,~S,~S,~N");
18 Clazz.makeConstructor (c$, 
19 function (displayChar, desc, ss, val, colour) {
20 this.construct (displayChar, desc, ss, val);
21 this.colour = colour;
22 }, "~S,~S,~S,~N,java.awt.Color");
23 Clazz.makeConstructor (c$, 
24 function (that) {
25 if (that == null || this === that) {
26 return;
27 }if (that.displayCharacter != null) this.displayCharacter =  String.instantialize (that.displayCharacter);
28 if (that.description != null) this.description =  String.instantialize (that.description);
29 this.secondaryStructure = that.secondaryStructure;
30 this.value = that.value;
31 this.colour = that.colour;
32 }, "jalview.datamodel.Annotation");
33 Clazz.makeConstructor (c$, 
34 function (val) {
35 this.construct (null, null, ' ', val, null);
36 }, "~N");
37 Clazz.overrideMethod (c$, "toString", 
38 function () {
39 var sb =  new StringBuffer ();
40 if (this.displayCharacter != null) {
41 sb.append ("\'");
42 sb.append (this.displayCharacter);
43 sb.append ("\'");
44 }{
45 sb.append (",");
46 }if (this.secondaryStructure.charCodeAt (0) != 0 && !("" + this.displayCharacter).equals ("" + this.secondaryStructure)) {
47 sb.append ("\'");
48 sb.append (this.secondaryStructure);
49 sb.append ("\'");
50 }{
51 sb.append (",");
52 }if (this.description != null && this.description.length > 0) {
53 sb.append ("\"");
54 sb.append (this.description);
55 sb.append ("\"");
56 }{
57 sb.append (",");
58 }if (!Float.isNaN (this.value)) {
59 sb.append (this.value);
60 }if (this.colour != null) {
61 if (sb.length () > 0) {
62 sb.append (",");
63 }sb.append ("[");
64 sb.append ("" + this.colour.getRed ());
65 sb.append (",");
66 sb.append ("" + this.colour.getGreen ());
67 sb.append (",");
68 sb.append ("" + this.colour.getBlue ());
69 sb.append ("]");
70 }return sb.toString ();
71 });
72 });