X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=48f9c20af2fe494099c75f061a96727bffcdb518;hb=eae0a6cd988e80f75caeee3ba92822fbee6e227d;hp=28744946978ca71223ed91857f35dfe65a220274;hpb=c59fb56cb143b05c5643a71f5b39996ac1cd2fef;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 2874494..48f9c20 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -23,7 +23,15 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio static Color HELIX_COLOUR = Color.red.darker(); static Color SHEET_COLOUR = Color.green.darker().darker(); - BufferedImage bi; + + BufferedImage image; + Graphics2D gg; + FontMetrics fm; + int imgWidth=0; + + boolean fastPaint = false; + + public static int GRAPH_HEIGHT = 40; @@ -64,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; @@ -303,7 +311,7 @@ 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) // scrollbar pulled right, image to the left + { + transX = (er-sr-horizontal)*av.charWidth; + sr = er - horizontal ; + } + else if(horizontal<0) + { + er = sr-horizontal; + } + + + gg.translate(transX, 0); + + drawComponent(gg, sr, er); + + gg.translate( -transX, 0 ); + + fastPaint = true; + repaint(); +} + + + public void drawComponent(Graphics2D g, int startRes, int endRes) + { + g.setColor(Color.white); + g.fillRect(0,0,(endRes-startRes) *av.charWidth, getHeight()); if(av.alignment.getAlignmentAnnotation()==null || av.alignment.getAlignmentAnnotation().length<1) { g.setColor(Color.black); @@ -366,11 +418,11 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio else iconOffset = 0; - for(j=av.startRes; j1) { @@ -461,7 +513,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio } total/=row.windowLength; - height = (int)( (total / row.graphMax) *50); + height = (int)( (total / row.graphMax) *GRAPH_HEIGHT); } @@ -515,7 +567,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio for(int j=0; j