JAL-666 JAL-1667 regularise use of API calls between applet and application overviews
authorJim Procter <jprocter@issues.jalview.org>
Tue, 27 Oct 2015 12:16:23 +0000 (12:16 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 27 Oct 2015 12:16:23 +0000 (12:16 +0000)
src/jalview/appletgui/OverviewPanel.java
src/jalview/gui/OverviewPanel.java

index 82d9a01..9ec6385 100755 (executable)
@@ -21,6 +21,7 @@
 package jalview.appletgui;
 
 import jalview.datamodel.AlignmentI;
+import jalview.renderer.AnnotationRenderer;
 
 import java.awt.Color;
 import java.awt.Dimension;
@@ -45,6 +46,8 @@ public class OverviewPanel extends Panel implements Runnable,
 
   AlignmentPanel ap;
 
+  final AnnotationRenderer renderer = new AnnotationRenderer();
+
   float scalew = 1f;
 
   float scaleh = 1f;
@@ -269,7 +272,7 @@ public class OverviewPanel extends Panel implements Runnable,
 
     if (av.isShowSequenceFeatures())
     {
-      fr.transferSettings(ap.seqPanel.seqCanvas.getFeatureRenderer());
+      fr.transferSettings(ap.getFeatureRenderer());
     }
 
     if (getSize().width > 0 && getSize().height > 0)
@@ -383,13 +386,13 @@ public class OverviewPanel extends Panel implements Runnable,
 
     if (av.getAlignmentConservationAnnotation() != null)
     {
+      renderer.updateFromAlignViewport(av);
       for (col = 0; col < width; col++)
       {
         lastcol = (int) (col * sampleCol);
         {
           mg.translate(col, sequencesHeight);
-          ap.annotationPanel.renderer.drawGraph(mg,
-                  av.getAlignmentConservationAnnotation(),
+          renderer.drawGraph(mg, av.getAlignmentConservationAnnotation(),
                   av.getAlignmentConservationAnnotation().annotations,
                   (int) (sampleCol) + 1, graphHeight,
                   (int) (col * sampleCol), (int) (col * sampleCol) + 1);
index abd2170..fa0c812 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.gui;
 
+import jalview.api.FeatureRenderer;
 import jalview.renderer.AnnotationRenderer;
 
 import java.awt.Color;
@@ -74,7 +75,7 @@ public class OverviewPanel extends JPanel implements Runnable
   // main visible SeqCanvas
   SequenceRenderer sr;
 
-  jalview.renderer.seqfeatures.FeatureRenderer fr;
+  FeatureRenderer fr;
 
   /**
    * Creates a new OverviewPanel object.
@@ -253,22 +254,19 @@ public class OverviewPanel extends JPanel implements Runnable
   // the overview is being calculated
   boolean resizeAgain = false;
 
-  /**
-   * DOCUMENT ME!
-   */
   @Override
   public void run()
   {
     miniMe = null;
+    int alwidth = av.getAlignment().getWidth();
+    int alheight = av.getAlignment().getHeight()
+            + av.getAlignment().getHiddenSequences().getSize();
 
     if (av.isShowSequenceFeatures())
     {
-      fr.transferSettings(ap.getSeqPanel().seqCanvas.getFeatureRenderer());
+      fr.transferSettings(ap.getFeatureRenderer());
     }
 
-    int alwidth = av.getAlignment().getWidth();
-    int alheight = av.getAlignment().getHeight()
-            + av.getAlignment().getHiddenSequences().getSize();
 
     setPreferredSize(new Dimension(width, sequencesHeight + graphHeight));
 
@@ -355,7 +353,8 @@ public class OverviewPanel extends JPanel implements Runnable
 
           if (av.isShowSequenceFeatures())
           {
-            color = fr.findFeatureColour(color, seq, lastcol);
+            color = fr.findFeatureColour(new Color(color), seq, lastcol)
+                    .getRGB();
           }
         }
         else