JAL-2418 source formatting
[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 jalview.api.ViewStyleI;
24
25 import java.awt.Color;
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     setShowText(vs.getShowText());
217     setShowUnconserved(vs.getShowUnconserved());
218     setTextColour(vs.getTextColour());
219     setTextColour2(vs.getTextColour2());
220     setThreshold(vs.getThreshold());
221     setThresholdTextColour(vs.getThresholdTextColour());
222     setUpperCasebold(vs.isUpperCasebold());
223     setWrapAlignment(vs.getWrapAlignment());
224     setWrappedWidth(vs.getWrappedWidth());
225     // ViewStyle.configureFrom(this, viewStyle);
226   }
227
228   public ViewStyle()
229   {
230   }
231
232   /**
233    * Returns true if all attributes of the ViewStyles have the same value
234    */
235   @Override
236   public boolean equals(Object other)
237   {
238     if (other == null || !(other instanceof ViewStyle))
239     {
240       return false;
241     }
242     ViewStyle vs = (ViewStyle) other;
243
244     boolean match = (getAbovePIDThreshold() == vs.getAbovePIDThreshold()
245             && isCentreColumnLabels() == vs.isCentreColumnLabels()
246             && getCharHeight() == vs.getCharHeight()
247             && getCharWidth() == vs.getCharWidth()
248             && getColourAppliesToAllGroups() == vs
249                     .getColourAppliesToAllGroups()
250             && isColourByReferenceSeq() == vs.isColourByReferenceSeq()
251             && getColourText() == vs.getColourText()
252             && isConservationColourSelected() == vs
253                     .isConservationColourSelected()
254             && getConservationSelected() == vs.getConservationSelected()
255             && isDisplayReferenceSeq() == vs.isDisplayReferenceSeq()
256             && getFontSize() == vs.getFontSize()
257             && getFontStyle() == vs.getFontStyle()
258             && getIdWidth() == vs.getIdWidth()
259             && getIncrement() == vs.getIncrement()
260             && isRenderGaps() == vs.isRenderGaps()
261             && isRightAlignIds() == vs.isRightAlignIds()
262             && getScaleAboveWrapped() == vs.getScaleAboveWrapped()
263             && getScaleLeftWrapped() == vs.getScaleLeftWrapped()
264             && isScaleProteinAsCdna() == vs.isScaleProteinAsCdna()
265             && isProteinFontAsCdna() == vs.isProteinFontAsCdna()
266             && getScaleRightWrapped() == vs.getScaleRightWrapped()
267             && isSeqNameItalics() == vs.isSeqNameItalics()
268             && isShowAnnotation() == vs.isShowAnnotation()
269             && getShowBoxes() == vs.getShowBoxes()
270             && isShowColourText() == vs.isShowColourText()
271             && isShowDBRefs() == vs.isShowDBRefs()
272             && getShowHiddenMarkers() == vs.getShowHiddenMarkers()
273             && getShowJVSuffix() == vs.getShowJVSuffix()
274             && isShowNPFeats() == vs.isShowNPFeats()
275             && isShowSequenceFeaturesHeight() == vs
276                     .isShowSequenceFeaturesHeight()
277             && isShowSequenceFeatures() == vs.isShowSequenceFeatures()
278             && getShowText() == vs.getShowText()
279             && getShowUnconserved() == vs.getShowUnconserved()
280             && getThreshold() == vs.getThreshold()
281             && getThresholdTextColour() == vs.getThresholdTextColour()
282             && isUpperCasebold() == vs.isUpperCasebold()
283             && getWrapAlignment() == vs.getWrapAlignment()
284             && getWrappedWidth() == vs.getWrappedWidth());
285     /*
286      * and compare non-primitive types; syntax below will match null with null
287      * values
288      */
289     match = match && String.valueOf(getFontName())
290             .equals(String.valueOf(vs.getFontName()));
291     match = match && String.valueOf(getTextColour())
292             .equals(String.valueOf(vs.getTextColour()));
293     match = match && String.valueOf(getTextColour2())
294             .equals(String.valueOf(vs.getTextColour2()));
295     return match;
296     // return equivalent(this, (ViewStyle) other);
297   }
298
299   /**
300    * Overridden to ensure that whenever vs1.equals(vs2) then vs1.hashCode() ==
301    * vs2.hashCode()
302    */
303   @Override
304   public int hashCode()
305   {
306     /*
307      * No need to include all properties, just a selection...
308      */
309     int hash = 0;
310     int m = 1;
311     // Boolean.hashCode returns 1231 or 1237
312     hash += m++ * Boolean.valueOf(this.abovePIDThreshold).hashCode();
313     hash += m++ * Boolean.valueOf(this.centreColumnLabels).hashCode();
314     hash += m++ * Boolean.valueOf(this.colourAppliesToAllGroups).hashCode();
315     hash += m++ * Boolean.valueOf(this.displayReferenceSeq).hashCode();
316     hash += m++ * Boolean.valueOf(this.renderGaps).hashCode();
317     hash += m++ * Boolean.valueOf(this.rightAlignIds).hashCode();
318     hash += m++ * Boolean.valueOf(this.scaleProteinAsCdna).hashCode();
319     hash += m++ * Boolean.valueOf(this.scaleRightWrapped).hashCode();
320     hash += m++ * Boolean.valueOf(this.seqNameItalics).hashCode();
321     hash += m++ * Boolean.valueOf(this.showAnnotation).hashCode();
322     hash += m++ * Boolean.valueOf(this.showBoxes).hashCode();
323     hash += m++ * Boolean.valueOf(this.showdbrefs).hashCode();
324     hash += m++ * Boolean.valueOf(this.showJVSuffix).hashCode();
325     hash += m++ * Boolean.valueOf(this.showSequenceFeatures).hashCode();
326     hash += m++ * Boolean.valueOf(this.showUnconserved).hashCode();
327     hash += m++ * Boolean.valueOf(this.wrapAlignment).hashCode();
328     hash += m++ * this.charHeight;
329     hash += m++ * this.charWidth;
330     hash += m++ * fontSize;
331     hash += m++ * fontStyle;
332     hash += m++ * idWidth;
333     hash += String.valueOf(this.fontName).hashCode();
334     return hash;
335   }
336
337   /**
338    * @return the upperCasebold
339    */
340   @Override
341   public boolean isUpperCasebold()
342   {
343     return upperCasebold;
344   }
345
346   /**
347    * @param upperCasebold
348    *          the upperCasebold to set
349    */
350   @Override
351   public void setUpperCasebold(boolean upperCasebold)
352   {
353     this.upperCasebold = upperCasebold;
354   }
355
356   /**
357    * flag for wrapping
358    */
359   boolean wrapAlignment = false;
360
361   /**
362    * number columns in wrapped alignment
363    */
364   int wrappedWidth;
365
366   private int fontStyle;
367
368   /**
369    * GUI state
370    * 
371    * @return true if percent identity threshold is applied to shading
372    */
373   @Override
374   public boolean getAbovePIDThreshold()
375   {
376     return abovePIDThreshold;
377   }
378
379   /**
380    * DOCUMENT ME!
381    * 
382    * @return DOCUMENT ME!
383    */
384   @Override
385   public int getCharHeight()
386   {
387     return charHeight;
388   }
389
390   /**
391    * DOCUMENT ME!
392    * 
393    * @return DOCUMENT ME!
394    */
395   @Override
396   public int getCharWidth()
397   {
398     return charWidth;
399   }
400
401   /**
402    * 
403    * 
404    * @return flag indicating if colourchanges propagated to all groups
405    */
406   @Override
407   public boolean getColourAppliesToAllGroups()
408   {
409     return colourAppliesToAllGroups;
410   }
411
412   /**
413    * DOCUMENT ME!
414    * 
415    * @return DOCUMENT ME!
416    */
417   @Override
418   public boolean getColourText()
419   {
420     return showColourText;
421   }
422
423   /**
424    * GUI state
425    * 
426    * @return true if conservation based shading is enabled
427    */
428   @Override
429   public boolean getConservationSelected()
430   {
431     return conservationColourSelected;
432   }
433
434   /**
435    * GUI State
436    * 
437    * @return get scalar for bleaching colourschemes by conservation
438    */
439   @Override
440   public int getIncrement()
441   {
442     return increment;
443   }
444
445   /**
446    * DOCUMENT ME!
447    * 
448    * @return DOCUMENT ME!
449    */
450   @Override
451   public boolean getScaleAboveWrapped()
452   {
453     return scaleAboveWrapped;
454   }
455
456   /**
457    * DOCUMENT ME!
458    * 
459    * @return DOCUMENT ME!
460    */
461   @Override
462   public boolean getScaleLeftWrapped()
463   {
464     return scaleLeftWrapped;
465   }
466
467   /**
468    * DOCUMENT ME!
469    * 
470    * @return DOCUMENT ME!
471    */
472   @Override
473   public boolean getScaleRightWrapped()
474   {
475     return scaleRightWrapped;
476   }
477
478   /**
479    * DOCUMENT ME!
480    * 
481    * @return DOCUMENT ME!
482    */
483   @Override
484   public boolean getShowBoxes()
485   {
486     return showBoxes;
487   }
488
489   @Override
490   public boolean getShowHiddenMarkers()
491   {
492     return showHiddenMarkers;
493   }
494
495   /**
496    * DOCUMENT ME!
497    * 
498    * @return DOCUMENT ME!
499    */
500   @Override
501   public boolean getShowJVSuffix()
502   {
503     return showJVSuffix;
504   }
505
506   /**
507    * DOCUMENT ME!
508    * 
509    * @return DOCUMENT ME!
510    */
511   @Override
512   public boolean getShowText()
513   {
514     return showText;
515   }
516
517   @Override
518   public boolean getShowUnconserved()
519   {
520     return showUnconserved;
521   }
522
523   /**
524    * @return the textColour
525    */
526   @Override
527   public Color getTextColour()
528   {
529     return textColour;
530   }
531
532   /**
533    * @return the textColour2
534    */
535   @Override
536   public Color getTextColour2()
537   {
538     return textColour2;
539   }
540
541   /**
542    * DOCUMENT ME!
543    * 
544    * @return DOCUMENT ME!
545    */
546   @Override
547   public int getThreshold()
548   {
549     return threshold;
550   }
551
552   /**
553    * @return the thresholdTextColour
554    */
555   @Override
556   public int getThresholdTextColour()
557   {
558     return thresholdTextColour;
559   }
560
561   /**
562    * DOCUMENT ME!
563    * 
564    * @return DOCUMENT ME!
565    */
566   @Override
567   public boolean getWrapAlignment()
568   {
569     return wrapAlignment;
570   }
571
572   /**
573    * DOCUMENT ME!
574    * 
575    * @return DOCUMENT ME!
576    */
577   @Override
578   public int getWrappedWidth()
579   {
580     return wrappedWidth;
581   }
582
583   @Override
584   public boolean isColourByReferenceSeq()
585   {
586     return colourByReferenceSeq;
587   }
588
589   /**
590    * @return the conservationColourSelected
591    */
592   @Override
593   public boolean isConservationColourSelected()
594   {
595     return conservationColourSelected;
596   }
597
598   @Override
599   public boolean isDisplayReferenceSeq()
600   {
601     return displayReferenceSeq;
602   }
603
604   /**
605    * @return the renderGaps
606    */
607   @Override
608   public boolean isRenderGaps()
609   {
610     return renderGaps;
611   }
612
613   @Override
614   public boolean isRightAlignIds()
615   {
616     return rightAlignIds;
617   }
618
619   /**
620    * @return the seqNameItalics
621    */
622   @Override
623   public boolean isSeqNameItalics()
624   {
625     return seqNameItalics;
626   }
627
628   @Override
629   public boolean isShowAnnotation()
630   {
631     return showAnnotation;
632   }
633
634   /**
635    * @return the showColourText
636    */
637   @Override
638   public boolean isShowColourText()
639   {
640     return showColourText;
641   }
642
643   /**
644    * @return the showSeqFeaturesHeight
645    */
646   @Override
647   public boolean isShowSequenceFeaturesHeight()
648   {
649     return showSeqFeaturesHeight;
650   }
651
652   @Override
653   public boolean isShowSequenceFeatures()
654   {
655     return showSequenceFeatures;
656   }
657
658   /**
659    * GUI state
660    * 
661    * 
662    * @param b
663    *          indicate if percent identity threshold is applied to shading
664    */
665   @Override
666   public void setAbovePIDThreshold(boolean b)
667   {
668     abovePIDThreshold = b;
669   }
670
671   /**
672    * DOCUMENT ME!
673    * 
674    * @param h
675    *          DOCUMENT ME!
676    */
677   @Override
678   public void setCharHeight(int h)
679   {
680     this.charHeight = h;
681   }
682
683   /**
684    * DOCUMENT ME!
685    * 
686    * @param w
687    *          DOCUMENT ME!
688    */
689   @Override
690   public void setCharWidth(int w)
691   {
692     this.charWidth = w;
693   }
694
695   /**
696    * @param value
697    *          indicating if subsequent colourscheme changes will be propagated
698    *          to all groups
699    */
700   @Override
701   public void setColourAppliesToAllGroups(boolean b)
702   {
703     colourAppliesToAllGroups = b;
704   }
705
706   @Override
707   public void setColourByReferenceSeq(boolean colourByReferenceSeq)
708   {
709     this.colourByReferenceSeq = colourByReferenceSeq;
710   }
711
712   /**
713    * DOCUMENT ME!
714    * 
715    * @param state
716    *          DOCUMENT ME!
717    */
718   @Override
719   public void setColourText(boolean state)
720   {
721     showColourText = state;
722   }
723
724   /**
725    * @param conservationColourSelected
726    *          the conservationColourSelected to set
727    */
728   @Override
729   public void setConservationColourSelected(
730           boolean conservationColourSelected)
731   {
732     this.conservationColourSelected = conservationColourSelected;
733   }
734
735   /**
736    * GUI state
737    * 
738    * @param b
739    *          enable conservation based shading
740    */
741   @Override
742   public void setConservationSelected(boolean b)
743   {
744     conservationColourSelected = b;
745   }
746
747   @Override
748   public void setDisplayReferenceSeq(boolean displayReferenceSeq)
749   {
750     this.displayReferenceSeq = displayReferenceSeq;
751   }
752
753   /**
754    * 
755    * @param inc
756    *          set the scalar for bleaching colourschemes according to degree of
757    *          conservation
758    */
759   @Override
760   public void setIncrement(int inc)
761   {
762     increment = inc;
763   }
764
765   /**
766    * DOCUMENT ME!
767    * 
768    * @param state
769    *          DOCUMENT ME!
770    */
771   @Override
772   public void setRenderGaps(boolean state)
773   {
774     renderGaps = state;
775   }
776
777   @Override
778   public void setRightAlignIds(boolean rightAlignIds)
779   {
780     this.rightAlignIds = rightAlignIds;
781   }
782
783   /**
784    * DOCUMENT ME!
785    * 
786    * @param b
787    *          DOCUMENT ME!
788    */
789   @Override
790   public void setScaleAboveWrapped(boolean b)
791   {
792     scaleAboveWrapped = b;
793   }
794
795   /**
796    * DOCUMENT ME!
797    * 
798    * @param b
799    *          DOCUMENT ME!
800    */
801   @Override
802   public void setScaleLeftWrapped(boolean b)
803   {
804     scaleLeftWrapped = b;
805   }
806
807   /**
808    * 
809    * 
810    * @param scaleRightWrapped
811    *          - true or false
812    */
813
814   @Override
815   public void setScaleRightWrapped(boolean b)
816   {
817     scaleRightWrapped = b;
818   }
819
820   @Override
821   public void setSeqNameItalics(boolean italics)
822   {
823     seqNameItalics = italics;
824   }
825
826   @Override
827   public void setShowAnnotation(boolean b)
828   {
829     showAnnotation = b;
830   }
831
832   /**
833    * DOCUMENT ME!
834    * 
835    * @param state
836    *          DOCUMENT ME!
837    */
838   @Override
839   public void setShowBoxes(boolean state)
840   {
841     showBoxes = state;
842   }
843
844   /**
845    * @param showColourText
846    *          the showColourText to set
847    */
848   @Override
849   public void setShowColourText(boolean showColourText)
850   {
851     this.showColourText = showColourText;
852   }
853
854   @Override
855   public void setShowHiddenMarkers(boolean show)
856   {
857     showHiddenMarkers = show;
858   }
859
860   /**
861    * DOCUMENT ME!
862    * 
863    * @param b
864    *          DOCUMENT ME!
865    */
866   @Override
867   public void setShowJVSuffix(boolean b)
868   {
869     showJVSuffix = b;
870   }
871
872   @Override
873   public void setShowSequenceFeaturesHeight(boolean selected)
874   {
875     showSeqFeaturesHeight = selected;
876
877   }
878
879   /**
880    * set the flag
881    * 
882    * @param b
883    *          features are displayed if true
884    */
885   @Override
886   public void setShowSequenceFeatures(boolean b)
887   {
888     showSequenceFeatures = b;
889   }
890
891   /**
892    * DOCUMENT ME!
893    * 
894    * @param state
895    *          DOCUMENT ME!
896    */
897   @Override
898   public void setShowText(boolean state)
899   {
900     showText = state;
901   }
902
903   @Override
904   public void setShowUnconserved(boolean showunconserved)
905   {
906     showUnconserved = showunconserved;
907   }
908
909   /**
910    * @param textColour
911    *          the textColour to set
912    */
913   @Override
914   public void setTextColour(Color textColour)
915   {
916     this.textColour = textColour;
917   }
918
919   /**
920    * @param textColour2
921    *          the textColour2 to set
922    */
923   @Override
924   public void setTextColour2(Color textColour2)
925   {
926     this.textColour2 = textColour2;
927   }
928
929   /**
930    * DOCUMENT ME!
931    * 
932    * @param thresh
933    *          DOCUMENT ME!
934    */
935   @Override
936   public void setThreshold(int thresh)
937   {
938     threshold = thresh;
939   }
940
941   /**
942    * @param thresholdTextColour
943    *          the thresholdTextColour to set
944    */
945   @Override
946   public void setThresholdTextColour(int thresholdTextColour)
947   {
948     this.thresholdTextColour = thresholdTextColour;
949   }
950
951   /**
952    * DOCUMENT ME!
953    * 
954    * @param state
955    *          DOCUMENT ME!
956    */
957   @Override
958   public void setWrapAlignment(boolean state)
959   {
960     wrapAlignment = state;
961   }
962
963   /**
964    * DOCUMENT ME!
965    * 
966    * @param w
967    *          DOCUMENT ME!
968    */
969   @Override
970   public void setWrappedWidth(int w)
971   {
972     this.wrappedWidth = w;
973   }
974
975   @Override
976   public boolean sameStyle(ViewStyleI that)
977   {
978     return this.equals(that);
979   }
980
981   @Override
982   public String getFontName()
983   {
984     return fontName;
985   }
986
987   @Override
988   public int getFontSize()
989   {
990     return fontSize;
991   }
992
993   @Override
994   public int getFontStyle()
995   {
996     return fontStyle;
997   }
998
999   @Override
1000   public void setFontName(String name)
1001   {
1002     fontName = name;
1003   }
1004
1005   @Override
1006   public void setFontSize(int size)
1007   {
1008     fontSize = size;
1009
1010   }
1011
1012   @Override
1013   public void setFontStyle(int style)
1014   {
1015     fontStyle = style;
1016   }
1017
1018   @Override
1019   public int getIdWidth()
1020   {
1021     return idWidth;
1022   }
1023
1024   /**
1025    * @param idWidth
1026    *          the idWidth to set
1027    */
1028   @Override
1029   public void setIdWidth(int idWidth)
1030   {
1031     this.idWidth = idWidth;
1032   }
1033
1034   /**
1035    * @return the centreColumnLabels
1036    */
1037   @Override
1038   public boolean isCentreColumnLabels()
1039   {
1040     return centreColumnLabels;
1041   }
1042
1043   /**
1044    * @param centreColumnLabels
1045    *          the centreColumnLabels to set
1046    */
1047   @Override
1048   public void setCentreColumnLabels(boolean centreColumnLabels)
1049   {
1050     this.centreColumnLabels = centreColumnLabels;
1051   }
1052
1053   /**
1054    * @return the showdbrefs
1055    */
1056   @Override
1057   public boolean isShowDBRefs()
1058   {
1059     return showdbrefs;
1060   }
1061
1062   /**
1063    * @param showdbrefs
1064    *          the showdbrefs to set
1065    */
1066   @Override
1067   public void setShowDBRefs(boolean showdbrefs)
1068   {
1069     this.showdbrefs = showdbrefs;
1070   }
1071
1072   /**
1073    * @return the shownpfeats
1074    */
1075   @Override
1076   public boolean isShowNPFeats()
1077   {
1078     return shownpfeats;
1079   }
1080
1081   /**
1082    * @param shownpfeats
1083    *          the shownpfeats to set
1084    */
1085   @Override
1086   public void setShowNPFeats(boolean shownpfeats)
1087   {
1088     this.shownpfeats = shownpfeats;
1089   }
1090
1091   @Override
1092   public boolean isScaleProteinAsCdna()
1093   {
1094     return this.scaleProteinAsCdna;
1095   }
1096
1097   @Override
1098   public void setScaleProteinAsCdna(boolean b)
1099   {
1100     this.scaleProteinAsCdna = b;
1101   }
1102
1103   @Override
1104   public boolean isProteinFontAsCdna()
1105   {
1106     return proteinFontAsCdna;
1107   }
1108
1109   @Override
1110   public void setProteinFontAsCdna(boolean b)
1111   {
1112     proteinFontAsCdna = b;
1113   }
1114 }