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