*/
package jalview.gui;
-import jalview.api.FeatureColourI;
-import jalview.datamodel.SearchResults;
-import jalview.datamodel.SearchResultsI;
-import jalview.datamodel.SequenceFeature;
-import jalview.datamodel.SequenceI;
-import jalview.gui.JalviewColourChooser.ColourChooserListener;
-import jalview.io.FeaturesFile;
-import jalview.schemes.FeatureColour;
-import jalview.util.ColorUtils;
-import jalview.util.MessageManager;
-
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
+import jalview.api.FeatureColourI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SearchResultsI;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+import jalview.gui.JalviewColourChooser.ColourChooserListener;
+import jalview.io.FeaturesFile;
+import jalview.schemes.FeatureColour;
+import jalview.util.ColorUtils;
+import jalview.util.MessageManager;
+
/**
* Provides a dialog allowing the user to add new features, or amend or delete
* existing features
* set dialog action handlers for OK (create/Amend) and Cancel options
* also for Delete if applicable (when amending features)
*/
- JvOptionPane dialog = JvOptionPane.newOptionDialog(Desktop.desktop)
+ JvOptionPane dialog = JvOptionPane.newOptionDialog(ap.alignFrame)
.setResponseHandler(0, okAction)
.setResponseHandler(2, cancelAction);
if (!forCreate)
{
boolean useLastDefaults = features.get(0).getType() == null;
+ @Override
public void run()
{
final String enteredType = name.getText().trim();
{
Runnable deleteAction = new Runnable()
{
+ @Override
public void run()
{
SequenceFeature sf = features.get(featureIndex);
String featureGroup = group.getText();
+ @Override
public void run()
{
final String enteredType = name.getText().trim();
package jalview.gui;
-import jalview.util.Platform;
-import jalview.util.dialogrunner.DialogRunnerI;
-
import java.awt.Component;
import java.awt.HeadlessException;
import java.beans.PropertyChangeEvent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
+import jalview.util.Platform;
+import jalview.util.dialogrunner.DialogRunnerI;
+
public class JvOptionPane extends JOptionPane
implements DialogRunnerI, PropertyChangeListener
{
if (action != null)
{
action.run();
+ parentComponent.requestFocus();
}
}
}