2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.appletgui;
23 import java.awt.event.*;
24 import jalview.datamodel.*;
25 import jalview.schemes.ColourSchemeI;
27 public class AnnotationPanel extends Panel implements AdjustmentListener,
28 ActionListener, MouseListener, MouseMotionListener
38 static String HELIX = "Helix";
40 static String SHEET = "Sheet";
42 static String LABEL = "Label";
44 static String REMOVE = "Remove Annotation";
46 static String COLOUR = "Colour";
48 static Color HELIX_COLOUR = Color.red.darker();
50 static Color SHEET_COLOUR = Color.green.darker().darker();
60 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();
111 Annotation[] anot = aa[activeRow].annotations;
113 if (anot.length < av.getColumnSelection().getMax())
115 Annotation[] temp = new Annotation[av.getColumnSelection().getMax() + 2];
116 System.arraycopy(anot, 0, temp, 0, anot.length);
118 aa[activeRow].annotations = anot;
122 if (av.colSel != null && av.colSel.size() > 0
123 && anot[av.colSel.getMin()] != null)
124 label = anot[av.getColumnSelection().getMin()].displayCharacter;
126 if (evt.getActionCommand().equals(REMOVE))
128 for (int i = 0; i < av.getColumnSelection().size(); i++)
130 anot[av.getColumnSelection().columnAt(i)] = null;
133 else if (evt.getActionCommand().equals(LABEL))
135 label = enterLabel(label, "Enter Label");
142 if ((label.length() > 0) && !aa[activeRow].hasText)
144 aa[activeRow].hasText = true;
147 for (int i = 0; i < av.getColumnSelection().size(); i++)
149 int index = av.getColumnSelection().columnAt(i);
151 if (!av.colSel.isVisible(index))
154 if (anot[index] == null)
156 anot[index] = new Annotation(label, "", ' ', 0);
159 anot[index].displayCharacter = label;
162 else if (evt.getActionCommand().equals(COLOUR))
164 UserDefinedColours udc = new UserDefinedColours(this, Color.black,
167 Color col = udc.getColor();
169 for (int i = 0; i < av.getColumnSelection().size(); i++)
171 int index = av.getColumnSelection().columnAt(i);
173 if (!av.colSel.isVisible(index))
176 if (anot[index] == null)
178 anot[index] = new Annotation("", "", ' ', 0);
181 anot[index].colour = col;
188 String symbol = "\u03B1";
190 if (evt.getActionCommand().equals(HELIX))
194 else if (evt.getActionCommand().equals(SHEET))
200 if (!aa[activeRow].hasIcons)
202 aa[activeRow].hasIcons = true;
205 label = enterLabel(symbol, "Enter Label");
212 if ((label.length() > 0) && !aa[activeRow].hasText)
214 aa[activeRow].hasText = true;
217 for (int i = 0; i < av.getColumnSelection().size(); i++)
219 int index = av.getColumnSelection().columnAt(i);
221 if (!av.colSel.isVisible(index))
224 if (anot[index] == null)
226 anot[index] = new Annotation(label, "", type, 0);
229 anot[index].secondaryStructure = type;
230 anot[index].displayCharacter = label;
240 String enterLabel(String text, String label)
242 EditNameDialog dialog = new EditNameDialog(text, null, label, null,
243 ap.alignFrame, "Enter Label", 400, 200, true);
246 return dialog.getName();
251 public void mousePressed(MouseEvent evt)
253 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
262 for (int i = 0; i < aa.length; i++)
266 height += aa[i].height;
269 if (evt.getY() < height)
275 else if (aa[i].graph > 0)
279 graphStretchY = evt.getY();
286 if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK
289 if (av.getColumnSelection() == null)
294 PopupMenu pop = new PopupMenu("Structure type");
295 MenuItem item = new MenuItem(HELIX);
296 item.addActionListener(this);
298 item = new MenuItem(SHEET);
299 item.addActionListener(this);
301 item = new MenuItem(LABEL);
302 item.addActionListener(this);
304 item = new MenuItem(COLOUR);
305 item.addActionListener(this);
307 item = new MenuItem(REMOVE);
308 item.addActionListener(this);
310 ap.alignFrame.add(pop);
311 pop.show(this, evt.getX(), evt.getY());
321 ap.scalePanel.mousePressed(evt);
324 public void mouseReleased(MouseEvent evt)
328 mouseDragging = false;
329 ap.scalePanel.mouseReleased(evt);
332 public void mouseClicked(MouseEvent evt)
336 public void mouseDragged(MouseEvent evt)
338 if (graphStretch > -1)
340 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
342 if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
344 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
346 graphStretchY = evt.getY();
348 ap.paintAlignment(true);
352 ap.scalePanel.mouseDragged(evt);
356 public void mouseMoved(MouseEvent evt)
358 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
366 for (int i = 0; i < aa.length; i++)
371 height += aa[i].height;
374 if (evt.getY() < height)
381 int res = evt.getX() / av.getCharWidth() + av.getStartRes();
383 if (av.hasHiddenColumns)
385 res = av.getColumnSelection().adjustForHiddenColumns(res);
388 if (row > -1 && res < aa[row].annotations.length
389 && aa[row].annotations[res] != null)
391 StringBuffer text = new StringBuffer("Sequence position " + (res + 1));
392 if (aa[row].annotations[res].description != null)
394 text.append(" " + aa[row].annotations[res].description);
396 ap.alignFrame.statusBar.setText(text.toString());
400 public void mouseEntered(MouseEvent evt)
402 ap.scalePanel.mouseEntered(evt);
405 public void mouseExited(MouseEvent evt)
407 ap.scalePanel.mouseExited(evt);
410 public int adjustPanelHeight()
412 // setHeight of panels
413 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
418 for (int i = 0; i < aa.length; i++)
429 aa[i].height += av.charHeight;
439 aa[i].height += aa[i].graphHeight;
442 if (aa[i].height == 0)
447 height += aa[i].height;
455 this.setSize(getSize().width, height);
463 public void addEditableColumn(int i)
467 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
473 for (int j = 0; j < aa.length; j++)
483 if (activeRes == null)
485 activeRes = new Vector();
486 activeRes.addElement(String.valueOf(i));
490 activeRes.addElement(String.valueOf(i));
493 public void update(Graphics g)
498 public void paint(Graphics g)
501 imgWidth = getSize().width;
502 // (av.endRes - av.startRes + 1) * av.charWidth;
504 if (image == null || imgWidth != image.getWidth(this))
506 image = createImage(imgWidth, ap.annotationPanel.getSize().height);
507 gg = image.getGraphics();
508 gg.setFont(av.getFont());
509 fm = gg.getFontMetrics();
515 g.drawImage(image, 0, 0, this);
520 gg.setColor(Color.white);
521 gg.fillRect(0, 0, getSize().width, getSize().height);
522 drawComponent(gg, av.startRes, av.endRes + 1);
524 g.drawImage(image, 0, 0, this);
527 public void fastPaint(int horizontal)
529 if (horizontal == 0 || av.alignment.getAlignmentAnnotation() == null
530 || av.alignment.getAlignmentAnnotation().length < 1)
536 gg.copyArea(0, 0, imgWidth, getSize().height, -horizontal
538 int sr = av.startRes, er = av.endRes + 1, transX = 0;
540 if (horizontal > 0) // scrollbar pulled right, image to the left
542 transX = (er - sr - horizontal) * av.charWidth;
543 sr = er - horizontal;
545 else if (horizontal < 0)
547 er = sr - horizontal;
550 gg.translate(transX, 0);
552 drawComponent(gg, sr, er);
554 gg.translate(-transX, 0);
570 public void drawComponent(Graphics g, int startRes, int endRes)
572 Font ofont = av.getFont();
575 g.setColor(Color.white);
576 g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getSize().height);
580 fm = g.getFontMetrics();
583 if ((av.alignment.getAlignmentAnnotation() == null)
584 || (av.alignment.getAlignmentAnnotation().length < 1))
586 g.setColor(Color.white);
587 g.fillRect(0, 0, getSize().width, getSize().height);
588 g.setColor(Color.black);
589 if (av.validCharWidth)
591 g.drawString("Alignment has no annotations", 20, 15);
597 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
604 int iconOffset = av.charHeight / 2;
605 boolean validRes = false;
606 boolean validEnd = false;
607 boolean labelAllCols = false;
608 boolean centreColLabels, centreColLabelsDef = av
609 .getCentreColumnLabels();
610 boolean scaleColLabel = false;
611 boolean[] graphGroupDrawn = new boolean[aa.length];
612 int charOffset = 0; // offset for a label
613 float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a
616 for (int i = 0; i < aa.length; i++)
618 AlignmentAnnotation row = aa[i];
624 centreColLabels = row.centreColLabels || centreColLabelsDef;
625 labelAllCols = row.showAllColLabels;
626 scaleColLabel = row.scaleColLabel;
632 if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
637 // this is so that we draw the characters below the graph
642 iconOffset = av.charHeight - fm.getDescent();
646 // TODO: else is the logic used in application, applet had no 'else'
647 else if (row.hasText)
649 iconOffset = av.charHeight - fm.getDescent();
658 while (x < endRes - startRes)
660 if (av.hasHiddenColumns)
662 column = av.getColumnSelection().adjustForHiddenColumns(
664 if (column > row.annotations.length - 1)
671 column = startRes + x;
674 if ((row.annotations.length <= column)
675 || (row.annotations[column] == null))
686 g.setColor(Color.red);
688 if (av.getColumnSelection() != null)
690 for (int n = 0; n < av.getColumnSelection().size(); n++)
692 int v = av.getColumnSelection().columnAt(n);
697 .fillRect(x * av.charWidth, y, av.charWidth,
704 if (av.validCharWidth
706 && (row.annotations[column].displayCharacter != null && row.annotations[column].displayCharacter
710 if (centreColLabels || scaleColLabel)
712 fmWidth = (float) fm.charsWidth(
713 row.annotations[column].displayCharacter.toCharArray(),
714 0, row.annotations[column].displayCharacter.length());
718 // justify the label and scale to fit in column
719 if (fmWidth > av.charWidth)
721 // scale only if the current font isn't already small enough
722 fmScaling = av.charWidth;
723 fmScaling /= fmWidth;
724 // not 1.1 // g.setFont(new
725 // Font(ofont,AffineTransform.getScaleInstance(fmScaling,
727 // and update the label's width to reflect the scaling.
728 fmWidth = av.charWidth;
735 .charWidth(row.annotations[column].displayCharacter
738 charOffset = (int) ((av.charWidth - fmWidth) / 2f);
740 if (row.annotations[column].colour == null)
741 g.setColor(Color.black);
743 g.setColor(row.annotations[column].colour);
745 if (column == 0 || row.graph > 0)
747 g.drawString(row.annotations[column].displayCharacter,
748 (x * av.charWidth) + charOffset, y + iconOffset + 3); // +
751 else if (row.annotations[column - 1] == null
753 || !row.annotations[column].displayCharacter
754 .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
755 .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
757 g.drawString(row.annotations[column].displayCharacter,
758 (x * av.charWidth) + charOffset, y + iconOffset + 3); // +3?
766 || (row.annotations[column].secondaryStructure != lastSS))
771 g.setColor(HELIX_COLOUR);
774 // Off by 1 offset when drawing rects and ovals
775 // to offscreen image on the MAC
776 g.fillRoundRect(lastSSX, y + 4 + iconOffset,
777 (x * av.charWidth) - lastSSX, 7, 8, 8);
781 int sCol = (lastSSX / av.charWidth) + startRes;
783 int x2 = (x * av.charWidth);
786 || row.annotations[sCol - 1] == null
787 || row.annotations[sCol - 1].secondaryStructure != 'H')
789 g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
791 x1 += av.charWidth / 2;
794 if (!validRes || row.annotations[column] == null
795 || row.annotations[column].secondaryStructure != 'H')
797 g.fillArc((x * av.charWidth) - av.charWidth, y + 4
798 + iconOffset, av.charWidth, 8, 270, 180);
799 x2 -= av.charWidth / 2;
802 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
806 g.setColor(SHEET_COLOUR);
807 g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
809 g.fillPolygon(new int[]
810 { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
811 (x * av.charWidth) }, new int[]
812 { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
818 g.setColor(Color.gray);
819 g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
827 lastSS = row.annotations[column].secondaryStructure;
834 lastSSX = (x * av.charWidth);
842 if (column >= row.annotations.length)
844 column = row.annotations.length - 1;
859 g.setColor(HELIX_COLOUR);
862 // Off by 1 offset when drawing rects and ovals
863 // to offscreen image on the MAC
864 g.fillRoundRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
869 int sCol = (lastSSX / av.charWidth) + startRes;
871 int x2 = (x * av.charWidth);
873 if (sCol == 0 || row.annotations[sCol - 1] == null
874 || row.annotations[sCol - 1].secondaryStructure != 'H')
877 .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8,
879 x1 += av.charWidth / 2;
882 if (row.annotations[column] == null
883 || row.annotations[column].secondaryStructure != 'H')
885 g.fillArc((x * av.charWidth) - av.charWidth,
886 y + 4 + iconOffset, av.charWidth, 8, 270, 180);
887 x2 -= av.charWidth / 2;
890 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
895 g.setColor(SHEET_COLOUR);
897 if (!validEnd || row.annotations[endRes] == null
898 || row.annotations[endRes].secondaryStructure != 'E')
900 g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
902 g.fillPolygon(new int[]
903 { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
904 (x * av.charWidth) }, new int[]
905 { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, 3);
909 g.fillRect(lastSSX, y + 4 + iconOffset, x * av.charWidth
915 g.setColor(Color.gray);
916 if (!av.wrapAlignment || endRes == av.endRes)
918 g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
926 if (row.graph > 0 && row.graphHeight > 0)
928 if (row.graph == AlignmentAnnotation.LINE_GRAPH)
930 if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
932 float groupmax = -999999, groupmin = 9999999;
933 for (int gg = 0; gg < aa.length; gg++)
935 if (aa[gg].graphGroup != row.graphGroup)
942 aa[gg].visible = false;
945 if (aa[gg].graphMax > groupmax)
947 groupmax = aa[gg].graphMax;
949 if (aa[gg].graphMin < groupmin)
951 groupmin = aa[gg].graphMin;
955 for (int gg = 0; gg < aa.length; gg++)
957 if (aa[gg].graphGroup == row.graphGroup)
959 drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
960 groupmax, row.graphHeight);
964 graphGroupDrawn[row.graphGroup] = true;
968 drawLineGraph(g, row, startRes, endRes, y, row.graphMin,
969 row.graphMax, row.graphHeight);
972 else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
974 drawBarGraph(g, row, startRes, endRes, row.graphMin,
979 if (row.graph > 0 && row.hasText)
991 public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes,
992 int eRes, int y, float min, float max, int graphHeight)
994 if (sRes > aa.annotations.length)
1001 // Adjustment for fastpaint to left
1002 if (eRes < av.endRes)
1007 eRes = Math.min(eRes, aa.annotations.length);
1010 float range = max - min;
1015 y2 = y - (int) ((0 - min / range) * graphHeight);
1018 g.setColor(Color.gray);
1019 g.drawLine(x - av.charWidth, y2, (eRes - sRes) * av.charWidth, y2);
1021 eRes = Math.min(eRes, aa.annotations.length);
1024 int aaMax = aa.annotations.length - 1;
1026 while (x < eRes - sRes)
1029 if (av.hasHiddenColumns)
1031 column = av.getColumnSelection().adjustForHiddenColumns(column);
1039 if (aa.annotations[column] == null) // || coaa.annotations[column - 1] ==
1046 if (aa.annotations[column].colour == null)
1047 g.setColor(Color.black);
1049 g.setColor(aa.annotations[column].colour);
1050 if (column == 0 || aa.annotations[column - 1] == null)
1053 - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
1058 - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
1061 - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
1063 g.drawLine(x * av.charWidth - av.charWidth / 2, y1, x * av.charWidth
1064 + av.charWidth / 2, y2);
1068 if (aa.threshold != null)
1070 g.setColor(aa.threshold.colour);
1072 y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
1073 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1077 public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes,
1078 int eRes, float min, float max, int y)
1080 ColourSchemeI profcolour = av.getGlobalColourScheme();
1081 if (profcolour == null)
1083 profcolour = new jalview.schemes.ZappoColourScheme();
1085 if (sRes > aa.annotations.length)
1089 Font ofont = g.getFont();
1090 eRes = Math.min(eRes, aa.annotations.length);
1092 int x = 0, y1 = y, y2 = y;
1094 float range = max - min;
1098 y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
1101 g.setColor(Color.gray);
1103 g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
1106 int aaMax = aa.annotations.length - 1;
1107 boolean renderHistogram = true, renderProfile = false;
1109 * Logos are disabled for 2.5 release : Bug # 0060064 if (aa.autoCalculated
1110 * && aa.label.startsWith("Consensus")) { // TODO: generalise this to have
1111 * render styles for consensus/profile data if (aa.groupRef!=null) {
1112 * renderHistogram = aa.groupRef.isShowConsensusHistogram(); renderProfile =
1113 * aa.groupRef.isShowSequenceLogo(); } else { renderHistogram =
1114 * av.isShowConsensusHistogram(); renderProfile = av.isShowSequenceLogo(); }
1117 while (x < eRes - sRes)
1120 if (av.hasHiddenColumns)
1122 column = av.getColumnSelection().adjustForHiddenColumns(column);
1130 if (aa.annotations[column] == null)
1136 if (aa.annotations[column].colour == null)
1137 g.setColor(Color.black);
1139 g.setColor(aa.annotations[column].colour);
1142 - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
1144 if (renderHistogram)
1148 g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
1152 g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
1155 // draw profile if available
1156 // Disabled for 2.5 release: see bug #0060064
1158 * if (aa.annotations[column].value!=0 && renderProfile) { int profl[] =
1159 * getProfileFor(aa,column); int ht = y1; //,htn=y2-y1;//aa.graphHeight;
1160 * float wdth; double ht2=0; char[] dc = new char[1]; // LineMetrics lm;
1161 * for (int c=1;profl!=null && c<profl[0];) { dc[0] = (char) profl[c++];
1162 * wdth = av.charWidth; wdth/=(float) fm .charsWidth(dc,0,1);
1164 * if (c>2) { ht+=(int)ht2; } { // not java 1.1 compatible: Bug # 0060064
1165 * g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(wdth,
1166 * (ht2=(htn*((double)profl[c++])/100.0))/av.charHeight))); lm =
1167 * g.getFontMetrics().getLineMetrics(dc,0,1, g);
1168 * g.setColor(profcolour.findColour(dc[0]));
1169 * g.drawChars(dc,0,1,x*av.charWidth, (int) (ht+lm.getHeight())); } }
1170 * g.setFont(ofont); }
1175 if (aa.threshold != null)
1177 g.setColor(aa.threshold.colour);
1178 y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
1179 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1184 * Disabled for 2.5 release - see bug #0060064 private int[]
1185 * getProfileFor(AlignmentAnnotation aa, int column) { // if
1186 * (aa.autoCalculated && aa.label.startsWith("Consensus")) { if
1187 * (aa.groupRef!=null && aa.groupRef.consensusData!=null) { // &&
1188 * aa.groupRef.isShowSequenceLogo()) { return
1189 * AAFrequency.extractProfile(aa.groupRef
1190 * .consensusData[column],aa.groupRef.getIgnoreGapsConsensus()); } // TODO
1191 * extend annotation row to enable dynamic and static profile data to be
1192 * stored if (aa.groupRef==null && aa.sequenceRef==null) // &&
1193 * av.isShowSequenceLogo()) { return
1194 * AAFrequency.extractProfile(av.hconsensus[column
1195 * ],av.getIgnoreGapsConsensus()); } // } return null; }
1198 // used by overview window
1199 public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
1200 int y, int sRes, int eRes)
1202 eRes = Math.min(eRes, aa.annotations.length);
1203 g.setColor(Color.white);
1204 g.fillRect(0, 0, width, y);
1205 g.setColor(new Color(0, 0, 180));
1209 for (int j = sRes; j < eRes; j++)
1211 if (aa.annotations[j].colour == null)
1212 g.setColor(Color.black);
1214 g.setColor(aa.annotations[j].colour);
1216 height = (int) ((aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);
1221 g.fillRect(x, y - height, av.charWidth, height);