2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3 * Copyright (C) 2009 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
19 package jalview.appletgui;
24 import java.awt.event.*;
25 import jalview.datamodel.*;
26 import jalview.schemes.ColourSchemeI;
28 public class AnnotationPanel extends Panel implements AdjustmentListener,
29 ActionListener, MouseListener, MouseMotionListener
39 static String HELIX = "Helix";
41 static String SHEET = "Sheet";
43 static String LABEL = "Label";
45 static String REMOVE = "Remove Annotation";
47 static String COLOUR = "Colour";
49 static Color HELIX_COLOUR = Color.red.darker();
51 static Color SHEET_COLOUR = Color.green.darker().darker();
61 boolean fastPaint = false;
62 //Used For mouse Dragging and resizing graphs
63 int graphStretch = -1;
65 int graphStretchY = -1;
67 boolean mouseDragging=false;
69 public static int GRAPH_HEIGHT = 40;
73 public AnnotationPanel(AlignmentPanel ap)
75 MAC = new jalview.util.Platform().isAMac();
81 addMouseMotionListener(this);
83 addMouseListener(this);
85 // ap.annotationScroller.getVAdjustable().addAdjustmentListener( this );
88 public AnnotationPanel(AlignViewport av)
93 public void adjustmentValueChanged(AdjustmentEvent evt)
95 ap.alabels.setScrollOffset(-evt.getValue());
104 public void actionPerformed(ActionEvent evt)
106 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
107 Annotation[] anot = aa[activeRow].annotations;
109 if (anot.length < av.getColumnSelection().getMax())
111 Annotation[] temp = new Annotation[av.getColumnSelection().getMax() + 2];
112 System.arraycopy(anot, 0, temp, 0, anot.length);
114 aa[activeRow].annotations = anot;
118 if (av.colSel != null && av.colSel.size() > 0
119 && anot[av.colSel.getMin()] != null)
120 label = anot[av.getColumnSelection().getMin()].displayCharacter;
122 if (evt.getActionCommand().equals(REMOVE))
124 for (int i = 0; i < av.getColumnSelection().size(); i++)
126 anot[av.getColumnSelection().columnAt(i)] = null;
129 else if (evt.getActionCommand().equals(LABEL))
131 label = enterLabel(label, "Enter Label");
138 if ((label.length() > 0) && !aa[activeRow].hasText)
140 aa[activeRow].hasText = true;
143 for (int i = 0; i < av.getColumnSelection().size(); i++)
145 int index = av.getColumnSelection().columnAt(i);
147 if (!av.colSel.isVisible(index))
150 if (anot[index] == null)
152 anot[index] = new Annotation(label, "", ' ', 0);
155 anot[index].displayCharacter = label;
158 else if (evt.getActionCommand().equals(COLOUR))
160 UserDefinedColours udc = new UserDefinedColours(this, Color.black,
163 Color col = udc.getColor();
165 for (int i = 0; i < av.getColumnSelection().size(); i++)
167 int index = av.getColumnSelection().columnAt(i);
169 if (!av.colSel.isVisible(index))
172 if (anot[index] == null)
174 anot[index] = new Annotation("", "", ' ', 0);
177 anot[index].colour = col;
184 String symbol = "\u03B1";
186 if (evt.getActionCommand().equals(HELIX))
190 else if (evt.getActionCommand().equals(SHEET))
196 if (!aa[activeRow].hasIcons)
198 aa[activeRow].hasIcons = true;
201 label = enterLabel(symbol, "Enter Label");
208 if ((label.length() > 0) && !aa[activeRow].hasText)
210 aa[activeRow].hasText = true;
213 for (int i = 0; i < av.getColumnSelection().size(); i++)
215 int index = av.getColumnSelection().columnAt(i);
217 if (!av.colSel.isVisible(index))
220 if (anot[index] == null)
222 anot[index] = new Annotation(label, "", type, 0);
225 anot[index].secondaryStructure = type;
226 anot[index].displayCharacter = label;
236 String enterLabel(String text, String label)
238 EditNameDialog dialog = new EditNameDialog(text, null, label, null,
239 ap.alignFrame, "Enter Label", 400, 200, true);
242 return dialog.getName();
247 public void mousePressed(MouseEvent evt)
249 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
258 for (int i = 0; i < aa.length; i++)
262 height += aa[i].height;
265 if (evt.getY() < height)
271 else if (aa[i].graph > 0)
275 graphStretchY = evt.getY();
283 if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK
286 if (av.getColumnSelection() == null)
291 PopupMenu pop = new PopupMenu("Structure type");
292 MenuItem item = new MenuItem(HELIX);
293 item.addActionListener(this);
295 item = new MenuItem(SHEET);
296 item.addActionListener(this);
298 item = new MenuItem(LABEL);
299 item.addActionListener(this);
301 item = new MenuItem(COLOUR);
302 item.addActionListener(this);
304 item = new MenuItem(REMOVE);
305 item.addActionListener(this);
307 ap.alignFrame.add(pop);
308 pop.show(this, evt.getX(), evt.getY());
318 ap.scalePanel.mousePressed(evt);
321 public void mouseReleased(MouseEvent evt)
325 mouseDragging = false;
326 ap.scalePanel.mouseReleased(evt);
329 public void mouseClicked(MouseEvent evt)
333 public void mouseDragged(MouseEvent evt)
335 if (graphStretch > -1)
337 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
339 if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
341 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
343 graphStretchY = evt.getY();
345 ap.paintAlignment(true);
349 ap.scalePanel.mouseDragged(evt);
353 public void mouseMoved(MouseEvent evt)
355 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
363 for (int i = 0; i < aa.length; i++)
368 height += aa[i].height;
371 if (evt.getY() < height)
378 int res = evt.getX() / av.getCharWidth() + av.getStartRes();
380 if (av.hasHiddenColumns)
382 res = av.getColumnSelection().adjustForHiddenColumns(res);
385 if (row > -1 && res < aa[row].annotations.length
386 && aa[row].annotations[res] != null)
388 StringBuffer text = new StringBuffer("Sequence position " + (res + 1));
389 if (aa[row].annotations[res].description != null)
391 text.append(" " + aa[row].annotations[res].description);
393 ap.alignFrame.statusBar.setText(text.toString());
397 public void mouseEntered(MouseEvent evt)
399 ap.scalePanel.mouseEntered(evt);
402 public void mouseExited(MouseEvent evt)
404 ap.scalePanel.mouseExited(evt);
407 public int adjustPanelHeight()
409 // setHeight of panels
410 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
415 for (int i = 0; i < aa.length; i++)
426 aa[i].height += av.charHeight;
436 aa[i].height += aa[i].graphHeight;
439 if (aa[i].height == 0)
444 height += aa[i].height;
452 this.setSize(getSize().width, height);
460 public void addEditableColumn(int i)
464 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
470 for (int j = 0; j < aa.length; j++)
480 if (activeRes == null)
482 activeRes = new Vector();
483 activeRes.addElement(String.valueOf(i));
487 activeRes.addElement(String.valueOf(i));
490 public void update(Graphics g)
495 public void paint(Graphics g)
498 imgWidth = getSize().width;
499 // (av.endRes - av.startRes + 1) * av.charWidth;
501 if (image == null || imgWidth != image.getWidth(this))
503 image = createImage(imgWidth, ap.annotationPanel.getSize().height);
504 gg = image.getGraphics();
505 gg.setFont(av.getFont());
506 fm = gg.getFontMetrics();
512 g.drawImage(image, 0, 0, this);
517 gg.setColor(Color.white);
518 gg.fillRect(0, 0, getSize().width, getSize().height);
519 drawComponent(gg, av.startRes, av.endRes + 1);
521 g.drawImage(image, 0, 0, this);
524 public void fastPaint(int horizontal)
526 if (horizontal == 0 || av.alignment.getAlignmentAnnotation() == null
527 || av.alignment.getAlignmentAnnotation().length < 1)
533 gg.copyArea(0, 0, imgWidth, getSize().height, -horizontal
535 int sr = av.startRes, er = av.endRes + 1, transX = 0;
537 if (horizontal > 0) // scrollbar pulled right, image to the left
539 transX = (er - sr - horizontal) * av.charWidth;
540 sr = er - horizontal;
542 else if (horizontal < 0)
544 er = sr - horizontal;
547 gg.translate(transX, 0);
549 drawComponent(gg, sr, er);
551 gg.translate(-transX, 0);
567 public void drawComponent(Graphics g, int startRes, int endRes)
569 Font ofont = av.getFont();
572 g.setColor(Color.white);
573 g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getSize().height);
577 fm = g.getFontMetrics();
580 if ((av.alignment.getAlignmentAnnotation() == null)
581 || (av.alignment.getAlignmentAnnotation().length < 1))
583 g.setColor(Color.white);
584 g.fillRect(0, 0, getSize().width, getSize().height);
585 g.setColor(Color.black);
586 if (av.validCharWidth)
588 g.drawString("Alignment has no annotations", 20, 15);
594 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
601 int iconOffset = av.charHeight / 2;
602 boolean validRes = false;
603 boolean validEnd = false;
604 boolean labelAllCols = false;
605 boolean centreColLabels,centreColLabelsDef = av.getCentreColumnLabels();
606 boolean scaleColLabel=false;
607 boolean[] graphGroupDrawn = new boolean[aa.length];
608 int charOffset = 0; // offset for a label
609 float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a column.
611 for (int i = 0; i < aa.length; i++)
613 AlignmentAnnotation row = aa[i];
619 centreColLabels = row.centreColLabels || centreColLabelsDef;
620 labelAllCols = row.showAllColLabels;
621 scaleColLabel = row.scaleColLabel;
627 if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
632 // this is so that we draw the characters below the graph
637 iconOffset = av.charHeight - fm.getDescent();
641 //TODO: else is the logic used in application, applet had no 'else'
642 else if (row.hasText)
644 iconOffset = av.charHeight - fm.getDescent();
653 while (x < endRes - startRes)
655 if (av.hasHiddenColumns)
657 column = av.getColumnSelection().adjustForHiddenColumns(
659 if (column > row.annotations.length - 1)
666 column = startRes + x;
669 if ((row.annotations.length <= column)
670 || (row.annotations[column] == null))
681 g.setColor(Color.red);
683 if (av.getColumnSelection() != null)
685 for (int n = 0; n < av.getColumnSelection().size(); n++)
687 int v = av.getColumnSelection().columnAt(n);
692 .fillRect(x * av.charWidth, y, av.charWidth,
699 if (av.validCharWidth
701 && (row.annotations[column].displayCharacter != null && row.annotations[column].displayCharacter
705 if (centreColLabels || scaleColLabel)
708 .charsWidth(row.annotations[column].displayCharacter
710 row.annotations[column].displayCharacter.length());
712 if ( scaleColLabel ) {
713 // justify the label and scale to fit in column
714 if (fmWidth > av.charWidth) {
715 // scale only if the current font isn't already small enough
716 fmScaling = av.charWidth;
717 fmScaling /= fmWidth;
718 // not 1.1 // g.setFont(new Font(ofont,AffineTransform.getScaleInstance(fmScaling, 1.0)));
719 // and update the label's width to reflect the scaling.
720 fmWidth = av.charWidth;
725 .charWidth(row.annotations[column].displayCharacter.charAt(0));
727 charOffset = (int) ((av.charWidth - fmWidth) / 2f);
729 if (row.annotations[column].colour == null)
730 g.setColor(Color.black);
732 g.setColor(row.annotations[column].colour);
734 if (column == 0 || row.graph > 0)
736 g.drawString(row.annotations[column].displayCharacter,
737 (x * av.charWidth) + charOffset, y + iconOffset + 3); // + 3?
739 else if (row.annotations[column - 1] == null
740 || (labelAllCols||!row.annotations[column].displayCharacter
741 .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
742 .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
744 g.drawString(row.annotations[column].displayCharacter,
745 (x * av.charWidth) + charOffset, y + iconOffset + 3); // +3?
753 || (row.annotations[column].secondaryStructure != lastSS))
758 g.setColor(HELIX_COLOUR);
761 // Off by 1 offset when drawing rects and ovals
762 // to offscreen image on the MAC
763 g.fillRoundRect(lastSSX, y + 4 + iconOffset,
764 (x * av.charWidth) - lastSSX, 7, 8, 8);
768 int sCol = (lastSSX / av.charWidth) + startRes;
770 int x2 = (x * av.charWidth);
773 || row.annotations[sCol - 1] == null
774 || row.annotations[sCol - 1].secondaryStructure != 'H')
776 g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
778 x1 += av.charWidth / 2;
781 if (!validRes || row.annotations[column] == null
782 || row.annotations[column].secondaryStructure != 'H')
784 g.fillArc((x * av.charWidth) - av.charWidth, y + 4
785 + iconOffset, av.charWidth, 8, 270, 180);
786 x2 -= av.charWidth / 2;
789 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
793 g.setColor(SHEET_COLOUR);
794 g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
796 g.fillPolygon(new int[]
797 { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
798 (x * av.charWidth) }, new int[]
799 { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
805 g.setColor(Color.gray);
806 g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
814 lastSS = row.annotations[column].secondaryStructure;
821 lastSSX = (x * av.charWidth);
829 if (column >= row.annotations.length)
831 column = row.annotations.length - 1;
846 g.setColor(HELIX_COLOUR);
849 // Off by 1 offset when drawing rects and ovals
850 // to offscreen image on the MAC
851 g.fillRoundRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
856 int sCol = (lastSSX / av.charWidth) + startRes;
858 int x2 = (x * av.charWidth);
860 if (sCol == 0 || row.annotations[sCol - 1] == null
861 || row.annotations[sCol - 1].secondaryStructure != 'H')
864 .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8,
866 x1 += av.charWidth / 2;
869 if (row.annotations[column] == null
870 || row.annotations[column].secondaryStructure != 'H')
872 g.fillArc((x * av.charWidth) - av.charWidth,
873 y + 4 + iconOffset, av.charWidth, 8, 270, 180);
874 x2 -= av.charWidth / 2;
877 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
882 g.setColor(SHEET_COLOUR);
884 if (!validEnd || row.annotations[endRes] == null
885 || row.annotations[endRes].secondaryStructure != 'E')
887 g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
889 g.fillPolygon(new int[]
890 { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
891 (x * av.charWidth) }, new int[]
892 { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, 3);
896 g.fillRect(lastSSX, y + 4 + iconOffset, x * av.charWidth
902 g.setColor(Color.gray);
903 if (!av.wrapAlignment || endRes == av.endRes)
905 g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
913 if (row.graph > 0 && row.graphHeight> 0)
915 if (row.graph == AlignmentAnnotation.LINE_GRAPH)
917 if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
919 float groupmax = -999999, groupmin = 9999999;
920 for (int gg = 0; gg < aa.length; gg++)
922 if (aa[gg].graphGroup != row.graphGroup)
929 aa[gg].visible = false;
932 if (aa[gg].graphMax > groupmax)
934 groupmax = aa[gg].graphMax;
936 if (aa[gg].graphMin < groupmin)
938 groupmin = aa[gg].graphMin;
942 for (int gg = 0; gg < aa.length; gg++)
944 if (aa[gg].graphGroup == row.graphGroup)
946 drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
947 groupmax, row.graphHeight);
951 graphGroupDrawn[row.graphGroup] = true;
955 drawLineGraph(g, row, startRes, endRes, y, row.graphMin,
956 row.graphMax, row.graphHeight);
959 else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
961 drawBarGraph(g, row, startRes, endRes, row.graphMin,
966 if (row.graph > 0 && row.hasText)
978 public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes,
979 int eRes, int y, float min, float max, int graphHeight)
981 if (sRes > aa.annotations.length)
988 // Adjustment for fastpaint to left
989 if (eRes < av.endRes)
994 eRes = Math.min(eRes, aa.annotations.length);
997 float range = max - min;
1002 y2 = y - (int) ((0 - min / range) * graphHeight);
1005 g.setColor(Color.gray);
1006 g.drawLine(x - av.charWidth, y2, (eRes - sRes) * av.charWidth, y2);
1008 eRes = Math.min(eRes, aa.annotations.length);
1011 int aaMax = aa.annotations.length - 1;
1013 while (x < eRes - sRes)
1016 if (av.hasHiddenColumns)
1018 column = av.getColumnSelection().adjustForHiddenColumns(column);
1026 if (aa.annotations[column] == null) // || coaa.annotations[column - 1] ==
1033 if (aa.annotations[column].colour == null)
1034 g.setColor(Color.black);
1036 g.setColor(aa.annotations[column].colour);
1037 if (column == 0 || aa.annotations[column - 1] == null)
1040 - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
1045 - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
1048 - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
1050 g.drawLine(x * av.charWidth - av.charWidth / 2, y1, x * av.charWidth
1051 + av.charWidth / 2, y2);
1055 if (aa.threshold != null)
1057 g.setColor(aa.threshold.colour);
1059 y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
1060 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1064 public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes,
1065 int eRes, float min, float max, int y)
1067 ColourSchemeI profcolour = av.getGlobalColourScheme();
1068 if (profcolour==null)
1070 profcolour = new jalview.schemes.ZappoColourScheme();
1072 if (sRes > aa.annotations.length)
1076 Font ofont = g.getFont();
1077 eRes = Math.min(eRes, aa.annotations.length);
1079 int x = 0, y1 = y, y2 = y;
1081 float range = max - min;
1085 y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
1088 g.setColor(Color.gray);
1090 g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
1093 int aaMax = aa.annotations.length - 1;
1094 boolean renderHistogram = true, renderProfile = false;
1095 /* Logos are disabled for 2.5 release : Bug # 0060064
1096 * if (aa.autoCalculated && aa.label.startsWith("Consensus")) {
1097 // TODO: generalise this to have render styles for consensus/profile data
1098 if (aa.groupRef!=null)
1100 renderHistogram = aa.groupRef.isShowConsensusHistogram();
1101 renderProfile = aa.groupRef.isShowSequenceLogo();
1103 renderHistogram = av.isShowConsensusHistogram();
1104 renderProfile = av.isShowSequenceLogo();
1107 while (x < eRes - sRes)
1110 if (av.hasHiddenColumns)
1112 column = av.getColumnSelection().adjustForHiddenColumns(column);
1120 if (aa.annotations[column] == null)
1126 if (aa.annotations[column].colour == null)
1127 g.setColor(Color.black);
1129 g.setColor(aa.annotations[column].colour);
1132 - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
1134 if (renderHistogram)
1138 g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
1142 g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
1145 // draw profile if available
1146 // Disabled for 2.5 release: see bug #0060064
1148 if (aa.annotations[column].value!=0 && renderProfile)
1150 int profl[] = getProfileFor(aa,column);
1151 int ht = y1; //,htn=y2-y1;//aa.graphHeight;
1154 char[] dc = new char[1];
1156 for (int c=1;profl!=null && c<profl[0];)
1158 dc[0] = (char) profl[c++];
1159 wdth = av.charWidth;
1161 .charsWidth(dc,0,1);
1168 // not java 1.1 compatible: Bug # 0060064
1169 g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(wdth, (ht2=(htn*((double)profl[c++])/100.0))/av.charHeight)));
1170 lm = g.getFontMetrics().getLineMetrics(dc,0,1, g);
1171 g.setColor(profcolour.findColour(dc[0]));
1172 g.drawChars(dc,0,1,x*av.charWidth, (int) (ht+lm.getHeight()));
1181 if (aa.threshold != null)
1183 g.setColor(aa.threshold.colour);
1184 y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
1185 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1190 * Disabled for 2.5 release - see bug #0060064
1191 private int[] getProfileFor(AlignmentAnnotation aa, int column)
1193 // if (aa.autoCalculated && aa.label.startsWith("Consensus")) {
1194 if (aa.groupRef!=null && aa.groupRef.consensusData!=null) { // && aa.groupRef.isShowSequenceLogo()) {
1195 return AAFrequency.extractProfile(aa.groupRef.consensusData[column],aa.groupRef.getIgnoreGapsConsensus());
1197 // TODO extend annotation row to enable dynamic and static profile data to be stored
1198 if (aa.groupRef==null && aa.sequenceRef==null) // && av.isShowSequenceLogo())
1200 return AAFrequency.extractProfile(av.hconsensus[column],av.getIgnoreGapsConsensus());
1207 // used by overview window
1208 public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
1209 int y, int sRes, int eRes)
1211 eRes = Math.min(eRes, aa.annotations.length);
1212 g.setColor(Color.white);
1213 g.fillRect(0, 0, width, y);
1214 g.setColor(new Color(0, 0, 180));
1218 for (int j = sRes; j < eRes; j++)
1220 if (aa.annotations[j].colour == null)
1221 g.setColor(Color.black);
1223 g.setColor(aa.annotations[j].colour);
1225 height = (int) ((aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);
1230 g.fillRect(x, y - height, av.charWidth, height);