Merge branch 'Release_2_8_2_Branch' of https://source.jalview.org/git/jalview.git...
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 18 Nov 2014 11:32:25 +0000 (11:32 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 18 Nov 2014 11:32:25 +0000 (11:32 +0000)
1  2 
help/html/features/preferences.html
src/jalview/gui/Preferences.java

@@@ -113,17 -113,15 +113,16 @@@ will be loaded.</p
  <p><a name="structure"><strong>&quot;Structure&quot;
  Preferences tab</strong></a><em> added in Jalview 2.8.2</em></p>
  <p><em>Process secondary structure from PDB</em> - if selected, then structure information
- read from PDB will be processed to derive secondary structure annotation.
- <p><em>Use RNAView for secondary structure</em> - if selected, the RNAView service will be 
- automatically called to derive secondary structure information.
- <p><em>Add secondary structure annotation to alignment</em> - if selected, PDB secondary structure
- annotation will be shown on the alignment when available.
- <p><em>Add Temperature Factor annotation to alignment</em> - if selected, PDB Temperature Factor
- annotation will be shown on the alignment when available. 
+ read from PDB will be processed and annotation added to associated sequences.
+ <p><em>Use RNAView for secondary structure</em> - if selected, the pyRNA RNAView service (<a href="https://github.com/fjossinet/PyRNA">https://github.com/fjossinet/PyRNA</a>) will be 
+ called to derive secondary structure information for RNA chains.
+ <p><em>Add secondary structure annotation to alignment</em> - if selected, <a href="http://swift.cmbi.ru.nl/gv/dssp/">Jmol's implementation DSSP</a> will be used to add annotation to polypeptide chains in the structure.
+ <p><em>Add Temperature Factor annotation to alignment</em> - if selected, values extracted from the Temperature Factor
+ column for the backbone atoms in the PDB file will be extracted as annotation lines shown on the alignment. 
  <p><em>Default structure viewer</em> - choose JMOL or CHIMERA for viewing 3D structures. 
  <p><em>Path to Chimera program</em> - Optional, as Jalview will search standard installation paths for Windows, Linux or MacOS. 
 -If you have installed Chimera in a non-standard location, you can specify it here. Enter the full path to the Chimera executable program.  
 +If you have installed Chimera in a non-standard location, you can specify it here, by entering the full path to the Chimera executable program.
 +Double-click this field to open a file chooser dialog.  
  
  <p><a name="connections"><strong>&quot;Connections&quot;
  Preferences tab</strong></a></p>
@@@ -291,7 -291,17 +291,7 @@@ public class Preferences extends GPrefe
        @Override
        public void actionPerformed(ActionEvent e)
        {
 -        if (chimeraPath.getText().trim().length() > 0)
 -        {
 -          File f = new File(chimeraPath.getText());
 -          if (!f.canExecute())
 -          {
 -            JOptionPane.showInternalMessageDialog(Desktop.desktop,
 -                    MessageManager.getString("label.invalid_path"),
 -                    MessageManager.getString("label.invalid_name"),
 -                    JOptionPane.ERROR_MESSAGE);
 -          }
 -        }
 +        validateChimeraPath();
        }
      });
  
     */
    public void ok_actionPerformed(ActionEvent e)
    {
 +    if (!validateSettings())
 +    {
 +      return;
 +    }
 +
      /*
       * Save Visual settings
       */
  
      dasSource.saveProperties(Cache.applicationProperties);
      wsPrefs.updateAndRefreshWsMenuConfig(false);
      Cache.saveProperties();
+     Desktop.instance.doConfigureStructurePrefs();
      try
      {
        frame.setClosed(true);
    }
  
    /**
 +   * Do any necessary validation before saving settings.
 +   * 
 +   * @return
 +   */
 +  private boolean validateSettings()
 +  {
 +    if (!validateStructure())
 +    {
 +      structureTab.requestFocusInWindow();
 +      return false;
 +    }
 +    return true;
 +  }
 +
 +  @Override
 +  protected boolean validateStructure()
 +  {
 +    return validateChimeraPath();
 +
 +  }
 +  /**
     * DOCUMENT ME!
     */
    public void startupFileTextfield_mouseClicked()
      userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());
    }
  
 +  /**
 +   * Returns true if chimera path is to a valid executable, else show an error
 +   * dialog.
 +   */
 +  private boolean validateChimeraPath()
 +  {
 +    if (chimeraPath.getText().trim().length() > 0)
 +    {
 +      File f = new File(chimeraPath.getText());
 +      if (!f.canExecute())
 +      {
 +        JOptionPane.showInternalMessageDialog(Desktop.desktop,
 +                MessageManager.getString("label.invalid_chimera_path"),
 +                MessageManager.getString("label.invalid_name"),
 +                JOptionPane.ERROR_MESSAGE);
 +        return false;
 +      }
 +    }
 +    return true;
 +  }
 +
  }