JAL-3719 Format->Colour Gaps option uses Overview gap colour logic pulled up to align...
[jalview.git] / src / jalview / viewmodel / styles / ViewStyle.java
index 91f2f0c..1daca08 100644 (file)
@@ -129,6 +129,10 @@ public class ViewStyle implements ViewStyleI
   boolean showText = true;
 
   /**
+   * colour gaps in the alignment view according to the overview gap colour
+   */
+  boolean colourGaps = false;
+  /**
    * show non-conserved residues only
    */
   protected boolean showUnconserved = false;
@@ -224,6 +228,7 @@ public class ViewStyle implements ViewStyleI
     setUpperCasebold(vs.isUpperCasebold());
     setWrapAlignment(vs.getWrapAlignment());
     setWrappedWidth(vs.getWrappedWidth());
+    setColourGaps(vs.getColourGaps());
     // ViewStyle.configureFrom(this, viewStyle);
   }
 
@@ -286,7 +291,8 @@ public class ViewStyle implements ViewStyleI
             && getThresholdTextColour() == vs.getThresholdTextColour()
             && isUpperCasebold() == vs.isUpperCasebold()
             && getWrapAlignment() == vs.getWrapAlignment()
-            && getWrappedWidth() == vs.getWrappedWidth());
+            && getWrappedWidth() == vs.getWrappedWidth()
+            && getColourGaps() == vs.getColourGaps());
     /*
      * and compare non-primitive types; syntax below will match null with null
      * values
@@ -330,6 +336,8 @@ public class ViewStyle implements ViewStyleI
     hash += m++ * Boolean.valueOf(this.showSequenceFeatures).hashCode();
     hash += m++ * Boolean.valueOf(this.showUnconserved).hashCode();
     hash += m++ * Boolean.valueOf(this.wrapAlignment).hashCode();
+    hash += m++ * Boolean.valueOf(this.colourGaps).hashCode();
+    hash += m++ * Boolean.valueOf(this.showColourText).hashCode();
     hash += m++ * this.charHeight;
     hash += m++ * this.charWidth;
     hash += m++ * fontSize;
@@ -1144,4 +1152,16 @@ public class ViewStyle implements ViewStyleI
   {
     return showComplementFeaturesOnTop;
   }
+
+  @Override
+  public void setColourGaps(boolean b)
+  {
+    colourGaps = b;
+  }
+
+  @Override
+  public boolean getColourGaps()
+  {
+    return colourGaps;
+  }
 }