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;
552 if (image == null || imgWidth != image.getWidth()
553 || image.getHeight(this) != getHeight())
555 image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(),
556 BufferedImage.TYPE_INT_RGB);
557 gg = (Graphics2D) image.getGraphics();
561 gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
562 RenderingHints.VALUE_ANTIALIAS_ON);
565 gg.setFont(av.getFont());
566 fm = gg.getFontMetrics();
567 gg.setColor(Color.white);
568 gg.fillRect(0, 0, imgWidth, image.getHeight());
571 drawComponent(gg, av.startRes, av.endRes + 1);
572 g.drawImage(image, 0, 0, this);
578 * @param horizontal DOCUMENT ME!
580 public void fastPaint(int horizontal)
582 if ( (horizontal == 0)
584 || av.alignment.getAlignmentAnnotation() == null
585 || av.alignment.getAlignmentAnnotation().length < 1
586 || av.updatingConsensus
587 || av.updatingConservation)
593 gg.copyArea(0, 0, imgWidth, getHeight(), -horizontal * av.charWidth, 0);
595 int sr = av.startRes;
596 int er = av.endRes + 1;
599 if (horizontal > 0) // scrollbar pulled right, image to the left
601 transX = (er - sr - horizontal) * av.charWidth;
602 sr = er - horizontal;
604 else if (horizontal < 0)
606 er = sr - horizontal;
609 gg.translate(transX, 0);
611 drawComponent(gg, sr, er);
613 gg.translate( -transX, 0);
624 * @param g DOCUMENT ME!
625 * @param startRes DOCUMENT ME!
626 * @param endRes DOCUMENT ME!
628 public void drawComponent(Graphics g, int startRes, int endRes)
630 if (av.updatingConsensus || av.updatingConservation)
636 //We'll keep a record of the old image,
637 //and draw a faded image until the calculation
639 if (fadedImage == null
640 || fadedImage.getWidth() != imgWidth
641 || fadedImage.getHeight() != image.getHeight())
643 fadedImage = new BufferedImage(
644 imgWidth, image.getHeight(),
645 BufferedImage.TYPE_INT_RGB);
647 Graphics2D fadedG = (Graphics2D) fadedImage.getGraphics();
649 fadedG.setColor(Color.white);
650 fadedG.fillRect(0, 0, imgWidth, image.getHeight());
653 AlphaComposite.getInstance(
654 AlphaComposite.SRC_OVER, .3f));
655 fadedG.drawImage(image, 0, 0, this);
665 g.setColor(Color.white);
666 g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getHeight());
668 g.setFont(av.getFont());
671 fm = g.getFontMetrics();
674 if ( (av.alignment.getAlignmentAnnotation() == null) ||
675 (av.alignment.getAlignmentAnnotation().length < 1))
677 g.setColor(Color.white);
678 g.fillRect(0, 0, getWidth(), getHeight());
679 g.setColor(Color.black);
680 if (av.validCharWidth)
682 g.drawString("Alignment has no annotations", 20, 15);
688 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
695 boolean validRes = false;
697 boolean[] graphGroupDrawn = new boolean[aa.length];
700 for (int i = 0; i < aa.length; i++)
702 AlignmentAnnotation row = aa[i];
714 if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
719 // this is so that we draw the characters below the graph
724 iconOffset =av.charHeight -fm.getDescent();
728 else if (row.hasText)
730 iconOffset = av.charHeight -fm.getDescent();
739 if (av.updatingConsensus && aa[i] == av.consensus)
743 g.drawImage(fadedImage,
744 0, y - row.height, imgWidth, y,
745 0, y - row.height, imgWidth, y, this);
746 g.setColor(Color.black);
747 // g.drawString("Calculating Consensus....",20, y-row.height/2);
751 else if (av.updatingConservation && aa[i].label.equals("Conservation"))
755 g.drawImage(fadedImage,
756 0, y - row.height, imgWidth, y,
757 0, y - row.height, imgWidth, y, this);
759 g.setColor(Color.black);
760 // g.drawString("Calculating Conservation.....",20, y-row.height/2);
764 else if (av.updatingConservation && aa[i].label.equals("Quality"))
768 g.drawImage(fadedImage,
769 0, y - row.height, imgWidth, y,
770 0, y - row.height, imgWidth, y, this);
771 g.setColor(Color.black);
772 /// g.drawString("Calculating Quality....",20, y-row.height/2);
780 while (x < endRes - startRes)
782 if (av.hasHiddenColumns)
784 column = av.getColumnSelection().adjustForHiddenColumns(startRes + x);
785 if (column > row.annotations.length - 1)
792 column = startRes + x;
795 if ( (row.annotations==null)
796 || (row.annotations.length <= column)
797 || (row.annotations[column] == null))
808 g.setColor(Color.red);
810 if (av.getColumnSelection() != null)
812 for (int n = 0; n < av.getColumnSelection().size(); n++)
814 int v = av.getColumnSelection().columnAt(n);
818 g.fillRect(x * av.charWidth, y,
819 av.charWidth, av.charHeight);
825 if (av.validCharWidth && validRes
826 && row.annotations[column].displayCharacter != null
827 && (row.annotations[column].displayCharacter.length() > 0))
830 int charOffset = (av.charWidth -
831 fm.charWidth(row.annotations[column].
832 displayCharacter.charAt(
835 if (row.annotations[column].colour == null)
836 g.setColor(Color.black);
838 g.setColor(row.annotations[column].colour);
840 if (column == 0 || row.graph > 0)
842 g.drawString(row.annotations[column].displayCharacter,
843 (x * av.charWidth) + charOffset,
847 row.annotations[column - 1] == null
848 || (!row.annotations[column].displayCharacter.equals(
849 row.annotations[column - 1].displayCharacter)
851 (row.annotations[column].displayCharacter.length() < 2 &&
852 row.annotations[column].secondaryStructure == ' ')))
854 g.drawString(row.annotations[column].displayCharacter,
855 x * av.charWidth + charOffset,
863 (row.annotations[column].secondaryStructure != lastSS))
868 g.setColor(HELIX_COLOUR);
871 //Off by 1 offset when drawing rects and ovals
872 //to offscreen image on the MAC
873 g.fillRoundRect(lastSSX, y + 4 + iconOffset,
874 (x * av.charWidth) - lastSSX, 7, 8, 8);
878 int sCol = (lastSSX / av.charWidth) + startRes;
880 int x2 = (x * av.charWidth);
883 row.annotations[sCol - 1] == null ||
884 row.annotations[sCol - 1].secondaryStructure != 'H')
886 g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
888 x1 += av.charWidth / 2;
891 if (row.annotations[column] == null ||
892 row.annotations[column].secondaryStructure != 'H')
894 g.fillArc( (x * av.charWidth) - av.charWidth,
895 y + 4 + iconOffset, av.charWidth, 8, 270, 180);
896 x2 -= av.charWidth / 2;
899 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
903 g.setColor(SHEET_COLOUR);
904 g.fillRect(lastSSX, y + 4 + iconOffset,
905 (x * av.charWidth) - lastSSX - 4, 7);
906 g.fillPolygon(new int[]
907 { (x * av.charWidth) - 4,
908 (x * av.charWidth) - 4,
912 y + iconOffset, y + 14 + iconOffset,
919 g.setColor(Color.gray);
920 g.fillRect(lastSSX, y + 6 + iconOffset,
921 (x * av.charWidth) - lastSSX, 2);
928 lastSS = row.annotations[column].secondaryStructure;
935 lastSSX = (x * av.charWidth);
943 if (column >= row.annotations.length)
945 column = row.annotations.length - 1;
955 g.setColor(HELIX_COLOUR);
958 //Off by 1 offset when drawing rects and ovals
959 //to offscreen image on the MAC
960 g.fillRoundRect(lastSSX, y + 4 + iconOffset,
961 (x * av.charWidth) - lastSSX, 7, 8, 8);
965 int sCol = (lastSSX / av.charWidth) + startRes;
967 int x2 = (x * av.charWidth);
970 row.annotations[sCol - 1] == null ||
971 row.annotations[sCol - 1].secondaryStructure != 'H')
973 g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
974 x1 += av.charWidth / 2;
977 if (row.annotations[column] == null ||
978 row.annotations[column].secondaryStructure != 'H')
980 g.fillArc( (x * av.charWidth) - av.charWidth,
981 y + 4 + iconOffset, av.charWidth, 8, 270,
983 x2 -= av.charWidth / 2;
986 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
991 g.setColor(SHEET_COLOUR);
993 if (row.annotations[endRes] == null
994 || row.annotations[endRes].secondaryStructure != 'E')
996 g.fillRect(lastSSX, y + 4 + iconOffset,
997 (x * av.charWidth) - lastSSX - 4, 7);
998 g.fillPolygon(new int[]
999 { (x * av.charWidth) - 4,
1000 (x * av.charWidth) - 4,
1001 (x * av.charWidth)},
1004 y + iconOffset, y + 14 + iconOffset,
1010 g.fillRect(lastSSX, y + 4 + iconOffset,
1011 (x + 1) * av.charWidth - lastSSX, 7);
1016 g.setColor(Color.gray);
1017 g.fillRect(lastSSX, y + 6 + iconOffset,
1018 (x * av.charWidth) - lastSSX, 2);
1024 if (row.graph > 0 && row.graphHeight > 0)
1026 if (row.graph == AlignmentAnnotation.LINE_GRAPH)
1028 if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
1030 float groupmax = -999999, groupmin = 9999999;
1031 for (int gg = 0; gg < aa.length; gg++)
1033 if (aa[gg].graphGroup != row.graphGroup)
1040 aa[gg].visible = false;
1043 if (aa[gg].graphMax > groupmax)
1045 groupmax = aa[gg].graphMax;
1047 if (aa[gg].graphMin < groupmin)
1049 groupmin = aa[gg].graphMin;
1053 for (int gg = 0; gg < aa.length; gg++)
1055 if (aa[gg].graphGroup == row.graphGroup)
1057 drawLineGraph(g, aa[gg], startRes, endRes, y,
1063 graphGroupDrawn[row.graphGroup] = true;
1067 drawLineGraph(g, row, startRes, endRes,
1068 y, row.graphMin, row.graphMax, row.graphHeight);
1071 else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
1073 drawBarGraph(g, row, startRes, endRes,
1074 row.graphMin, row.graphMax, y);
1078 if (row.graph > 0 && row.hasText)
1090 public void drawLineGraph(Graphics g, AlignmentAnnotation aa,
1093 float min, float max,
1096 if (sRes > aa.annotations.length)
1103 //Adjustment for fastpaint to left
1104 if (eRes < av.endRes)
1109 eRes = Math.min(eRes, aa.annotations.length);
1117 float range = max - min;
1122 y2 = y - (int) ( (0 - min / range) * graphHeight);
1125 g.setColor(Color.gray);
1126 g.drawLine(x - av.charWidth, y2, (eRes - sRes + 1) * av.charWidth, y2);
1128 eRes = Math.min(eRes, aa.annotations.length);
1131 int aaMax = aa.annotations.length - 1;
1133 while (x < eRes - sRes)
1136 if (av.hasHiddenColumns)
1138 column = av.getColumnSelection().adjustForHiddenColumns(column);
1146 if (aa.annotations[column] == null || aa.annotations[column - 1] == null)
1152 if (aa.annotations[column].colour == null)
1153 g.setColor(Color.black);
1155 g.setColor(aa.annotations[column].colour);
1158 (int) ( ( (aa.annotations[column - 1].value - min) / range) * graphHeight);
1160 (int) ( ( (aa.annotations[column].value - min) / range) * graphHeight);
1162 g.drawLine(x * av.charWidth - av.charWidth / 2, y1,
1163 x * av.charWidth + av.charWidth / 2, y2);
1167 if (aa.threshold != null)
1169 g.setColor(aa.threshold.colour);
1170 Graphics2D g2 = (Graphics2D) g;
1171 g2.setStroke(new BasicStroke(1,
1172 BasicStroke.CAP_SQUARE,
1173 BasicStroke.JOIN_ROUND, 3f,
1177 y2 = (int) (y - ( (aa.threshold.value - min) / range) * graphHeight);
1178 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1179 g2.setStroke(new BasicStroke());
1183 public void drawBarGraph(Graphics g, AlignmentAnnotation aa,
1185 float min, float max,
1188 if (sRes > aa.annotations.length)
1193 eRes = Math.min(eRes, aa.annotations.length);
1195 int x = 0, y1 = y, y2 = y;
1197 float range = max - min;
1201 y2 = y - (int) ( (0 - min / (range)) * aa.graphHeight);
1204 g.setColor(Color.gray);
1206 g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
1209 int aaMax = aa.annotations.length - 1;
1211 while (x < eRes - sRes)
1214 if (av.hasHiddenColumns)
1216 column = av.getColumnSelection().adjustForHiddenColumns(column);
1224 if (aa.annotations[column] == null)
1230 if (aa.annotations[column].colour == null)
1231 g.setColor(Color.black);
1233 g.setColor(aa.annotations[column].colour);
1236 (int) ( ( (aa.annotations[column].value - min) / (range)) * aa.graphHeight);
1240 g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
1244 g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
1250 if (aa.threshold != null)
1252 g.setColor(aa.threshold.colour);
1253 Graphics2D g2 = (Graphics2D) g;
1254 g2.setStroke(new BasicStroke(1,
1255 BasicStroke.CAP_SQUARE,
1256 BasicStroke.JOIN_ROUND, 3f,
1260 y2 = (int) (y - ( (aa.threshold.value - min) / range) * aa.graphHeight);
1261 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1262 g2.setStroke(new BasicStroke());
1266 // used by overview window
1267 public void drawGraph(Graphics g, AlignmentAnnotation aa, int width, int y,
1270 eRes = Math.min(eRes, aa.annotations.length);
1271 g.setColor(Color.white);
1272 g.fillRect(0, 0, width, y);
1273 g.setColor(new Color(0, 0, 180));
1277 for (int j = sRes; j < eRes; j++)
1279 if (aa.annotations[j] != null)
1281 if (aa.annotations[j].colour == null)
1282 g.setColor(Color.black);
1284 g.setColor(aa.annotations[j].colour);
1286 height = (int) ( (aa.annotations[j].value / aa.graphMax) * y);
1292 g.fillRect(x, y - height, av.charWidth, height);