From: Jim Procter Date: Thu, 25 May 2017 16:16:27 +0000 (+0100) Subject: Merge branch 'develop' into features/JAL-1648_cache_user_inputs X-Git-Tag: Release_2_10_2~3^2~45^2~2^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=78256846b6471432d6cb1996d893845f24b2566c;p=jalview.git Merge branch 'develop' into features/JAL-1648_cache_user_inputs bugfixes in finder for feature creation and minimum window size merged to topic --- 78256846b6471432d6cb1996d893845f24b2566c diff --cc resources/lang/Messages.properties index d4ae42f,a24e768..ee08b56 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@@ -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 diff --cc src/jalview/gui/AnnotationColumnChooser.java index 00ccbf0,96299e7..a15f605 --- a/src/jalview/gui/AnnotationColumnChooser.java +++ b/src/jalview/gui/AnnotationColumnChooser.java @@@ -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; diff --cc src/jalview/gui/Finder.java index a314cef,625fc27..be7f9e5 --- a/src/jalview/gui/Finder.java +++ b/src/jalview/gui/Finder.java @@@ -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(); } /** @@@ -205,28 -203,27 +212,27 @@@ } /** - * 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 seqs = new ArrayList(); + List features = new ArrayList(); + - 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, @@@ -242,13 -243,13 +252,13 @@@ * 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)) { diff --cc src/jalview/jbgui/GFinder.java index ee8a81a,7e9fc30..bbd20ca --- a/src/jalview/jbgui/GFinder.java +++ b/src/jalview/jbgui/GFinder.java @@@ -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 searchBox = new JvCacheableInputBox(getCacheKey()); BorderLayout mainBorderLayout = new BorderLayout(); @@@ -130,12 -130,13 +130,12 @@@ @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)