Merge commit
authorCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 2 Feb 2015 15:49:53 +0000 (15:49 +0000)
committerCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 2 Feb 2015 15:49:53 +0000 (15:49 +0000)
1  2 
resources/lang/Messages.properties
src/jalview/analysis/Finder.java
src/jalview/appletgui/Finder.java
src/jalview/gui/Finder.java

@@@ -57,10 -57,8 +57,10 @@@ action.by_pairwise_id = by Pairwise Ide
  action.by_id = by Id
  action.by_length = by Length
  action.by_group = by Group
 +action.unmark_as_reference = Unmark as Reference 
 +action.set_as_reference = Set as Reference 
  action.remove = Remove
 -action.remove_redundancy = Remove Redundancy
 +action.remove_redundancy = Remove Redundancy...
  action.pairwise_alignment = Pairwise Alignments...
  action.by_rna_helixes = by RNA Helices
  action.user_defined = User Defined...
@@@ -478,8 -476,8 +478,8 @@@ label.settings_for_type = Settings for 
  label.view_full_application = View in Full Application
  label.load_associated_tree = Load Associated Tree ...
  label.load_features_annotations = Load Features/Annotations ...
 -label.export_features = Export Features
 -label.export_annotations = Export Annotations
 +label.export_features = Export Features ...
 +label.export_annotations = Export Annotations ...
  label.jalview_copy = Copy (Jalview Only)
  label.jalview_cut = Cut (Jalview Only)
  label.to_upper_case = To Upper Case
@@@ -597,7 -595,7 +597,7 @@@ label.figure_id_column_width = Figure I
  label.use_modeller_output = Use Modeller Output
  label.wrap_alignment = Wrap Alignment
  label.right_align_ids = Right Align Ids
 -label.sequence_name_italics = Seq Name Italics
 +label.sequence_name_italics = Sequence Name Italics
  label.open_overview = Open Overview
  label.default_colour_scheme_for_alignment = Default Colour Scheme for alignment
  label.annotation_shading_default = Annotation Shading Default
@@@ -1178,16 -1176,4 +1178,17 @@@ label.show_logo = Show Log
  label.normalise_logo = Normalise Logo
  label.no_colour_selection_in_scheme = Please, make a colour selection before to apply colour scheme
  label.no_colour_selection_warn = Error saving colour scheme
 +label.select_by_annotation = Select By Annotation
 +action.select_by_annotation = Select by Annotation...
 +label.threshold_filter =  Threshold Filter
 +action.hide = Hide
 +action.select = Select
 +label.alpha_helix = Alpha Helix
 +label.beta_strand = Beta Strand
 +label.turn = Turn
 +label.select_all = Select All
 +label.structures_filter = Structures Filter
 +label.search_filter = Search Filter
 +label.display_name = Display Label
 +label.description = Description
+ label.include_description= Include Description
@@@ -42,6 -42,8 +42,8 @@@ public class Finde
  
    boolean caseSensitive = false;
  
+   private boolean includeDescription = false;
    boolean findAll = false;
  
    com.stevesoft.pat.Regex regex = null;
            }
          }
  
-         if (regex.search(seq.getDescription()))
+         if (isIncludeDescription() && regex.search(seq.getDescription()))
          {
            idMatch.addElement(seq);
            hasResults = true;
            {
              continue;
            }
 -
 +// if invalid string used, then regex has no matched to/from
            int sres = seq
                    .findPosition(resIndex
                            + Integer.parseInt(spaces.elementAt(resIndex)
    {
      this.seqIndex = seqIndex;
    }
+   public boolean isIncludeDescription()
+   {
+     return includeDescription;
+   }
+   public void setIncludeDescription(boolean includeDescription)
+   {
+     this.includeDescription = includeDescription;
+   }
  }
   */
  package jalview.appletgui;
  
- import java.util.*;
- import java.awt.*;
- import java.awt.event.*;
- import jalview.datamodel.*;
+ import jalview.datamodel.SearchResults;
+ import jalview.datamodel.SequenceFeature;
+ import jalview.datamodel.SequenceI;
  import jalview.util.MessageManager;
  
+ import java.awt.Button;
+ import java.awt.Checkbox;
+ import java.awt.Font;
+ import java.awt.Frame;
+ import java.awt.GridLayout;
+ import java.awt.Label;
+ import java.awt.Panel;
+ import java.awt.Rectangle;
+ import java.awt.TextField;
+ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
+ import java.awt.event.KeyEvent;
+ import java.awt.event.WindowAdapter;
+ import java.awt.event.WindowEvent;
+ import java.util.Vector;
  public class Finder extends Panel implements ActionListener
  {
    AlignViewport av;
              features, true, ap))
      {
        ap.alignFrame.sequenceFeatures.setState(true);
 -      av.showSequenceFeatures(true);
 +      av.setShowSequenceFeatures(true);
        ap.highlightSearchResults(null);
      }
    }
      jalview.analysis.Finder finder = new jalview.analysis.Finder(
              av.getAlignment(), av.getSelectionGroup(), seqIndex, resIndex);
      finder.setCaseSensitive(caseSensitive.getState());
