JAL-2744 add score to feature details report, description to menu item
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 5 Oct 2017 09:41:46 +0000 (10:41 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 5 Oct 2017 09:41:46 +0000 (10:41 +0100)
src/jalview/datamodel/SequenceFeature.java
src/jalview/gui/PopupMenu.java

index 0352918..4208ce1 100755 (executable)
@@ -563,6 +563,10 @@ public class SequenceFeature implements FeatureLocationI
     {
       sb.append(String.format("%s %d-%d %s", type, begin, end, description));
     }
+    if (!Float.isNaN(score) && score != 0f)
+    {
+      sb.append(" score=").append(score);
+    }
     if (featureGroup != null)
     {
       sb.append(" (").append(featureGroup).append(")");
index 8e9bade..33c86bc 100644 (file)
@@ -549,6 +549,18 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       {
         desc = String.format("%s %d-%d", sf.getType(), start, end);
       }
+      String description = sf.getDescription();
+      if (description != null)
+      {
+        if (description.length() <= 6)
+        {
+          desc = desc + " " + description;
+        }
+        else
+        {
+          desc = desc + " " + description.substring(0, 6) + "..";
+        }
+      }
       if (sf.getFeatureGroup() != null)
       {
         desc = desc + " (" + sf.getFeatureGroup() + ")";