git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
068a888
)
JAL-4380 Improved annotation tooltips especially secondary structure tooltips
bug/JAL-4375_annotation_not_redrawn_correctly_when_scrolling_left-right_via_trackpad_in_wrap_mode
author
Ben Soares
<b.soares@dundee.ac.uk>
Tue, 2 Apr 2024 19:27:50 +0000
(20:27 +0100)
committer
Ben Soares
<b.soares@dundee.ac.uk>
Tue, 2 Apr 2024 19:27:50 +0000
(20:27 +0100)
src/jalview/gui/AnnotationPanel.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/AnnotationPanel.java
b/src/jalview/gui/AnnotationPanel.java
index
c97ee53
..
0f6173b
100755
(executable)
--- a/
src/jalview/gui/AnnotationPanel.java
+++ b/
src/jalview/gui/AnnotationPanel.java
@@
-1334,32
+1334,37
@@
public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
.highlightPositionsOn(ann.sequenceRef, highlightPos, null);
}
}
.highlightPositionsOn(ann.sequenceRef, highlightPos, null);
}
}
- return tooltip;
+ return tooltip == null || tooltip.length() == 0 ? null : tooltip;
}
private static String getAnnotationBriefSummary(Annotation a)
{
}
private static String getAnnotationBriefSummary(Annotation a)
{
- String tt = a.description;
- if (tt == null || tt.trim().length() == 0)
+ StringBuilder ttSB = new StringBuilder();
+ if (a.secondaryStructure != 0 && a.secondaryStructure != ' ')
{
{
- tt = String.valueOf(a.displayCharacter);
+ ttSB.append(a.secondaryStructure);
}
}
- if ((tt == null || tt.length() == 0) && !Float.isNaN(a.value))
+ else if (a.description != null && a.description.trim().length() > 0)
+ {
+ ttSB.append(a.description);
+ }
+ else if (a.displayCharacter != null
+ && a.displayCharacter.trim().length() > 0)
+ {
+ ttSB.append(a.displayCharacter);
+ }
+ else if (!Float.isNaN(a.value))
{
if (a.value == Math.floor(a.value)) // likely integer value
{
{
if (a.value == Math.floor(a.value)) // likely integer value
{
- tt = String.format("%.0f", a.value);
+ ttSB.append(String.format("%.0f", a.value));
}
else // display as is
{
}
else // display as is
{
- tt = String.valueOf(a.value);
+ ttSB.append(String.valueOf(a.value));
}
}
}
}
- if (tt == null || tt.trim().length() == 0)
- {
- tt = String.valueOf(a.secondaryStructure);
- }
- return tt;
+ return ttSB.toString();
}
/**
}
/**