Merge branch 'develop' into Release_2_9_0b1_Branch
authorJim Procter <jprocter@issues.jalview.org>
Tue, 22 Sep 2015 14:25:40 +0000 (15:25 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 22 Sep 2015 14:25:40 +0000 (15:25 +0100)
1  2 
doc/UnitTesting.html
help/html/io/export.html
help/html/releases.html
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/AnnotationColumnChooser.java
src/jalview/appletgui/JVDialog.java
src/jalview/bin/JalviewLite.java
src/jalview/gui/AlignmentPanel.java
test/jalview/gui/AnnotationChooserTest.java
test/jalview/gui/FontChooserTest.java

diff --combined doc/UnitTesting.html
@@@ -1,7 -1,7 +1,7 @@@
  <html>
  <!--
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -83,7 -83,7 +83,7 @@@ The TestNG tests for Jalview can be exe
        <ul>
              <li>Ensure that you have TestNG plugin correctly install for eclipse</li>
              <li>Ensure that your test classes are error free and properly annotated</li>
-             <li>Create a lunch configuration "Select the Run / Run... (or Run / Debug...) menu and create a new TestNG configuration"</li>
+             <li>Create a launch configuration "Select the Run / Run... (or Run / Debug...) menu and create a new TestNG configuration"</li>
            <li>Run the tests by executing the configuration target created above</li>
          </ul> 
        A more detailed guide for installing and executing TestNG in eclipse is available at <a href=http://testng.org/doc/eclipse.html>testng.org/doc/eclipse.html</a> <br>&nbsp;
diff --combined help/html/io/export.html
@@@ -1,7 -1,7 +1,7 @@@
  <html>
  <!--
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -46,8 -46,7 +46,7 @@@
      <li>BioJS MSA - A JavaScript based multiple sequence alignment
        viewer. <br> <em>For interactive alignment data
          visualisation in a web browser.<br />Get more info about the
-         BioJS MSA viewer at a
-         href="http://msa.biojs.net/">http://msa.biojs.net/</a>
+         BioJS MSA viewer at <a href="http://msa.biojs.net/">http://msa.biojs.net/</a>
      </em>
      </li>
  
    <p>
      In Jalview 2.9, new HTML exporting options were introduced. The
      standard HTML export option displays alignments as SVG documents
-     embedded as scollable panes. Exported pages can optionally also
+     embedded as scrollable panes. Exported pages can optionally also
      include <a href="../features/bioJsonFormat.html">BioJSON</a> data,
      which allows Jalview to extract the original data used to create the
      page. Jalview can also generate HTML pages which embed BioJSON data
      and the BioJS MSA viewer, a pure javascript alignment viewer that
-     provides a range of interactive analysis capabiltiies.
+     provides a range of interactive analysis capabilities.
    </p>
    <p>
    <p>
diff --combined help/html/releases.html
@@@ -1,7 -1,7 +1,7 @@@
  <html>
  <!--
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
        </td>
      </tr>
      <tr>
+       <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>
+         </div>
+       </td>
+       <td>
+         <div align="center"></div>
+       </td>
+       <td>
+         <div align="left">
+           <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>
+           </ul>
+         </div>
+       </td>
+     </tr>
+     <tr>
        <td><div align="center">
            <strong><a name="Jalview.2.9">2.9</a><br /> <em>10/9/2015</em></strong>
          </div></td>
        </td>
      </tr>
      <tr>
-       <td width="60" nowrap>
-         <div align="center">
-           <strong><a name="Jalview.2.8.2b1">2.8.2b1</a><br />
-             <em>15/12/2014</em></strong>
-         </div>
-       </td>
-       <td>
-         <div align="center"></div>
-       </td>
-       <td>
-         <div align="center">
-           <ul>
-             <li>Reinstated the display of default example file on
-               startup</li>
-             <li>All pairs shown in Jalview window when viewing
-               result of pairwise alignment</li>
-           </ul>
-         </div>
-       </td>
-     </tr>
-     <tr>
        <td><div align="center">
            <strong><a name="Jalview.2.8.2">2.8.2</a><br /> <em>3/12/2014</em></strong>
          </div></td>
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -75,6 -75,7 +75,7 @@@ import java.awt.BorderLayout
  import java.awt.Canvas;
  import java.awt.CheckboxMenuItem;
  import java.awt.Color;
+ import java.awt.FlowLayout;
  import java.awt.Font;
  import java.awt.FontMetrics;
  import java.awt.Frame;
@@@ -83,6 -84,7 +84,7 @@@ import java.awt.Label
  import java.awt.Menu;
  import java.awt.MenuBar;
  import java.awt.MenuItem;
+ import java.awt.Panel;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.event.FocusEvent;
@@@ -105,8 -107,6 +107,6 @@@ import java.util.Map
  import java.util.StringTokenizer;
  import java.util.Vector;
  
- import javax.swing.JOptionPane;
  import org.jmol.viewer.Viewer;
  
  public class AlignFrame extends EmbmenuFrame implements ActionListener,
      normSequenceLogo.setState(viewport.isNormaliseSequenceLogo());
      applyToAllGroups.setState(viewport.getColourAppliesToAllGroups());
      annotationPanelMenuItem.setState(viewport.isShowAnnotation());
-     showAlignmentAnnotations.setState(viewport.isShowAnnotation());
-     showSequenceAnnotations.setState(viewport.isShowAnnotation());
+     showAlignmentAnnotations.setEnabled(annotationPanelMenuItem.getState());
+     showSequenceAnnotations.setEnabled(annotationPanelMenuItem.getState());
+     showAlignmentAnnotations.setState(true);
+     showSequenceAnnotations.setState(false);
  
      seqLimits.setState(viewport.getShowJVSuffix());
  
      }
      else if (source == annotationPanelMenuItem)
      {
-       viewport.setShowAnnotation(annotationPanelMenuItem.getState());
-       alignPanel.setAnnotationVisible(annotationPanelMenuItem.getState());
+       boolean showAnnotations = annotationPanelMenuItem.getState();
+       showAlignmentAnnotations.setEnabled(showAnnotations);
+       showSequenceAnnotations.setEnabled(showAnnotations);
+       viewport.setShowAnnotation(showAnnotations);
+       alignPanel.setAnnotationVisible(showAnnotations);
      }
      else if (source == sequenceFeatures)
      {
  
      /*
       * If the cut affects all sequences, warn, remove highlighted columns
-      */if (sg.getSize() == viewport.getAlignment().getHeight())
+      */
+     if (sg.getSize() == viewport.getAlignment().getHeight())
      {
        boolean isEntireAlignWidth = (((sg.getEndRes() - sg.getStartRes()) + 1) == viewport
                .getAlignment().getWidth()) ? true : false;
        if (isEntireAlignWidth)
        {
-         int confirm = JOptionPane.showConfirmDialog(this,
-                 MessageManager.getString("warn.delete_all"), // $NON-NLS-1$
-                 MessageManager.getString("label.delete_all"), // $NON-NLS-1$
-                 JOptionPane.OK_CANCEL_OPTION);
+         String title = MessageManager.getString("label.delete_all");
+         Panel infoPanel = new Panel();
+         infoPanel.setLayout(new FlowLayout());
+         infoPanel
+                 .add(new Label(MessageManager.getString("warn.delete_all")));
+         final JVDialog dialog = new JVDialog(this, title, true, 400,
+                 200);
+         dialog.setMainPanel(infoPanel);
+         dialog.ok.setLabel(MessageManager.getString("action.ok"));
+         dialog.cancel.setLabel(MessageManager.getString("action.cancel"));
+         dialog.setVisible(true);
  
-         if (confirm == JOptionPane.CANCEL_OPTION
-                 || confirm == JOptionPane.CLOSED_OPTION)
+         if (!dialog.accept)
          {
            return;
          }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -49,7 -49,7 +49,7 @@@ import java.awt.event.TextListener
  import java.util.Iterator;
  import java.util.Vector;
  
- import javax.swing.JPanel;
+ //import javax.swing.JPanel;
  
  //import net.miginfocom.swing.MigLayout;
  
@@@ -241,7 -241,7 +241,7 @@@ public class AnnotationColumnChooser ex
      actionPanel.add(ok);
      actionPanel.add(cancel);
  
-     JPanel staticPanel = new JPanel();
+     Panel staticPanel = new Panel();
      staticPanel.setLayout(new BorderLayout());
      staticPanel.setBackground(Color.white);
  
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -28,6 -28,8 +28,8 @@@ import java.awt.Frame
  import java.awt.Panel;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
+ import java.awt.event.WindowAdapter;
+ import java.awt.event.WindowEvent;
  
  public class JVDialog extends Dialog implements ActionListener
  {
              width, height);
    }
  
+   public JVDialog(Frame owner, Panel mainPanel, String title,
+           boolean modal, int width, int height)
+   {
+     super(owner, title, modal);
+     this.owner = owner;
+     height += owner.getInsets().top + getInsets().bottom;
+     setBounds(owner.getBounds().x + (owner.getSize().width - width) / 2,
+             owner.getBounds().y + (owner.getSize().height - height) / 2,
+             width, height);
+     setMainPanel(mainPanel);
+   }
    void setMainPanel(Panel panel)
    {
      add(panel, BorderLayout.NORTH);
      buttonPanel.add(cancel);
      ok.addActionListener(this);
      cancel.addActionListener(this);
      add(buttonPanel, BorderLayout.SOUTH);
  
+     addWindowListener(new WindowAdapter()
+     {
+       public void windowClosing(WindowEvent ev)
+       {
+         setVisible(false);
+         dispose();
+       }
+     });
      pack();
  
    }
      }
  
      setVisible(false);
+     dispose();
    }
  
  }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -2860,6 -2860,15 +2860,15 @@@ public class JalviewLite extends Apple
            URL localref)
    {
      String resolvedPath = "";
+     if (targetPath.startsWith("/"))
+     {
+       String codebase = localref.toString();
+       String localfile = localref.getFile();
+       resolvedPath = codebase.substring(0,
+               codebase.length() - localfile.length())
+               + targetPath;
+       return resolvedPath;
+     }
  
      /*
       * get URL path and strip off any trailing file e.g.
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -566,6 -566,9 +566,9 @@@ public class AlignmentPanel extends GAl
      annotationScroller.setPreferredSize(new Dimension(annotationScroller
              .getWidth(), annotationHeight));
  
+     Dimension e = idPanel.getSize();
+     alabels.setSize(new Dimension(e.width, annotationHeight));
      annotationSpaceFillerHolder.setPreferredSize(new Dimension(
              annotationSpaceFillerHolder.getWidth(), annotationHeight));
      annotationScroller.validate();
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -78,12 -78,12 +78,12 @@@ public class AnnotationChooserTes
      // pin down annotation sort order for test
      Cache.applicationProperties.setProperty(Preferences.SORT_ANNOTATIONS,
              SequenceAnnotationOrder.NONE.name());
-     final String True = Boolean.TRUE.toString();
+     final String TRUE = Boolean.TRUE.toString();
      Cache.applicationProperties.setProperty(
-             Preferences.SHOW_AUTOCALC_ABOVE, True);
-     Cache.applicationProperties.setProperty("SHOW_QUALITY", True);
-     Cache.applicationProperties.setProperty("SHOW_CONSERVATION", True);
-     Cache.applicationProperties.setProperty("SHOW_IDENTITY", True);
+             Preferences.SHOW_AUTOCALC_ABOVE, TRUE);
+     Cache.applicationProperties.setProperty("SHOW_QUALITY", TRUE);
+     Cache.applicationProperties.setProperty("SHOW_CONSERVATION", TRUE);
+     Cache.applicationProperties.setProperty("SHOW_IDENTITY", TRUE);
  
      AlignmentI al = new jalview.io.FormatAdapter().readFile(TEST_DATA,
              AppletFormatAdapter.PASTE, "FASTA");
        assertTrue(i + "'th sequence not visible", anns[i].visible);
      }
  
+     /*
+      * check options to hide JMol and IUPRED annotations for all sequences
+      */
      final Checkbox hideCheckbox = (Checkbox) getComponent(testee, 1, 0, 1);
      setSelected(hideCheckbox, true);
  
      assertTrue(anns[0].visible); // Conservation
      assertTrue(anns[1].visible); // Quality
      assertTrue(anns[2].visible); // Consensus
-     assertTrue(anns[3].visible); // Beauty (not seq-related)
-     assertFalse(anns[4].visible); // IUPRED
+     assertFalse(anns[3].visible); // IUPRED
+     assertTrue(anns[4].visible); // Beauty (not seq-related)
      assertFalse(anns[5].visible); // JMol
      assertFalse(anns[6].visible); // IUPRED
      assertFalse(anns[7].visible); // JMol
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -35,7 -35,7 +35,7 @@@ public class FontChooserTes
     * available, plain) fonts and point sizes that would be rejected by Jalview's
     * FontChooser as having an I-width of less than 1.0.
     */
-   @Test(groups = { "Functional" })
+   @Test(groups = { "Functional" }, enabled = false)
    public void dumpInvalidFonts()
    {
      String[] fonts = java.awt.GraphicsEnvironment