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 = "";
6 this.secondaryStructure = ' ';
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;
18 Clazz.makeConstructor (c$,
19 function (displayChar, desc, ss, val, colour) {
20 this.construct (displayChar, desc, ss, val);
22 }, "~S,~S,~S,~N,java.awt.Color");
23 Clazz.makeConstructor (c$,
25 if (that == null || this === that) {
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$,
35 this.construct (null, null, ' ', val, null);
37 Clazz.overrideMethod (c$, "toString",
39 var sb = new StringBuffer ();
40 if (this.displayCharacter != null) {
42 sb.append (this.displayCharacter);
46 }if (this.secondaryStructure.charCodeAt (0) != 0 && !("" + this.displayCharacter).equals ("" + this.secondaryStructure)) {
48 sb.append (this.secondaryStructure);
52 }if (this.description != null && this.description.length > 0) {
54 sb.append (this.description);
58 }if (!Float.isNaN (this.value)) {
59 sb.append (this.value);
60 }if (this.colour != null) {
61 if (sb.length () > 0) {
64 sb.append ("" + this.colour.getRed ());
66 sb.append ("" + this.colour.getGreen ());
68 sb.append ("" + this.colour.getBlue ());
70 }return sb.toString ();