2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3 * Copyright (C) 2008 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
25 import java.awt.event.*;
26 import java.awt.print.*;
29 import jalview.datamodel.*;
30 import jalview.jbgui.*;
31 import jalview.schemes.*;
39 public class AlignmentPanel extends GAlignmentPanel implements
40 AdjustmentListener, Printable
42 public AlignViewport av;
44 OverviewPanel overviewPanel;
50 IdwidthAdjuster idwidthAdjuster;
53 public AlignFrame alignFrame;
55 ScalePanel scalePanel;
57 AnnotationPanel annotationPanel;
59 AnnotationLabels alabels;
61 // this value is set false when selection area being dragged
62 boolean fastPaint = true;
69 * Creates a new AlignmentPanel object.
76 public AlignmentPanel(AlignFrame af, final AlignViewport av)
80 seqPanel = new SeqPanel(av, this);
81 idPanel = new IdPanel(av, this);
83 scalePanel = new ScalePanel(av, this);
85 idPanelHolder.add(idPanel, BorderLayout.CENTER);
86 idwidthAdjuster = new IdwidthAdjuster(this);
87 idSpaceFillerPanel1.add(idwidthAdjuster, BorderLayout.CENTER);
89 annotationPanel = new AnnotationPanel(this);
90 alabels = new AnnotationLabels(this);
92 annotationScroller.setViewportView(annotationPanel);
93 annotationSpaceFillerHolder.add(alabels, BorderLayout.CENTER);
95 scalePanelHolder.add(scalePanel, BorderLayout.CENTER);
96 seqPanelHolder.add(seqPanel, BorderLayout.CENTER);
98 setScrollValues(0, 0);
100 setAnnotationVisible(av.getShowAnnotation());
102 hscroll.addAdjustmentListener(this);
103 vscroll.addAdjustmentListener(this);
105 final AlignmentPanel ap = this;
106 av.addPropertyChangeListener(new PropertyChangeListener()
108 public void propertyChange(PropertyChangeEvent evt)
110 if (evt.getPropertyName().equals("alignment"))
112 PaintRefresher.Refresh(ap, av.getSequenceSetId(), true, true);
119 adjustAnnotationHeight();
123 public void alignmentChanged()
125 av.alignmentChanged(this);
127 alignFrame.updateEditMenuBar();
129 paintAlignment(true);
136 public void fontChanged()
138 // set idCanvas bufferedImage to null
139 // to prevent drawing old image
140 FontMetrics fm = getFontMetrics(av.getFont());
142 scalePanelHolder.setPreferredSize(new Dimension(10, av.charHeight
144 idSpaceFillerPanel1.setPreferredSize(new Dimension(10, av.charHeight
147 idPanel.idCanvas.gg = null;
148 seqPanel.seqCanvas.img = null;
149 annotationPanel.adjustPanelHeight();
151 Dimension d = calculateIdWidth();
152 d.setSize(d.width + 4, d.height);
153 idPanel.idCanvas.setPreferredSize(d);
154 hscrollFillerPanel.setPreferredSize(d);
156 if (overviewPanel != null)
158 overviewPanel.setBoxPosition();
165 * Calculate the width of the alignment labels based on the displayed names
166 * and any bounds on label width set in preferences.
168 * @return Dimension giving the maximum width of the alignment label panel
169 * that should be used.
171 public Dimension calculateIdWidth()
173 Container c = new Container();
175 FontMetrics fm = c.getFontMetrics(new Font(av.font.getName(),
176 Font.ITALIC, av.font.getSize()));
178 AlignmentI al = av.getAlignment();
179 int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
180 int maxwidth = Math.max(20, Math.min(afwidth - 200, (int) 2 * afwidth
186 while ((i < al.getHeight()) && (al.getSequenceAt(i) != null))
188 SequenceI s = al.getSequenceAt(i);
190 id = s.getDisplayId(av.getShowJVSuffix());
192 if (fm.stringWidth(id) > idWidth)
194 idWidth = fm.stringWidth(id);
200 // Also check annotation label widths
203 if (al.getAlignmentAnnotation() != null)
205 fm = c.getFontMetrics(alabels.getFont());
207 while (i < al.getAlignmentAnnotation().length)
209 String label = al.getAlignmentAnnotation()[i].label;
211 if (fm.stringWidth(label) > idWidth)
213 idWidth = fm.stringWidth(label);
220 return new Dimension(Math.min(maxwidth, idWidth), 12);
229 public void highlightSearchResults(SearchResults results)
231 seqPanel.seqCanvas.highlightSearchResults(results);
233 // do we need to scroll the panel?
236 SequenceI seq = results.getResultSequence(0);
237 int seqIndex = av.alignment.findIndex(seq);
238 int start = seq.findIndex(results.getResultStart(0)) - 1;
239 int end = seq.findIndex(results.getResultEnd(0)) - 1;
241 if (!av.wrapAlignment)
243 if ((av.getStartRes() > end)
244 || (av.getEndRes() < start)
245 || ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
247 setScrollValues(start, seqIndex);
252 scrollToWrappedVisible(start);
256 paintAlignment(true);
259 void scrollToWrappedVisible(int res)
261 int cwidth = seqPanel.seqCanvas
262 .getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());
263 if (res <= av.getStartRes() || res >= (av.getStartRes() + cwidth))
265 vscroll.setValue(res / cwidth);
266 av.startRes = vscroll.getValue() * cwidth;
273 * @return DOCUMENT ME!
275 public OverviewPanel getOverviewPanel()
277 return overviewPanel;
286 public void setOverviewPanel(OverviewPanel op)
297 public void setAnnotationVisible(boolean b)
299 if (!av.wrapAlignment)
301 annotationSpaceFillerHolder.setVisible(b);
302 annotationScroller.setVisible(b);
307 public void adjustAnnotationHeight()
309 // TODO: display vertical annotation scrollbar if necessary
310 // this is called after loading new annotation onto alignment
311 if (alignFrame.getHeight() == 0)
313 System.out.println("NEEDS FIXING");
316 int height = annotationPanel.adjustPanelHeight();
318 if (hscroll.isVisible())
320 height += hscroll.getPreferredSize().height;
322 if (height > alignFrame.getHeight() / 2)
324 height = alignFrame.getHeight() / 2;
329 annotationScroller.setPreferredSize(new Dimension(annotationScroller
330 .getWidth(), height));
332 annotationSpaceFillerHolder.setPreferredSize(new Dimension(
333 annotationSpaceFillerHolder.getWidth(), height));
334 annotationScroller.validate();// repaint();
344 public void setWrapAlignment(boolean wrap)
347 scalePanelHolder.setVisible(!wrap);
348 hscroll.setVisible(!wrap);
349 idwidthAdjuster.setVisible(!wrap);
353 annotationScroller.setVisible(false);
354 annotationSpaceFillerHolder.setVisible(false);
356 else if (av.showAnnotation)
358 annotationScroller.setVisible(true);
359 annotationSpaceFillerHolder.setVisible(true);
362 idSpaceFillerPanel1.setVisible(!wrap);
367 // return value is true if the scroll is valid
368 public boolean scrollUp(boolean up)
372 if (vscroll.getValue() < 1)
378 vscroll.setValue(vscroll.getValue() - 1);
382 if ((vextent + vscroll.getValue()) >= av.getAlignment().getHeight())
388 vscroll.setValue(vscroll.getValue() + 1);
402 * @return DOCUMENT ME!
404 public boolean scrollRight(boolean right)
408 if (hscroll.getValue() < 1)
414 hscroll.setValue(hscroll.getValue() - 1);
418 if ((hextent + hscroll.getValue()) >= av.getAlignment().getWidth())
424 hscroll.setValue(hscroll.getValue() + 1);
440 public void setScrollValues(int x, int y)
443 int width = av.alignment.getWidth();
444 int height = av.alignment.getHeight();
446 if (av.hasHiddenColumns)
448 width = av.getColumnSelection().findColumnPosition(width);
451 av.setEndRes((x + (seqPanel.seqCanvas.getWidth() / av.charWidth)) - 1);
453 hextent = seqPanel.seqCanvas.getWidth() / av.charWidth;
454 vextent = seqPanel.seqCanvas.getHeight() / av.charHeight;
461 if (vextent > height)
466 if ((hextent + x) > width)
471 if ((vextent + y) > height)
473 y = height - vextent;
486 hscroll.setValues(x, hextent, 0, width);
487 vscroll.setValues(y, vextent, 0, height);
496 public void adjustmentValueChanged(AdjustmentEvent evt)
499 int oldX = av.getStartRes();
500 int oldY = av.getStartSeq();
502 if (evt.getSource() == hscroll)
504 int x = hscroll.getValue();
507 .setEndRes((x + (seqPanel.seqCanvas.getWidth() / av
508 .getCharWidth())) - 1);
511 if (evt.getSource() == vscroll)
513 int offy = vscroll.getValue();
515 if (av.getWrapAlignment())
519 int rowSize = seqPanel.seqCanvas
520 .getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());
521 av.setStartRes(offy * rowSize);
522 av.setEndRes((offy + 1) * rowSize);
526 // This is only called if file loaded is a jar file that
527 // was wrapped when saved and user has wrap alignment true
528 // as preference setting
529 SwingUtilities.invokeLater(new Runnable()
533 setScrollValues(av.getStartRes(), av.getStartSeq());
540 av.setStartSeq(offy);
542 + (seqPanel.seqCanvas.getHeight() / av.getCharHeight()));
546 if (overviewPanel != null)
548 overviewPanel.setBoxPosition();
551 int scrollX = av.startRes - oldX;
552 int scrollY = av.startSeq - oldY;
554 if (av.getWrapAlignment() || !fastPaint)
560 // Make sure we're not trying to draw a panel
561 // larger than the visible window
562 if (scrollX > av.endRes - av.startRes)
564 scrollX = av.endRes - av.startRes;
566 else if (scrollX < av.startRes - av.endRes)
568 scrollX = av.startRes - av.endRes;
571 if (scrollX != 0 || scrollY != 0)
573 idPanel.idCanvas.fastPaint(scrollY);
574 seqPanel.seqCanvas.fastPaint(scrollX, scrollY);
575 scalePanel.repaint();
577 if (av.getShowAnnotation())
579 annotationPanel.fastPaint(scrollX);
585 public void paintAlignment(boolean updateOverview)
591 jalview.structure.StructureSelectionManager
592 .getStructureSelectionManager().sequenceColoursChanged(this);
594 if (overviewPanel != null)
596 overviewPanel.updateOverviewImage();
607 public void paintComponent(Graphics g)
611 Dimension d = idPanel.idCanvas.getPreferredSize();
612 idPanelHolder.setPreferredSize(d);
613 hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));
616 if (av.getWrapAlignment())
618 int maxwidth = av.alignment.getWidth();
620 if (av.hasHiddenColumns)
622 maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
625 int canvasWidth = seqPanel.seqCanvas
626 .getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());
631 .getWrappedCanvasWidth(seqPanel.seqCanvas
633 vscroll.setMaximum(max);
634 vscroll.setUnitIncrement(1);
635 vscroll.setVisibleAmount(1);
640 setScrollValues(av.getStartRes(), av.getStartSeq());
654 * @return DOCUMENT ME!
656 * @throws PrinterException
659 public int print(Graphics pg, PageFormat pf, int pi)
660 throws PrinterException
662 pg.translate((int) pf.getImageableX(), (int) pf.getImageableY());
664 int pwidth = (int) pf.getImageableWidth();
665 int pheight = (int) pf.getImageableHeight();
667 if (av.getWrapAlignment())
669 return printWrappedAlignment(pg, pwidth, pheight, pi);
673 return printUnwrapped(pg, pwidth, pheight, pi);
689 * @return DOCUMENT ME!
691 * @throws PrinterException
694 public int printUnwrapped(Graphics pg, int pwidth, int pheight, int pi)
695 throws PrinterException
697 int idWidth = getVisibleIdWidth();
698 FontMetrics fm = getFontMetrics(av.getFont());
699 int scaleHeight = av.charHeight + fm.getDescent();
701 pg.setColor(Color.white);
702 pg.fillRect(0, 0, pwidth, pheight);
703 pg.setFont(av.getFont());
705 // //////////////////////////////////
706 // / How many sequences and residues can we fit on a printable page?
707 int totalRes = (pwidth - idWidth) / av.getCharWidth();
709 int totalSeq = (int) ((pheight - scaleHeight) / av.getCharHeight()) - 1;
711 int pagesWide = (av.getAlignment().getWidth() / totalRes) + 1;
713 // ///////////////////////////
714 // / Only print these sequences and residues on this page
717 // ///////////////////////////
718 // / Only print these sequences and residues on this page
721 // ///////////////////////////
722 // / Only print these sequences and residues on this page
725 // ///////////////////////////
726 // / Only print these sequences and residues on this page
728 startRes = (pi % pagesWide) * totalRes;
729 endRes = (startRes + totalRes) - 1;
731 if (endRes > (av.getAlignment().getWidth() - 1))
733 endRes = av.getAlignment().getWidth() - 1;
736 startSeq = (pi / pagesWide) * totalSeq;
737 endSeq = startSeq + totalSeq;
739 if (endSeq > av.getAlignment().getHeight())
741 endSeq = av.getAlignment().getHeight();
744 int pagesHigh = ((av.alignment.getHeight() / totalSeq) + 1) * pheight;
746 if (av.showAnnotation)
748 pagesHigh += annotationPanel.adjustPanelHeight() + 3;
751 pagesHigh /= pheight;
753 if (pi >= (pagesWide * pagesHigh))
755 return Printable.NO_SUCH_PAGE;
759 pg.translate(idWidth, 0);
760 scalePanel.drawScale(pg, startRes, endRes, pwidth - idWidth,
762 pg.translate(-idWidth, scaleHeight);
766 Color currentColor = null;
767 Color currentTextColor = null;
769 pg.setFont(idPanel.idCanvas.idfont);
772 for (int i = startSeq; i < endSeq; i++)
774 seq = av.getAlignment().getSequenceAt(i);
775 if ((av.getSelectionGroup() != null)
776 && av.getSelectionGroup().getSequences(null).contains(seq))
778 currentColor = Color.gray;
779 currentTextColor = Color.black;
783 currentColor = av.getSequenceColour(seq);
784 currentTextColor = Color.black;
787 pg.setColor(currentColor);
788 pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth, av
791 pg.setColor(currentTextColor);
794 if (av.rightAlignIds)
796 fm = pg.getFontMetrics();
798 - fm.stringWidth(seq.getDisplayId(av.getShowJVSuffix()))
802 pg.drawString(seq.getDisplayId(av.getShowJVSuffix()), xPos,
803 (((i - startSeq) * av.charHeight) + av.getCharHeight())
804 - (av.getCharHeight() / 5));
807 pg.setFont(av.getFont());
809 // draw main sequence panel
810 pg.translate(idWidth, 0);
811 seqPanel.seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq, 0);
813 if (av.showAnnotation && (endSeq == av.alignment.getHeight()))
815 pg.translate(-idWidth - 3, (endSeq - startSeq) * av.charHeight + 3);
816 alabels.drawComponent((Graphics2D) pg, idWidth);
817 pg.translate(idWidth + 3, 0);
818 annotationPanel.drawComponent((Graphics2D) pg, startRes, endRes + 1);
821 return Printable.PAGE_EXISTS;
836 * @return DOCUMENT ME!
838 * @throws PrinterException
841 public int printWrappedAlignment(Graphics pg, int pwidth, int pheight,
842 int pi) throws PrinterException
845 int annotationHeight = 0;
846 AnnotationLabels labels = null;
847 if (av.showAnnotation)
849 annotationHeight = annotationPanel.adjustPanelHeight();
850 labels = new AnnotationLabels(av);
853 int hgap = av.charHeight;
854 if (av.scaleAboveWrapped)
856 hgap += av.charHeight;
859 int cHeight = av.getAlignment().getHeight() * av.charHeight + hgap
862 int idWidth = getVisibleIdWidth();
864 int maxwidth = av.alignment.getWidth();
865 if (av.hasHiddenColumns)
867 maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
870 int resWidth = seqPanel.seqCanvas.getWrappedCanvasWidth(pwidth
873 int totalHeight = cHeight * (maxwidth / resWidth + 1);
875 pg.setColor(Color.white);
876 pg.fillRect(0, 0, pwidth, pheight);
877 pg.setFont(av.getFont());
881 pg.setColor(Color.black);
883 pg.translate(0, -pi * pheight);
885 pg.setClip(0, pi * pheight, pwidth, pheight);
891 for (int i = 0; i < av.alignment.getHeight(); i++)
893 pg.setFont(idPanel.idCanvas.idfont);
894 SequenceI s = av.alignment.getSequenceAt(i);
895 String string = s.getDisplayId(av.getShowJVSuffix());
897 if (av.rightAlignIds)
899 FontMetrics fm = pg.getFontMetrics();
900 xPos = idWidth - fm.stringWidth(string) - 4;
902 pg.drawString(string, xPos,
903 ((i * av.charHeight) + ypos + av.charHeight)
904 - (av.charHeight / 5));
908 pg.translate(-3, ypos
909 + (av.getAlignment().getHeight() * av.charHeight));
911 pg.setFont(av.getFont());
912 labels.drawComponent(pg, idWidth);
913 pg.translate(+3, -ypos
914 - (av.getAlignment().getHeight() * av.charHeight));
918 } while (ypos < totalHeight);
920 pg.translate(idWidth, 0);
922 seqPanel.seqCanvas.drawWrappedPanel(pg, pwidth - idWidth, totalHeight,
925 if ((pi * pheight) < totalHeight)
927 return Printable.PAGE_EXISTS;
932 return Printable.NO_SUCH_PAGE;
936 int getVisibleIdWidth()
938 return idPanel.getWidth() > 0 ? idPanel.getWidth()
939 : calculateIdWidth().width + 4;
942 void makeAlignmentImage(int type, File file)
944 int maxwidth = av.alignment.getWidth();
945 if (av.hasHiddenColumns)
947 maxwidth = av.getColumnSelection().findColumnPosition(maxwidth);
950 int height = ((av.alignment.getHeight() + 1) * av.charHeight)
951 + scalePanel.getHeight();
952 int width = getVisibleIdWidth() + (maxwidth * av.charWidth);
954 if (av.getWrapAlignment())
956 height = getWrappedHeight();
957 if (System.getProperty("java.awt.headless") != null
958 && System.getProperty("java.awt.headless").equals("true"))
960 width = alignFrame.getWidth() - vscroll.getPreferredSize().width
961 - alignFrame.getInsets().left
962 - alignFrame.getInsets().right;
966 width = seqPanel.getWidth() + getVisibleIdWidth();
970 else if (av.getShowAnnotation())
972 height += annotationPanel.adjustPanelHeight() + 3;
978 jalview.util.ImageMaker im;
979 if (type == jalview.util.ImageMaker.PNG)
981 im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.PNG,
982 "Create PNG image from alignment", width, height, file,
987 im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.EPS,
988 "Create EPS file from alignment", width, height, file,
989 alignFrame.getTitle());
992 if (av.getWrapAlignment())
994 if (im.getGraphics() != null)
996 printWrappedAlignment(im.getGraphics(), width, height, 0);
1002 if (im.getGraphics() != null)
1004 printUnwrapped(im.getGraphics(), width, height, 0);
1008 } catch (OutOfMemoryError err)
1011 System.out.println("########################\n" + "OUT OF MEMORY "
1012 + file + "\n" + "########################");
1013 new OOMWarning("Creating Image for " + file, err);
1014 // System.out.println("Create IMAGE: " + err);
1015 } catch (Exception ex)
1017 ex.printStackTrace();
1024 public void makeEPS(File epsFile)
1026 makeAlignmentImage(jalview.util.ImageMaker.EPS, epsFile);
1032 public void makePNG(File pngFile)
1034 makeAlignmentImage(jalview.util.ImageMaker.PNG, pngFile);
1037 public void makePNGImageMap(File imgMapFile, String imageName)
1039 // /////ONLY WORKS WITH NONE WRAPPED ALIGNMENTS
1040 // ////////////////////////////////////////////
1041 int idWidth = getVisibleIdWidth();
1042 FontMetrics fm = getFontMetrics(av.getFont());
1043 int scaleHeight = av.charHeight + fm.getDescent();
1046 // ////////////////////////////////
1047 if (imgMapFile != null)
1051 int s, sSize = av.alignment.getHeight(), res, alwidth = av.alignment
1052 .getWidth(), g, gSize, f, fSize, sy;
1053 StringBuffer text = new StringBuffer();
1054 PrintWriter out = new PrintWriter(new FileWriter(imgMapFile));
1055 out.println(jalview.io.HTMLOutput.getImageMapHTML());
1056 out.println("<img src=\"" + imageName
1057 + "\" border=\"0\" usemap=\"#Map\" >"
1058 + "<map name=\"Map\">");
1060 for (s = 0; s < sSize; s++)
1062 sy = s * av.charHeight + scaleHeight;
1064 SequenceI seq = av.alignment.getSequenceAt(s);
1065 SequenceFeature[] features = seq.getDatasetSequence()
1066 .getSequenceFeatures();
1067 SequenceGroup[] groups = av.alignment.findAllGroups(seq);
1068 for (res = 0; res < alwidth; res++)
1070 text = new StringBuffer();
1072 if (av.alignment.isNucleotide())
1074 obj = ResidueProperties.nucleotideName.get(seq.getCharAt(res)
1079 obj = ResidueProperties.aa2Triplet.get(seq.getCharAt(res)
1088 String triplet = obj.toString();
1089 int alIndex = seq.findPosition(res);
1090 gSize = groups.length;
1091 for (g = 0; g < gSize; g++)
1093 if (text.length() < 1)
1095 text.append("<area shape=\"rect\" coords=\""
1096 + (idWidth + res * av.charWidth) + "," + sy + ","
1097 + (idWidth + (res + 1) * av.charWidth) + ","
1098 + (av.charHeight + sy) + "\""
1099 + " onMouseOver=\"toolTip('" + alIndex + " "
1103 if (groups[g].getStartRes() < res
1104 && groups[g].getEndRes() > res)
1106 text.append("<br><em>" + groups[g].getName() + "</em>");
1110 if (features != null)
1112 if (text.length() < 1)
1114 text.append("<area shape=\"rect\" coords=\""
1115 + (idWidth + res * av.charWidth) + "," + sy + ","
1116 + (idWidth + (res + 1) * av.charWidth) + ","
1117 + (av.charHeight + sy) + "\""
1118 + " onMouseOver=\"toolTip('" + alIndex + " "
1121 fSize = features.length;
1122 for (f = 0; f < fSize; f++)
1125 if ((features[f].getBegin() <= seq.findPosition(res))
1126 && (features[f].getEnd() >= seq.findPosition(res)))
1128 if (features[f].getType().equals("disulfide bond"))
1130 if (features[f].getBegin() == seq.findPosition(res)
1131 || features[f].getEnd() == seq
1134 text.append("<br>disulfide bond "
1135 + features[f].getBegin() + ":"
1136 + features[f].getEnd());
1141 text.append("<br>");
1142 text.append(features[f].getType());
1143 if (features[f].getDescription() != null
1144 && !features[f].getType().equals(
1145 features[f].getDescription()))
1147 text.append(" " + features[f].getDescription());
1150 if (features[f].getValue("status") != null)
1152 text.append(" (" + features[f].getValue("status")
1160 if (text.length() > 1)
1162 text.append("')\"; onMouseOut=\"toolTip()\"; href=\"#\">");
1163 out.println(text.toString());
1167 out.println("</map></body></html>");
1170 } catch (Exception ex)
1172 ex.printStackTrace();
1174 } // /////////END OF IMAGE MAP
1178 int getWrappedHeight()
1180 int seqPanelWidth = seqPanel.seqCanvas.getWidth();
1182 if (System.getProperty("java.awt.headless") != null
1183 && System.getProperty("java.awt.headless").equals("true"))
1185 seqPanelWidth = alignFrame.getWidth() - getVisibleIdWidth()
1186 - vscroll.getPreferredSize().width
1187 - alignFrame.getInsets().left - alignFrame.getInsets().right;
1190 int chunkWidth = seqPanel.seqCanvas
1191 .getWrappedCanvasWidth(seqPanelWidth);
1193 int hgap = av.charHeight;
1194 if (av.scaleAboveWrapped)
1196 hgap += av.charHeight;
1199 int annotationHeight = 0;
1200 if (av.showAnnotation)
1202 annotationHeight = annotationPanel.adjustPanelHeight();
1205 int cHeight = av.getAlignment().getHeight() * av.charHeight + hgap
1208 int maxwidth = av.alignment.getWidth();
1209 if (av.hasHiddenColumns)
1211 maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
1214 int height = ((maxwidth / chunkWidth) + 1) * cHeight;