Merge branch 'features/JAL-1912_biojson-per-sequence-annotation' of http://source...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 7 Oct 2015 10:57:37 +0000 (11:57 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 7 Oct 2015 10:57:37 +0000 (11:57 +0100)
16 files changed:
examples/appletParameters.html
examples/applets.html
examples/estrogenReceptorProtein_frag.fa
help/html/releases.html
src/jalview/appletgui/AlignViewport.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/Desktop.java
src/jalview/gui/SeqPanel.java
src/jalview/gui/SplitFrame.java
src/jalview/io/HtmlSvgOutput.java
src/jalview/jbgui/GPDBSearchPanel.java
src/jalview/jbgui/GSplitFrame.java
src/jalview/jbgui/GStructureChooser.java
src/jalview/ws/uimodel/PDBRestRequest.java
test/jalview/ws/dbsources/PDBRestClientTest.java

index 8daa4ee..1e45aae 100644 (file)
@@ -118,6 +118,14 @@ the applet can be interacted with <em>via</em> its
             <td>Default is no colour.</td>
           </tr>
           <tr> 
+            <td>defaultColourNuc</td>
+            <td>A colour scheme (from the list above) to apply to Nucleotide alignments</td><td>This overrides defaultColour if it is specified.</td>
+          </tr>
+          <tr> 
+            <td>defaultColourProt</td>
+            <td>A colour scheme (from the list above) to apply to Peptide alignments</td><td>This overrides defaultColour if it is specified.</td>
+          </tr>
+          <tr> 
             <td>userDefinedColour</td>
             <td><p><em>Example:</em><br>
                 D,E=red; K,R,H=0022FF; c=yellow</p></td>
index d811e94..34118b8 100644 (file)
@@ -187,7 +187,8 @@ Try out JalviewLite by pressing one of the buttons below.<br/>
 <param name="windowWidth" value="800"/>
 <param name="showAnnotation" value="true"/>
 <param name="showSequenceLogo" value="true"/>
-<param name="defaultColour" value="Purine/Pyrimidine"/>
+<param name="defaultColourNuc" value="Purine/Pyrimidine"/>
+<param name="defaultColourProt" value="Clustal"/>
    <param name="APPLICATION_URL"
      value="http://www.jalview.org/services/launchApp"/>
 </applet>
index cb3c37e..c9e31aa 100644 (file)
@@ -1,14 +1,8 @@
->UNIPROT|Q7LCB3/249-274
----SLEHTLPVNRETLKRKVSGNRCASPV----------
->UNIPROT|Q9VSE9/175-200
----GSGTSGGNGGGGGGGTSGGNATNASA----------
 >UNIPROT|Q9IBD5/371-408
 EGHHNYLCAGRNDCIVDKIRRKNCPACRLRKCYQAGMI-
 >UNIPROT|Q9YGV9/522-559
 EGKQKYLCASINDCTIDKLRRKNCPSCRLKRCFAAGMT-
 >UNIPROT|Q90ZM7/97-134
 EGQHNYLCAGRNDCIIDKIRRKNCPACRLRKCIQAGMT-
->UNIPROT|Q91445/24-61
-EGKQKYLCASRNDCTIDKFRRKNCPSCRLRKCYEAGMT-
 >UNIPROT|Q90ZM8/198-236
 QGHNDYMCPATNQCTIDRNRRKSCQACRLRKCYEVGMVK
index 9c2a10e..7f1b627 100755 (executable)
       <td width="60" nowrap>
         <div align="center">
           <strong><a name="Jalview.2.9.0b1">2.9.0b1</a><br />
-            <em>29/09/2015</em></strong>
+            <em>6/10/2015</em></strong>
         </div>
       </td>
       <td>
-        <div align="center"></div>
+      <em>General</em>
+      <ul>
+            <li>Updated Spanish translations of localized text for 2.9</li>
+      </ul>
+      <em>Application</em><ul>
+      <!-- <li>cDNA/Protein splitframe window geometry preserved in Jalview projects</li>-->
+      <li>Signed OSX InstallAnywhere installer</li></ul>
+        <em>Applet</em>
+        <ul><li>Split frame example added to applet examples page</li>
+            </ul>
       </td>
       <td>
         <div align="left">
