*/
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
});
description = new JTextArea(3, 25);
-
+
start = new JSpinner();
end = new JSpinner();
start.setPreferredSize(new Dimension(80, 20));
end.setPreferredSize(new Dimension(80, 20));
-
+
/*
* ensure that start can never be more than end
*/
- start.addChangeListener(new ChangeListener()
+ start.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
{
- Integer startVal = (Integer) start.getValue();
+ Integer startVal = (Integer) start.getValue();
((SpinnerNumberModel) end.getModel()).setMinimum(startVal);
}
});
- end.addChangeListener(new ChangeListener()
+ end.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
{
- Integer endVal = (Integer) end.getValue();
+ Integer endVal = (Integer) end.getValue();
((SpinnerNumberModel) start.getModel()).setMaximum(endVal);
}
});
updateColourButton(mainPanel, colour, featureColour);
};
};
- JalviewColourChooser.showColourChooser(Desktop.getDesktop(),
+ JalviewColourChooser.showColourChooser(Desktop.getDesktopPane(),
title, featureColour.getColour(), listener);
}
else
start.setValue(new Integer(firstFeature.getBegin()));
end.setValue(new Integer(firstFeature.getEnd()));
- ((SpinnerNumberModel) start.getModel())
- .setMaximum(firstFeature.getEnd());
- ((SpinnerNumberModel) end.getModel())
- .setMinimum(firstFeature.getBegin());
+ ((SpinnerNumberModel) start.getModel()).setMaximum(firstFeature.getEnd());
+ ((SpinnerNumberModel) end.getModel()).setMinimum(firstFeature.getBegin());
description.setText(firstFeature.getDescription());
featureColour = fr.getFeatureStyle(featureType);
*/
public void showDialog()
{
- Runnable okAction = forCreate ? getCreateAction() : getAmendAction();
- Runnable cancelAction = getCancelAction();
+ Runnable okAction = forCreate ? getCreateAction() : getAmendAction();
+ Runnable cancelAction = getCancelAction();
/*
* set dialog action handlers for OK (create/Amend) and Cancel options
}
dialog.showInternalDialog(mainPanel, title,
- JvOptionPane.YES_NO_CANCEL_OPTION, JvOptionPane.PLAIN_MESSAGE,
- null, options, MessageManager.getString("action.ok"));
+ JvOptionPane.YES_NO_CANCEL_OPTION,
+ JvOptionPane.PLAIN_MESSAGE, null, options,
+ MessageManager.getString("action.ok"));
}
/**
*/
protected Runnable getCancelAction()
{
- Runnable okAction = new Runnable()
+ Runnable okAction = new Runnable()
{
@Override
public void run()
*/
protected Runnable getCreateAction()
{
- Runnable okAction = new Runnable()
+ Runnable okAction = new Runnable()
{
boolean useLastDefaults = features.get(0).getType() == null;
*/
protected Runnable getDeleteAction()
{
- Runnable deleteAction = new Runnable()
+ Runnable deleteAction = new Runnable()
{
@Override
public void run()
*/
protected Runnable getAmendAction()
{
- Runnable okAction = new Runnable()
+ Runnable okAction = new Runnable()
{
boolean useLastDefaults = features.get(0).getType() == null;
-
+
String featureType = name.getText();
-
+
String featureGroup = group.getText();
-
@Override
public void run()
{