1 package jalview.viewmodel.styles;
3 import jalview.api.ViewStyleI;
8 * A container for holding alignment view properties. View properties are
9 * data-independent, which means they can be safely copied between views
10 * involving different alignment data without causing exceptions in the
16 public class ViewStyle implements ViewStyleI
19 private boolean abovePIDThreshold = false;
26 * gui state - changes to colour scheme propagated to all groups
28 private boolean colourAppliesToAllGroups;
31 * colour according to the reference sequence defined on the alignment
33 private boolean colourByReferenceSeq = false;
35 boolean conservationColourSelected = false;
38 * show the reference sequence in the alignment view
40 private boolean displayReferenceSeq = false;
42 private int increment;
45 * display gap characters
47 boolean renderGaps = true;
49 private boolean rightAlignIds = false;
51 boolean scaleAboveWrapped = false;
53 boolean scaleLeftWrapped = true;
55 boolean scaleRightWrapped = true;
57 boolean seqNameItalics;
60 * show annotation tracks on the alignment
62 private boolean showAnnotation = true;
65 * render each residue in a coloured box
67 boolean showBoxes = true;
70 * Colour sequence text
72 boolean showColourText = false;
77 boolean showHiddenMarkers = true;
80 * show /start-end in ID panel
82 boolean showJVSuffix = true;
85 * scale features height according to score
87 boolean showSeqFeaturesHeight;
90 * display setting for showing/hiding sequence features on alignment view
92 boolean showSequenceFeatures = false;
95 * display sequence symbols
97 boolean showText = true;
100 * show non-conserved residues only
102 protected boolean showUnconserved = false;
104 Color textColour = Color.black;
106 Color textColour2 = Color.white;
109 * PID or consensus threshold
114 * threshold for switching between textColour & textColour2
116 int thresholdTextColour = 0;
119 * upper case characters in sequence are shown in bold
121 boolean upperCasebold = false;
124 * @return the upperCasebold
127 public boolean isUpperCasebold()
129 return upperCasebold;
133 * @param upperCasebold
134 * the upperCasebold to set
137 public void setUpperCasebold(boolean upperCasebold)
139 this.upperCasebold = upperCasebold;
145 boolean wrapAlignment = false;
148 * number columns in wrapped alignment
155 * @return true if percent identity threshold is applied to shading
158 public boolean getAbovePIDThreshold()
160 return abovePIDThreshold;
166 * @return DOCUMENT ME!
169 public int getCharHeight()
177 * @return DOCUMENT ME!
180 public int getCharWidth()
188 * @return flag indicating if colourchanges propagated to all groups
191 public boolean getColourAppliesToAllGroups()
193 return colourAppliesToAllGroups;
199 * @return DOCUMENT ME!
202 public boolean getColourText()
204 return showColourText;
210 * @return true if conservation based shading is enabled
213 public boolean getConservationSelected()
215 return conservationColourSelected;
221 * @return get scalar for bleaching colourschemes by conservation
224 public int getIncrement()
232 * @return DOCUMENT ME!
235 public boolean getScaleAboveWrapped()
237 return scaleAboveWrapped;
243 * @return DOCUMENT ME!
246 public boolean getScaleLeftWrapped()
248 return scaleLeftWrapped;
254 * @return DOCUMENT ME!
257 public boolean getScaleRightWrapped()
259 return scaleRightWrapped;
265 * @return DOCUMENT ME!
268 public boolean getShowBoxes()
274 public boolean getShowHiddenMarkers()
276 return showHiddenMarkers;
282 * @return DOCUMENT ME!
285 public boolean getShowJVSuffix()
293 * @return DOCUMENT ME!
296 public boolean getShowText()
302 public boolean getShowUnconserved()
304 return showUnconserved;
308 * @return the textColour
311 public Color getTextColour()
317 * @return the textColour2
320 public Color getTextColour2()
328 * @return DOCUMENT ME!
331 public int getThreshold()
337 * @return the thresholdTextColour
340 public int getThresholdTextColour()
342 return thresholdTextColour;
348 * @return DOCUMENT ME!
351 public boolean getWrapAlignment()
353 return wrapAlignment;
359 * @return DOCUMENT ME!
362 public int getWrappedWidth()
368 public boolean isColourByReferenceSeq()
370 return colourByReferenceSeq;
374 * @return the conservationColourSelected
377 public boolean isConservationColourSelected()
379 return conservationColourSelected;
383 public boolean isDisplayReferenceSeq()
385 return displayReferenceSeq;
389 * @return the renderGaps
392 public boolean isRenderGaps()
398 public boolean isRightAlignIds()
400 return rightAlignIds;
404 * @return the seqNameItalics
407 public boolean isSeqNameItalics()
409 return seqNameItalics;
413 public boolean isShowAnnotation()
415 return showAnnotation;
419 * @return the showColourText
422 public boolean isShowColourText()
424 return showColourText;
428 * @return the showSeqFeaturesHeight
431 public boolean isShowSeqFeaturesHeight()
433 return showSeqFeaturesHeight;
437 public boolean isShowSequenceFeatures()
439 return showSequenceFeatures;
443 public boolean isShowSequenceFeaturesHeight()
446 return showSeqFeaturesHeight;
454 * indicate if percent identity threshold is applied to shading
457 public void setAbovePIDThreshold(boolean b)
459 abovePIDThreshold = b;
469 public void setCharHeight(int h)
481 public void setCharWidth(int w)
489 * indicating if subsequent colourscheme changes will be propagated
493 public void setColourAppliesToAllGroups(boolean b)
495 colourAppliesToAllGroups = b;
499 public void setColourByReferenceSeq(boolean colourByReferenceSeq)
501 this.colourByReferenceSeq = colourByReferenceSeq;
511 public void setColourText(boolean state)
513 showColourText = state;
517 * @param conservationColourSelected
518 * the conservationColourSelected to set
521 public void setConservationColourSelected(
522 boolean conservationColourSelected)
524 this.conservationColourSelected = conservationColourSelected;
531 * enable conservation based shading
534 public void setConservationSelected(boolean b)
536 conservationColourSelected = b;
540 public void setDisplayReferenceSeq(boolean displayReferenceSeq)
542 this.displayReferenceSeq = displayReferenceSeq;
548 * set the scalar for bleaching colourschemes according to degree of
552 public void setIncrement(int inc)
564 public void setRenderGaps(boolean state)
570 public void setRightAlignIds(boolean rightAlignIds)
572 this.rightAlignIds = rightAlignIds;
582 public void setScaleAboveWrapped(boolean b)
584 scaleAboveWrapped = b;
594 public void setScaleLeftWrapped(boolean b)
596 scaleLeftWrapped = b;
602 * @param scaleRightWrapped
607 public void setScaleRightWrapped(boolean b)
609 scaleRightWrapped = b;
613 public void setSeqNameItalics(boolean italics)
615 seqNameItalics = italics;
619 public void setShowAnnotation(boolean b)
631 public void setShowBoxes(boolean state)
637 * @param showColourText
638 * the showColourText to set
641 public void setShowColourText(boolean showColourText)
643 this.showColourText = showColourText;
647 public void setShowHiddenMarkers(boolean show)
649 showHiddenMarkers = show;
659 public void setShowJVSuffix(boolean b)
665 public void setShowSeqFeaturesHeight(boolean selected)
667 showSeqFeaturesHeight = selected;
675 * features are displayed if true
678 public void setShowSequenceFeatures(boolean b)
680 showSequenceFeatures = b;
690 public void setShowText(boolean state)
696 public void setShowUnconserved(boolean showunconserved)
698 showUnconserved = showunconserved;
703 * the textColour to set
706 public void setTextColour(Color textColour)
708 this.textColour = textColour;
713 * the textColour2 to set
716 public void setTextColour2(Color textColour2)
718 this.textColour2 = textColour2;
728 public void setThreshold(int thresh)
734 * @param thresholdTextColour
735 * the thresholdTextColour to set
738 public void setThresholdTextColour(int thresholdTextColour)
740 this.thresholdTextColour = thresholdTextColour;
750 public void setWrapAlignment(boolean state)
752 wrapAlignment = state;
762 public void setWrappedWidth(int w)
764 this.wrappedWidth = w;