2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.datamodel.Alignment;
24 import jalview.datamodel.AlignmentAnnotation;
25 import jalview.datamodel.Annotation;
26 import jalview.datamodel.Sequence;
27 import jalview.datamodel.SequenceGroup;
28 import jalview.datamodel.SequenceI;
29 import jalview.io.FormatAdapter;
30 import jalview.util.MessageManager;
32 import java.awt.Color;
33 import java.awt.Dimension;
35 import java.awt.FontMetrics;
36 import java.awt.Graphics;
37 import java.awt.Graphics2D;
38 import java.awt.Image;
39 import java.awt.MediaTracker;
40 import java.awt.RenderingHints;
41 import java.awt.Toolkit;
42 import java.awt.datatransfer.StringSelection;
43 import java.awt.event.ActionEvent;
44 import java.awt.event.ActionListener;
45 import java.awt.event.MouseEvent;
46 import java.awt.event.MouseListener;
47 import java.awt.event.MouseMotionListener;
48 import java.awt.geom.AffineTransform;
49 import java.awt.image.BufferedImage;
50 import java.util.ArrayList;
51 import java.util.Arrays;
52 import java.util.regex.Pattern;
54 import javax.swing.JCheckBoxMenuItem;
55 import javax.swing.JMenuItem;
56 import javax.swing.JPanel;
57 import javax.swing.JPopupMenu;
58 import javax.swing.SwingUtilities;
59 import javax.swing.ToolTipManager;
67 public class AnnotationLabels extends JPanel implements MouseListener,
68 MouseMotionListener, ActionListener
70 String TOGGLE_LABELSCALE = MessageManager.getString("label.scale_label_to_column");
72 String ADDNEW = MessageManager.getString("label.add_new_row");
74 String EDITNAME = MessageManager.getString("label.edit_label_description");
76 String HIDE = MessageManager.getString("label.hide_row");
78 String DELETE = MessageManager.getString("label.delete_row");
80 String SHOWALL = MessageManager.getString("label.show_all_hidden_rows");
82 String OUTPUT_TEXT = MessageManager.getString("label.export_annotation");
84 String COPYCONS_SEQ = MessageManager.getString("label.copy_consensus_sequence");
86 boolean resizePanel = false;
94 boolean resizing = false;
102 private int scrollOffset = 0;
104 Font font = new Font("Arial", Font.PLAIN, 11);
106 private boolean hasHiddenRows;
109 * Creates a new AnnotationLabels object.
114 public AnnotationLabels(AlignmentPanel ap)
118 ToolTipManager.sharedInstance().registerComponent(this);
120 java.net.URL url = getClass().getResource("/images/idwidth.gif");
125 temp = java.awt.Toolkit.getDefaultToolkit().createImage(url);
130 MediaTracker mt = new MediaTracker(this);
131 mt.addImage(temp, 0);
133 } catch (Exception ex)
137 BufferedImage bi = new BufferedImage(temp.getHeight(this),
138 temp.getWidth(this), BufferedImage.TYPE_INT_RGB);
139 Graphics2D g = (Graphics2D) bi.getGraphics();
140 g.rotate(Math.toRadians(90));
141 g.drawImage(temp, 0, -bi.getWidth(this), this);
144 addMouseListener(this);
145 addMouseMotionListener(this);
146 addMouseWheelListener(ap.getAnnotationPanel());
149 public AnnotationLabels(AlignViewport av)
160 public void setScrollOffset(int y)
167 * sets selectedRow to -2 if no annotation preset, -1 if no visible row is at
171 * coordinate position to search for a row
173 void getSelectedRow(int y)
176 AlignmentAnnotation[] aa = ap.av.getAlignment()
177 .getAlignmentAnnotation();
181 for (int i = 0; i < aa.length; i++)
189 height += aa[i].height;
207 public void actionPerformed(ActionEvent evt)
209 AlignmentAnnotation[] aa = ap.av.getAlignment()
210 .getAlignmentAnnotation();
212 if (evt.getActionCommand().equals(ADDNEW))
214 AlignmentAnnotation newAnnotation = new AlignmentAnnotation(null,
215 null, new Annotation[ap.av.getAlignment().getWidth()]);
217 if (!editLabelDescription(newAnnotation))
222 ap.av.getAlignment().addAnnotation(newAnnotation);
223 ap.av.getAlignment().setAnnotationIndex(newAnnotation, 0);
225 else if (evt.getActionCommand().equals(EDITNAME))
227 editLabelDescription(aa[selectedRow]);
230 else if (evt.getActionCommand().equals(HIDE))
232 aa[selectedRow].visible = false;
234 else if (evt.getActionCommand().equals(DELETE))
236 ap.av.getAlignment().deleteAnnotation(aa[selectedRow]);
238 else if (evt.getActionCommand().equals(SHOWALL))
240 for (int i = 0; i < aa.length; i++)
242 if (!aa[i].visible && aa[i].annotations != null)
244 aa[i].visible = true;
248 else if (evt.getActionCommand().equals(OUTPUT_TEXT))
250 new AnnotationExporter().exportAnnotations(ap,
251 new AlignmentAnnotation[]
252 { aa[selectedRow] });
254 else if (evt.getActionCommand().equals(COPYCONS_SEQ))
256 SequenceI cons = null;
257 if (aa[selectedRow].groupRef != null)
259 cons = aa[selectedRow].groupRef.getConsensusSeq();
263 cons = av.getConsensusSeq();
267 copy_annotseqtoclipboard(cons);
271 else if (evt.getActionCommand().equals(TOGGLE_LABELSCALE))
273 aa[selectedRow].scaleColLabel = !aa[selectedRow].scaleColLabel;
283 protected void refresh()
285 ap.validateAnnotationDimensions(false);
296 boolean editLabelDescription(AlignmentAnnotation annotation)
298 EditNameDialog dialog = new EditNameDialog(annotation.label,
299 annotation.description, " Annotation Name ",
300 "Annotation Description ", "Edit Annotation Name/Description",
308 annotation.label = dialog.getName();
310 String text = dialog.getDescription();
311 if (text != null && text.length() == 0)
315 annotation.description = text;
326 public void mousePressed(MouseEvent evt)
328 getSelectedRow(evt.getY() - getScrollOffset());
338 public void mouseReleased(MouseEvent evt)
340 int start = selectedRow;
341 getSelectedRow(evt.getY() - getScrollOffset());
342 int end = selectedRow;
346 // Swap these annotations
347 AlignmentAnnotation startAA = ap.av.getAlignment()
348 .getAlignmentAnnotation()[start];
351 end = ap.av.getAlignment().getAlignmentAnnotation().length - 1;
353 AlignmentAnnotation endAA = ap.av.getAlignment()
354 .getAlignmentAnnotation()[end];
356 ap.av.getAlignment().getAlignmentAnnotation()[end] = startAA;
357 ap.av.getAlignment().getAlignmentAnnotation()[start] = endAA;
363 ap.getAnnotationPanel().repaint();
372 public void mouseEntered(MouseEvent evt)
387 public void mouseExited(MouseEvent evt)
389 if (dragEvent == null)
402 public void mouseDragged(MouseEvent evt)
408 Dimension d = ap.annotationScroller.getPreferredSize();
409 int dif = evt.getY() - oldY;
411 dif /= ap.av.getCharHeight();
412 dif *= ap.av.getCharHeight();
414 if ((d.height - dif) > 20)
416 ap.annotationScroller.setPreferredSize(new Dimension(d.width,
418 d = ap.annotationSpaceFillerHolder.getPreferredSize();
419 ap.annotationSpaceFillerHolder.setPreferredSize(new Dimension(
420 d.width, d.height - dif));
421 ap.paintAlignment(true);
438 public void mouseMoved(MouseEvent evt)
440 resizePanel = evt.getY() < 10;
442 getSelectedRow(evt.getY() - getScrollOffset());
445 && ap.av.getAlignment().getAlignmentAnnotation().length > selectedRow)
447 AlignmentAnnotation aa = ap.av.getAlignment()
448 .getAlignmentAnnotation()[selectedRow];
450 StringBuffer desc = new StringBuffer();
451 if (aa.description != null
452 && !aa.description.equals("New description"))
454 // TODO: we could refactor and merge this code with the code in
455 // jalview.gui.SeqPanel.mouseMoved(..) that formats sequence feature
457 desc.append(aa.getDescription(true).trim());
458 // check to see if the description is an html fragment.
459 if (desc.length() < 6
460 || (desc.substring(0, 6).toLowerCase().indexOf("<html>") < 0))
462 // clean the description ready for embedding in html
463 desc = new StringBuffer(Pattern.compile("<").matcher(desc)
464 .replaceAll("<"));
465 desc.insert(0, "<html>");
469 // remove terminating html if any
470 int i = desc.substring(desc.length() - 7).toLowerCase()
471 .lastIndexOf("</html>");
474 desc.setLength(desc.length() - 7 + i);
479 desc.append("<br/>");
481 // if (aa.hasProperties())
483 // desc.append("<table>");
484 // for (String prop : aa.getProperties())
486 // desc.append("<tr><td>" + prop + "</td><td>"
487 // + aa.getProperty(prop) + "</td><tr>");
489 // desc.append("</table>");
494 // begin the tooltip's html fragment
495 desc.append("<html>");
498 // TODO: limit precision of score to avoid noise from imprecise
500 // (64.7 becomes 64.7+/some tiny value).
501 desc.append(" Score: " + aa.score);
504 if (desc.length() > 6)
506 desc.append("</html>");
507 this.setToolTipText(desc.toString());
511 this.setToolTipText(null);
522 public void mouseClicked(MouseEvent evt)
524 final AlignmentAnnotation[] aa = ap.av.getAlignment()
525 .getAlignmentAnnotation();
526 if (SwingUtilities.isLeftMouseButton(evt))
528 if (selectedRow > -1 && selectedRow < aa.length)
530 if (aa[selectedRow].groupRef != null)
532 if (evt.getClickCount() >= 2)
534 // todo: make the ap scroll to the selection - not necessary, first
535 // click highlights/scrolls, second selects
536 ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(null);
537 ap.av.setSelectionGroup(// new SequenceGroup(
538 aa[selectedRow].groupRef); // );
539 ap.paintAlignment(false);
540 PaintRefresher.Refresh(ap, ap.av.getSequenceSetId());
541 ap.av.sendSelection();
545 ap.getSeqPanel().ap.getIdPanel()
546 .highlightSearchResults(aa[selectedRow].groupRef
547 .getSequences(null));
551 else if (aa[selectedRow].sequenceRef != null)
553 if (evt.getClickCount() == 1)
555 ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(Arrays
556 .asList(new SequenceI[]
557 { aa[selectedRow].sequenceRef }));
559 else if (evt.getClickCount() >= 2)
561 ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(null);
562 SequenceGroup sg = ap.av.getSelectionGroup();
565 // we make a copy rather than edit the current selection if no modifiers pressed
566 // see Enhancement JAL-1557
567 if (!(evt.isControlDown() || evt.isShiftDown()))
569 sg = new SequenceGroup(sg);
571 sg.addSequence(aa[selectedRow].sequenceRef, false);
573 if (evt.isControlDown())
575 sg.addOrRemove(aa[selectedRow].sequenceRef, true);
577 // notionally, we should also add intermediate sequences from last added sequence ?
578 sg.addSequence(aa[selectedRow].sequenceRef, true);
582 sg = new SequenceGroup();
584 sg.setEndRes(ap.av.getAlignment().getWidth()-1);
585 sg.addSequence(aa[selectedRow].sequenceRef, false);
587 ap.av.setSelectionGroup(sg);
588 ap.av.sendSelection();
589 ap.paintAlignment(false);
590 PaintRefresher.Refresh(ap, ap.av.getSequenceSetId());
596 if (!SwingUtilities.isRightMouseButton(evt))
601 JPopupMenu pop = new JPopupMenu(
602 MessageManager.getString("label.annotations"));
603 JMenuItem item = new JMenuItem(ADDNEW);
604 item.addActionListener(this);
609 { // let the user make everything visible again
610 item = new JMenuItem(SHOWALL);
611 item.addActionListener(this);
614 pop.show(this, evt.getX(), evt.getY());
617 item = new JMenuItem(EDITNAME);
618 item.addActionListener(this);
620 item = new JMenuItem(HIDE);
621 item.addActionListener(this);
623 // JAL-1264 hide all sequence-specific annotations of this type
624 final String label = aa[selectedRow].label;
625 if (selectedRow < aa.length)
627 if (aa[selectedRow].sequenceRef != null)
629 JMenuItem hideType = new JMenuItem();
630 String text = MessageManager.getString("label.hide_all") + " " + label;
631 hideType.setText(text);
632 hideType.addActionListener(new ActionListener()
635 public void actionPerformed(ActionEvent e)
637 for (AlignmentAnnotation ann : ap.av.getAlignment()
638 .getAlignmentAnnotation())
640 if (ann.sequenceRef != null && ann.label != null
641 && ann.label.equals(label))
652 item = new JMenuItem(DELETE);
653 item.addActionListener(this);
657 item = new JMenuItem(SHOWALL);
658 item.addActionListener(this);
661 item = new JMenuItem(OUTPUT_TEXT);
662 item.addActionListener(this);
664 // TODO: annotation object should be typed for autocalculated/derived
666 if (selectedRow < aa.length)
668 if (!aa[selectedRow].autoCalculated)
670 if (aa[selectedRow].graph == AlignmentAnnotation.NO_GRAPH)
672 // display formatting settings for this row.
674 // av and sequencegroup need to implement same interface for
675 item = new JCheckBoxMenuItem(TOGGLE_LABELSCALE,
676 aa[selectedRow].scaleColLabel);
677 item.addActionListener(this);
681 else if (label.indexOf("Consensus") > -1)
684 // av and sequencegroup need to implement same interface for
685 final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(
686 MessageManager.getString("label.ignore_gaps_consensus"),
687 (aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef
688 .getIgnoreGapsConsensus() : ap.av
689 .isIgnoreGapsConsensus());
690 final AlignmentAnnotation aaa = aa[selectedRow];
691 cbmi.addActionListener(new ActionListener()
693 public void actionPerformed(ActionEvent e)
695 if (aaa.groupRef != null)
697 // TODO: pass on reference to ap so the view can be updated.
698 aaa.groupRef.setIgnoreGapsConsensus(cbmi.getState());
699 ap.getAnnotationPanel().paint(ap.getAnnotationPanel().getGraphics());
703 ap.av.setIgnoreGapsConsensus(cbmi.getState(), ap);
708 // av and sequencegroup need to implement same interface for
709 if (aaa.groupRef != null)
711 final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
712 MessageManager.getString("label.show_group_histogram"),
713 aa[selectedRow].groupRef.isShowConsensusHistogram());
714 chist.addActionListener(new ActionListener()
716 public void actionPerformed(ActionEvent e)
718 // TODO: pass on reference
724 aaa.groupRef.setShowConsensusHistogram(chist.getState());
726 // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
730 final JCheckBoxMenuItem cprofl = new JCheckBoxMenuItem(
731 MessageManager.getString("label.show_group_logo"),
732 aa[selectedRow].groupRef.isShowSequenceLogo());
733 cprofl.addActionListener(new ActionListener()
735 public void actionPerformed(ActionEvent e)
737 // TODO: pass on reference
743 aaa.groupRef.setshowSequenceLogo(cprofl.getState());
745 // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
749 final JCheckBoxMenuItem cproflnorm = new JCheckBoxMenuItem(
750 MessageManager.getString("label.normalise_group_logo"),
751 aa[selectedRow].groupRef.isNormaliseSequenceLogo());
752 cproflnorm.addActionListener(new ActionListener()
754 public void actionPerformed(ActionEvent e)
757 // TODO: pass on reference
763 aaa.groupRef.setNormaliseSequenceLogo(cproflnorm.getState());
764 // automatically enable logo display if we're clicked
765 aaa.groupRef.setshowSequenceLogo(true);
767 // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
774 final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
775 MessageManager.getString("label.show_histogram"), av.isShowConsensusHistogram());
776 chist.addActionListener(new ActionListener()
778 public void actionPerformed(ActionEvent e)
780 // TODO: pass on reference
786 av.setShowConsensusHistogram(chist.getState());
787 ap.alignFrame.setMenusForViewport();
789 // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
793 final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
794 MessageManager.getString("label.show_logo"), av.isShowSequenceLogo());
795 cprof.addActionListener(new ActionListener()
797 public void actionPerformed(ActionEvent e)
799 // TODO: pass on reference
805 av.setShowSequenceLogo(cprof.getState());
806 ap.alignFrame.setMenusForViewport();
808 // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
812 final JCheckBoxMenuItem cprofnorm = new JCheckBoxMenuItem(
813 MessageManager.getString("label.normalise_logo"), av.isNormaliseSequenceLogo());
814 cprofnorm.addActionListener(new ActionListener()
816 public void actionPerformed(ActionEvent e)
818 // TODO: pass on reference
824 av.setShowSequenceLogo(true);
825 av.setNormaliseSequenceLogo(cprofnorm.getState());
826 ap.alignFrame.setMenusForViewport();
828 // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
833 final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
834 consclipbrd.addActionListener(this);
835 pop.add(consclipbrd);
838 pop.show(this, evt.getX(), evt.getY());
842 * do a single sequence copy to jalview and the system clipboard
845 * sequence to be copied to clipboard
847 protected void copy_annotseqtoclipboard(SequenceI sq)
849 SequenceI[] seqs = new SequenceI[]
851 String[] omitHidden = null;
852 SequenceI[] dseqs = new SequenceI[]
853 { sq.getDatasetSequence() };
854 if (dseqs[0] == null)
856 dseqs[0] = new Sequence(sq);
857 dseqs[0].setSequence(jalview.analysis.AlignSeq.extractGaps(
858 jalview.util.Comparison.GapChars, sq.getSequenceAsString()));
860 sq.setDatasetSequence(dseqs[0]);
862 Alignment ds = new Alignment(dseqs);
863 if (av.hasHiddenColumns())
865 omitHidden = av.getColumnSelection().getVisibleSequenceStrings(0,
866 sq.getLength(), seqs);
869 String output = new FormatAdapter().formatSequences("Fasta", seqs,
872 Toolkit.getDefaultToolkit().getSystemClipboard()
873 .setContents(new StringSelection(output), Desktop.instance);
875 ArrayList<int[]> hiddenColumns = null;
876 if (av.hasHiddenColumns())
878 hiddenColumns = new ArrayList<int[]>();
879 for (int[] region : av.getColumnSelection().getHiddenColumns())
881 hiddenColumns.add(new int[]
882 { region[0], region[1] });
886 Desktop.jalviewClipboard = new Object[]
887 { seqs, ds, // what is the dataset of a consensus sequence ? need to flag
888 // sequence as special.
898 public void paintComponent(Graphics g)
901 int width = getWidth();
904 width = ap.calculateIdWidth().width + 4;
907 Graphics2D g2 = (Graphics2D) g;
910 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
911 RenderingHints.VALUE_ANTIALIAS_ON);
914 drawComponent(g2, true, width);
919 * Draw the full set of annotation Labels for the alignment at the given
923 * Graphics2D instance (needed for font scaling)
925 * Width for scaling labels
928 public void drawComponent(Graphics g, int width)
930 drawComponent(g, false, width);
933 private final boolean debugRedraw = false;
936 * Draw the full set of annotation Labels for the alignment at the given
940 * Graphics2D instance (needed for font scaling)
942 * - true indicates that only current visible area needs to be
945 * Width for scaling labels
947 public void drawComponent(Graphics g, boolean clip, int width)
949 if (av.getFont().getSize() < 10)
955 g.setFont(av.getFont());
958 FontMetrics fm = g.getFontMetrics(g.getFont());
959 g.setColor(Color.white);
960 g.fillRect(0, 0, getWidth(), getHeight());
962 g.translate(0, getScrollOffset());
963 g.setColor(Color.black);
965 AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
966 int fontHeight = g.getFont().getSize();
971 Font baseFont = g.getFont();
972 FontMetrics baseMetrics = fm;
973 int ofontH = fontHeight;
976 int[] visr = (ap != null && ap.getAnnotationPanel() != null) ? ap.getAnnotationPanel()
977 .getVisibleVRange() : null;
978 if (clip && visr != null)
983 boolean visible = true, before = false, after = false;
986 hasHiddenRows = false;
988 for (int i = 0; i < aa.length; i++)
993 hasHiddenRows = true;
1006 System.out.println("before vis: " + i);
1010 // don't draw what isn't visible
1013 if (olY > visHeight)
1020 System.out.println("Scroll offset: " + sOffset
1021 + " after vis: " + i);
1025 // don't draw what isn't visible
1029 g.setColor(Color.black);
1031 offset = -aa[i].height / 2;
1035 offset += fm.getHeight() / 2;
1036 offset -= fm.getDescent();
1040 offset += fm.getDescent();
1043 x = width - fm.stringWidth(aa[i].label) - 3;
1045 if (aa[i].graphGroup > -1)
1048 // TODO: JAL-1291 revise rendering model so the graphGroup map is
1049 // computed efficiently for all visible labels
1050 for (int gg = 0; gg < aa.length; gg++)
1052 if (aa[gg].graphGroup == aa[i].graphGroup)
1057 if (groupSize * (fontHeight + 8) < aa[i].height)
1059 graphExtras = (aa[i].height - (groupSize * (fontHeight + 8))) / 2;
1063 // scale font to fit
1064 float h = aa[i].height / (float) groupSize, s;
1071 fontHeight = -8 + (int) h;
1072 s = ((float) fontHeight) / (float) ofontH;
1073 Font f = baseFont.deriveFont(AffineTransform
1074 .getScaleInstance(s, s));
1076 fm = g.getFontMetrics();
1077 graphExtras = (aa[i].height - (groupSize * (fontHeight + 8))) / 2;
1082 for (int gg = 0; gg < aa.length; gg++)
1084 if (aa[gg].graphGroup == aa[i].graphGroup)
1086 x = width - fm.stringWidth(aa[gg].label) - 3;
1087 g.drawString(aa[gg].label, x, y - graphExtras);
1089 if (aa[gg]._linecolour != null)
1092 g.setColor(aa[gg]._linecolour);
1093 g.drawLine(x, y - graphExtras + 3,
1094 x + fm.stringWidth(aa[gg].label), y - graphExtras
1098 g.setColor(Color.black);
1099 graphExtras += fontHeight + 8;
1103 g.setFont(baseFont);
1105 fontHeight = ofontH;
1109 g.drawString(aa[i].label, x, y + offset);
1116 g.drawImage(image, 2, 0 - getScrollOffset(), this);
1118 else if (dragEvent != null && aa != null)
1120 g.setColor(Color.lightGray);
1121 g.drawString(aa[selectedRow].label, dragEvent.getX(),
1122 dragEvent.getY() - getScrollOffset());
1125 if (!av.getWrapAlignment() && ((aa == null) || (aa.length < 1)))
1127 g.drawString(MessageManager.getString("label.right_click"), 2, 8);
1128 g.drawString(MessageManager.getString("label.to_add_annotation"), 2,
1133 public int getScrollOffset()
1135 return scrollOffset;