1 Clazz.declarePackage ("jalview.datamodel");
\r
2 Clazz.load (null, "jalview.datamodel.Annotation", ["java.lang.Float", "$.StringBuffer"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.displayCharacter = "";
\r
5 this.description = "";
\r
6 this.secondaryStructure = ' ';
\r
9 Clazz.instantialize (this, arguments);
\r
10 }, jalview.datamodel, "Annotation");
\r
11 Clazz.makeConstructor (c$,
\r
12 function (displayChar, desc, ss, val) {
\r
13 this.displayCharacter = displayChar;
\r
14 this.description = desc;
\r
15 this.secondaryStructure = ss;
\r
18 Clazz.makeConstructor (c$,
\r
19 function (displayChar, desc, ss, val, colour) {
\r
20 this.construct (displayChar, desc, ss, val);
\r
21 this.colour = colour;
\r
22 }, "~S,~S,~S,~N,java.awt.Color");
\r
23 Clazz.makeConstructor (c$,
\r
25 if (that == null || this === that) {
\r
27 }if (that.displayCharacter != null) this.displayCharacter = String.instantialize (that.displayCharacter);
\r
28 if (that.description != null) this.description = String.instantialize (that.description);
\r
29 this.secondaryStructure = that.secondaryStructure;
\r
30 this.value = that.value;
\r
31 this.colour = that.colour;
\r
32 }, "jalview.datamodel.Annotation");
\r
33 Clazz.makeConstructor (c$,
\r
35 this.construct (null, null, ' ', val, null);
\r
37 Clazz.overrideMethod (c$, "toString",
\r
39 var sb = new StringBuffer ();
\r
40 if (this.displayCharacter != null) {
\r
42 sb.append (this.displayCharacter);
\r
46 }if (this.secondaryStructure.charCodeAt (0) != 0 && !("" + this.displayCharacter).equals ("" + this.secondaryStructure)) {
\r
48 sb.append (this.secondaryStructure);
\r
52 }if (this.description != null && this.description.length > 0) {
\r
54 sb.append (this.description);
\r
58 }if (!Float.isNaN (this.value)) {
\r
59 sb.append (this.value);
\r
60 }if (this.colour != null) {
\r
61 if (sb.length () > 0) {
\r
64 sb.append (this.colour.getRed ());
\r
66 sb.append (this.colour.getGreen ());
\r
68 sb.append (this.colour.getBlue ());
\r
70 }return sb.toString ();
\r