import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
-import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
});
addEscapeHandler();
Desktop.addInternalFrame(frame, MessageManager.getString("label.find"),
- MY_WIDTH, MY_HEIGHT);
- frame.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
- searchBox.requestFocus();
+ true, MY_WIDTH, MY_HEIGHT, true, true);
+ searchBox.getComponent().requestFocus();
}
/**
/**
* Opens a dialog that allows the user to create sequence features for the
- * find match results.
+ * find match results
*/
@Override
public void createFeatures_actionPerformed()
{
+ if (searchResults.isEmpty())
+ {
+ return; // shouldn't happen
+ }
List<SequenceI> seqs = new ArrayList<SequenceI>();
List<SequenceFeature> features = new ArrayList<SequenceFeature>();
- String searchString = searchBox.getEditor().getItem().toString().trim();
+ String searchString = searchBox.getUserInput();
String desc = "Search Results";
/*
match.getEnd(), desc));
}
- new FeatureEditor(ap).createFeatures(seqs, features, new Runnable()
- {
- @Override
- public void run()
- {
-
- /*
- * ensure feature display is turned on to show the new features,
- * and remove them as highlighted regions
- */
- ap.alignFrame.showSeqFeatures.setSelected(true);
- av.setShowSequenceFeatures(true);
- ap.highlightSearchResults(null);
- }
- });
+ new FeatureEditor(ap, seqs, features, true).showDialog();
}
/**
{
createFeatures.setEnabled(false);
- String searchString = searchBox.getUserInput().trim();
+ String searchString = searchBox.getUserInput();
if (isInvalidSearchString(searchString))
{
seqIndex = 0;
JvOptionPane.showInternalMessageDialog(this,
MessageManager.getString("label.finished_searching"), null,
- JvOptionPane.INFORMATION_MESSAGE);
+ JvOptionPane.PLAIN_MESSAGE);
}
else
{
resIndex = -1;
seqIndex = 0;
JvOptionPane.showInternalMessageDialog(this, message, null,
- JvOptionPane.INFORMATION_MESSAGE);
+ JvOptionPane.PLAIN_MESSAGE);
}
}
}