Merge branch 'develop' into features/JAL-2094_colourInterface features/JAL-2094_colourInterface
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 19 Sep 2016 16:56:18 +0000 (17:56 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 19 Sep 2016 16:56:18 +0000 (17:56 +0100)
Conflicts:
src/jalview/api/FeatureColourI.java
src/jalview/api/FeatureRenderer.java
src/jalview/appletgui/FeatureColourChooser.java
src/jalview/appletgui/FeatureRenderer.java
src/jalview/appletgui/FeatureSettings.java
src/jalview/appletgui/SeqCanvas.java
src/jalview/appletgui/SequenceRenderer.java
src/jalview/appletgui/UserDefinedColours.java
src/jalview/ext/ensembl/EnsemblGene.java
src/jalview/gui/FeatureColourChooser.java
src/jalview/gui/FeatureRenderer.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/SeqCanvas.java
src/jalview/gui/TreeCanvas.java
src/jalview/io/FeaturesFile.java
src/jalview/io/PDBFeatureSettings.java
src/jalview/renderer/seqfeatures/FeatureRenderer.java
src/jalview/schemes/FeatureColour.java
src/jalview/schemes/FeatureColourAdapter.java
src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java
src/jalview/ws/jws1/SeqSearchWSThread.java
src/jalview/ws/jws2/AADisorderClient.java
test/jalview/io/FeaturesFileTest.java
test/jalview/schemes/FeatureColourTest.java

40 files changed:
1  2 
examples/exampleFeatures.txt
src/MCview/Atom.java
src/MCview/PDBChain.java
src/jalview/api/AlignViewportI.java
src/jalview/api/FeatureColourI.java
src/jalview/appletgui/AnnotationColourChooser.java
src/jalview/appletgui/FeatureColourChooser.java
src/jalview/appletgui/FeatureRenderer.java
src/jalview/appletgui/FeatureSettings.java
src/jalview/appletgui/OverviewPanel.java
src/jalview/appletgui/SeqCanvas.java
src/jalview/appletgui/SequenceRenderer.java
src/jalview/appletgui/TreeCanvas.java
src/jalview/controller/AlignViewController.java
src/jalview/datamodel/SequenceGroup.java
src/jalview/ext/ensembl/EnsemblGene.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/FeatureColourChooser.java
src/jalview/gui/FeatureRenderer.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/SeqCanvas.java
src/jalview/gui/SequenceRenderer.java
src/jalview/gui/TextColourChooser.java
src/jalview/gui/TreeCanvas.java
src/jalview/io/AnnotationFile.java
src/jalview/io/FeaturesFile.java
src/jalview/io/HtmlSvgOutput.java
src/jalview/io/JSONFile.java
src/jalview/io/PDBFeatureSettings.java
src/jalview/renderer/seqfeatures/FeatureRenderer.java
src/jalview/schemes/FeatureColour.java
src/jalview/schemes/FeatureColourAdapter.java
src/jalview/viewmodel/AlignmentViewport.java
src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java
test/MCview/PDBChainTest.java
test/jalview/ext/ensembl/EnsemblGeneTest.java
test/jalview/io/FeaturesFileTest.java
test/jalview/schemes/FeatureColourTest.java

@@@ -22,12 -22,11 +22,13 @@@ NEST-RL    3e16b
  ASX-TURN-IIL  a67c98
  BETA-TURN-IIR c79792
  PHOSPHORYLATION (T)   c88395
 -BETA-TURN-IIL 8b5b50
 -ST-MOTIF      ac25a1
 +BETA-TURN-IIL label
 +#8b5b50
 +ST-MOTIF      label|||0|0
 +#ac25a1
  
  STARTGROUP    uniprot
+ <html><a href="http://pfam.xfam.org/family/PF00111">Pfam family</a></html>    FER_CAPAA       -1      0       0       Pfam
  Iron-sulfur (2Fe-2S)  FER_CAPAA       -1      39      39      METAL
  Iron-sulfur (2Fe-2S)  FER_CAPAA       -1      44      44      METAL
  Iron-sulfur (2Fe-2S)  FER_CAPAA       -1      47      47      METAL
Simple merge
@@@ -28,11 -27,10 +28,11 @@@ import jalview.datamodel.Mapping
  import jalview.datamodel.Sequence;
  import jalview.datamodel.SequenceFeature;
  import jalview.datamodel.SequenceI;
 +import jalview.schemes.Colour;
  import jalview.schemes.ColourSchemeI;
  import jalview.schemes.ResidueProperties;
+ import jalview.structure.StructureImportSettings;
  import jalview.structure.StructureMapping;
- import jalview.structure.StructureViewSettings;
  
  import java.awt.Color;
  import java.util.List;
Simple merge
@@@ -32,11 -33,18 +31,18 @@@ public interface FeatureColour
     * 
     * @return
     */
 -  Color getMaxColour();
 +  ColorI getMaxColour();
  
    /**
-    * Answers true if the feature is coloured by label (description); only
-    * applicable when isGraduatedColour answers true
+    * Answers true if the feature has a single colour, i.e. if isColourByLabel()
+    * and isGraduatedColour() both answer false
+    * 
+    * @return
+    */
+   boolean isSimpleColour();
+   /**
+    * Answers true if the feature is coloured by label (description)
     * 
     * @return
     */
     */
    float getThreshold();
  
-   float getMax();
-   /**
-    * Returns the minimum score of the graduated colour range
-    * 
-    * @return
-    */
-   float getMin();
+   void setThreshold(float f);
  
    /**
 +   * Answers true if either isAboveThreshold or isBelowThreshold answers true
 +   * 
 +   * @return
 +   */
 +  boolean hasThreshold();
 +
 +  /**
-    * Returns the computed colour for the given sequence feature
+    * Answers true if the colour varies between the actual minimum and maximum
+    * score values of the feature, or false if between absolute minimum and
+    * maximum values (or if not a graduated colour).
     * 
-    * @param feature
     * @return
     */
-   ColorI getColor(SequenceFeature feature);
+   boolean isAutoScaled();
+   void setAutoScaled(boolean b);
  
    /**
 -   * Returns the maximum score of the graduated colour range
 +   * Answers true if the feature has a simple colour, or is coloured by label,
 +   * or has a graduated colour and the score of this feature instance is within
 +   * the range to render (if any), i.e. does not lie below or above any
 +   * threshold set.
     * 
 +   * @param feature
     * @return
     */
 -  float getMax();
 +  boolean isColored(SequenceFeature feature);
  
    /**
 -   * Returns the minimum score of the graduated colour range
 +   * Update the min-max range for a graduated colour scheme
     * 
 -   * @return
 +   * @param min
 +   * @param max
     */
 -  float getMin();
 +  void updateBounds(float min, float max);
  
    /**
 -   * Answers true if either isAboveThreshold or isBelowThreshold answers true
 +   * Returns the colour in Jalview features file format
     * 
     * @return
     */
 -  boolean hasThreshold();
 +  String toJalviewFormat(String featureType);
  
-   void setThreshold(float f);
-   boolean isAutoScaled();
-   void setAutoScaled(boolean b);
-   boolean isSimpleColour();
-   void setAboveThreshold(boolean b);
-   void setThresholdMinMax(boolean b);
-   void setBelowThreshold(boolean b);
+   /**
 -   * Returns the computed colour for the given sequence feature
++   * Returns the maximum score of the graduated colour range
+    * 
 -   * @param feature
+    * @return
+    */
 -  Color getColor(SequenceFeature feature);
++  float getMax();
  
-   void setColourByLabel(boolean b);
+   /**
 -   * Answers true if the feature has a simple colour, or is coloured by label,
 -   * or has a graduated colour and the score of this feature instance is within
 -   * the range to render (if any), i.e. does not lie below or above any
 -   * threshold set.
++   * Returns the minimum score of the graduated colour range
+    * 
 -   * @param feature
+    * @return
+    */
 -  boolean isColored(SequenceFeature feature);
 -
 -  /**
 -   * Update the min-max range for a graduated colour scheme
 -   * 
 -   * @param min
 -   * @param max
 -   */
 -  void updateBounds(float min, float max);
++  float getMin();
  
-   void setGraduatedColour(boolean b);
+   /**
 -   * Returns the colour in Jalview features file format
++   * Returns the computed colour for the given sequence feature
+    * 
++   * @param feature
+    * @return
+    */
 -  String toJalviewFormat(String featureType);
++  ColorI getColor(SequenceFeature feature);
  }