+        <em>General</em>
           <ul>
             <li>Mapping of cDNA to protein in split frames incorrect when sequence start > 1</li>
-            <li>Split frame example added to applet examples page</li>
-            <li>Applet with Jmol examples not loading correctly</li>
-            <li>Incorrect warning on deleting selected columns</li>
-            <li>Annotations incorrectly rendered after BioJS export and reimport</li>
-            <li>Incorrect sequence limits after Fetch DB References with 'trim retrieved sequences'</li>
-            <li>Spanish translations of localized text - updates needed for 2.9</li>
-            <li>Provide signed OSX InstallAnywhere installer</li>
+            <li>Broken images in filter column by annotation dialog documentation</li>
+            <li>Feature colours not parsed from features file</li>
+            <li>Exceptions and incomplete link URLs recovered when loading a features file containing HTML tags in feature description</li>
+            
           </ul>
+      <em>Application</em><ul>
+            <li>Annotations corrupted after BioJS export and reimport</li>
+            <li>Incorrect sequence limits after Fetch DB References with 'trim retrieved sequences'</li>
+            <li>Incorrect warning about deleting all data when deleting selected columns</li>
+            <li>Patch to build system for shipping properly signed JNLP templates for webstart launch</li>
+            <li>EMBL-PDBe fetcher/viewer dialogs do not offer unreleased structures for download or viewing</li>
+            <li>Tab/space/return keystroke operation of EMBL-PDBe fetcher/viewer dialogs works correctly</li>
+            <li>Disabled 'minimise' button on Jalview windows running on OSX to workaround redraw hang bug</li>
+            <li>Split cDNA/Protein view position and geometry not recovered from jalview project</li>
+            <li>Initial enabled/disabled state of annotation menu sorter 'show autocalculated first/last' corresponds to alignment view</li>
+            </ul>
+      <em>Applet</em><ul>
+            <li>Reorder sequences mirrored in cDNA/Protein split frame</li>
+            <li>Applet with Jmol examples not loading correctly</li>
+            </ul>
         </div>
       </td>
     </tr>
index e434825..7ef2d59 100644 (file)
@@ -187,8 +187,13 @@ public class AlignViewport extends AlignmentViewport implements
 
     if (applet != null)
     {
-      String colour = applet.getParameter("defaultColour");
-
+      String colour = al.isNucleotide() ? applet
+              .getParameter("defaultColourNuc") : applet
+              .getParameter("defaultColourProt");
+      if (colour == null)
+      {
+        colour = applet.getParameter("defaultColour");
+      }
       if (colour == null)
       {
         colour = applet.getParameter("userDefinedColour");
index a857f11..92c6355 100644 (file)
@@ -1072,7 +1072,7 @@ public class AlignViewport extends AlignmentViewport implements
       // TODO would like next line without cast but needs more refactoring...
       final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement())
               .getAlignPanel();
-      complementPanel.setFollowingComplementScroll(true);
+      complementPanel.setDontScrollComplement(true);
       complementPanel.scrollToCentre(sr, verticalOffset);
     }
   }
index 2c7dd3e..4d49bc2 100644 (file)
@@ -99,7 +99,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    * Flag set while scrolling to follow complementary cDNA/protein scroll. When
    * true, suppresses invoking the same method recursively.
    */
-  private boolean followingComplementScroll;
+  private boolean dontScrollComplement;
 
   /**
    * Creates a new AlignmentPanel object.
@@ -732,7 +732,14 @@ public class AlignmentPanel extends GAlignmentPanel implements
       x = 0;
     }
 
+    /*
+     * each scroll adjustment triggers adjustmentValueChanged, which resets the
+     * 'do not scroll complement' flag; ensure it is the same for both
+     * operations
+     */
+    boolean flag = isDontScrollComplement();
     hscroll.setValues(x, hextent, 0, width);
+    setDontScrollComplement(flag);
     vscroll.setValues(y, vextent, 0, height);
   }
 
@@ -831,9 +838,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
      * If there is one, scroll the (Protein/cDNA) complementary alignment to
      * match, unless we are ourselves doing that.
      */
-    if (isFollowingComplementScroll())
+    if (isDontScrollComplement())
     {
-      setFollowingComplementScroll(false);
+      setDontScrollComplement(false);
     }
     else
     {
@@ -880,6 +887,12 @@ public class AlignmentPanel extends GAlignmentPanel implements
     hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));
     validate();
 
