new Implementation for getting colour quickly
authoramwaterhouse <Andrew Waterhouse>
Mon, 28 Nov 2005 17:15:29 +0000 (17:15 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 28 Nov 2005 17:15:29 +0000 (17:15 +0000)
src/jalview/gui/FeatureRenderer.java
src/jalview/gui/OverviewPanel.java
src/jalview/gui/RotatableCanvas.java
src/jalview/gui/SequenceRenderer.java

index fa06d94..03080bd 100755 (executable)
@@ -73,6 +73,7 @@ public class FeatureRenderer
       bi.setRGB(0,0, initialCol.getRGB());\r
 \r
       drawText = false;\r
+\r
       drawSequence(bi.getGraphics(), seq, i, i, 0, 0, 1, 1);\r
       drawText = true;\r
 \r
index 5391e78..3662ec2 100755 (executable)
@@ -281,7 +281,7 @@ public class OverviewPanel extends JPanel implements Runnable
             lastrow = (int)(row*sampleRow);\r
             lastcol = (int)(col*sampleCol);\r
 \r
-            color = sr.findSequenceColour(Color.white,\r
+            color = sr.getResidueBoxColour(\r
                 av.alignment.getSequenceAt(lastrow), lastcol);\r
 \r
             if(av.showSequenceFeatures)\r
index 632b284..fc72b4b 100755 (executable)
@@ -486,8 +486,6 @@ public class RotatableCanvas extends JPanel implements MouseListener,
      */\r
     public void keyPressed(KeyEvent evt)\r
     {\r
-        requestFocus();\r
-\r
         if (evt.getKeyCode() == KeyEvent.VK_UP)\r
         {\r
             scalefactor = (float) (scalefactor * 1.1);\r
index 460c6d1..0cc7952 100755 (executable)
@@ -62,40 +62,24 @@ public class SequenceRenderer
         renderGaps = b;\r
     }\r
 \r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param cs DOCUMENT ME!\r
-     * @param seq DOCUMENT ME!\r
-     * @param i DOCUMENT ME!\r
-     *\r
-     * @return DOCUMENT ME!\r
-     */\r
-    public Color getResidueBoxColour(ColourSchemeI cs, SequenceI seq, int i)\r
-    {\r
-        getBoxColour(cs, seq, i);\r
-\r
-        return resBoxColour;\r
-    }\r
 \r
-    BufferedImage bi;\r
-    public Color findSequenceColour(Color initialCol, SequenceI seq, int i)\r
+    public Color getResidueBoxColour(SequenceI seq, int i)\r
     {\r
-      if (bi == null)\r
-        bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);\r
-\r
-      graphics = bi.getGraphics();\r
-\r
-      if(initialCol!=null)\r
-        bi.setRGB(0,0, initialCol.getRGB());\r
-\r
       allGroups = av.alignment.findAllGroups(seq);\r
 \r
-      i = seq.findIndex(i);\r
-\r
-      drawBoxes(seq, i,i, 0, 0, 1,1);\r
+      if (inCurrentSequenceGroup(i))\r
+      {\r
+        if (currentSequenceGroup.getDisplayBoxes())\r
+        {\r
+          getBoxColour(currentSequenceGroup.cs, seq, i);\r
+        }\r
+      }\r
+      else if (av.getShowBoxes())\r
+      {\r
+          getBoxColour(av.globalColourScheme, seq, i);\r
+      }\r
 \r
-      return new Color(bi.getRGB(0, 0));\r
+      return resBoxColour;\r
     }\r
 \r
 \r
@@ -181,7 +165,7 @@ public class SequenceRenderer
           }\r
           else if (av.getShowBoxes())\r
           {\r
-            getBoxColour(av.getGlobalColourScheme(), seq, i);\r
+            getBoxColour(av.globalColourScheme, seq, i);\r
           }\r
 \r
         }\r
@@ -271,7 +255,7 @@ public class SequenceRenderer
 \r
                 if (av.getColourText())\r
                 {\r
-                    getBoxColour(av.getGlobalColourScheme(), seq, i);\r
+                    getBoxColour(av.globalColourScheme, seq, i);\r
 \r
                     if (av.getShowBoxes())\r
                     {\r