JAL-4071 boring GUI bits - add togglable menu item for show/hide sequence feature...
[jalview.git] / src / jalview / viewmodel / styles / ViewStyle.java
index f01047d..0a525e2 100644 (file)
  */
 package jalview.viewmodel.styles;
 
-import jalview.api.ViewStyleI;
-
 import java.awt.Color;
 
+import jalview.api.ViewStyleI;
+
 /**
  * A container for holding alignment view properties. View properties are
  * data-independent, which means they can be safely copied between views
@@ -124,6 +124,12 @@ public class ViewStyle implements ViewStyleI
   boolean showSequenceFeatures = false;
 
   /**
+   * display setting for showing/hiding annotation tracks reporting sequence
+   * feature counts in columns of alignment view
+   */
+  boolean showSequenceFeatureCounts = false;
+
+  /**
    * display sequence symbols
    */
   boolean showText = true;
@@ -213,6 +219,8 @@ public class ViewStyle implements ViewStyleI
     setShowNPFeats(vs.isShowNPFeats());
     setShowSequenceFeaturesHeight(vs.isShowSequenceFeaturesHeight());
     setShowSequenceFeatures(vs.isShowSequenceFeatures());
+    setShowComplementFeatures(vs.isShowComplementFeatures());
+    setShowComplementFeaturesOnTop(vs.isShowComplementFeaturesOnTop());
     setShowText(vs.getShowText());
     setShowUnconserved(vs.getShowUnconserved());
     setTextColour(vs.getTextColour());
@@ -275,26 +283,26 @@ public class ViewStyle implements ViewStyleI
             && isShowSequenceFeaturesHeight() == vs
                     .isShowSequenceFeaturesHeight()
             && isShowSequenceFeatures() == vs.isShowSequenceFeatures()
+            && isShowComplementFeatures() == vs.isShowComplementFeatures()
+            && isShowComplementFeaturesOnTop() == vs
+                    .isShowComplementFeaturesOnTop()
             && getShowText() == vs.getShowText()
             && getShowUnconserved() == vs.getShowUnconserved()
             && getThreshold() == vs.getThreshold()
             && getThresholdTextColour() == vs.getThresholdTextColour()
             && isUpperCasebold() == vs.isUpperCasebold()
-            && getWrapAlignment() == vs.getWrapAlignment() && getWrappedWidth() == vs
-            .getWrappedWidth());
+            && getWrapAlignment() == vs.getWrapAlignment()
+            && getWrappedWidth() == vs.getWrappedWidth());
     /*
      * and compare non-primitive types; syntax below will match null with null
      * values
      */
-    match = match
-            && String.valueOf(getFontName()).equals(
-                    String.valueOf(vs.getFontName()));
-    match = match
-            && String.valueOf(getTextColour()).equals(
-                    String.valueOf(vs.getTextColour()));
-    match = match
-            && String.valueOf(getTextColour2()).equals(
-                    String.valueOf(vs.getTextColour2()));
+    match = match && String.valueOf(getFontName())
+            .equals(String.valueOf(vs.getFontName()));
+    match = match && String.valueOf(getTextColour())
+            .equals(String.valueOf(vs.getTextColour()));
+    match = match && String.valueOf(getTextColour2())
+            .equals(String.valueOf(vs.getTextColour2()));
     return match;
     // return equivalent(this, (ViewStyle) other);
   }
@@ -368,6 +376,10 @@ public class ViewStyle implements ViewStyleI
 
   private int fontStyle;
 
+  private boolean showComplementFeatures;
+
+  private boolean showComplementFeaturesOnTop;
+
   /**
    * GUI state
    * 
@@ -1114,4 +1126,40 @@ public class ViewStyle implements ViewStyleI
   {
     proteinFontAsCdna = b;
   }
+
+  @Override
+  public void setShowComplementFeatures(boolean b)
+  {
+    showComplementFeatures = b;
+  }
+
+  @Override
+  public boolean isShowComplementFeatures()
+  {
+    return showComplementFeatures;
+  }
+
+  @Override
+  public void setShowComplementFeaturesOnTop(boolean b)
+  {
+    showComplementFeaturesOnTop = b;
+  }
+
+  @Override
+  public boolean isShowComplementFeaturesOnTop()
+  {
+    return showComplementFeaturesOnTop;
+  }
+
+  @Override
+  public void setShowSequenceFeatureCounts(boolean show)
+  {
+    showSequenceFeatureCounts = show;
+  }
+
+  @Override
+  public boolean isShowSequenceFeatureCounts()
+  {
+    return showSequenceFeatureCounts;
+  }
 }