+    /*
+     * set scroll bar positions; first suppress this being 'followed' in any
+     * complementary split pane
+     */
+    setDontScrollComplement(true);
+
     if (av.getWrapAlignment())
     {
       int maxwidth = av.getAlignment().getWidth();
@@ -1789,17 +1802,17 @@ public class AlignmentPanel extends GAlignmentPanel implements
   }
 
   /**
-   * Set a flag to say we are scrolling to follow a (cDNA/protein) complement.
+   * Set a flag to say do not scroll any (cDNA/protein) complement.
    * 
    * @param b
    */
-  protected void setFollowingComplementScroll(boolean b)
+  protected void setDontScrollComplement(boolean b)
   {
-    this.followingComplementScroll = b;
+    this.dontScrollComplement = b;
   }
 
-  protected boolean isFollowingComplementScroll()
+  protected boolean isDontScrollComplement()
   {
-    return this.followingComplementScroll;
+    return this.dontScrollComplement;
   }
 }
index d03e3f2..c957444 100644 (file)
@@ -33,6 +33,7 @@ import jalview.jbgui.GStructureViewer;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.ImageMaker;
 import jalview.util.MessageManager;
+import jalview.util.Platform;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.ws.params.ParamManager;
 
@@ -305,6 +306,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     boolean showjconsole = jalview.bin.Cache.getDefault(
             "SHOW_JAVA_CONSOLE", false);
     desktop = new MyDesktopPane(selmemusage);
+    if (Platform.isAMac())
+    {
+      desktop.setDoubleBuffered(false);
+    }
     showMemusage.setSelected(selmemusage);
     desktop.setBackground(Color.white);
     getContentPane().setLayout(new BorderLayout());
@@ -750,8 +755,13 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     frame.setResizable(resizable);
     frame.setMaximizable(resizable);
     frame.setIconifiable(resizable);
