X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=77f557bff87a4a488d7e50e8b6171a2a7db2c4ee;hb=b8ad1d6974a31bce823c3d7ac2f49d07f0a0c061;hp=c94a5a849acc6c587102b3ca30ff75f0f962c817;hpb=4532dfefeac026198bfea1b9dbe84186e870bfc8;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index c94a5a8..77f557b 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -29,6 +29,9 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio FontMetrics fm; int imgWidth=0; + boolean fastPaint = false; + + public static int GRAPH_HEIGHT = 40; @@ -69,7 +72,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio aa[i].height += 16; if (aa[i].isGraph) - aa[i].height += 50; + aa[i].height += GRAPH_HEIGHT; if(aa[i].height==0) aa[i].height = 20; @@ -308,8 +311,15 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio } int res = evt.getX() / av.getCharWidth() + av.getStartRes(); - if(row>-1 && aa[row].annotations[res]!=null) + if(row>-1 && res0) { - int charOffset = (av.charWidth - - fm.charWidth(row.annotations[j].displayCharacter. - charAt(0))) / 2; + int charOffset = (av.charWidth - fm.charWidth(row.annotations[j].displayCharacter.charAt(0)))/2; g.setColor( row.annotations[j].colour); if(j==0) { @@ -488,7 +509,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio if (validRes && row.isGraph) { g.setColor(new Color(0,0,180)); - int height = (int)((row.annotations[j].value / row.graphMax)*50); + int height = (int)((row.annotations[j].value / row.graphMax)*GRAPH_HEIGHT); if(row.windowLength>1) { @@ -502,10 +523,10 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio } total/=row.windowLength; - height = (int)( (total / row.graphMax) *50); + height = (int)( (total / row.graphMax) *GRAPH_HEIGHT); } - + g.setColor(row.annotations[j].colour); g.fillRect(x, y-height, av.charWidth, height ); } @@ -556,7 +577,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio for(int j=0; j