+     finder.setIncludeDescription(searchDescription.getState());
      finder.setFindAll(findAll);
  
      String searchString = textfield.getText();
  
    protected Button findNext = new Button();
  
-   Panel jPanel1 = new Panel();
+   Panel actionsPanel = new Panel();
  
    GridLayout gridLayout1 = new GridLayout();
  
  
    Checkbox caseSensitive = new Checkbox();
  
+   Checkbox searchDescription = new Checkbox();
    private void jbInit() throws Exception
    {
      jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
      this.setLayout(null);
      textfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
      textfield.setText("");
-     textfield.setBounds(new Rectangle(40, 27, 133, 21));
+     textfield.setBounds(new Rectangle(40, 17, 133, 21));
      textfield.addKeyListener(new java.awt.event.KeyAdapter()
      {
        public void keyTyped(KeyEvent e)
      findNext.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
      findNext.setLabel(MessageManager.getString("action.find_next"));
      findNext.addActionListener(this);
-     jPanel1.setBounds(new Rectangle(180, 5, 141, 64));
-     jPanel1.setLayout(gridLayout1);
+     actionsPanel.setBounds(new Rectangle(195, 5, 141, 64));
+     actionsPanel.setLayout(gridLayout1);
      gridLayout1.setHgap(0);
      gridLayout1.setRows(3);
      gridLayout1.setVgap(2);
      createNewGroup.setLabel(MessageManager.getString("label.new_feature"));
      createNewGroup.addActionListener(this);
      caseSensitive.setLabel(MessageManager.getString("label.match_case"));
-     caseSensitive.setBounds(new Rectangle(40, 49, 126, 23));
-     jPanel1.add(findNext, null);
-     jPanel1.add(findAll, null);
-     jPanel1.add(createNewGroup, null);
+     caseSensitive.setBounds(new Rectangle(30, 39, 126, 23));
+     searchDescription.setLabel(MessageManager
+             .getString("label.include_description"));
+     searchDescription.setBounds(new Rectangle(30, 59, 170, 23));
+     actionsPanel.add(findNext, null);
+     actionsPanel.add(findAll, null);
+     actionsPanel.add(createNewGroup, null);
      this.add(caseSensitive);
      this.add(textfield, null);
      this.add(jLabel1, null);
-     this.add(jPanel1, null);
+     this.add(actionsPanel, null);
+     this.add(searchDescription);
    }
  
    void textfield_keyTyped(KeyEvent e)
@@@ -182,7 -182,7 +182,7 @@@ public class Finder extends GFinde
                searchResults.getResultEnd(i), "Search Results");
      }
  
 -    if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
 +    if (ap.getSeqPanel().seqCanvas.getFeatureRenderer().amendFeatures(seqs,
              features, true, ap))
      {
        ap.alignFrame.showSeqFeatures.setSelected(true);
      jalview.analysis.Finder finder = new jalview.analysis.Finder(
              av.getAlignment(), av.getSelectionGroup(), seqIndex, resIndex);
      finder.setCaseSensitive(caseSensitive.isSelected());
+     finder.setIncludeDescription(searchDescription.isSelected());
      finder.setFindAll(findAll);
  
      finder.find(searchString); // returns true if anything was actually found
      if ((idMatch.size() > 0))
      {
        haveResults = true;
 -      ap.idPanel.highlightSearchResults(idMatch);
 +      ap.getIdPanel().highlightSearchResults(idMatch);
      }
      else
      {
 -      ap.idPanel.highlightSearchResults(null);
 +      ap.getIdPanel().highlightSearchResults(null);
      }
  
      if (searchResults.getSize() > 0)