-    frame.setFrameIcon(null);
-
+    if (Platform.isAMac())
+    {
+      frame.setIconifiable(false);
+      frame.setFrameIcon(null);
+      // frame.setDesktopIcon(null);
+      frame.setDoubleBuffered(false);
+    }
     if (frame.getX() < 1 && frame.getY() < 1)
     {
       frame.setLocation(xOffset * openFrameCount, yOffset
@@ -2966,25 +2976,39 @@ public class Desktop extends jalview.jbgui.GDesktop implements
        * AlignmentPanel objects, including their AlignmentViewports, so the
        * cdna/protein relationships between the viewports is carried over to the
        * new split frames.
+       * 
+       * explodedGeometry holds the (x, y) position of the previously exploded
+       * SplitFrame, and the (width, height) of the AlignFrame component
        */
       AlignmentPanel topPanel = (AlignmentPanel) topPanels.get(i);
       AlignFrame newTopFrame = new AlignFrame(topPanel);
       newTopFrame.setSize(oldTopFrame.getSize());
       newTopFrame.setVisible(true);
+      Rectangle geometry = ((AlignViewport) topPanel.getAlignViewport())
+              .getExplodedGeometry();
+      if (geometry != null)
+      {
+        newTopFrame.setSize(geometry.getSize());
+      }
+
       AlignmentPanel bottomPanel = (AlignmentPanel) bottomPanels.get(i);
       AlignFrame newBottomFrame = new AlignFrame(bottomPanel);
       newBottomFrame.setSize(oldBottomFrame.getSize());
       newBottomFrame.setVisible(true);
+      geometry = ((AlignViewport) bottomPanel.getAlignViewport())
+              .getExplodedGeometry();
+      if (geometry != null)
+      {
+        newBottomFrame.setSize(geometry.getSize());
+      }
+
       topPanel.av.setGatherViewsHere(false);
       bottomPanel.av.setGatherViewsHere(false);
       JInternalFrame splitFrame = new SplitFrame(newTopFrame,
               newBottomFrame);
-      // either panel may hold previous exploded frame geometry
-      Rectangle geometry = ((AlignViewport) topPanel.getAlignViewport())
-              .getExplodedGeometry();
       if (geometry != null)
       {
-        splitFrame.setBounds(geometry);
+        splitFrame.setLocation(geometry.getLocation());
       }
       Desktop.addInternalFrame(splitFrame, sf.getTitle(), -1, -1);
     }
@@ -3007,10 +3031,18 @@ public class Desktop extends jalview.jbgui.GDesktop implements
    */
   public void gatherViews(GSplitFrame source)
   {
+    /*
+     * special handling of explodedGeometry for a view within a SplitFrame: - it
+     * holds the (x, y) position of the enclosing SplitFrame, and the (width,
+     * height) of the AlignFrame component
+     */
     AlignFrame myTopFrame = (AlignFrame) source.getTopFrame();
     AlignFrame myBottomFrame = (AlignFrame) source.getBottomFrame();
-    myTopFrame.viewport.setExplodedGeometry(source.getBounds());
-    myBottomFrame.viewport.setExplodedGeometry(source.getBounds());
+    myTopFrame.viewport.setExplodedGeometry(new Rectangle(source.getX(),
+            source.getY(), myTopFrame.getWidth(), myTopFrame.getHeight()));
+    myBottomFrame.viewport.setExplodedGeometry(new Rectangle(source.getX(),
+            source.getY(), myBottomFrame.getWidth(), myBottomFrame
+                    .getHeight()));
     myTopFrame.viewport.setGatherViewsHere(true);
     myBottomFrame.viewport.setGatherViewsHere(true);
     String topViewId = myTopFrame.viewport.getSequenceSetId();
@@ -3035,10 +3067,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements
             gatherThis = true;
             topPanel.av.setGatherViewsHere(false);
             bottomPanel.av.setGatherViewsHere(false);
-            // both panels refer to the same split frame geometry
-            Rectangle position = sf.getBounds();
-            topPanel.av.setExplodedGeometry(position);
-            bottomPanel.av.setExplodedGeometry(position);
+            topPanel.av.setExplodedGeometry(new Rectangle(sf.getLocation(),
+                    topFrame.getSize()));
+            bottomPanel.av.setExplodedGeometry(new Rectangle(sf
+                    .getLocation(), bottomFrame.getSize()));
             myTopFrame.addAlignmentPanel(topPanel, false);
             myBottomFrame.addAlignmentPanel(bottomPanel, false);
           }
index 4ee87fc..fe05e6e 100644 (file)
@@ -680,7 +680,7 @@ public class SeqPanel extends JPanel implements MouseListener,
        * 
        * @see AlignmentPanel#adjustmentValueChanged
        */
-      ap.setFollowingComplementScroll(true);
+      ap.setDontScrollComplement(true);
       if (ap.scrollToPosition(results, false))
       {
         seqCanvas.revalidate();
index 9da8240..3a6d266 100644 (file)
@@ -26,6 +26,7 @@ import jalview.datamodel.AlignmentI;
 import jalview.jbgui.GAlignFrame;
 import jalview.jbgui.GSplitFrame;
 import jalview.structure.StructureSelectionManager;
+import jalview.util.Platform;
 import jalview.viewmodel.AlignmentViewport;
 
 import java.awt.Component;
@@ -37,12 +38,15 @@ import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 import java.beans.PropertyVetoException;
 import java.util.Map.Entry;
+import java.util.Set;
 
 import javax.swing.AbstractAction;
 import javax.swing.InputMap;
 import javax.swing.JComponent;
 import javax.swing.JMenuItem;
 import javax.swing.KeyStroke;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
 import javax.swing.event.InternalFrameAdapter;
 import javax.swing.event.InternalFrameEvent;
 
@@ -81,10 +85,23 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI
     ((AlignFrame) getTopFrame()).getViewport().setCodingComplement(
             ((AlignFrame) getBottomFrame()).getViewport());
 
-    int width = ((AlignFrame) getTopFrame()).getWidth();
-    // about 50 pixels for the SplitFrame's title bar etc
+    /*
+     * estimate width and height of SplitFrame; this.getInsets() doesn't seem to
+     * give the full additional size (a few pixels short)
+     */
+    UIDefaults defaults = UIManager.getDefaults();
+    Set<Object> keySet = defaults.keySet();
+    for (Object key : keySet)
+    {
+      System.out.println(key.toString() + " = "
+              + UIManager.get(key).toString());
+    }
+    int widthFudge = Platform.isAMac() ? 28 : 28; // Windows tbc
+    int heightFudge = Platform.isAMac() ? 50 : 50; // tbc
+    int width = ((AlignFrame) getTopFrame()).getWidth() + widthFudge;
     int height = ((AlignFrame) getTopFrame()).getHeight()
-            + ((AlignFrame) getBottomFrame()).getHeight() + 50;
+            + ((AlignFrame) getBottomFrame()).getHeight() + DIVIDER_SIZE
+            + heightFudge;
     height = fitHeightToDesktop(height);
     setSize(width, height);
 
index e946367..6c2faca 100644 (file)
@@ -76,6 +76,10 @@ public class HtmlSvgOutput
                   .getSelectedFile().getParent());
           file = chooser.getSelectedFile();
         }
