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