@@@ -60,18 -58,22 +60,10 @@@ import java.util.Hashtable
  public class FeatureRenderer extends
          jalview.renderer.seqfeatures.FeatureRenderer
  {
-   /**
-    * Creates a new FeatureRenderer object.
-    * 
-    * @param av
-    *          DOCUMENT ME!
-    */
-   public FeatureRenderer(AlignmentViewport av)
-   {
-     super();
-     this.av = av;
-   }
 -
+   // Holds web links for feature groups and feature types
+   // in the form label|link
+   Hashtable featureLinks = null;
  
 -  /**
 -   * Creates a new FeatureRenderer object.
 -   * 
 -   * @param av
 -   */
 -  public FeatureRenderer(AlignmentViewport av)
 -  {
 -    super(av);
 -
 -  }
 -
    static String lastFeatureAdded;
  
    static String lastFeatureGroupAdded;
  
    FeatureColourPanel colourPanel;
  
++  /**
++   * Creates a new FeatureRenderer object.
++   * 
++   * @param av
++   */
++  public FeatureRenderer(AlignmentViewport av)
++  {
++    super(av);
++  }
++
    class FeatureColourPanel extends Panel
    {
      String label = "";
@@@ -765,28 -763,31 +765,29 @@@ public class FeatureSettings extends Pa
      public void paint(Graphics g)
      {
        Dimension d = getSize();
-       if (col.isColourByLabel())
+       if (col != null)
        {
-         g.setColor(Color.white);
-         g.fillRect(d.width / 2, 0, d.width / 2, d.height);
-         /*
-          * g.setColor(Color.black); Font f=g.getFont().deriveFont(9);
-          * g.setFont(f);
-          * 
-          * // g.setFont(g.getFont().deriveFont( //
-          * AffineTransform.getScaleInstance( //
-          * width/g.getFontMetrics().stringWidth("Label"), //
-          * height/g.getFontMetrics().getHeight()))); g.drawString("Label",
-          * width/2, 0);
-          */
-       }
-       else if (col.isGraduatedColour())
-       {
-         Color maxCol = ColorUtils.getColor(col.getMaxColour());
-         g.setColor(maxCol);
-         g.fillRect(d.width / 2, 0, d.width / 2, d.height);
+         if (col.isColourByLabel())
+         {
+           g.setColor(Color.white);
+           g.fillRect(d.width / 2, 0, d.width / 2, d.height);
+           /*
+            * g.setColor(Color.black); Font f=g.getFont().deriveFont(9);
+            * g.setFont(f);
+            * 
+            * // g.setFont(g.getFont().deriveFont( //
+            * AffineTransform.getScaleInstance( //
+            * width/g.getFontMetrics().stringWidth("Label"), //
+            * height/g.getFontMetrics().getHeight()))); g.drawString("Label",
+            * width/2, 0);
+            */
 -
+         }
+         else if (col.isGraduatedColour())
+         {
 -          Color maxCol = col.getMaxColour();
++          Color maxCol = ColorUtils.getColor(col.getMaxColour());
+           g.setColor(maxCol);
+           g.fillRect(d.width / 2, 0, d.width / 2, d.height);
 -
+         }
        }
  
        if (hasLink)
@@@ -24,7 -24,8 +24,9 @@@ import jalview.datamodel.AlignmentI
  import jalview.datamodel.SearchResults;
  import jalview.datamodel.SequenceGroup;
  import jalview.datamodel.SequenceI;
+ import jalview.renderer.ScaleRenderer;
+ import jalview.renderer.ScaleRenderer.ScaleMark;
 +import jalview.util.ColorUtils;
  import jalview.viewmodel.AlignmentViewport;
  
  import java.awt.Color;
Simple merge
Simple merge
@@@ -417,10 -411,9 +417,9 @@@ public class FeatureColourChooser exten
      }
      else
      {
 -      acg = new FeatureColour(oldminColour = minColour.getBackground(),
 -              oldmaxColour = maxColour.getBackground(), min, max);
 -
 +      acg = new FeatureColour(new Colour(
 +              oldminColour = minColour.getBackground()), new Colour(
 +              oldmaxColour = maxColour.getBackground()), min, max);
      }
  
      if (!hasThreshold)
@@@ -423,8 -422,8 +424,12 @@@ public class FeatureRenderer extend
     * update the amend feature button dependent on the given style
     * 
     * @param bigPanel
 +   * @param colour
     * @param col
++<<<<<<< HEAD
++=======
+    * @param col
++>>>>>>> refs/heads/develop
     */
    protected void updateColourButton(JPanel bigPanel, JLabel colour,
            FeatureColourI col)
@@@ -1523,10 -1532,8 +1536,8 @@@ public class FeatureSettings extends JP
        {
          this.setText("");
          this.setIcon(null);
 -        newColor = cellColour.getColour();
 +        newColor = ColorUtils.getColor(cellColour.getColour());
          setBackground(newColor);
-         // comp.setToolTipText("RGB value: " + newColor.getRed() + ", "
-         // + newColor.getGreen() + ", " + newColor.getBlue());
        }
        if (isSelected)
        {
@@@ -4123,9 -4341,15 +4342,15 @@@ public class Jalview2XM
      for (int i = 0; i < JSEQ.length; i++)
      {
        af.viewport.setSequenceColour(af.viewport.getAlignment()
 -              .getSequenceAt(i), new java.awt.Color(JSEQ[i].getColour()));
 +              .getSequenceAt(i), new Colour(JSEQ[i].getColour()));
      }
  
+     if (al.hasSeqrep())
+     {
+       af.getViewport().setColourByReferenceSeq(true);
+       af.getViewport().setDisplayReferenceSeq(true);
+     }
      af.viewport.setGatherViewsHere(view.getGatheredViews());
  
      if (view.getSequenceSetId() != null)
@@@ -24,7 -24,8 +24,9 @@@ import jalview.datamodel.AlignmentI
  import jalview.datamodel.SearchResults;
  import jalview.datamodel.SequenceGroup;
  import jalview.datamodel.SequenceI;
+ import jalview.renderer.ScaleRenderer;
+ import jalview.renderer.ScaleRenderer.ScaleMark;
 +import jalview.util.ColorUtils;
  
  import java.awt.BasicStroke;
  import java.awt.BorderLayout;
@@@ -92,8 -83,9 +86,9 @@@ public class SequenceRenderer implement
    }
  
    @Override
 -  public Color getResidueBoxColour(SequenceI seq, int i)
 +  public ColorI getResidueBoxColour(SequenceI seq, int i)
    {
+     // rate limiting step when rendering overview for lots of groups
      allGroups = av.getAlignment().findAllGroups(seq);
  
      if (inCurrentSequenceGroup(i))
@@@ -996,18 -1035,14 +1038,15 @@@ public class TreeCanvas extends JPanel 
                  .getCodingComplement();
          if (codingComplement != null)
          {
-           if (codingComplement != null)
+           SequenceGroup mappedGroup = MappingUtils.mapSequenceGroup(sg, av,
+                   codingComplement);
+           if (mappedGroup.getSequences().size() > 0)
            {
-             SequenceGroup mappedGroup = MappingUtils.mapSequenceGroup(sg,
-                     av, codingComplement);
-             if (mappedGroup.getSequences().size() > 0)
+             codingComplement.getAlignment().addGroup(mappedGroup);
+             for (SequenceI seq : mappedGroup.getSequences())
              {
-               codingComplement.getAlignment().addGroup(mappedGroup);
-               for (SequenceI seq : mappedGroup.getSequences())
-               {
-                 codingComplement.setSequenceColour(seq,
-                         new Colour(col.brighter()));
-               }
 -              codingComplement.setSequenceColour(seq, col.brighter());
++              codingComplement.setSequenceColour(seq,
++                      new Colour(col.brighter()));
              }
            }
          }
Simple merge
@@@ -743,51 -525,15 +748,15 @@@ public class FeaturesFile extends Align
        // write feature colours only if we're given them and we are generating
        // viewed features
        // TODO: decide if feature links should also be written here ?
 -      Iterator<String> en = visible.keySet().iterator();
 +      Iterator<String> en = featureColours.keySet().iterator();
-       String featureType, color;
        while (en.hasNext())
        {
-         featureType = en.next();
-         FeatureColourI fc = featureColours.get(featureType);
-         if (fc.isSimpleColour())
-         {
-           color = Format.getHexString(fc.getColour());
-         }
-         else
-         {
-           color = (fc.isColourByLabel() ? "label|" : "")
-                   + Format.getHexString(fc.getMinColour()) + "|"
-                   + Format.getHexString(fc.getMaxColour())
-                   + (fc.isAutoScaled() ? "|" : "|abso|") + fc.getMin() + "|"
-                   + fc.getMax() + "|";
-             if (fc.isBelowThreshold())
-             {
-               color += "below";
-             }
-             else if (fc.isAboveThreshold())
-             {
-               color += "above";
-             }
-             // add the value
-             color += "|" + fc.getThreshold();
-           }
- //          else
- //          {
- //            color += "none";
- //          }
-         // else
-         // {
-         // // legacy support for integer objects containing colour triplet
-         // values
-         // color = Format.getHexString(new Color(Integer
-         // .parseInt(fc.toString())));
-         // }
-         out.append(featureType);
-         out.append(TAB);
-         out.append(color);
-         out.append(newline);
 -        String featureType = en.next().toString();
 -        FeatureColourI colour = visible.get(featureType);
++        String featureType = en.next();
++        FeatureColourI colour = featureColours.get(featureType);
+         out.append(colour.toJalviewFormat(featureType)).append(newline);
        }
      }
      // Work out which groups are both present and visible
      List<String> groups = new ArrayList<String>();
      int groupIndex = 0;
          features = sequences[i].getSequenceFeatures();
          if (features != null)
          {
-           for (int j = 0; j < features.length; j++)
+           for (SequenceFeature sequenceFeature : features)
            {
-             isnonpos = features[j].begin == 0 && features[j].end == 0;
+             isnonpos = sequenceFeature.begin == 0 && sequenceFeature.end == 0;
              if ((!nonpos && isnonpos)
 -                    || (!isnonpos && visOnly && !visible
 +                    || (!isnonpos && visOnly && !featureColours
-                             .containsKey(features[j].type)))
+                             .containsKey(sequenceFeature.type)))
              {
                // skip if feature is nonpos and we ignore them or if we only
                // output visible and it isn't non-pos and it's not visible
Simple merge
Simple merge
@@@ -1,11 -1,11 +1,11 @@@
  package jalview.io;
  
 +import jalview.api.ColorI;
  import jalview.api.FeatureColourI;
 +import jalview.schemes.Colour;
- import jalview.schemes.FeatureColourAdapter;
+ import jalview.schemes.FeatureColour;
  import jalview.schemes.FeatureSettingsAdapter;
  
 -import java.awt.Color;
 -
  public class PDBFeatureSettings extends FeatureSettingsAdapter
  {
  
   */
  package jalview.renderer.seqfeatures;
  
+ import jalview.api.AlignViewportI;
 +import jalview.api.ColorI;
  import jalview.datamodel.SequenceFeature;
  import jalview.datamodel.SequenceI;
 +import jalview.schemes.Colour;
  import jalview.viewmodel.seqfeatures.FeatureRendererModel;
  
  import java.awt.AlphaComposite;
@@@ -112,10 -111,10 +112,10 @@@ public class FeatureColour implements F
      }
  
      /*
-      * autoScaled == true: colours range over actual score range; autoScaled ==
-      * false ('abso'): colours range over min/max range
 -     * autoScaled == true: colours range over actual score range
++     * autoScaled == true: colours range over actual score range; 
+      * autoScaled == false ('abso'): colours range over min/max range
       */
-     boolean autoScaled = false;
+     boolean autoScaled = true;
      String tok = null, minval, maxval;
      if (mincol != null)
      {
      return graduatedColour;
    }
  
--  /**
--   * Sets the 'graduated colour' flag. If true, also sets 'colour by label' to
--   * false.
--   */
-   @Override
-   public void setGraduatedColour(boolean b)
-   {
-     graduatedColour = b;
-     if (b)
-     {
-       setColourByLabel(false);
-     }
-   }
 -  void setGraduatedColour(boolean b)
 -  {
 -    graduatedColour = b;
 -    if (b)
 -    {
 -      setColourByLabel(false);
 -    }
 -  }
 -
    @Override
 -  public Color getColour()
 +  public ColorI getColour()
    {
      return colour;
    }
        setGraduatedColour(false);
      }
    }
++
++  /**
++   * Sets the 'graduated colour' flag. If true, also sets 'colour by label' to
++   * false.
++   */
++  void setGraduatedColour(boolean b)
++  {
++    graduatedColour = b;
++    if (b)
++    {
++      setColourByLabel(false);
++    }
++  }
++
    @Override
    public boolean isBelowThreshold()
    {
index cc03dd3,0000000..869a8ca
mode 100644,000000..100644
--- /dev/null
@@@ -1,155 -1,0 +1,150 @@@
 +package jalview.schemes;
 +
 +import jalview.api.ColorI;
 +import jalview.api.FeatureColourI;
 +import jalview.datamodel.SequenceFeature;
 +
 +/**
 + * A convenience class with implementations of FeatureColourI methods. Override
 + * methods as required in subclasses.
 + */
 +public class FeatureColourAdapter implements FeatureColourI
 +{
 +  @Override
 +  public boolean isGraduatedColour()
 +  {
 +    return isColourByLabel() || isAboveThreshold() || isBelowThreshold();
 +  }
 +
 +  @Override
 +  public ColorI getColour()
 +  {
 +    return Colour.black;
 +  }
 +
 +  @Override
 +  public ColorI getMinColour()
 +  {
 +    return Colour.white;
 +  }
 +
 +  @Override
 +  public ColorI getMaxColour()
 +  {
 +    return Colour.black;
 +  }
 +
 +  @Override
 +  public boolean isColourByLabel()
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public boolean isBelowThreshold()
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public boolean isAboveThreshold()
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public boolean isThresholdMinMax()
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public float getThreshold()
 +  {
 +    return 0f;
 +  }
 +
 +  @Override
 +  public float getMax()
 +  {
 +    return 0;
 +  }
 +
 +  @Override
 +  public float getMin()
 +  {
 +    return 0;
 +  }
 +
 +  @Override
 +  public boolean hasThreshold()
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public ColorI getColor(SequenceFeature feature)
 +  {
 +    return null;
 +  }
 +
 +  @Override
 +  public boolean isColored(SequenceFeature feature)
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public void updateBounds(float min, float max)
 +  {
 +  }
 +
 +  @Override
 +  public String toJalviewFormat(String featureType)
 +  {
 +    return null;
 +  }
 +
 +  @Override
 +  public void setThreshold(float f)
 +  {
 +  }
 +
 +  @Override
 +  public boolean isAutoScaled()
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public void setAutoScaled(boolean b)
 +  {
 +  }
 +
 +  @Override
 +  public boolean isSimpleColour()
 +  {
 +    return false;
 +  }
 +
 +  @Override
 +  public void setAboveThreshold(boolean b)
 +  {
 +  }
 +
 +  @Override
 +  public void setThresholdMinMax(boolean b)
 +  {
 +  }
 +
 +  @Override
 +  public void setBelowThreshold(boolean b)
 +  {
 +  }
 +
 +  @Override
 +  public void setColourByLabel(boolean b)
 +  {
 +  }
 +
-   @Override
-   public void setGraduatedColour(boolean b)
-   {
-   }
 +}
@@@ -27,11 -27,8 +27,10 @@@ import jalview.datamodel.AlignmentI
  import jalview.datamodel.SequenceFeature;
  import jalview.datamodel.SequenceI;
  import jalview.renderer.seqfeatures.FeatureRenderer;
 +import jalview.schemes.Colour;
  import jalview.schemes.FeatureColour;
  import jalview.schemes.UserColourScheme;
 +import jalview.util.ColorUtils;
- import jalview.viewmodel.AlignmentViewport;
  
  import java.awt.Color;
  import java.beans.PropertyChangeListener;
@@@ -66,14 -63,8 +65,14 @@@ public abstract class FeatureRendererMo
    protected PropertyChangeSupport changeSupport = new PropertyChangeSupport(
            this);
  
-   protected AlignmentViewport av;
+   protected AlignViewportI av;
  
 +  /*
 +   * map holds per feature type, {{min, max}, {min, max}} feature score
 +   * values for positional and non-positional features respectively
 +   */
 +  private Map<String, float[][]> minmax = new Hashtable<String, float[][]>();
 +
    @Override
    public AlignViewportI getViewport()
    {
@@@ -31,10 -30,9 +31,10 @@@ import jalview.datamodel.AlignmentAnnot
  import jalview.datamodel.Sequence;
  import jalview.datamodel.SequenceFeature;
  import jalview.datamodel.SequenceI;
 +import jalview.schemes.Colour;
  import jalview.schemes.ColourSchemeI;
  import jalview.schemes.TaylorColourScheme;
- import jalview.structure.StructureViewSettings;
+ import jalview.structure.StructureImportSettings;
  
  import java.awt.Color;
  import java.util.Vector;
@@@ -11,9 -11,9 +11,9 @@@ import jalview.datamodel.SequenceFeatur
  import jalview.datamodel.SequenceI;
  import jalview.io.gff.SequenceOntologyFactory;
  import jalview.io.gff.SequenceOntologyLite;
++import jalview.schemes.Colour;
  import jalview.util.MapList;
  
--import java.awt.Color;
  import java.util.List;
  
  import org.testng.annotations.AfterClass;
@@@ -250,9 -250,9 +250,9 @@@ public class EnsemblGeneTes
      assertTrue(fc.isFeatureDisplayed("sequence_variant"));
      assertTrue(fc.isFeatureDisplayed("feature_variant")); // subtype
      assertFalse(fc.isFeatureDisplayed("transcript"));
--    assertEquals(Color.RED, fc.getFeatureColour("sequence_variant")
++    assertEquals(Colour.red, fc.getFeatureColour("sequence_variant")
              .getColour());
--    assertEquals(Color.RED, fc.getFeatureColour("feature_variant")
++    assertEquals(Colour.red, fc.getFeatureColour("feature_variant")
              .getColour());
      assertTrue(fc.getFeatureColour("exon").isColourByLabel());
      assertTrue(fc.getFeatureColour("coding_exon").isColourByLabel());
Simple merge