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();
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();
282 if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK
285 if (av.getColumnSelection() == null)
290 PopupMenu pop = new PopupMenu("Structure type");
291 MenuItem item = new MenuItem(HELIX);
292 item.addActionListener(this);
294 item = new MenuItem(SHEET);
295 item.addActionListener(this);
297 item = new MenuItem(LABEL);
298 item.addActionListener(this);
300 item = new MenuItem(COLOUR);
301 item.addActionListener(this);
303 item = new MenuItem(REMOVE);
304 item.addActionListener(this);
306 ap.alignFrame.add(pop);
307 pop.show(this, evt.getX(), evt.getY());
317 ap.scalePanel.mousePressed(evt);
320 public void mouseReleased(MouseEvent evt)
324 mouseDragging = false;
325 ap.scalePanel.mouseReleased(evt);
328 public void mouseClicked(MouseEvent evt)
332 public void mouseDragged(MouseEvent evt)
334 if (graphStretch > -1)
336 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
338 if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
340 av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
342 graphStretchY = evt.getY();
344 ap.paintAlignment(true);
348 ap.scalePanel.mouseDragged(evt);
352 public void mouseMoved(MouseEvent evt)
354 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
362 for (int i = 0; i < aa.length; i++)
367 height += aa[i].height;
370 if (evt.getY() < height)
377 int res = evt.getX() / av.getCharWidth() + av.getStartRes();
379 if (av.hasHiddenColumns)
381 res = av.getColumnSelection().adjustForHiddenColumns(res);
384 if (row > -1 && res < aa[row].annotations.length
385 && aa[row].annotations[res] != null)
387 StringBuffer text = new StringBuffer("Sequence position " + (res + 1));
388 if (aa[row].annotations[res].description != null)
390 text.append(" " + aa[row].annotations[res].description);
392 ap.alignFrame.statusBar.setText(text.toString());
396 public void mouseEntered(MouseEvent evt)
398 ap.scalePanel.mouseEntered(evt);
401 public void mouseExited(MouseEvent evt)
403 ap.scalePanel.mouseExited(evt);
406 public int adjustPanelHeight()
408 // setHeight of panels
409 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
414 for (int i = 0; i < aa.length; i++)
425 aa[i].height += av.charHeight;
435 aa[i].height += aa[i].graphHeight;
438 if (aa[i].height == 0)
443 height += aa[i].height;
451 this.setSize(getSize().width, height);
459 public void addEditableColumn(int i)
463 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
469 for (int j = 0; j < aa.length; j++)
479 if (activeRes == null)
481 activeRes = new Vector();
482 activeRes.addElement(String.valueOf(i));
486 activeRes.addElement(String.valueOf(i));
489 public void update(Graphics g)
494 public void paint(Graphics g)
497 imgWidth = getSize().width;
498 // (av.endRes - av.startRes + 1) * av.charWidth;
500 if (image == null || imgWidth != image.getWidth(this))
502 image = createImage(imgWidth, ap.annotationPanel.getSize().height);
503 gg = image.getGraphics();
504 gg.setFont(av.getFont());
505 fm = gg.getFontMetrics();
511 g.drawImage(image, 0, 0, this);
516 gg.setColor(Color.white);
517 gg.fillRect(0, 0, getSize().width, getSize().height);
518 drawComponent(gg, av.startRes, av.endRes + 1);
520 g.drawImage(image, 0, 0, this);
523 public void fastPaint(int horizontal)
525 if (horizontal == 0 || av.alignment.getAlignmentAnnotation() == null
526 || av.alignment.getAlignmentAnnotation().length < 1)
532 gg.copyArea(0, 0, imgWidth, getSize().height, -horizontal
534 int sr = av.startRes, er = av.endRes + 1, transX = 0;
536 if (horizontal > 0) // scrollbar pulled right, image to the left
538 transX = (er - sr - horizontal) * av.charWidth;
539 sr = er - horizontal;
541 else if (horizontal < 0)
543 er = sr - horizontal;
546 gg.translate(transX, 0);
548 drawComponent(gg, sr, er);
550 gg.translate(-transX, 0);
566 public void drawComponent(Graphics g, int startRes, int endRes)
568 Font ofont = av.getFont();
571 g.setColor(Color.white);
572 g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getSize().height);
576 fm = g.getFontMetrics();
579 if ((av.alignment.getAlignmentAnnotation() == null)
580 || (av.alignment.getAlignmentAnnotation().length < 1))
582 g.setColor(Color.white);
583 g.fillRect(0, 0, getSize().width, getSize().height);
584 g.setColor(Color.black);
585 if (av.validCharWidth)
587 g.drawString("Alignment has no annotations", 20, 15);
593 AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
600 int iconOffset = av.charHeight / 2;
601 boolean validRes = false;
602 boolean validEnd = false;
603 boolean labelAllCols = false;
604 boolean centreColLabels, centreColLabelsDef = av
605 .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
612 for (int i = 0; i < aa.length; i++)
614 AlignmentAnnotation row = aa[i];
620 centreColLabels = row.centreColLabels || centreColLabelsDef;
621 labelAllCols = row.showAllColLabels;
622 scaleColLabel = row.scaleColLabel;
628 if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
633 // this is so that we draw the characters below the graph
638 iconOffset = av.charHeight - fm.getDescent();
642 // TODO: else is the logic used in application, applet had no 'else'
643 else if (row.hasText)
645 iconOffset = av.charHeight - fm.getDescent();
654 while (x < endRes - startRes)
656 if (av.hasHiddenColumns)
658 column = av.getColumnSelection().adjustForHiddenColumns(
660 if (column > row.annotations.length - 1)
667 column = startRes + x;
670 if ((row.annotations.length <= column)
671 || (row.annotations[column] == null))
682 g.setColor(Color.red);
684 if (av.getColumnSelection() != null)
686 for (int n = 0; n < av.getColumnSelection().size(); n++)
688 int v = av.getColumnSelection().columnAt(n);
693 .fillRect(x * av.charWidth, y, av.charWidth,
700 if (av.validCharWidth
702 && (row.annotations[column].displayCharacter != null && row.annotations[column].displayCharacter
706 if (centreColLabels || scaleColLabel)
708 fmWidth = (float) fm.charsWidth(
709 row.annotations[column].displayCharacter.toCharArray(),
710 0, row.annotations[column].displayCharacter.length());
714 // justify the label and scale to fit in column
715 if (fmWidth > av.charWidth)
717 // scale only if the current font isn't already small enough
718 fmScaling = av.charWidth;
719 fmScaling /= fmWidth;
720 // not 1.1 // g.setFont(new
721 // Font(ofont,AffineTransform.getScaleInstance(fmScaling,
723 // and update the label's width to reflect the scaling.
724 fmWidth = av.charWidth;
731 .charWidth(row.annotations[column].displayCharacter
734 charOffset = (int) ((av.charWidth - fmWidth) / 2f);
736 if (row.annotations[column].colour == null)
737 g.setColor(Color.black);
739 g.setColor(row.annotations[column].colour);
741 if (column == 0 || row.graph > 0)
743 g.drawString(row.annotations[column].displayCharacter,
744 (x * av.charWidth) + charOffset, y + iconOffset + 3); // +
747 else if (row.annotations[column - 1] == null
749 || !row.annotations[column].displayCharacter
750 .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
751 .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
753 g.drawString(row.annotations[column].displayCharacter,
754 (x * av.charWidth) + charOffset, y + iconOffset + 3); // +3?
762 || (row.annotations[column].secondaryStructure != lastSS))
767 g.setColor(HELIX_COLOUR);
770 // Off by 1 offset when drawing rects and ovals
771 // to offscreen image on the MAC
772 g.fillRoundRect(lastSSX, y + 4 + iconOffset,
773 (x * av.charWidth) - lastSSX, 7, 8, 8);
777 int sCol = (lastSSX / av.charWidth) + startRes;
779 int x2 = (x * av.charWidth);
782 || row.annotations[sCol - 1] == null
783 || row.annotations[sCol - 1].secondaryStructure != 'H')
785 g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
787 x1 += av.charWidth / 2;
790 if (!validRes || row.annotations[column] == null
791 || row.annotations[column].secondaryStructure != 'H')
793 g.fillArc((x * av.charWidth) - av.charWidth, y + 4
794 + iconOffset, av.charWidth, 8, 270, 180);
795 x2 -= av.charWidth / 2;
798 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
802 g.setColor(SHEET_COLOUR);
803 g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
805 g.fillPolygon(new int[]
806 { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
807 (x * av.charWidth) }, new int[]
808 { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
814 g.setColor(Color.gray);
815 g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
823 lastSS = row.annotations[column].secondaryStructure;
830 lastSSX = (x * av.charWidth);
838 if (column >= row.annotations.length)
840 column = row.annotations.length - 1;
855 g.setColor(HELIX_COLOUR);
858 // Off by 1 offset when drawing rects and ovals
859 // to offscreen image on the MAC
860 g.fillRoundRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
865 int sCol = (lastSSX / av.charWidth) + startRes;
867 int x2 = (x * av.charWidth);
869 if (sCol == 0 || row.annotations[sCol - 1] == null
870 || row.annotations[sCol - 1].secondaryStructure != 'H')
873 .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8,
875 x1 += av.charWidth / 2;
878 if (row.annotations[column] == null
879 || row.annotations[column].secondaryStructure != 'H')
881 g.fillArc((x * av.charWidth) - av.charWidth,
882 y + 4 + iconOffset, av.charWidth, 8, 270, 180);
883 x2 -= av.charWidth / 2;
886 g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
891 g.setColor(SHEET_COLOUR);
893 if (!validEnd || row.annotations[endRes] == null
894 || row.annotations[endRes].secondaryStructure != 'E')
896 g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
898 g.fillPolygon(new int[]
899 { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
900 (x * av.charWidth) }, new int[]
901 { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, 3);
905 g.fillRect(lastSSX, y + 4 + iconOffset, x * av.charWidth
911 g.setColor(Color.gray);
912 if (!av.wrapAlignment || endRes == av.endRes)
914 g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
922 if (row.graph > 0 && row.graphHeight > 0)
924 if (row.graph == AlignmentAnnotation.LINE_GRAPH)
926 if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
928 float groupmax = -999999, groupmin = 9999999;
929 for (int gg = 0; gg < aa.length; gg++)
931 if (aa[gg].graphGroup != row.graphGroup)
938 aa[gg].visible = false;
941 if (aa[gg].graphMax > groupmax)
943 groupmax = aa[gg].graphMax;
945 if (aa[gg].graphMin < groupmin)
947 groupmin = aa[gg].graphMin;
951 for (int gg = 0; gg < aa.length; gg++)
953 if (aa[gg].graphGroup == row.graphGroup)
955 drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
956 groupmax, row.graphHeight);
960 graphGroupDrawn[row.graphGroup] = true;
964 drawLineGraph(g, row, startRes, endRes, y, row.graphMin,
965 row.graphMax, row.graphHeight);
968 else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
970 drawBarGraph(g, row, startRes, endRes, row.graphMin,
975 if (row.graph > 0 && row.hasText)
987 public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes,
988 int eRes, int y, float min, float max, int graphHeight)
990 if (sRes > aa.annotations.length)
997 // Adjustment for fastpaint to left
998 if (eRes < av.endRes)
1003 eRes = Math.min(eRes, aa.annotations.length);
1006 float range = max - min;
1011 y2 = y - (int) ((0 - min / range) * graphHeight);
1014 g.setColor(Color.gray);
1015 g.drawLine(x - av.charWidth, y2, (eRes - sRes) * av.charWidth, y2);
1017 eRes = Math.min(eRes, aa.annotations.length);
1020 int aaMax = aa.annotations.length - 1;
1022 while (x < eRes - sRes)
1025 if (av.hasHiddenColumns)
1027 column = av.getColumnSelection().adjustForHiddenColumns(column);
1035 if (aa.annotations[column] == null) // || coaa.annotations[column - 1] ==
1042 if (aa.annotations[column].colour == null)
1043 g.setColor(Color.black);
1045 g.setColor(aa.annotations[column].colour);
1046 if (column == 0 || aa.annotations[column - 1] == null)
1049 - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
1054 - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
1057 - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
1059 g.drawLine(x * av.charWidth - av.charWidth / 2, y1, x * av.charWidth
1060 + av.charWidth / 2, y2);
1064 if (aa.threshold != null)
1066 g.setColor(aa.threshold.colour);
1068 y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
1069 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1073 public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes,
1074 int eRes, float min, float max, int y)
1076 ColourSchemeI profcolour = av.getGlobalColourScheme();
1077 if (profcolour == null)
1079 profcolour = new jalview.schemes.ZappoColourScheme();
1081 if (sRes > aa.annotations.length)
1085 Font ofont = g.getFont();
1086 eRes = Math.min(eRes, aa.annotations.length);
1088 int x = 0, y1 = y, y2 = y;
1090 float range = max - min;
1094 y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
1097 g.setColor(Color.gray);
1099 g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
1102 int aaMax = aa.annotations.length - 1;
1103 boolean renderHistogram = true, renderProfile = false;
1105 * Logos are disabled for 2.5 release : Bug # 0060064 if (aa.autoCalculated
1106 * && aa.label.startsWith("Consensus")) { // TODO: generalise this to have
1107 * render styles for consensus/profile data if (aa.groupRef!=null) {
1108 * renderHistogram = aa.groupRef.isShowConsensusHistogram(); renderProfile =
1109 * aa.groupRef.isShowSequenceLogo(); } else { renderHistogram =
1110 * av.isShowConsensusHistogram(); renderProfile = av.isShowSequenceLogo(); }
1113 while (x < eRes - sRes)
1116 if (av.hasHiddenColumns)
1118 column = av.getColumnSelection().adjustForHiddenColumns(column);
1126 if (aa.annotations[column] == null)
1132 if (aa.annotations[column].colour == null)
1133 g.setColor(Color.black);
1135 g.setColor(aa.annotations[column].colour);
1138 - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
1140 if (renderHistogram)
1144 g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
1148 g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
1151 // draw profile if available
1152 // Disabled for 2.5 release: see bug #0060064
1154 * if (aa.annotations[column].value!=0 && renderProfile) { int profl[] =
1155 * getProfileFor(aa,column); int ht = y1; //,htn=y2-y1;//aa.graphHeight;
1156 * float wdth; double ht2=0; char[] dc = new char[1]; // LineMetrics lm;
1157 * for (int c=1;profl!=null && c<profl[0];) { dc[0] = (char) profl[c++];
1158 * wdth = av.charWidth; wdth/=(float) fm .charsWidth(dc,0,1);
1160 * if (c>2) { ht+=(int)ht2; } { // not java 1.1 compatible: Bug # 0060064
1161 * g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(wdth,
1162 * (ht2=(htn*((double)profl[c++])/100.0))/av.charHeight))); lm =
1163 * g.getFontMetrics().getLineMetrics(dc,0,1, g);
1164 * g.setColor(profcolour.findColour(dc[0]));
1165 * g.drawChars(dc,0,1,x*av.charWidth, (int) (ht+lm.getHeight())); } }
1166 * g.setFont(ofont); }
1171 if (aa.threshold != null)
1173 g.setColor(aa.threshold.colour);
1174 y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
1175 g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
1180 * Disabled for 2.5 release - see bug #0060064 private int[]
1181 * getProfileFor(AlignmentAnnotation aa, int column) { // if
1182 * (aa.autoCalculated && aa.label.startsWith("Consensus")) { if
1183 * (aa.groupRef!=null && aa.groupRef.consensusData!=null) { // &&
1184 * aa.groupRef.isShowSequenceLogo()) { return
1185 * AAFrequency.extractProfile(aa.groupRef
1186 * .consensusData[column],aa.groupRef.getIgnoreGapsConsensus()); } // TODO
1187 * extend annotation row to enable dynamic and static profile data to be
1188 * stored if (aa.groupRef==null && aa.sequenceRef==null) // &&
1189 * av.isShowSequenceLogo()) { return
1190 * AAFrequency.extractProfile(av.hconsensus[column
1191 * ],av.getIgnoreGapsConsensus()); } // } return null; }
1194 // used by overview window
1195 public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
1196 int y, int sRes, int eRes)
1198 eRes = Math.min(eRes, aa.annotations.length);
1199 g.setColor(Color.white);
1200 g.fillRect(0, 0, width, y);
1201 g.setColor(new Color(0, 0, 180));
1205 for (int j = sRes; j < eRes; j++)
1207 if (aa.annotations[j].colour == null)
1208 g.setColor(Color.black);
1210 g.setColor(aa.annotations[j].colour);
1212 height = (int) ((aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);
1217 g.fillRect(x, y - height, av.charWidth, height);