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