X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureEditor.java;h=b53e57c8609ec41deb1da31ca29f2fcf3ccf1337;hb=747167089ecf8d6afc70d417f5a20352e029bd95;hp=844eee4f74c3ccddb2325ed6e6a8bd4e9d1e739d;hpb=0e8bd9f4db76c85561be7e65f1e987c2d78b4fd6;p=jalview.git diff --git a/src/jalview/gui/FeatureEditor.java b/src/jalview/gui/FeatureEditor.java index 844eee4..b53e57c 100644 --- a/src/jalview/gui/FeatureEditor.java +++ b/src/jalview/gui/FeatureEditor.java @@ -20,6 +20,17 @@ */ 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; @@ -48,17 +59,6 @@ import javax.swing.event.ChangeListener; 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 @@ -190,30 +190,30 @@ public class FeatureEditor }); 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); } }); @@ -242,7 +242,7 @@ public class FeatureEditor updateColourButton(mainPanel, colour, featureColour); }; }; - JalviewColourChooser.showColourChooser(Desktop.getDesktop(), + JalviewColourChooser.showColourChooser(Desktop.getDesktopPane(), title, featureColour.getColour(), listener); } else @@ -401,10 +401,8 @@ public class FeatureEditor 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); @@ -427,8 +425,8 @@ public class FeatureEditor */ 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 @@ -462,8 +460,9 @@ public class FeatureEditor } 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")); } /** @@ -476,7 +475,7 @@ public class FeatureEditor */ protected Runnable getCancelAction() { - Runnable okAction = new Runnable() + Runnable okAction = new Runnable() { @Override public void run() @@ -500,7 +499,7 @@ public class FeatureEditor */ protected Runnable getCreateAction() { - Runnable okAction = new Runnable() + Runnable okAction = new Runnable() { boolean useLastDefaults = features.get(0).getType() == null; @@ -559,7 +558,7 @@ public class FeatureEditor */ protected Runnable getDeleteAction() { - Runnable deleteAction = new Runnable() + Runnable deleteAction = new Runnable() { @Override public void run() @@ -662,14 +661,13 @@ public class FeatureEditor */ 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() {