Merge branch 'develop' into releases/Release_2_11_Branch
authorJim Procter <jprocter@issues.jalview.org>
Tue, 11 Sep 2018 12:29:37 +0000 (13:29 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 11 Sep 2018 12:29:37 +0000 (13:29 +0100)
JAL-3091 bring 2.11 onto release 2.10.5 to simplify merge

1  2 
.classpath
THIRDPARTYLIBS
build.xml
help/html/releases.html
src/jalview/bin/Jalview.java
src/jalview/datamodel/SequenceFeature.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AquaInternalFrameManager.java
src/jalview/gui/Desktop.java
test/jalview/gui/SeqCanvasTest.java

diff --cc .classpath
Simple merge
diff --cc THIRDPARTYLIBS
Simple merge
diff --cc build.xml
Simple merge
@@@ -67,122 -67,31 +67,146 @@@ li:before 
          </div>
        </td>
      </tr>
+     
+       <td width="60" nowrap>
+         <div align="center">
+           <strong><a name="Jalview.2.11.0">2.11.0</a><br />
+             <em>8/09/2018</em></strong>
+         </div>
+       </td>
+       <td><div align="left">
+           <em></em>
+           <ul>
+             <li>
+               <!--  -->
+             </li>
+           </ul>
+         </div></td>
+       <td><div align="left">
+           <em></em>
+           <ul>
+             <li>
+               <!-- JAL-3035 -->DAS sequence retrieval and annotation capabilities removed from the Jalview Desktop
+             </li>
+           </ul>
+         </div></td>
+     </tr>
      <tr>
 +    <td width="60" nowrap>
 +      <div align="center">
 +        <strong><a name="Jalview.2.10.5">2.10.5</a><br /> <em>10/09/2018</em></strong>
 +      </div>
 +    </td>
 +    <td><div align="left">
 +        <em></em>
 +        <ul>
 +            <li>
 +              <!-- JAL-3101 -->Default memory for Jalview webstart and
 +              InstallAnywhere increased to 1G.
 +            </li>
 +            <li>
 +              <!-- JAL-247 -->Hidden sequence markers and representative
 +              sequence bolding included when exporting alignment as EPS,
 +              SVG, PNG or HTML. <em>Display is configured via the
 +                Format menu, or for command-line use via a jalview
 +                properties file.</em>
 +            </li>
 +            <li>
 +              <!-- JAL-3076 -->Ensembl client updated to Version 7 REST
 +              API and sequence data now imported as JSON.
 +            </li>
 +            <li>
 +              <!-- JAL-3065 -->Change in recommended way of starting
 +              Jalview via a Java command line: add jars in lib directory
 +              to CLASSPATH, rather than via the deprecated java.ext.dirs
 +              property.
 +            </li>
 +          </ul>
 +          <em>Development</em>
 +          <ul>
 +            <li>
 +              <!-- JAL-3047 -->Support added to execute test suite
 +              instrumented with <a href="http://openclover.org/">Open
 +                Clover</a>
 +            </li>
 +          </ul>
 +        </div></td>
 +    <td><div align="left">
 +        <em></em>
 +        <ul>
 +            <li>
 +              <!-- JAL-3104 -->Poorly scaled bar in quality annotation
 +              row shown in Feredoxin Structure alignment view of example
 +              alignment.
 +            </li>
 +            <li>
 +              <!-- JAL-2854 -->Annotation obscures sequences if lots of
 +              annotation displayed.
 +            </li>
 +            <li>
 +              <!-- JAL-3107 -->Group conservation/consensus not shown
 +              for newly created group when 'Apply to all groups'
 +              selected
 +            </li>
 +            <li>
 +              <!-- JAL-3087 -->Corrupted display when switching to
 +              wrapped mode when sequence panel's vertical scrollbar is
 +              visible.
 +            </li>
 +            <li>
 +              <!-- JAL-3003 -->Alignment is black in exported EPS file
 +              when sequences are selected in exported view.</em>
 +            </li>
 +            <li>
 +              <!-- JAL-3059 -->Groups with different coloured borders
 +              aren't rendered with correct colour.
 +            </li>
 +            <li>
 +              <!-- JAL-3092 -->Jalview could hang when importing certain
 +              types of knotted RNA secondary structure.
 +            </li>
 +            <li>
 +              <!-- JAL-3095 -->Sequence highlight and selection in
 +              trimmed VARNA 2D structure is incorrect for sequences that
 +              do not start at 1.
 +            </li>
 +            <li>
 +              <!-- JAL-3061 -->'.' inserted into RNA secondary structure
 +              annotation when columns are inserted into an alignment,
 +              and when exporting as Stockholm flatfile.
 +            </li>
 +            <li>
 +              <!-- JAL-3053 -->Jalview annotation rows containing upper
 +              and lower-case 'E' and 'H' do not automatically get
 +              treated as RNA secondary structure.
 +            </li>
 +            <li>
 +              <!-- JAL-3106 -->.jvp should be used as default extension
 +              (not .jar) when saving a jalview project file.
 +            </li>
 +            <li>
 +              <!-- JAL-3105 -->Mac Users: closing a window correctly
 +              transfers focus to previous window on OSX
 +            </li>
 +          </ul>
 +          <em>Java 10 Issues Resolved</em>
 +          <ul>
 +            <li>
 +              <!-- JAL-2988 -->OSX - Can't save new files via the File
 +              or export menus by typing in a name into the Save dialog
 +              box.
 +            </li>
 +            <li>
 +              <!-- JAL-2988 JAL-2968 -->Jalview now uses patched version
 +              of the <a href="https://violetlib.org/vaqua/overview.html">VAqua5</a>
 +              'look and feel' which has improved compatibility with the
 +              latest version of OSX.
 +            </li>
 +          </ul>
 +        </div>
 +    </td>
 +    </tr>
 +    <tr>
        <td width="60" nowrap>
          <div align="center">
            <strong><a name="Jalview.2.10.4b1">2.10.4b1</a><br />
Simple merge
   */
  package jalview.datamodel;
  
+ import jalview.datamodel.features.FeatureAttributeType;
+ import jalview.datamodel.features.FeatureAttributes;
  import jalview.datamodel.features.FeatureLocationI;
+ import jalview.datamodel.features.FeatureSourceI;
+ import jalview.datamodel.features.FeatureSources;
+ import jalview.util.StringUtils;
  
 +import java.util.Comparator;
  import java.util.HashMap;
  import java.util.Map;
  import java.util.Map.Entry;
@@@ -536,22 -597,142 +598,160 @@@ public class SequenceFeature implement
    {
      return begin == 0 && end == 0;
    }
+   /**
+    * Answers an html-formatted report of feature details
+    * 
+    * @return
+    */
+   public String getDetailsReport()
+   {
+     FeatureSourceI metadata = FeatureSources.getInstance()
+             .getSource(source);
+     StringBuilder sb = new StringBuilder(128);
+     sb.append("<br>");
+     sb.append("<table>");
+     sb.append(String.format(ROW_DATA, "Type", type, ""));
+     sb.append(String.format(ROW_DATA, "Start/end", begin == end ? begin
+             : begin + (isContactFeature() ? ":" : "-") + end, ""));
+     String desc = StringUtils.stripHtmlTags(description);
+     sb.append(String.format(ROW_DATA, "Description", desc, ""));
+     if (!Float.isNaN(score) && score != 0f)
+     {
+       sb.append(String.format(ROW_DATA, "Score", score, ""));
+     }
+     if (featureGroup != null)
+     {
+       sb.append(String.format(ROW_DATA, "Group", featureGroup, ""));
+     }
+     if (otherDetails != null)
+     {
+       TreeMap<String, Object> ordered = new TreeMap<>(
+               String.CASE_INSENSITIVE_ORDER);
+       ordered.putAll(otherDetails);
+       for (Entry<String, Object> entry : ordered.entrySet())
+       {
+         String key = entry.getKey();
+         if (ATTRIBUTES.equals(key))
+         {
+           continue; // to avoid double reporting
+         }
+         Object value = entry.getValue();
+         if (value instanceof Map<?, ?>)
+         {
+           /*
+            * expand values in a Map attribute across separate lines
+            * copy to a TreeMap for alphabetical ordering
+            */
+           Map<String, Object> values = (Map<String, Object>) value;
+           SortedMap<String, Object> sm = new TreeMap<>(
+                   String.CASE_INSENSITIVE_ORDER);
+           sm.putAll(values);
+           for (Entry<?, ?> e : sm.entrySet())
+           {
+             sb.append(String.format(ROW_DATA, key, e.getKey().toString(), e
+                     .getValue().toString()));
+           }
+         }
+         else
+         {
+           // tried <td title="key"> but it failed to provide a tooltip :-(
+           String attDesc = null;
+           if (metadata != null)
+           {
+             attDesc = metadata.getAttributeName(key);
+           }
+           String s = entry.getValue().toString();
+           if (isValueInteresting(key, s, metadata))
+           {
+             sb.append(String.format(ROW_DATA, key, attDesc == null ? ""
+                     : attDesc, s));
+           }
+         }
+       }
+     }
+     sb.append("</table>");
+     String text = sb.toString();
+     return text;
+   }
+   /**
+    * Answers true if we judge the value is worth displaying, by some heuristic
+    * rules, else false
+    * 
+    * @param key
+    * @param value
+    * @param metadata
+    * @return
+    */
+   boolean isValueInteresting(String key, String value,
+           FeatureSourceI metadata)
+   {
+     /*
+      * currently suppressing zero values as well as null or empty
+      */
+     if (value == null || "".equals(value) || ".".equals(value)
+             || "0".equals(value))
+     {
+       return false;
+     }
+     if (metadata == null)
+     {
+       return true;
+     }
+     FeatureAttributeType attType = metadata.getAttributeType(key);
+     if (attType != null
+             && (attType == FeatureAttributeType.Float || attType
+                     .equals(FeatureAttributeType.Integer)))
+     {
+       try
+       {
+         float fval = Float.valueOf(value);
+         if (fval == 0f)
+         {
+           return false;
+         }
+       } catch (NumberFormatException e)
+       {
+         // ignore
+       }
+     }
+     return true; // default to interesting
+   }
+   /**
+    * Sets the feature source identifier
+    * 
+    * @param theSource
+    */
+   public void setSource(String theSource)
+   {
+     source = theSource;
+   }
  }
 +
 +class SFSortByEnd implements Comparator<SequenceFeature>
 +{
 +  @Override
 +  public int compare(SequenceFeature a, SequenceFeature b)
 +  {
 +    return a.getEnd() - b.getEnd();
 +  }
 +}
 +
 +class SFSortByBegin implements Comparator<SequenceFeature>
 +{
 +  @Override
 +  public int compare(SequenceFeature a, SequenceFeature b)
 +  {
 +    return a.getBegin() - b.getBegin();
 +  }
 +}
Simple merge
Simple merge
Simple merge