From: gmungoc Date: Tue, 14 Apr 2020 08:26:14 +0000 (+0100) Subject: JAL-3583 remove debug logging, Javadoc added X-Git-Tag: Release_2_11_4_0~45^2~18^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2b21aa74fdc06b43a1c6d80653e7bd51574b78bf;p=jalview.git JAL-3583 remove debug logging, Javadoc added --- diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index f433aec..2ad5bea 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1145,9 +1145,8 @@ public class SeqPanel extends JPanel String tooltip = AnnotationPanel.buildToolTip(anns[rowIndex], column, anns); - if (true || !tooltip.equals(lastTooltip)) + if (!tooltip.equals(lastTooltip)) { - System.out.println("wrapped tooltip set"); lastTooltip = tooltip; lastFormattedTooltip = tooltip == null ? null : JvSwingUtils.wrapTooltip(true, tooltip); diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index 4933cd6..9d7fcfc 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -20,6 +20,12 @@ */ package jalview.io; +import java.util.Collection; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + import jalview.api.FeatureColourI; import jalview.datamodel.DBRefEntry; import jalview.datamodel.DBRefSource; @@ -32,13 +38,6 @@ import jalview.util.StringUtils; import jalview.util.UrlLink; import jalview.viewmodel.seqfeatures.FeatureRendererModel; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - /** * generate HTML reports for a sequence * @@ -299,17 +298,26 @@ public class SequenceAnnotationReport appendFeature(sb, rpos, fr, feature, mf, 0); } + /** + * Appends {@code sb} to {@code sb0}, and returns false, unless + * {@code maxlength} is not zero and appending would make the total length + * greater than {@code maxlength}, in which case the text is not appended, and + * the method returns true. + * + * @param sb0 + * @param sb + * @param maxlength + * @return + */ private static boolean appendTextMaxLengthReached(StringBuilder sb0, StringBuilder sb, int maxlength) { - boolean ret = false; if (maxlength == 0 || sb0.length() + sb.length() < maxlength) { sb0.append(sb); return false; - } else { - return true; } + return true; } /**