From: Renia Correya Date: Fri, 30 Aug 2024 13:04:10 +0000 (+0530) Subject: Fix for JAL-4427 X-Git-Tag: Release_2_11_4_0~7^2^2~1^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=621f426fa1cd84aa41ab94581fecf0b4b659da50;p=jalview.git Fix for JAL-4427 Sequence ID text showing html code - protein disorder. --- diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 7c5afcd..27417f0 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -66,6 +66,7 @@ import jalview.io.FileFormat; import jalview.io.FormatAdapter; import jalview.util.Comparison; import jalview.util.MessageManager; +import jalview.util.ParseHtmlBodyAndLinks; import jalview.util.Platform; /** @@ -1348,6 +1349,7 @@ public class AnnotationLabels extends JPanel } SequenceI lastSeqRef = null; String lastLabel = null; + String lastDescription = null; AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); int fontHeight = g != null ? g.getFont().getSize() : fm.getFont().getSize(); @@ -1435,10 +1437,24 @@ public class AnnotationLabels extends JPanel offset += fm.getDescent(); } String label = aa[i].label; + ParseHtmlBodyAndLinks phbDecription = new ParseHtmlBodyAndLinks( + aa[i].description, true, "\n"); + String description = phbDecription.getNonHtmlContent(); boolean vertBar = false; - if ((lastLabel != null && lastLabel.equals(label))) + if (lastLabel != null && lastLabel.equals(label) && + lastDescription != null && lastDescription.equals(description)) { - label = aa[i].description; + //JAL-4427 + label = aa[i].label; // No change in label + } + else if (lastLabel != null && lastLabel.equals(label)) + { + //JAL-4427 + if(!(lastDescription != null && lastDescription.equals(description)) + && (aa[i].sequenceRef == lastSeqRef)) { + label = description; + lastDescription = description; + } } else { @@ -1447,11 +1463,18 @@ public class AnnotationLabels extends JPanel { lastLabel = label; // next label is the same as this label - label = aa[i].description; + //JAL-4427 + if(!(lastDescription != null && lastDescription.equals(description))) { + if(aa[nexAA].sequenceRef == aa[i].sequenceRef) { + label = description; + } + lastDescription = description; + } } else { lastLabel = label; + lastDescription = description; } } if (aa[i].sequenceRef != null)