Merge branch 'develop' into features/JAL-1648_cache_user_inputs
authorJim Procter <jprocter@issues.jalview.org>
Thu, 25 May 2017 16:16:27 +0000 (17:16 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 25 May 2017 16:16:27 +0000 (17:16 +0100)
bugfixes in finder for feature creation and minimum window size merged to topic

1  2 
resources/lang/Messages.properties
src/jalview/fts/core/GFTSPanel.java
src/jalview/gui/AnnotationColumnChooser.java
src/jalview/gui/Finder.java
src/jalview/jbgui/GFinder.java

@@@ -1294,5 -1301,13 +1301,15 @@@ warn.name_cannot_be_duplicate = User-de
  label.invalid_name = Invalid Name !
  label.output_seq_details = Output Sequence Details to list all database references
  label.urllinks = Links
 +label.default_cache_size = Default Cache Size
- action.clear_cached_items = Clear Cached Items
++action.clear_cached_items = Clear Cached Items
+ label.togglehidden = Show hidden regions
+ label.quality_descr = Alignment Quality based on Blosum62 scores
+ label.conservation_descr = Conservation of total alignment less than {0}% gaps
+ label.consensus_descr = PID
+ label.complement_consensus_descr = PID for cDNA
+ label.strucconsensus_descr = PID for base pairs
+ label.occupancy_descr = Number of aligned positions 
+ label.show_experimental = Enable experimental features
+ label.show_experimental_tip = Enable any new and currently 'experimental' features (see Latest Release Notes for details)
+ label.warning_hidden = Warning: {0} {1} is currently hidden
Simple merge
@@@ -21,9 -21,7 +21,8 @@@
  
  package jalview.gui;
  
- import jalview.datamodel.AlignmentAnnotation;
- import jalview.datamodel.ColumnSelection;
+ import jalview.datamodel.HiddenColumns;
 +import jalview.io.cache.JvCacheableInputBox;
  import jalview.schemes.AnnotationColourGradient;
  import jalview.util.MessageManager;
  import jalview.viewmodel.annotationfilter.AnnotationFilterParameter;
@@@ -94,19 -100,11 +101,19 @@@ public class Finder extends GFinde
      frame = new JInternalFrame();
      frame.setContentPane(this);
      frame.setLayer(JLayeredPane.PALETTE_LAYER);
 +    frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
 +    {
 +      @Override
 +      public void internalFrameClosing(InternalFrameEvent e)
 +      {
 +        closeAction();
 +      }
 +    });
      addEscapeHandler();
      Desktop.addInternalFrame(frame, MessageManager.getString("label.find"),
-             WIDTH, HEIGHT);
+             MY_WIDTH, MY_HEIGHT);
+     frame.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
 -    textfield.requestFocus();
 +    searchBox.requestFocus();
    }
  
    /**
    }
  
    /**
-    * DOCUMENT ME!
-    * 
-    * @param e
-    *          DOCUMENT ME!
+    * Opens a dialog that allows the user to create sequence features for the
+    * find match results.
     */
    @Override
-   public void createNewGroup_actionPerformed(ActionEvent e)
+   public void createFeatures_actionPerformed()
    {
-     SequenceI[] seqs = new SequenceI[searchResults.getSize()];
-     SequenceFeature[] features = new SequenceFeature[searchResults
-             .getSize()];
+     List<SequenceI> seqs = new ArrayList<SequenceI>();
+     List<SequenceFeature> features = new ArrayList<SequenceFeature>();
 -    String searchString = textfield.getText().trim();
++    String searchString = searchBox.getEditor().getItem().toString().trim();
+     String desc = "Search Results";
  
-     int i = 0;
+     /*
+      * assemble dataset sequences, and template new sequence features,
+      * for the amend features dialog
+      */
      for (SearchResultMatchI match : searchResults.getResults())
      {
-       seqs[i] = match.getSequence().getDatasetSequence();
-       features[i] = new SequenceFeature(searchBox.getEditor().getItem()
-               .toString().trim(),
-               "Search Results", null, match.getStart(), match.getEnd(),
-               "Search Results");
-       i++;
+       seqs.add(match.getSequence().getDatasetSequence());
+       features.add(new SequenceFeature(searchString, desc, null, match
+               .getStart(), match.getEnd(), desc));
      }
  
      if (ap.getSeqPanel().seqCanvas.getFeatureRenderer().amendFeatures(seqs,
     * Search the alignment for the next or all matches. If 'all matches', a
     * dialog is shown with the number of sequence ids and subsequences matched.
     * 
-    * @param findAll
+    * @param doFindAll
     */
-   void doSearch(boolean findAll)
+   void doSearch(boolean doFindAll)
    {
-     createNewGroup.setEnabled(false);
+     createFeatures.setEnabled(false);
  
 -    String searchString = textfield.getText().trim();
 +    String searchString = searchBox.getUserInput().trim();
  
      if (isInvalidSearchString(searchString))
      {
@@@ -57,9 -57,11 +57,9 @@@ public class GFinder extends JPane
  
    GridLayout gridLayout1 = new GridLayout();
  
-   protected JButton createNewGroup = new JButton();
+   protected JButton createFeatures = new JButton();
  
 -  JScrollPane jScrollPane1 = new JScrollPane();
 -
 -  protected JTextArea textfield = new JTextArea();
 +  protected JvCacheableInputBox<String> searchBox = new JvCacheableInputBox<String>(getCacheKey());
  
    BorderLayout mainBorderLayout = new BorderLayout();
  
        @Override
        public void actionPerformed(ActionEvent e)
        {
-         createNewGroup_actionPerformed(e);
+         createFeatures_actionPerformed();
        }
      });
 -    textfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 12));
 -    textfield.setText("");
 -    textfield.setLineWrap(true);
 -    textfield.addCaretListener(new CaretListener()
 +    searchBox.setFont(new java.awt.Font("Verdana", Font.PLAIN, 12));
 +    ((JTextComponent) searchBox.getEditor().getEditorComponent())
 +            .addCaretListener(new CaretListener()
      {
        @Override
        public void caretUpdate(CaretEvent e)