X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAnnotationLabels.java;h=2178e37ef8abb920386662214a112048dc40761c;hb=e716284ee3824cfc190e43eaa4f9335e3ac75637;hp=6df208815fe8f9e1b0d7a08e401f950169c06cb9;hpb=69dd054a99ba910b138e84c8db62a11ee7c3ef37;p=jalview.git diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 6df2088..2178e37 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) + * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * @@ -14,6 +14,7 @@ * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.gui; @@ -29,6 +30,7 @@ import javax.swing.*; import jalview.datamodel.*; import jalview.io.*; +import jalview.util.MessageManager; /** * DOCUMENT ME! @@ -530,7 +532,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, return; } - JPopupMenu pop = new JPopupMenu("Annotations"); + JPopupMenu pop = new JPopupMenu(MessageManager.getString("label.annotations")); JMenuItem item = new JMenuItem(ADDNEW); item.addActionListener(this); pop.add(item); @@ -831,6 +833,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, { drawComponent(g, false, width); } + + private final boolean debugRedraw = false; /** * Draw the full set of annotation Labels for the alignment at the given cursor * @@ -880,8 +884,6 @@ public class AnnotationLabels extends JPanel implements MouseListener, for (int i = 0; i < aa.length; i++) { visible = true; - g.setColor(Color.black); - if (!aa[i].visible) { hasHiddenRows = true; @@ -893,7 +895,9 @@ public class AnnotationLabels extends JPanel implements MouseListener, { if (!before) { - System.out.println("before vis: "+i); + if (debugRedraw) { + System.out.println("before vis: "+i); + } before=true; } // don't draw what isn't visible @@ -904,12 +908,16 @@ public class AnnotationLabels extends JPanel implements MouseListener, if (!after) { - System.out.println("Scroll offset: "+sOffset+" after vis: "+i); + if (debugRedraw) { + System.out.println("Scroll offset: "+sOffset+" after vis: "+i); + } after=true; } // don't draw what isn't visible continue; }} + g.setColor(Color.black); + offset = -aa[i].height / 2; if (aa[i].hasText) @@ -925,6 +933,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, if (aa[i].graphGroup > -1) { int groupSize = 0; + // TODO: JAL-1291 revise rendering model so the graphGroup map is computed efficiently for all visible labels for (int gg = 0; gg < aa.length; gg++) { if (aa[gg].graphGroup == aa[i].graphGroup) @@ -1002,8 +1011,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, if (!av.wrapAlignment && ((aa == null) || (aa.length < 1))) { - g.drawString("Right click", 2, 8); - g.drawString("to add annotation", 2, 18); + g.drawString(MessageManager.getString("label.right_click"), 2, 8); + g.drawString(MessageManager.getString("label.to_add_annotation"), 2, 18); } } }