(JAL-961) refactored consensus and rna structure consensus workers from alignViewport(s)
[jalview.git] / src / jalview / gui / OverviewPanel.java
index d7220df..7e00f2e 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.renderer.AnnotationRenderer;
+
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.image.*;
@@ -36,6 +38,7 @@ public class OverviewPanel extends JPanel implements Runnable
 
   AlignmentPanel ap;
 
+  final AnnotationRenderer renderer = new AnnotationRenderer();
   float scalew = 1f;
 
   float scaleh = 1f;
@@ -356,12 +359,13 @@ public class OverviewPanel extends JPanel implements Runnable
 
     if (av.conservation != null)
     {
+      renderer.updateFromAlignViewport(av); 
       for (col = 0; col < width; col++)
       {
         lastcol = (int) (col * sampleCol);
         {
           mg.translate(col, sequencesHeight);
-          ap.annotationPanel.drawGraph(mg, av.conservation,
+          renderer.drawGraph(mg, av.conservation,
                   (int) (sampleCol) + 1, graphHeight,
                   (int) (col * sampleCol), (int) (col * sampleCol) + 1);
           mg.translate(-col, -sequencesHeight);
@@ -388,8 +392,7 @@ public class OverviewPanel extends JPanel implements Runnable
   {
     int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth();
     int fullsizeHeight = (av.alignment.getHeight() + av.alignment
-            .getHiddenSequences().getSize())
-            * av.getCharHeight();
+            .getHiddenSequences().getSize()) * av.getCharHeight();
 
     int startRes = av.getStartRes();
     int endRes = av.getEndRes();