Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jalview / viewmodel / styles / ViewStyle.js
1 Clazz.declarePackage ("jalview.viewmodel.styles");
2 Clazz.load (["jalview.api.ViewStyleI", "java.awt.Color"], "jalview.viewmodel.styles.ViewStyle", ["java.lang.Boolean"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.abovePIDThreshold = false;
5 this.charHeight = 0;
6 this.charWidth = 0;
7 this.idWidth = -1;
8 this.colourAppliesToAllGroups = false;
9 this.centreColumnLabels = false;
10 this.showdbrefs = false;
11 this.shownpfeats = false;
12 this.colourByReferenceSeq = false;
13 this.conservationColourSelected = false;
14 this.displayReferenceSeq = false;
15 this.increment = 0;
16 this.renderGaps = true;
17 this.rightAlignIds = false;
18 this.scaleAboveWrapped = false;
19 this.scaleLeftWrapped = true;
20 this.scaleRightWrapped = true;
21 this.seqNameItalics = false;
22 this.showAnnotation = true;
23 this.showBoxes = true;
24 this.showColourText = false;
25 this.showHiddenMarkers = true;
26 this.showJVSuffix = true;
27 this.showSeqFeaturesHeight = false;
28 this.showSequenceFeatures = false;
29 this.showText = true;
30 this.showUnconserved = false;
31 this.textColour = null;
32 this.textColour2 = null;
33 this.threshold = 0;
34 this.thresholdTextColour = 0;
35 this.upperCasebold = false;
36 this.fontName = null;
37 this.fontSize = 0;
38 this.scaleProteinAsCdna = true;
39 this.wrapAlignment = false;
40 this.wrappedWidth = 0;
41 this.fontStyle = 0;
42 Clazz.instantialize (this, arguments);
43 }, jalview.viewmodel.styles, "ViewStyle", null, jalview.api.ViewStyleI);
44 Clazz.prepareFields (c$, function () {
45 this.textColour = java.awt.Color.black;
46 this.textColour2 = java.awt.Color.white;
47 });
48 Clazz.makeConstructor (c$, 
49 function (vs) {
50 this.setAbovePIDThreshold (vs.getAbovePIDThreshold ());
51 this.setCentreColumnLabels (vs.isCentreColumnLabels ());
52 this.setCharHeight (vs.getCharHeight ());
53 this.setCharWidth (vs.getCharWidth ());
54 this.setColourAppliesToAllGroups (vs.getColourAppliesToAllGroups ());
55 this.setColourByReferenceSeq (vs.isColourByReferenceSeq ());
56 this.setColourText (vs.getColourText ());
57 this.setConservationColourSelected (vs.isConservationColourSelected ());
58 this.setConservationSelected (vs.getConservationSelected ());
59 this.setDisplayReferenceSeq (vs.isDisplayReferenceSeq ());
60 this.setFontName (vs.getFontName ());
61 this.setFontSize (vs.getFontSize ());
62 this.setFontStyle (vs.getFontStyle ());
63 this.setIdWidth (vs.getIdWidth ());
64 this.setIncrement (vs.getIncrement ());
65 this.setRenderGaps (vs.isRenderGaps ());
66 this.setRightAlignIds (vs.isRightAlignIds ());
67 this.setScaleAboveWrapped (vs.getScaleAboveWrapped ());
68 this.setScaleLeftWrapped (vs.getScaleLeftWrapped ());
69 this.setScaleProteinAsCdna (vs.isScaleProteinAsCdna ());
70 this.setScaleRightWrapped (vs.getScaleRightWrapped ());
71 this.setSeqNameItalics (vs.isSeqNameItalics ());
72 this.setShowAnnotation (vs.isShowAnnotation ());
73 this.setShowBoxes (vs.getShowBoxes ());
74 this.setShowColourText (vs.isShowColourText ());
75 this.setShowDBRefs (vs.isShowDBRefs ());
76 this.setShowHiddenMarkers (vs.getShowHiddenMarkers ());
77 this.setShowJVSuffix (vs.getShowJVSuffix ());
78 this.setShowNPFeats (vs.isShowNPFeats ());
79 this.setShowSequenceFeaturesHeight (vs.isShowSequenceFeaturesHeight ());
80 this.setShowSequenceFeatures (vs.isShowSequenceFeatures ());
81 this.setShowText (vs.getShowText ());
82 this.setShowUnconserved (vs.getShowUnconserved ());
83 this.setTextColour (vs.getTextColour ());
84 this.setTextColour2 (vs.getTextColour2 ());
85 this.setThreshold (vs.getThreshold ());
86 this.setThresholdTextColour (vs.getThresholdTextColour ());
87 this.setUpperCasebold (vs.isUpperCasebold ());
88 this.setWrapAlignment (vs.getWrapAlignment ());
89 this.setWrappedWidth (vs.getWrappedWidth ());
90 }, "jalview.api.ViewStyleI");
91 Clazz.makeConstructor (c$, 
92 function () {
93 });
94 Clazz.overrideMethod (c$, "equals", 
95 function (other) {
96 if (other == null || !(Clazz.instanceOf (other, jalview.viewmodel.styles.ViewStyle))) {
97 return false;
98 }var vs = other;
99 var match = (this.getAbovePIDThreshold () == vs.getAbovePIDThreshold () && this.isCentreColumnLabels () == vs.isCentreColumnLabels () && this.getCharHeight () == vs.getCharHeight () && this.getCharWidth () == vs.getCharWidth () && this.getColourAppliesToAllGroups () == vs.getColourAppliesToAllGroups () && this.isColourByReferenceSeq () == vs.isColourByReferenceSeq () && this.getColourText () == vs.getColourText () && this.isConservationColourSelected () == vs.isConservationColourSelected () && this.getConservationSelected () == vs.getConservationSelected () && this.isDisplayReferenceSeq () == vs.isDisplayReferenceSeq () && this.getFontSize () == vs.getFontSize () && this.getFontStyle () == vs.getFontStyle () && this.getIdWidth () == vs.getIdWidth () && this.getIncrement () == vs.getIncrement () && this.isRenderGaps () == vs.isRenderGaps () && this.isRightAlignIds () == vs.isRightAlignIds () && this.getScaleAboveWrapped () == vs.getScaleAboveWrapped () && this.getScaleLeftWrapped () == vs.getScaleLeftWrapped () && this.isScaleProteinAsCdna () == vs.isScaleProteinAsCdna () && this.getScaleRightWrapped () == vs.getScaleRightWrapped () && this.isSeqNameItalics () == vs.isSeqNameItalics () && this.isShowAnnotation () == vs.isShowAnnotation () && this.getShowBoxes () == vs.getShowBoxes () && this.isShowColourText () == vs.isShowColourText () && this.isShowDBRefs () == vs.isShowDBRefs () && this.getShowHiddenMarkers () == vs.getShowHiddenMarkers () && this.getShowJVSuffix () == vs.getShowJVSuffix () && this.isShowNPFeats () == vs.isShowNPFeats () && this.isShowSequenceFeaturesHeight () == vs.isShowSequenceFeaturesHeight () && this.isShowSequenceFeatures () == vs.isShowSequenceFeatures () && this.getShowText () == vs.getShowText () && this.getShowUnconserved () == vs.getShowUnconserved () && this.getThreshold () == vs.getThreshold () && this.getThresholdTextColour () == vs.getThresholdTextColour () && this.isUpperCasebold () == vs.isUpperCasebold () && this.getWrapAlignment () == vs.getWrapAlignment () && this.getWrappedWidth () == vs.getWrappedWidth ());
100 match = match && String.valueOf (this.getFontName ()).equals (String.valueOf (vs.getFontName ()));
101 match = match && String.valueOf (this.getTextColour ()).equals (String.valueOf (vs.getTextColour ()));
102 match = match && String.valueOf (this.getTextColour2 ()).equals (String.valueOf (vs.getTextColour2 ()));
103 return match;
104 }, "~O");
105 Clazz.overrideMethod (c$, "hashCode", 
106 function () {
107 var hash = 0;
108 var m = 1;
109 hash += m++ * Boolean.$valueOf (this.abovePIDThreshold).hashCode ();
110 hash += m++ * Boolean.$valueOf (this.centreColumnLabels).hashCode ();
111 hash += m++ * Boolean.$valueOf (this.colourAppliesToAllGroups).hashCode ();
112 hash += m++ * Boolean.$valueOf (this.displayReferenceSeq).hashCode ();
113 hash += m++ * Boolean.$valueOf (this.renderGaps).hashCode ();
114 hash += m++ * Boolean.$valueOf (this.rightAlignIds).hashCode ();
115 hash += m++ * Boolean.$valueOf (this.scaleProteinAsCdna).hashCode ();
116 hash += m++ * Boolean.$valueOf (this.scaleRightWrapped).hashCode ();
117 hash += m++ * Boolean.$valueOf (this.seqNameItalics).hashCode ();
118 hash += m++ * Boolean.$valueOf (this.showAnnotation).hashCode ();
119 hash += m++ * Boolean.$valueOf (this.showBoxes).hashCode ();
120 hash += m++ * Boolean.$valueOf (this.showdbrefs).hashCode ();
121 hash += m++ * Boolean.$valueOf (this.showJVSuffix).hashCode ();
122 hash += m++ * Boolean.$valueOf (this.showSequenceFeatures).hashCode ();
123 hash += m++ * Boolean.$valueOf (this.showUnconserved).hashCode ();
124 hash += m++ * Boolean.$valueOf (this.wrapAlignment).hashCode ();
125 hash += m++ * this.charHeight;
126 hash += m++ * this.charWidth;
127 hash += m++ * this.fontSize;
128 hash += m++ * this.fontStyle;
129 hash += m++ * this.idWidth;
130 hash += String.valueOf (this.fontName).hashCode ();
131 return hash;
132 });
133 Clazz.defineMethod (c$, "isUpperCasebold", 
134 function () {
135 return this.upperCasebold;
136 });
137 Clazz.overrideMethod (c$, "setUpperCasebold", 
138 function (upperCasebold) {
139 this.upperCasebold = upperCasebold;
140 }, "~B");
141 Clazz.defineMethod (c$, "getAbovePIDThreshold", 
142 function () {
143 return this.abovePIDThreshold;
144 });
145 Clazz.defineMethod (c$, "getCharHeight", 
146 function () {
147 return this.charHeight;
148 });
149 Clazz.defineMethod (c$, "getCharWidth", 
150 function () {
151 return this.charWidth;
152 });
153 Clazz.defineMethod (c$, "getColourAppliesToAllGroups", 
154 function () {
155 return this.colourAppliesToAllGroups;
156 });
157 Clazz.defineMethod (c$, "getColourText", 
158 function () {
159 return this.showColourText;
160 });
161 Clazz.defineMethod (c$, "getConservationSelected", 
162 function () {
163 return this.conservationColourSelected;
164 });
165 Clazz.defineMethod (c$, "getIncrement", 
166 function () {
167 return this.increment;
168 });
169 Clazz.defineMethod (c$, "getScaleAboveWrapped", 
170 function () {
171 return this.scaleAboveWrapped;
172 });
173 Clazz.defineMethod (c$, "getScaleLeftWrapped", 
174 function () {
175 return this.scaleLeftWrapped;
176 });
177 Clazz.defineMethod (c$, "getScaleRightWrapped", 
178 function () {
179 return this.scaleRightWrapped;
180 });
181 Clazz.defineMethod (c$, "getShowBoxes", 
182 function () {
183 return this.showBoxes;
184 });
185 Clazz.defineMethod (c$, "getShowHiddenMarkers", 
186 function () {
187 return this.showHiddenMarkers;
188 });
189 Clazz.defineMethod (c$, "getShowJVSuffix", 
190 function () {
191 return this.showJVSuffix;
192 });
193 Clazz.defineMethod (c$, "getShowText", 
194 function () {
195 return this.showText;
196 });
197 Clazz.defineMethod (c$, "getShowUnconserved", 
198 function () {
199 return this.showUnconserved;
200 });
201 Clazz.defineMethod (c$, "getTextColour", 
202 function () {
203 return this.textColour;
204 });
205 Clazz.defineMethod (c$, "getTextColour2", 
206 function () {
207 return this.textColour2;
208 });
209 Clazz.defineMethod (c$, "getThreshold", 
210 function () {
211 return this.threshold;
212 });
213 Clazz.defineMethod (c$, "getThresholdTextColour", 
214 function () {
215 return this.thresholdTextColour;
216 });
217 Clazz.defineMethod (c$, "getWrapAlignment", 
218 function () {
219 return this.wrapAlignment;
220 });
221 Clazz.defineMethod (c$, "getWrappedWidth", 
222 function () {
223 return this.wrappedWidth;
224 });
225 Clazz.defineMethod (c$, "isColourByReferenceSeq", 
226 function () {
227 return this.colourByReferenceSeq;
228 });
229 Clazz.defineMethod (c$, "isConservationColourSelected", 
230 function () {
231 return this.conservationColourSelected;
232 });
233 Clazz.defineMethod (c$, "isDisplayReferenceSeq", 
234 function () {
235 return this.displayReferenceSeq;
236 });
237 Clazz.defineMethod (c$, "isRenderGaps", 
238 function () {
239 return this.renderGaps;
240 });
241 Clazz.defineMethod (c$, "isRightAlignIds", 
242 function () {
243 return this.rightAlignIds;
244 });
245 Clazz.defineMethod (c$, "isSeqNameItalics", 
246 function () {
247 return this.seqNameItalics;
248 });
249 Clazz.defineMethod (c$, "isShowAnnotation", 
250 function () {
251 return this.showAnnotation;
252 });
253 Clazz.defineMethod (c$, "isShowColourText", 
254 function () {
255 return this.showColourText;
256 });
257 Clazz.defineMethod (c$, "isShowSequenceFeaturesHeight", 
258 function () {
259 return this.showSeqFeaturesHeight;
260 });
261 Clazz.defineMethod (c$, "isShowSequenceFeatures", 
262 function () {
263 return this.showSequenceFeatures;
264 });
265 Clazz.overrideMethod (c$, "setAbovePIDThreshold", 
266 function (b) {
267 this.abovePIDThreshold = b;
268 }, "~B");
269 Clazz.overrideMethod (c$, "setCharHeight", 
270 function (h) {
271 this.charHeight = h;
272 }, "~N");
273 Clazz.overrideMethod (c$, "setCharWidth", 
274 function (w) {
275 this.charWidth = w;
276 }, "~N");
277 Clazz.overrideMethod (c$, "setColourAppliesToAllGroups", 
278 function (b) {
279 this.colourAppliesToAllGroups = b;
280 }, "~B");
281 Clazz.overrideMethod (c$, "setColourByReferenceSeq", 
282 function (colourByReferenceSeq) {
283 this.colourByReferenceSeq = colourByReferenceSeq;
284 }, "~B");
285 Clazz.overrideMethod (c$, "setColourText", 
286 function (state) {
287 this.showColourText = state;
288 }, "~B");
289 Clazz.overrideMethod (c$, "setConservationColourSelected", 
290 function (conservationColourSelected) {
291 this.conservationColourSelected = conservationColourSelected;
292 }, "~B");
293 Clazz.overrideMethod (c$, "setConservationSelected", 
294 function (b) {
295 this.conservationColourSelected = b;
296 }, "~B");
297 Clazz.overrideMethod (c$, "setDisplayReferenceSeq", 
298 function (displayReferenceSeq) {
299 this.displayReferenceSeq = displayReferenceSeq;
300 }, "~B");
301 Clazz.overrideMethod (c$, "setIncrement", 
302 function (inc) {
303 this.increment = inc;
304 }, "~N");
305 Clazz.overrideMethod (c$, "setRenderGaps", 
306 function (state) {
307 this.renderGaps = state;
308 }, "~B");
309 Clazz.overrideMethod (c$, "setRightAlignIds", 
310 function (rightAlignIds) {
311 this.rightAlignIds = rightAlignIds;
312 }, "~B");
313 Clazz.overrideMethod (c$, "setScaleAboveWrapped", 
314 function (b) {
315 this.scaleAboveWrapped = b;
316 }, "~B");
317 Clazz.overrideMethod (c$, "setScaleLeftWrapped", 
318 function (b) {
319 this.scaleLeftWrapped = b;
320 }, "~B");
321 Clazz.overrideMethod (c$, "setScaleRightWrapped", 
322 function (b) {
323 this.scaleRightWrapped = b;
324 }, "~B");
325 Clazz.overrideMethod (c$, "setSeqNameItalics", 
326 function (italics) {
327 this.seqNameItalics = italics;
328 }, "~B");
329 Clazz.overrideMethod (c$, "setShowAnnotation", 
330 function (b) {
331 this.showAnnotation = b;
332 }, "~B");
333 Clazz.overrideMethod (c$, "setShowBoxes", 
334 function (state) {
335 this.showBoxes = state;
336 }, "~B");
337 Clazz.overrideMethod (c$, "setShowColourText", 
338 function (showColourText) {
339 this.showColourText = showColourText;
340 }, "~B");
341 Clazz.overrideMethod (c$, "setShowHiddenMarkers", 
342 function (show) {
343 this.showHiddenMarkers = show;
344 }, "~B");
345 Clazz.overrideMethod (c$, "setShowJVSuffix", 
346 function (b) {
347 this.showJVSuffix = b;
348 }, "~B");
349 Clazz.overrideMethod (c$, "setShowSequenceFeaturesHeight", 
350 function (selected) {
351 this.showSeqFeaturesHeight = selected;
352 }, "~B");
353 Clazz.overrideMethod (c$, "setShowSequenceFeatures", 
354 function (b) {
355 this.showSequenceFeatures = b;
356 }, "~B");
357 Clazz.overrideMethod (c$, "setShowText", 
358 function (state) {
359 this.showText = state;
360 }, "~B");
361 Clazz.overrideMethod (c$, "setShowUnconserved", 
362 function (showunconserved) {
363 this.showUnconserved = showunconserved;
364 }, "~B");
365 Clazz.overrideMethod (c$, "setTextColour", 
366 function (textColour) {
367 this.textColour = textColour;
368 }, "java.awt.Color");
369 Clazz.overrideMethod (c$, "setTextColour2", 
370 function (textColour2) {
371 this.textColour2 = textColour2;
372 }, "java.awt.Color");
373 Clazz.overrideMethod (c$, "setThreshold", 
374 function (thresh) {
375 this.threshold = thresh;
376 }, "~N");
377 Clazz.overrideMethod (c$, "setThresholdTextColour", 
378 function (thresholdTextColour) {
379 this.thresholdTextColour = thresholdTextColour;
380 }, "~N");
381 Clazz.overrideMethod (c$, "setWrapAlignment", 
382 function (state) {
383 this.wrapAlignment = state;
384 }, "~B");
385 Clazz.overrideMethod (c$, "setWrappedWidth", 
386 function (w) {
387 this.wrappedWidth = w;
388 }, "~N");
389 Clazz.overrideMethod (c$, "sameStyle", 
390 function (that) {
391 return this.equals (that);
392 }, "jalview.api.ViewStyleI");
393 Clazz.defineMethod (c$, "getFontName", 
394 function () {
395 return this.fontName;
396 });
397 Clazz.defineMethod (c$, "getFontSize", 
398 function () {
399 return this.fontSize;
400 });
401 Clazz.defineMethod (c$, "getFontStyle", 
402 function () {
403 return this.fontStyle;
404 });
405 Clazz.overrideMethod (c$, "setFontName", 
406 function (name) {
407 this.fontName = name;
408 }, "~S");
409 Clazz.overrideMethod (c$, "setFontSize", 
410 function (size) {
411 this.fontSize = size;
412 }, "~N");
413 Clazz.overrideMethod (c$, "setFontStyle", 
414 function (style) {
415 this.fontStyle = style;
416 }, "~N");
417 Clazz.defineMethod (c$, "getIdWidth", 
418 function () {
419 return this.idWidth;
420 });
421 Clazz.overrideMethod (c$, "setIdWidth", 
422 function (idWidth) {
423 this.idWidth = idWidth;
424 }, "~N");
425 Clazz.defineMethod (c$, "isCentreColumnLabels", 
426 function () {
427 return this.centreColumnLabels;
428 });
429 Clazz.overrideMethod (c$, "setCentreColumnLabels", 
430 function (centreColumnLabels) {
431 this.centreColumnLabels = centreColumnLabels;
432 }, "~B");
433 Clazz.defineMethod (c$, "isShowDBRefs", 
434 function () {
435 return this.showdbrefs;
436 });
437 Clazz.overrideMethod (c$, "setShowDBRefs", 
438 function (showdbrefs) {
439 this.showdbrefs = showdbrefs;
440 }, "~B");
441 Clazz.defineMethod (c$, "isShowNPFeats", 
442 function () {
443 return this.shownpfeats;
444 });
445 Clazz.overrideMethod (c$, "setShowNPFeats", 
446 function (shownpfeats) {
447 this.shownpfeats = shownpfeats;
448 }, "~B");
449 Clazz.defineMethod (c$, "isScaleProteinAsCdna", 
450 function () {
451 return this.scaleProteinAsCdna;
452 });
453 Clazz.overrideMethod (c$, "setScaleProteinAsCdna", 
454 function (b) {
455 this.scaleProteinAsCdna = b;
456 }, "~B");
457 });