2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 import java.awt.event.*;
23 import java.awt.image.*;
26 import jalview.datamodel.*;
34 public class AnnotationPanel
35 extends JPanel implements MouseListener,
36 MouseMotionListener, ActionListener, AdjustmentListener
38 final String HELIX = "Helix";
39 final String SHEET = "Sheet";
40 final String LABEL = "Label";
41 final String REMOVE = "Remove Annotation";
42 final String COLOUR = "Colour";
43 final Color HELIX_COLOUR = Color.red.darker();
44 final Color SHEET_COLOUR = Color.green.darker().darker();
51 BufferedImage fadedImage;
55 boolean fastPaint = false;
57 //Used For mouse Dragging and resizing graphs
58 int graphStretch = -1;
59 int graphStretchY = -1;
60 int min; //used by mouseDragged to see if user
61 int max; //used by mouseDragged to see if user
62 boolean mouseDragging = false;
67 * Creates a new AnnotationPanel object.
69 * @param ap DOCUMENT ME!
71 public AnnotationPanel(AlignmentPanel ap)
74 if (System.getProperty("os.name").startsWith("Mac"))
79 ToolTipManager.sharedInstance().registerComponent(this);
80 ToolTipManager.sharedInstance().setInitialDelay(0);
81 ToolTipManager.sharedInstance().setDismissDelay(10000);
85 addMouseListener(this);
86 addMouseMotionListener(this);
87 ap.annotationScroller.getVerticalScrollBar().addAdjustmentListener(this);
90 public AnnotationPanel(AlignViewport av)
98 * @param evt DOCUMENT ME!
100 public void adjustmentValueChanged(AdjustmentEvent evt)
102 ap.alabels.setScrollOffset( -evt.getValue());
108 public int adjustPanelHeight()
110 // setHeight of panels
111 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
116 for (int i = 0; i < aa.length; i++)
127 aa[i].height += av.charHeight;
137 aa[i].height += aa[i].graphHeight;
140 if (aa[i].height == 0)
145 height += aa[i].height;
153 this.setPreferredSize(new Dimension(1, height));
161 * @param evt DOCUMENT ME!
163 public void actionPerformed(ActionEvent evt)
165 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
166 Annotation[] anot = aa[activeRow].annotations;
168 if (anot.length < av.getColumnSelection().getMax())
170 Annotation[] temp = new Annotation[av.getColumnSelection().getMax() + 2];
171 System.arraycopy(anot, 0, temp, 0, anot.length);
173 aa[activeRow].annotations = anot;
176 if (evt.getActionCommand().equals(REMOVE))
178 for (int i = 0; i < av.getColumnSelection().size(); i++)
180 anot[av.getColumnSelection().columnAt(i)] = null;
183 else if (evt.getActionCommand().equals(LABEL))
185 String label = JOptionPane.showInputDialog(this, "Enter Label ",
187 JOptionPane.QUESTION_MESSAGE);
194 if ( (label.length() > 0) && !aa[activeRow].hasText)
196 aa[activeRow].hasText = true;
199 for (int i = 0; i < av.getColumnSelection().size(); i++)
201 int index = av.getColumnSelection().columnAt(i);
203 if(!av.colSel.isVisible(index))
206 if (anot[index] == null)
208 anot[index] = new Annotation(label, "", ' ', 0);
211 anot[index].displayCharacter = label;
214 else if (evt.getActionCommand().equals(COLOUR))
216 Color col = JColorChooser.showDialog(this,
217 "Choose foreground colour",
220 for (int i = 0; i < av.getColumnSelection().size(); i++)
222 int index = av.getColumnSelection().columnAt(i);
224 if(!av.colSel.isVisible(index))
227 if (anot[index] == null)
229 anot[index] = new Annotation("", "", ' ', 0);
232 anot[index].colour = col;
235 else // HELIX OR SHEET
238 String symbol = "\u03B1";
240 if (evt.getActionCommand().equals(HELIX))
244 else if (evt.getActionCommand().equals(SHEET))
250 if (!aa[activeRow].hasIcons)
252 aa[activeRow].hasIcons = true;
255 String label = JOptionPane.showInputDialog(
256 "Enter a label for the structure?",
264 if ( (label.length() > 0) && !aa[activeRow].hasText)
266 aa[activeRow].hasText = true;
269 for (int i = 0; i < av.getColumnSelection().size(); i++)
271 int index = av.getColumnSelection().columnAt(i);
273 if(!av.colSel.isVisible(index))
276 if (anot[index] == null)
278 anot[index] = new Annotation(label, "", type, 0);
281 anot[index].secondaryStructure = type;
282 anot[index].displayCharacter = label;
295 * @param evt DOCUMENT ME!
297 public void mousePressed(MouseEvent evt)
300 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
309 for (int i = 0; i < aa.length; i++)
313 height += aa[i].height;
316 if (evt.getY() < height)
322 else if (aa[i].graph > 0)
326 graphStretchY = evt.getY();
333 if (SwingUtilities.isRightMouseButton(evt) && activeRow != -1)
335 if (av.getColumnSelection() == null)
340 JPopupMenu pop = new JPopupMenu("Structure type");
341 JMenuItem item = new JMenuItem(HELIX);
342 item.addActionListener(this);
344 item = new JMenuItem(SHEET);
345 item.addActionListener(this);
347 item = new JMenuItem(LABEL);
348 item.addActionListener(this);
350 item = new JMenuItem(COLOUR);
351 item.addActionListener(this);
353 item = new JMenuItem(REMOVE);
354 item.addActionListener(this);
356 pop.show(this, evt.getX(), evt.getY());
366 ap.scalePanel.mousePressed(evt);
373 * @param evt DOCUMENT ME!
375 public void mouseReleased(MouseEvent evt)
379 mouseDragging = false;
380 ap.scalePanel.mouseReleased(evt);
386 * @param evt DOCUMENT ME!
388 public void mouseEntered(MouseEvent evt)
390 ap.scalePanel.mouseEntered(evt);
396 * @param evt DOCUMENT ME!
398 public void mouseExited(MouseEvent evt)
400 ap.scalePanel.mouseExited(evt);
406 * @param evt DOCUMENT ME!
408 public void mouseDragged(MouseEvent evt)
410 if (graphStretch > -1)
412 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight +=
413 graphStretchY - evt.getY();
414 if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
416 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
418 graphStretchY = evt.getY();
420 ap.paintAlignment(true);
424 ap.scalePanel.mouseDragged(evt);
431 * @param evt DOCUMENT ME!
433 public void mouseMoved(MouseEvent evt)
435 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
439 this.setToolTipText(null);
446 for (int i = 0; i < aa.length; i++)
450 height += aa[i].height;
453 if (evt.getY() < height)
463 this.setToolTipText(null);
467 int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
469 if (av.hasHiddenColumns)
471 res = av.getColumnSelection().adjustForHiddenColumns(res);
474 if (aa[row].annotations != null
476 && res < (int) aa[row].annotations.length)
478 if (aa[row].graphGroup > -1)
480 StringBuffer tip = new StringBuffer("<html>");
481 for (int gg = 0; gg < aa.length; gg++)
483 if (aa[gg].graphGroup == aa[row].graphGroup && aa[gg].annotations[res] != null)
485 tip.append(aa[gg].label + " " + aa[gg].annotations[res].description +
489 if (tip.length() != 6)
491 tip.setLength(tip.length() - 4);
492 this.setToolTipText(tip.toString() + "</html>");
495 else if (aa[row].annotations[res] != null
496 && aa[row].annotations[res].description != null)
498 this.setToolTipText(aa[row].annotations[res].description);
501 if (aa[row].annotations[res] != null)
503 StringBuffer text = new StringBuffer("Sequence position " +
506 if (aa[row].annotations[res].description != null)
508 text.append(" " + aa[row].annotations[res].description);
511 ap.alignFrame.statusBar.setText(text.toString());
516 this.setToolTipText(null);
523 * @param evt DOCUMENT ME!
525 public void mouseClicked(MouseEvent evt)
532 * @param g DOCUMENT ME!
534 public void paintComponent(Graphics g)
536 g.setColor(Color.white);
537 g.fillRect(0, 0, getWidth(), getHeight());
542 || (getVisibleRect().width != g.getClipBounds().width)
543 || (getVisibleRect().height != g.getClipBounds().height))
545 g.drawImage(image, 0, 0, this);
550 imgWidth = (av.endRes - av.startRes + 1) * av.charWidth;
553 if (image == null || imgWidth != image.getWidth()
554 || image.getHeight(this) != getHeight())
556 image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(),
557 BufferedImage.TYPE_INT_RGB);
558 gg = (Graphics2D) image.getGraphics();
562 gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
563 RenderingHints.VALUE_ANTIALIAS_ON);
566 gg.setFont(av.getFont());
567 fm = gg.getFontMetrics();
568 gg.setColor(Color.white);
569 gg.fillRect(0, 0, imgWidth, image.getHeight());
572 drawComponent(gg, av.startRes, av.endRes + 1);
573 g.drawImage(image, 0, 0, this);
579 * @param horizontal DOCUMENT ME!
581 public void fastPaint(int horizontal)
583 if ( (horizontal == 0)
585 || av.alignment.getAlignmentAnnotation() == null
586 || av.alignment.getAlignmentAnnotation().length < 1
587 || av.updatingConsensus
588 || av.updatingConservation)
594 gg.copyArea(0, 0, imgWidth, getHeight(), -horizontal * av.charWidth, 0);
596 int sr = av.startRes;
597 int er = av.endRes + 1;
600 if (horizontal > 0) // scrollbar pulled right, image to the left
602 transX = (er - sr - horizontal) * av.charWidth;
603 sr = er - horizontal;
605 else if (horizontal < 0)
607 er = sr - horizontal;
610 gg.translate(transX, 0);
612 drawComponent(gg, sr, er);
614 gg.translate( -transX, 0);
625 * @param g DOCUMENT ME!
626 * @param startRes DOCUMENT ME!
627 * @param endRes DOCUMENT ME!
629 public void drawComponent(Graphics g, int startRes, int endRes)
631 if (av.updatingConsensus || av.updatingConservation)
637 //We'll keep a record of the old image,
638 //and draw a faded image until the calculation
640 if (fadedImage == null
641 || fadedImage.getWidth() != imgWidth
642 || fadedImage.getHeight() != image.getHeight())
644 fadedImage = new BufferedImage(
645 imgWidth, image.getHeight(),
646 BufferedImage.TYPE_INT_RGB);
648 Graphics2D fadedG = (Graphics2D) fadedImage.getGraphics();
650 fadedG.setColor(Color.white);
651 fadedG.fillRect(0, 0, imgWidth, image.getHeight());
654 AlphaComposite.getInstance(
655 AlphaComposite.SRC_OVER, .3f));
656 fadedG.drawImage(image, 0, 0, this);
666 g.setColor(Color.white);
667 g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getHeight());
669 g.setFont(av.getFont());
672 fm = g.getFontMetrics();
675 if ( (av.alignment.getAlignmentAnnotation() == null) ||
676 (av.alignment.getAlignmentAnnotation().length < 1))
678 g.setColor(Color.white);
679 g.fillRect(0, 0, getWidth(), getHeight());
680 g.setColor(Color.black);
681 if (av.validCharWidth)
683 g.drawString("Alignment has no annotations", 20, 15);
689 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
696 boolean validRes = false;
698 boolean[] graphGroupDrawn = new boolean[aa.length];
701 for (int i = 0; i < aa.length; i++)
703 AlignmentAnnotation row = aa[i];
715 if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
720 // this is so that we draw the characters below the graph
725 iconOffset =av.charHeight -fm.getDescent();
729 else if (row.hasText)
731 iconOffset = av.charHeight -fm.getDescent();
740 if (av.updatingConsensus && aa[i] == av.consensus)
744 g.drawImage(fadedImage,
745 0, y - row.height, imgWidth, y,
746 0, y - row.height, imgWidth, y, this);
747 g.setColor(Color.black);
748 // g.drawString("Calculating Consensus....",20, y-row.height/2);
752 else if (av.updatingConservation && aa[i].label.equals("Conservation"))
756 g.drawImage(fadedImage,
757 0, y - row.height, imgWidth, y,
758 0, y - row.height, imgWidth, y, this);
760 g.setColor(Color.black);
761 // g.drawString("Calculating Conservation.....",20, y-row.height/2);
765 else if (av.updatingConservation && aa[i].label.equals("Quality"))
769 g.drawImage(fadedImage,
770 0, y - row.height, imgWidth, y,
771 0, y - row.height, imgWidth, y, this);
772 g.setColor(Color.black);
773 /// g.drawString("Calculating Quality....",20, y-row.height/2);
781 while (x < endRes - startRes)
783 if (av.hasHiddenColumns)
785 column = av.getColumnSelection().adjustForHiddenColumns(startRes + x);
786 if (column > row.annotations.length - 1)
793 column = startRes + x;
796 if ( (row.annotations==null)
797 || (row.annotations.length <= column)
798 || (row.annotations[column] == null))
809 g.setColor(Color.red);
811 if (av.getColumnSelection() != null)
813 for (int n = 0; n < av.getColumnSelection().size(); n++)
815 int v = av.getColumnSelection().columnAt(n);
819 g.fillRect(x * av.charWidth, y,
820 av.charWidth, av.charHeight);
826 if (av.validCharWidth && validRes
827 && row.annotations[column].displayCharacter != null
828 && (row.annotations[column].displayCharacter.length() > 0))
831 int charOffset = (av.charWidth -
832 fm.charWidth(row.annotations[column].
833 displayCharacter.charAt(
836 if (row.annotations[column].colour == null)
837 g.setColor(Color.black);
839 g.setColor(row.annotations[column].colour);
841 if (column == 0 || row.graph > 0)
843 g.drawString(row.annotations[column].displayCharacter,
844 (x * av.charWidth) + charOffset,
848 row.annotations[column - 1] == null
849 || (!row.annotations[column].displayCharacter.equals(
850 row.annotations[column - 1].displayCharacter)
852 (row.annotations[column].displayCharacter.length() < 2 &&
853 row.annotations[column].secondaryStructure == ' ')))
855 g.drawString(row.annotations[column].displayCharacter,
856 x * av.charWidth + charOffset,
864 (row.annotations[column].secondaryStructure != lastSS))
869 g.setColor(HELIX_COLOUR);
872 //Off by 1 offset when drawing rects and ovals
873 //to offscreen image on the MAC
874 g.fillRoundRect(lastSSX, y + 4 + iconOffset,
875 (x * av.charWidth) - lastSSX, 7, 8, 8);
879 int sCol = (lastSSX / av.charWidth) + startRes;
881 int x2 = (x * av.charWidth);
884 row.annotations[sCol - 1] == null ||
885 row.annotations[sCol - 1].secondaryStructure != 'H')
887 g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
889 x1 += av.charWidth / 2;
892 if (row.annotations[column] == null ||
893 row.annotations[column].secondaryStructure != 'H')
895 g.fillArc( (x * av.charWidth) - av.charWidth,
896 y + 4 + iconOffset, av.charWidth, 8, 270, 180);
897 x2 -= av.charWidth / 2;
900 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
904 g.setColor(SHEET_COLOUR);
905 g.fillRect(lastSSX, y + 4 + iconOffset,
906 (x * av.charWidth) - lastSSX - 4, 7);
907 g.fillPolygon(new int[]
908 { (x * av.charWidth) - 4,
909 (x * av.charWidth) - 4,
913 y + iconOffset, y + 14 + iconOffset,
920 g.setColor(Color.gray);
921 g.fillRect(lastSSX, y + 6 + iconOffset,
922 (x * av.charWidth) - lastSSX, 2);
929 lastSS = row.annotations[column].secondaryStructure;
936 lastSSX = (x * av.charWidth);
944 if (column >= row.annotations.length)
946 column = row.annotations.length - 1;
956 g.setColor(HELIX_COLOUR);
959 //Off by 1 offset when drawing rects and ovals
960 //to offscreen image on the MAC
961 g.fillRoundRect(lastSSX, y + 4 + iconOffset,
962 (x * av.charWidth) - lastSSX, 7, 8, 8);
966 int sCol = (lastSSX / av.charWidth) + startRes;
968 int x2 = (x * av.charWidth);
971 row.annotations[sCol - 1] == null ||
972 row.annotations[sCol - 1].secondaryStructure != 'H')
974 g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
975 x1 += av.charWidth / 2;
978 if (row.annotations[column] == null ||
979 row.annotations[column].secondaryStructure != 'H')
981 g.fillArc( (x * av.charWidth) - av.charWidth,
982 y + 4 + iconOffset, av.charWidth, 8, 270,
984 x2 -= av.charWidth / 2;
987 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
992 g.setColor(SHEET_COLOUR);
994 if (row.annotations[endRes] == null
995 || row.annotations[endRes].secondaryStructure != 'E')
997 g.fillRect(lastSSX, y + 4 + iconOffset,
998 (x * av.charWidth) - lastSSX - 4, 7);
999 g.fillPolygon(new int[]
1000 { (x * av.charWidth) - 4,
1001 (x * av.charWidth) - 4,
1002 (x * av.charWidth)},
1005 y + iconOffset, y + 14 + iconOffset,
1011 g.fillRect(lastSSX, y + 4 + iconOffset,
1012 (x + 1) * av.charWidth - lastSSX, 7);
1017 g.setColor(Color.gray);
1018 g.fillRect(lastSSX, y + 6 + iconOffset,
1019 (x * av.charWidth) - lastSSX, 2);
1025 if (row.graph > 0 && row.graphHeight > 0)
1027 if (row.graph == AlignmentAnnotation.LINE_GRAPH)
1029 if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
1031 float groupmax = -999999, groupmin = 9999999;
1032 for (int gg = 0; gg < aa.length; gg++)
1034 if (aa[gg].graphGroup != row.graphGroup)
1041 aa[gg].visible = false;
1044 if (aa[gg].graphMax > groupmax)
1046 groupmax = aa[gg].graphMax;
1048 if (aa[gg].graphMin < groupmin)
1050 groupmin = aa[gg].graphMin;
1054 for (int gg = 0; gg < aa.length; gg++)
1056 if (aa[gg].graphGroup == row.graphGroup)
1058 drawLineGraph(g, aa[gg], startRes, endRes, y,
1064 graphGroupDrawn[row.graphGroup] = true;
1068 drawLineGraph(g, row, startRes, endRes,
1069 y, row.graphMin, row.graphMax, row.graphHeight);
1072 else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
1074 drawBarGraph(g, row, startRes, endRes,
1075 row.graphMin, row.graphMax, y);
1079 if (row.graph > 0 && row.hasText)
1091 public void drawLineGraph(Graphics g, AlignmentAnnotation aa,
1094 float min, float max,
1097 if (sRes > aa.annotations.length)
1104 //Adjustment for fastpaint to left
1105 if (eRes < av.endRes)
1110 eRes = Math.min(eRes, aa.annotations.length);
1118 float range = max - min;
1123 y2 = y - (int) ( (0 - min / range) * graphHeight);
1126 g.setColor(Color.gray);
1127 g.drawLine(x - av.charWidth, y2, (eRes - sRes + 1) * av.charWidth, y2);
1129 eRes = Math.min(eRes, aa.annotations.length);
1132 int aaMax = aa.annotations.length - 1;
1134 while (x < eRes - sRes)
1137 if (av.hasHiddenColumns)
1139 column = av.getColumnSelection().adjustForHiddenColumns(column);
1147 if (aa.annotations[column] == null || aa.annotations[column - 1] == null)
1153 if (aa.annotations[column].colour == null)
1154 g.setColor(Color.black);
1156 g.setColor(aa.annotations[column].colour);
1159 (int) ( ( (aa.annotations[column - 1].value - min) / range) * graphHeight);
1161 (int) ( ( (aa.annotations[column].value - min) / range) * graphHeight);
1163 g.drawLine(x * av.charWidth - av.charWidth / 2, y1,
1164 x * av.charWidth + av.charWidth / 2, y2);
1168 if (aa.threshold != null)
1170 g.setColor(aa.threshold.colour);
1171 Graphics2D g2 = (Graphics2D) g;
1172 g2.setStroke(new BasicStroke(1,
1173 BasicStroke.CAP_SQUARE,
1174 BasicStroke.JOIN_ROUND, 3f,
1178 y2 = (int) (y - ( (aa.threshold.value - min) / range) * graphHeight);
1179 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1180 g2.setStroke(new BasicStroke());
1184 public void drawBarGraph(Graphics g, AlignmentAnnotation aa,
1186 float min, float max,
1189 if (sRes > aa.annotations.length)
1194 eRes = Math.min(eRes, aa.annotations.length);
1196 int x = 0, y1 = y, y2 = y;
1198 float range = max - min;
1202 y2 = y - (int) ( (0 - min / (range)) * aa.graphHeight);
1205 g.setColor(Color.gray);
1207 g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
1210 int aaMax = aa.annotations.length - 1;
1212 while (x < eRes - sRes)
1215 if (av.hasHiddenColumns)
1217 column = av.getColumnSelection().adjustForHiddenColumns(column);
1225 if (aa.annotations[column] == null)
1231 if (aa.annotations[column].colour == null)
1232 g.setColor(Color.black);
1234 g.setColor(aa.annotations[column].colour);
1237 (int) ( ( (aa.annotations[column].value - min) / (range)) * aa.graphHeight);
1241 g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
1245 g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
1251 if (aa.threshold != null)
1253 g.setColor(aa.threshold.colour);
1254 Graphics2D g2 = (Graphics2D) g;
1255 g2.setStroke(new BasicStroke(1,
1256 BasicStroke.CAP_SQUARE,
1257 BasicStroke.JOIN_ROUND, 3f,
1261 y2 = (int) (y - ( (aa.threshold.value - min) / range) * aa.graphHeight);
1262 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1263 g2.setStroke(new BasicStroke());
1267 // used by overview window
1268 public void drawGraph(Graphics g, AlignmentAnnotation aa, int width, int y,
1271 eRes = Math.min(eRes, aa.annotations.length);
1272 g.setColor(Color.white);
1273 g.fillRect(0, 0, width, y);
1274 g.setColor(new Color(0, 0, 180));
1278 for (int j = sRes; j < eRes; j++)
1280 if (aa.annotations[j] != null)
1282 if (aa.annotations[j].colour == null)
1283 g.setColor(Color.black);
1285 g.setColor(aa.annotations[j].colour);
1287 height = (int) ( (aa.annotations[j].value / aa.graphMax) * y);
1293 g.fillRect(x, y - height, av.charWidth, height);