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