+        else
+        {
+          return;
+        }
       }
 
       AlignmentDimension aDimension = ap.getAlignmentDimension();
index ddb2f7a..a105999 100644 (file)
@@ -191,12 +191,13 @@ public abstract class GPDBSearchPanel extends JPanel
         case KeyEvent.VK_TAB: // tab key
           if (evt.isShiftDown())
           {
-            txt_search.requestFocus();
+            tabbedPane.requestFocus();
           }
           else
           {
             btn_back.requestFocus();
           }
+          evt.consume();
           break;
         default:
           return;
index daad4fd..7c4dcf3 100644 (file)
@@ -33,7 +33,7 @@ import javax.swing.plaf.basic.BasicInternalFrameUI;
 
 public class GSplitFrame extends JInternalFrame
 {
-  private static final int DIVIDER_SIZE = 5;
+  protected static final int DIVIDER_SIZE = 5;
 
   private static final long serialVersionUID = 1L;
 
index cf80613..25924f0 100644 (file)
@@ -164,7 +164,7 @@ public abstract class GStructureChooser extends JPanel implements
         toolTipText = getValueAt(rowIndex, colIndex).toString();
       } catch (Exception e)
       {
-        e.printStackTrace();
+        // e.printStackTrace();
       }
       toolTipText = (toolTipText == null ? null
               : (toolTipText.length() > 500 ? JvSwingUtils.wrapTooltip(
@@ -243,12 +243,13 @@ public abstract class GStructureChooser extends JPanel implements
         case KeyEvent.VK_TAB: // tab key
           if (evt.isShiftDown())
           {
-            chk_invertFilter.requestFocus();
+            pnl_filter.requestFocus();
           }
           else
           {
             btn_view.requestFocus();
           }
+          evt.consume();
           break;
         default:
           return;
@@ -293,9 +294,16 @@ public abstract class GStructureChooser extends JPanel implements
           }
           else
           {
+            if (btn_view.isEnabled())
+            {
             btn_view.requestFocus();
+            }
+            else
+            {
+              btn_cancel.requestFocus();
+            }
           }
-
+          evt.consume();
         default:
           return;
         }
index 5442b65..24f38d1 100644 (file)
@@ -21,6 +21,7 @@
 
 package jalview.ws.uimodel;
 
+import jalview.bin.Cache;
 import jalview.datamodel.SequenceI;
 import jalview.ws.dbsources.PDBRestClient.PDBDocField;
 
@@ -44,14 +45,14 @@ public class PDBRestRequest
 
   private boolean allowEmptySequence;
 
-  private boolean allowUnpublishedEntries;
+  private boolean allowUnpublishedEntries = Cache.getDefault(
+          "ALLOW_UNPUBLISHED_PDB_QUERYING", false);
 
   private int responseSize;
 
   private boolean isSortAscending;
 
-  private Collection<PDBDocField> wantedFields;// = new
-                                               // Collection<PDBDocField>();
+  private Collection<PDBDocField> wantedFields;
 
   public String getFieldToSearchBy()
   {
index 0005ba9..401f4c9 100644 (file)
@@ -264,7 +264,7 @@ public class PDBRestClientTest
           if (pdbJsonDoc.get(field.getCode()) == null)
           {
             // System.out.println(">>>\t" + field.getCode());
-            assertTrue(field.getClass()
+            assertTrue(field.getCode()
                     + " has been removed from PDB doc Entity",
                     !pdbJsonResponseString.contains(field.getCode()));
           }