X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationLabels.java;h=9c1db3d39cd21fe5dc38e98bf9059b46afd85516;hb=ab43013b7e357b84b4abade0dba949668dfb2a0e;hp=0c29840034c1629a0d54a385d1699d47b5c9af0c;hpb=32973e4c3a37dd4485c4190f45bbf43017af40df;p=jalview.git diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 0c29840..9c1db3d 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1) * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. @@ -47,6 +47,7 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; +import java.util.Arrays; import java.util.Vector; import java.util.regex.Pattern; @@ -477,29 +478,39 @@ public class AnnotationLabels extends JPanel implements MouseListener, { desc.append("
"); } - + // if (aa.hasProperties()) + // { + // desc.append(""); + // for (String prop : aa.getProperties()) + // { + // desc.append(""); + // } + // desc.append("
" + prop + "" + // + aa.getProperty(prop) + "
"); + // } } else { // begin the tooltip's html fragment desc.append(""); + if (aa.hasScore()) + { + // TODO: limit precision of score to avoid noise from imprecise + // doubles + // (64.7 becomes 64.7+/some tiny value). + desc.append(" Score: " + aa.score); + } } - if (aa.hasScore()) - { - // TODO: limit precision of score to avoid noise from imprecise doubles - // (64.7 becomes 64.7+/some tiny value). - desc.append(" Score: " + aa.score); - } - if (desc.length() > 6) { desc.append(""); this.setToolTipText(desc.toString()); } else + { this.setToolTipText(null); + } } - } /** @@ -672,7 +683,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, pop.addSeparator(); // av and sequencegroup need to implement same interface for final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem( - "Ignore Gaps In Consensus", + MessageManager.getString("label.ignore_gaps_consensus"), (aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef .getIgnoreGapsConsensus() : ap.av .getIgnoreGapsConsensus()); @@ -698,7 +709,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, if (aaa.groupRef != null) { final JCheckBoxMenuItem chist = new JCheckBoxMenuItem( - "Show Group Histogram", + MessageManager.getString("label.show_group_histogram"), aa[selectedRow].groupRef.isShowConsensusHistogram()); chist.addActionListener(new ActionListener() { @@ -717,7 +728,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(chist); final JCheckBoxMenuItem cprofl = new JCheckBoxMenuItem( - "Show Group Logo", + MessageManager.getString("label.show_group_logo"), aa[selectedRow].groupRef.isShowSequenceLogo()); cprofl.addActionListener(new ActionListener() { @@ -736,7 +747,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(cprofl); final JCheckBoxMenuItem cproflnorm = new JCheckBoxMenuItem( - "Normalise Group Logo", + MessageManager.getString("label.normalise_group_logo"), aa[selectedRow].groupRef.isNormaliseSequenceLogo()); cproflnorm.addActionListener(new ActionListener() { @@ -761,7 +772,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, else { final JCheckBoxMenuItem chist = new JCheckBoxMenuItem( - "Show Histogram", av.isShowConsensusHistogram()); + MessageManager.getString("label.show_histogram"), av.isShowConsensusHistogram()); chist.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -780,7 +791,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(chist); final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem( - "Show Logo", av.isShowSequenceLogo()); + MessageManager.getString("label.show_logo"), av.isShowSequenceLogo()); cprof.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -799,7 +810,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(cprof); final JCheckBoxMenuItem cprofnorm = new JCheckBoxMenuItem( - "Normalise Logo", av.isNormaliseSequenceLogo()); + MessageManager.getString("label.normalise_logo"), av.isNormaliseSequenceLogo()); cprofnorm.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -1028,7 +1039,9 @@ public class AnnotationLabels extends JPanel implements MouseListener, offset -= fm.getDescent(); } else + { offset += fm.getDescent(); + } x = width - fm.stringWidth(aa[i].label) - 3;