Merge branch 'releases/Release_2_11_3_Branch'
[jalview.git] / src / jalview / viewmodel / styles / ViewStyle.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.viewmodel.styles;
22
23 import java.awt.Color;
24
25 import jalview.api.ViewStyleI;
26
27 /**
28  * A container for holding alignment view properties. View properties are
29  * data-independent, which means they can be safely copied between views
30  * involving different alignment data without causing exceptions in the
31  * rendering system.
32  * 
33  * @author jprocter
34  *
35  */
36 public class ViewStyle implements ViewStyleI
37 {
38   private boolean abovePIDThreshold = false;
39
40   int charHeight;
41
42   int charWidth;
43
44   int idWidth = -1;
45
46   /**
47    * gui state - changes to colour scheme propagated to all groups
48    */
49   private boolean colourAppliesToAllGroups;
50
51   /**
52    * centre columnar annotation labels in displayed alignment annotation
53    */
54   boolean centreColumnLabels = false;
55
56   private boolean showdbrefs;
57
58   private boolean shownpfeats;
59
60   // --------END Structure Conservation
61
62   /**
63    * colour according to the reference sequence defined on the alignment
64    */
65   private boolean colourByReferenceSeq = false;
66
67   boolean conservationColourSelected = false;
68
69   /**
70    * show the reference sequence in the alignment view
71    */
72   private boolean displayReferenceSeq = false;
73
74   private int increment;
75
76   /**
77    * display gap characters
78    */
79   boolean renderGaps = true;
80
81   private boolean rightAlignIds = false;
82
83   boolean scaleAboveWrapped = false;
84
85   boolean scaleLeftWrapped = true;
86
87   boolean scaleRightWrapped = true;
88
89   boolean seqNameItalics;
90
91   /**
92    * show annotation tracks on the alignment
93    */
94   private boolean showAnnotation = true;
95
96   /**
97    * render each residue in a coloured box
98    */
99   boolean showBoxes = true;
100
101   /**
102    * Colour sequence text
103    */
104   boolean showColourText = false;
105
106   /**
107    * show blue triangles
108    */
109   boolean showHiddenMarkers = true;
110
111   /**
112    * show /start-end in ID panel
113    */
114   boolean showJVSuffix = true;
115
116   /**
117    * scale features height according to score
118    */
119   boolean showSeqFeaturesHeight;
120
121   /**
122    * display setting for showing/hiding sequence features on alignment view
123    */
124   boolean showSequenceFeatures = false;
125
126   /**
127    * display sequence symbols
128    */
129   boolean showText = true;
130
131   /**
132    * show non-conserved residues only
133    */
134   protected boolean showUnconserved = false;
135
136   Color textColour = Color.black;
137
138   Color textColour2 = Color.white;
139
140   /**
141    * PID or consensus threshold
142    */
143   int threshold;
144
145   /**
146    * threshold for switching between textColour & textColour2
147    */
148   int thresholdTextColour = 0;
149
150   /**
151    * upper case characters in sequence are shown in bold
152    */
153   boolean upperCasebold = false;
154
155   /**
156    * name of base font for view
157    */
158   private String fontName;
159
160   /**
161    * size for base font
162    */
163   private int fontSize;
164
165   /*
166    * If true, scale protein residues to 3 times width of cDNA bases (in
167    * SplitFrame views only)
168    */
169   private boolean scaleProteinAsCdna = true;
170
171   /*
172    * if true, font changes to protein or cDNA are applied to both
173    * sides of a split screen
174    */
175   private boolean proteinFontAsCdna = true;
176
177   /**
178    * Copy constructor
179    * 
180    * @param vs
181    */
182   public ViewStyle(ViewStyleI vs)
183   {
184     setAbovePIDThreshold(vs.getAbovePIDThreshold());
185     setCentreColumnLabels(vs.isCentreColumnLabels());
186     setCharHeight(vs.getCharHeight());
187     setCharWidth(vs.getCharWidth());
188     setColourAppliesToAllGroups(vs.getColourAppliesToAllGroups());
189     setColourByReferenceSeq(vs.isColourByReferenceSeq());
190     setColourText(vs.getColourText());
191     setConservationColourSelected(vs.isConservationColourSelected());
192     setConservationSelected(vs.getConservationSelected());
193     setDisplayReferenceSeq(vs.isDisplayReferenceSeq());
194     setFontName(vs.getFontName());
195     setFontSize(vs.getFontSize());
196     setFontStyle(vs.getFontStyle());
197     setIdWidth(vs.getIdWidth());
198     setIncrement(vs.getIncrement());
199     setRenderGaps(vs.isRenderGaps());
200     setRightAlignIds(vs.isRightAlignIds());
201     setScaleAboveWrapped(vs.getScaleAboveWrapped());
202     setScaleLeftWrapped(vs.getScaleLeftWrapped());
203     setScaleProteinAsCdna(vs.isScaleProteinAsCdna());
204     setProteinFontAsCdna(vs.isProteinFontAsCdna());
205     setScaleRightWrapped(vs.getScaleRightWrapped());
206     setSeqNameItalics(vs.isSeqNameItalics());
207     setShowAnnotation(vs.isShowAnnotation());
208     setShowBoxes(vs.getShowBoxes());
209     setShowColourText(vs.isShowColourText());
210     setShowDBRefs(vs.isShowDBRefs());
211     setShowHiddenMarkers(vs.getShowHiddenMarkers());
212     setShowJVSuffix(vs.getShowJVSuffix());
213     setShowNPFeats(vs.isShowNPFeats());
214     setShowSequenceFeaturesHeight(vs.isShowSequenceFeaturesHeight());
215     setShowSequenceFeatures(vs.isShowSequenceFeatures());
216     setShowComplementFeatures(vs.isShowComplementFeatures());
217     setShowComplementFeaturesOnTop(vs.isShowComplementFeaturesOnTop());
218     setShowText(vs.getShowText());
219     setShowUnconserved(vs.getShowUnconserved());
220     setTextColour(vs.getTextColour());
221     setTextColour2(vs.getTextColour2());
222     setThreshold(vs.getThreshold());
223     setThresholdTextColour(vs.getThresholdTextColour());
224     setUpperCasebold(vs.isUpperCasebold());
225     setWrapAlignment(vs.getWrapAlignment());
226     setWrappedWidth(vs.getWrappedWidth());
227     // ViewStyle.configureFrom(this, viewStyle);
228   }
229
230   public ViewStyle()
231   {
232   }
233
234   /**
235    * Returns true if all attributes of the ViewStyles have the same value
236    */
237   @Override
238   public boolean equals(Object other)
239   {
240     if (other == null || !(other instanceof ViewStyle))
241     {
242       return false;
243     }
244     ViewStyle vs = (ViewStyle) other;
245
246     boolean match = (getAbovePIDThreshold() == vs.getAbovePIDThreshold()
247             && isCentreColumnLabels() == vs.isCentreColumnLabels()
248             && getCharHeight() == vs.getCharHeight()
249             && getCharWidth() == vs.getCharWidth()
250             && getColourAppliesToAllGroups() == vs
251                     .getColourAppliesToAllGroups()
252             && isColourByReferenceSeq() == vs.isColourByReferenceSeq()
253             && getColourText() == vs.getColourText()
254             && isConservationColourSelected() == vs
255                     .isConservationColourSelected()
256             && getConservationSelected() == vs.getConservationSelected()
257             && isDisplayReferenceSeq() == vs.isDisplayReferenceSeq()
258             && getFontSize() == vs.getFontSize()
259             && getFontStyle() == vs.getFontStyle()
260             && getIdWidth() == vs.getIdWidth()
261             && getIncrement() == vs.getIncrement()
262             && isRenderGaps() == vs.isRenderGaps()
263             && isRightAlignIds() == vs.isRightAlignIds()
264             && getScaleAboveWrapped() == vs.getScaleAboveWrapped()
265             && getScaleLeftWrapped() == vs.getScaleLeftWrapped()
266             && isScaleProteinAsCdna() == vs.isScaleProteinAsCdna()
267             && isProteinFontAsCdna() == vs.isProteinFontAsCdna()
268             && getScaleRightWrapped() == vs.getScaleRightWrapped()
269             && isSeqNameItalics() == vs.isSeqNameItalics()
270             && isShowAnnotation() == vs.isShowAnnotation()
271             && getShowBoxes() == vs.getShowBoxes()
272             && isShowColourText() == vs.isShowColourText()
273             && isShowDBRefs() == vs.isShowDBRefs()
274             && getShowHiddenMarkers() == vs.getShowHiddenMarkers()
275             && getShowJVSuffix() == vs.getShowJVSuffix()
276             && isShowNPFeats() == vs.isShowNPFeats()
277             && isShowSequenceFeaturesHeight() == vs
278                     .isShowSequenceFeaturesHeight()
279             && isShowSequenceFeatures() == vs.isShowSequenceFeatures()
280             && isShowComplementFeatures() == vs.isShowComplementFeatures()
281             && isShowComplementFeaturesOnTop() == vs
282                     .isShowComplementFeaturesOnTop()
283             && getShowText() == vs.getShowText()
284             && getShowUnconserved() == vs.getShowUnconserved()
285             && getThreshold() == vs.getThreshold()
286             && getThresholdTextColour() == vs.getThresholdTextColour()
287             && isUpperCasebold() == vs.isUpperCasebold()
288             && getWrapAlignment() == vs.getWrapAlignment()
289             && getWrappedWidth() == vs.getWrappedWidth());
290     /*
291      * and compare non-primitive types; syntax below will match null with null
292      * values
293      */
294     match = match && String.valueOf(getFontName())
295             .equals(String.valueOf(vs.getFontName()));
296     match = match && String.valueOf(getTextColour())
297             .equals(String.valueOf(vs.getTextColour()));
298     match = match && String.valueOf(getTextColour2())
299             .equals(String.valueOf(vs.getTextColour2()));
300     return match;
301     // return equivalent(this, (ViewStyle) other);
302   }
303
304   /**
305    * Overridden to ensure that whenever vs1.equals(vs2) then vs1.hashCode() ==
306    * vs2.hashCode()
307    */
308   @Override
309   public int hashCode()
310   {
311     /*
312      * No need to include all properties, just a selection...
313      */
314     int hash = 0;
315     int m = 1;
316     // Boolean.hashCode returns 1231 or 1237
317     hash += m++ * Boolean.valueOf(this.abovePIDThreshold).hashCode();
318     hash += m++ * Boolean.valueOf(this.centreColumnLabels).hashCode();
319     hash += m++ * Boolean.valueOf(this.colourAppliesToAllGroups).hashCode();
320     hash += m++ * Boolean.valueOf(this.displayReferenceSeq).hashCode();
321     hash += m++ * Boolean.valueOf(this.renderGaps).hashCode();
322     hash += m++ * Boolean.valueOf(this.rightAlignIds).hashCode();
323     hash += m++ * Boolean.valueOf(this.scaleProteinAsCdna).hashCode();
324     hash += m++ * Boolean.valueOf(this.scaleRightWrapped).hashCode();
325     hash += m++ * Boolean.valueOf(this.seqNameItalics).hashCode();
326     hash += m++ * Boolean.valueOf(this.showAnnotation).hashCode();
327     hash += m++ * Boolean.valueOf(this.showBoxes).hashCode();
328     hash += m++ * Boolean.valueOf(this.showdbrefs).hashCode();
329     hash += m++ * Boolean.valueOf(this.showJVSuffix).hashCode();
330     hash += m++ * Boolean.valueOf(this.showSequenceFeatures).hashCode();
331     hash += m++ * Boolean.valueOf(this.showUnconserved).hashCode();
332     hash += m++ * Boolean.valueOf(this.wrapAlignment).hashCode();
333     hash += m++ * this.charHeight;
334     hash += m++ * this.charWidth;
335     hash += m++ * fontSize;
336     hash += m++ * fontStyle;
337     hash += m++ * idWidth;
338     hash += String.valueOf(this.fontName).hashCode();
339     return hash;
340   }
341
342   /**
343    * @return the upperCasebold
344    */
345   @Override
346   public boolean isUpperCasebold()
347   {
348     return upperCasebold;
349   }
350
351   /**
352    * @param upperCasebold
353    *          the upperCasebold to set
354    */
355   @Override
356   public void setUpperCasebold(boolean upperCasebold)
357   {
358     this.upperCasebold = upperCasebold;
359   }
360
361   /**
362    * flag for wrapping
363    */
364   boolean wrapAlignment = false;
365
366   /**
367    * number columns in wrapped alignment
368    */
369   int wrappedWidth;
370
371   private int fontStyle;
372
373   private boolean showComplementFeatures;
374
375   private boolean showComplementFeaturesOnTop;
376
377   /**
378    * GUI state
379    * 
380    * @return true if percent identity threshold is applied to shading
381    */
382   @Override
383   public boolean getAbovePIDThreshold()
384   {
385     return abovePIDThreshold;
386   }
387
388   /**
389    * DOCUMENT ME!
390    * 
391    * @return DOCUMENT ME!
392    */
393   @Override
394   public int getCharHeight()
395   {
396     return charHeight;
397   }
398
399   /**
400    * DOCUMENT ME!
401    * 
402    * @return DOCUMENT ME!
403    */
404   @Override
405   public int getCharWidth()
406   {
407     return charWidth;
408   }
409
410   /**
411    * 
412    * 
413    * @return flag indicating if colourchanges propagated to all groups
414    */
415   @Override
416   public boolean getColourAppliesToAllGroups()
417   {
418     return colourAppliesToAllGroups;
419   }
420
421   /**
422    * DOCUMENT ME!
423    * 
424    * @return DOCUMENT ME!
425    */
426   @Override
427   public boolean getColourText()
428   {
429     return showColourText;
430   }
431
432   /**
433    * GUI state
434    * 
435    * @return true if conservation based shading is enabled
436    */
437   @Override
438   public boolean getConservationSelected()
439   {
440     return conservationColourSelected;
441   }
442
443   /**
444    * GUI State
445    * 
446    * @return get scalar for bleaching colourschemes by conservation
447    */
448   @Override
449   public int getIncrement()
450   {
451     return increment;
452   }
453
454   /**
455    * DOCUMENT ME!
456    * 
457    * @return DOCUMENT ME!
458    */
459   @Override
460   public boolean getScaleAboveWrapped()
461   {
462     return scaleAboveWrapped;
463   }
464
465   /**
466    * DOCUMENT ME!
467    * 
468    * @return DOCUMENT ME!
469    */
470   @Override
471   public boolean getScaleLeftWrapped()
472   {
473     return scaleLeftWrapped;
474   }
475
476   /**
477    * DOCUMENT ME!
478    * 
479    * @return DOCUMENT ME!
480    */
481   @Override
482   public boolean getScaleRightWrapped()
483   {
484     return scaleRightWrapped;
485   }
486
487   /**
488    * DOCUMENT ME!
489    * 
490    * @return DOCUMENT ME!
491    */
492   @Override
493   public boolean getShowBoxes()
494   {
495     return showBoxes;
496   }
497
498   @Override
499   public boolean getShowHiddenMarkers()
500   {
501     return showHiddenMarkers;
502   }
503
504   /**
505    * DOCUMENT ME!
506    * 
507    * @return DOCUMENT ME!
508    */
509   @Override
510   public boolean getShowJVSuffix()
511   {
512     return showJVSuffix;
513   }
514
515   /**
516    * DOCUMENT ME!
517    * 
518    * @return DOCUMENT ME!
519    */
520   @Override
521   public boolean getShowText()
522   {
523     return showText;
524   }
525
526   @Override
527   public boolean getShowUnconserved()
528   {
529     return showUnconserved;
530   }
531
532   /**
533    * @return the textColour
534    */
535   @Override
536   public Color getTextColour()
537   {
538     return textColour;
539   }
540
541   /**
542    * @return the textColour2
543    */
544   @Override
545   public Color getTextColour2()
546   {
547     return textColour2;
548   }
549
550   /**
551    * DOCUMENT ME!
552    * 
553    * @return DOCUMENT ME!
554    */
555   @Override
556   public int getThreshold()
557   {
558     return threshold;
559   }
560
561   /**
562    * @return the thresholdTextColour
563    */
564   @Override
565   public int getThresholdTextColour()
566   {
567     return thresholdTextColour;
568   }
569
570   /**
571    * DOCUMENT ME!
572    * 
573    * @return DOCUMENT ME!
574    */
575   @Override
576   public boolean getWrapAlignment()
577   {
578     return wrapAlignment;
579   }
580
581   /**
582    * DOCUMENT ME!
583    * 
584    * @return DOCUMENT ME!
585    */
586   @Override
587   public int getWrappedWidth()
588   {
589     return wrappedWidth;
590   }
591
592   @Override
593   public boolean isColourByReferenceSeq()
594   {
595     return colourByReferenceSeq;
596   }
597
598   /**
599    * @return the conservationColourSelected
600    */
601   @Override
602   public boolean isConservationColourSelected()
603   {
604     return conservationColourSelected;
605   }
606
607   @Override
608   public boolean isDisplayReferenceSeq()
609   {
610     return displayReferenceSeq;
611   }
612
613   /**
614    * @return the renderGaps
615    */
616   @Override
617   public boolean isRenderGaps()
618   {
619     return renderGaps;
620   }
621
622   @Override
623   public boolean isRightAlignIds()
624   {
625     return rightAlignIds;
626   }
627
628   /**
629    * @return the seqNameItalics
630    */
631   @Override
632   public boolean isSeqNameItalics()
633   {
634     return seqNameItalics;
635   }
636
637   @Override
638   public boolean isShowAnnotation()
639   {
640     return showAnnotation;
641   }
642
643   /**
644    * @return the showColourText
645    */
646   @Override
647   public boolean isShowColourText()
648   {
649     return showColourText;
650   }
651
652   /**
653    * @return the showSeqFeaturesHeight
654    */
655   @Override
656   public boolean isShowSequenceFeaturesHeight()
657   {
658     return showSeqFeaturesHeight;
659   }
660
661   @Override
662   public boolean isShowSequenceFeatures()
663   {
664     return showSequenceFeatures;
665   }
666
667   /**
668    * GUI state
669    * 
670    * 
671    * @param b
672    *          indicate if percent identity threshold is applied to shading
673    */
674   @Override
675   public void setAbovePIDThreshold(boolean b)
676   {
677     abovePIDThreshold = b;
678   }
679
680   /**
681    * DOCUMENT ME!
682    * 
683    * @param h
684    *          DOCUMENT ME!
685    */
686   @Override
687   public void setCharHeight(int h)
688   {
689     this.charHeight = h;
690   }
691
692   /**
693    * DOCUMENT ME!
694    * 
695    * @param w
696    *          DOCUMENT ME!
697    */
698   @Override
699   public void setCharWidth(int w)
700   {
701     this.charWidth = w;
702   }
703
704   /**
705    * @param value
706    *          indicating if subsequent colourscheme changes will be propagated
707    *          to all groups
708    */
709   @Override
710   public void setColourAppliesToAllGroups(boolean b)
711   {
712     colourAppliesToAllGroups = b;
713   }
714
715   @Override
716   public void setColourByReferenceSeq(boolean colourByReferenceSeq)
717   {
718     this.colourByReferenceSeq = colourByReferenceSeq;
719   }
720
721   /**
722    * DOCUMENT ME!
723    * 
724    * @param state
725    *          DOCUMENT ME!
726    */
727   @Override
728   public void setColourText(boolean state)
729   {
730     showColourText = state;
731   }
732
733   /**
734    * @param conservationColourSelected
735    *          the conservationColourSelected to set
736    */
737   @Override
738   public void setConservationColourSelected(
739           boolean conservationColourSelected)
740   {
741     this.conservationColourSelected = conservationColourSelected;
742   }
743
744   /**
745    * GUI state
746    * 
747    * @param b
748    *          enable conservation based shading
749    */
750   @Override
751   public void setConservationSelected(boolean b)
752   {
753     conservationColourSelected = b;
754   }
755
756   @Override
757   public void setDisplayReferenceSeq(boolean displayReferenceSeq)
758   {
759     this.displayReferenceSeq = displayReferenceSeq;
760   }
761
762   /**
763    * 
764    * @param inc
765    *          set the scalar for bleaching colourschemes according to degree of
766    *          conservation
767    */
768   @Override
769   public void setIncrement(int inc)
770   {
771     increment = inc;
772   }
773
774   /**
775    * DOCUMENT ME!
776    * 
777    * @param state
778    *          DOCUMENT ME!
779    */
780   @Override
781   public void setRenderGaps(boolean state)
782   {
783     renderGaps = state;
784   }
785
786   @Override
787   public void setRightAlignIds(boolean rightAlignIds)
788   {
789     this.rightAlignIds = rightAlignIds;
790   }
791
792   /**
793    * DOCUMENT ME!
794    * 
795    * @param b
796    *          DOCUMENT ME!
797    */
798   @Override
799   public void setScaleAboveWrapped(boolean b)
800   {
801     scaleAboveWrapped = b;
802   }
803
804   /**
805    * DOCUMENT ME!
806    * 
807    * @param b
808    *          DOCUMENT ME!
809    */
810   @Override
811   public void setScaleLeftWrapped(boolean b)
812   {
813     scaleLeftWrapped = b;
814   }
815
816   /**
817    * 
818    * 
819    * @param scaleRightWrapped
820    *          - true or false
821    */
822
823   @Override
824   public void setScaleRightWrapped(boolean b)
825   {
826     scaleRightWrapped = b;
827   }
828
829   @Override
830   public void setSeqNameItalics(boolean italics)
831   {
832     seqNameItalics = italics;
833   }
834
835   @Override
836   public void setShowAnnotation(boolean b)
837   {
838     showAnnotation = b;
839   }
840
841   /**
842    * DOCUMENT ME!
843    * 
844    * @param state
845    *          DOCUMENT ME!
846    */
847   @Override
848   public void setShowBoxes(boolean state)
849   {
850     showBoxes = state;
851   }
852
853   /**
854    * @param showColourText
855    *          the showColourText to set
856    */
857   @Override
858   public void setShowColourText(boolean showColourText)
859   {
860     this.showColourText = showColourText;
861   }
862
863   @Override
864   public void setShowHiddenMarkers(boolean show)
865   {
866     showHiddenMarkers = show;
867   }
868
869   /**
870    * DOCUMENT ME!
871    * 
872    * @param b
873    *          DOCUMENT ME!
874    */
875   @Override
876   public void setShowJVSuffix(boolean b)
877   {
878     showJVSuffix = b;
879   }
880
881   @Override
882   public void setShowSequenceFeaturesHeight(boolean selected)
883   {
884     showSeqFeaturesHeight = selected;
885
886   }
887
888   /**
889    * set the flag
890    * 
891    * @param b
892    *          features are displayed if true
893    */
894   @Override
895   public void setShowSequenceFeatures(boolean b)
896   {
897     showSequenceFeatures = b;
898   }
899
900   /**
901    * DOCUMENT ME!
902    * 
903    * @param state
904    *          DOCUMENT ME!
905    */
906   @Override
907   public void setShowText(boolean state)
908   {
909     showText = state;
910   }
911
912   @Override
913   public void setShowUnconserved(boolean showunconserved)
914   {
915     showUnconserved = showunconserved;
916   }
917
918   /**
919    * @param textColour
920    *          the textColour to set
921    */
922   @Override
923   public void setTextColour(Color textColour)
924   {
925     this.textColour = textColour;
926   }
927
928   /**
929    * @param textColour2
930    *          the textColour2 to set
931    */
932   @Override
933   public void setTextColour2(Color textColour2)
934   {
935     this.textColour2 = textColour2;
936   }
937
938   /**
939    * DOCUMENT ME!
940    * 
941    * @param thresh
942    *          DOCUMENT ME!
943    */
944   @Override
945   public void setThreshold(int thresh)
946   {
947     threshold = thresh;
948   }
949
950   /**
951    * @param thresholdTextColour
952    *          the thresholdTextColour to set
953    */
954   @Override
955   public void setThresholdTextColour(int thresholdTextColour)
956   {
957     this.thresholdTextColour = thresholdTextColour;
958   }
959
960   /**
961    * DOCUMENT ME!
962    * 
963    * @param state
964    *          DOCUMENT ME!
965    */
966   @Override
967   public void setWrapAlignment(boolean state)
968   {
969     wrapAlignment = state;
970   }
971
972   /**
973    * DOCUMENT ME!
974    * 
975    * @param w
976    *          DOCUMENT ME!
977    */
978   @Override
979   public void setWrappedWidth(int w)
980   {
981     this.wrappedWidth = w;
982   }
983
984   @Override
985   public boolean sameStyle(ViewStyleI that)
986   {
987     return this.equals(that);
988   }
989
990   @Override
991   public String getFontName()
992   {
993     return fontName;
994   }
995
996   @Override
997   public int getFontSize()
998   {
999     return fontSize;
1000   }
1001
1002   @Override
1003   public int getFontStyle()
1004   {
1005     return fontStyle;
1006   }
1007
1008   @Override
1009   public void setFontName(String name)
1010   {
1011     fontName = name;
1012   }
1013
1014   @Override
1015   public void setFontSize(int size)
1016   {
1017     fontSize = size;
1018
1019   }
1020
1021   @Override
1022   public void setFontStyle(int style)
1023   {
1024     fontStyle = style;
1025   }
1026
1027   @Override
1028   public int getIdWidth()
1029   {
1030     return idWidth;
1031   }
1032
1033   /**
1034    * @param idWidth
1035    *          the idWidth to set
1036    */
1037   @Override
1038   public void setIdWidth(int idWidth)
1039   {
1040     this.idWidth = idWidth;
1041   }
1042
1043   /**
1044    * @return the centreColumnLabels
1045    */
1046   @Override
1047   public boolean isCentreColumnLabels()
1048   {
1049     return centreColumnLabels;
1050   }
1051
1052   /**
1053    * @param centreColumnLabels
1054    *          the centreColumnLabels to set
1055    */
1056   @Override
1057   public void setCentreColumnLabels(boolean centreColumnLabels)
1058   {
1059     this.centreColumnLabels = centreColumnLabels;
1060   }
1061
1062   /**
1063    * @return the showdbrefs
1064    */
1065   @Override
1066   public boolean isShowDBRefs()
1067   {
1068     return showdbrefs;
1069   }
1070
1071   /**
1072    * @param showdbrefs
1073    *          the showdbrefs to set
1074    */
1075   @Override
1076   public void setShowDBRefs(boolean showdbrefs)
1077   {
1078     this.showdbrefs = showdbrefs;
1079   }
1080
1081   /**
1082    * @return the shownpfeats
1083    */
1084   @Override
1085   public boolean isShowNPFeats()
1086   {
1087     return shownpfeats;
1088   }
1089
1090   /**
1091    * @param shownpfeats
1092    *          the shownpfeats to set
1093    */
1094   @Override
1095   public void setShowNPFeats(boolean shownpfeats)
1096   {
1097     this.shownpfeats = shownpfeats;
1098   }
1099
1100   @Override
1101   public boolean isScaleProteinAsCdna()
1102   {
1103     return this.scaleProteinAsCdna;
1104   }
1105
1106   @Override
1107   public void setScaleProteinAsCdna(boolean b)
1108   {
1109     this.scaleProteinAsCdna = b;
1110   }
1111
1112   @Override
1113   public boolean isProteinFontAsCdna()
1114   {
1115     return proteinFontAsCdna;
1116   }
1117
1118   @Override
1119   public void setProteinFontAsCdna(boolean b)
1120   {
1121     proteinFontAsCdna = b;
1122   }
1123
1124   @Override
1125   public void setShowComplementFeatures(boolean b)
1126   {
1127     showComplementFeatures = b;
1128   }
1129
1130   @Override
1131   public boolean isShowComplementFeatures()
1132   {
1133     return showComplementFeatures;
1134   }
1135
1136   @Override
1137   public void setShowComplementFeaturesOnTop(boolean b)
1138   {
1139     showComplementFeaturesOnTop = b;
1140   }
1141
1142   @Override
1143   public boolean isShowComplementFeaturesOnTop()
1144   {
1145     return showComplementFeaturesOnTop;
1146   }
1147 }