X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureEditor.java;h=b53e57c8609ec41deb1da31ca29f2fcf3ccf1337;hb=747167089ecf8d6afc70d417f5a20352e029bd95;hp=b829ec74e1c1b2ddc9ad25469db1b6ff43a1726e;hpb=1e28a196997a1e0b8b74d468bfd3df8ec74c1337;p=jalview.git diff --git a/src/jalview/gui/FeatureEditor.java b/src/jalview/gui/FeatureEditor.java index b829ec7..b53e57c 100644 --- a/src/jalview/gui/FeatureEditor.java +++ b/src/jalview/gui/FeatureEditor.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.gui; import jalview.api.FeatureColourI; @@ -10,7 +30,6 @@ import jalview.io.FeaturesFile; import jalview.schemes.FeatureColour; import jalview.util.ColorUtils; import jalview.util.MessageManager; -import jalview.util.dialogrunner.RunResponse; import java.awt.BorderLayout; import java.awt.Color; @@ -223,7 +242,7 @@ public class FeatureEditor updateColourButton(mainPanel, colour, featureColour); }; }; - JalviewColourChooser.showColourChooser(Desktop.getDesktop(), + JalviewColourChooser.showColourChooser(Desktop.getDesktopPane(), title, featureColour.getColour(), listener); } else @@ -406,18 +425,19 @@ public class FeatureEditor */ public void showDialog() { - RunResponse okAction = forCreate ? getCreateAction() : getAmendAction(); - RunResponse cancelAction = getCancelAction(); + Runnable okAction = forCreate ? getCreateAction() : getAmendAction(); + Runnable cancelAction = getCancelAction(); /* * 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) - .addResponse(0, okAction).addResponse(2, cancelAction); + JvOptionPane dialog = JvOptionPane.newOptionDialog(ap.alignFrame) + .setResponseHandler(0, okAction) + .setResponseHandler(2, cancelAction); if (!forCreate) { - dialog.addResponse(1, getDeleteAction()); + dialog.setResponseHandler(1, getDeleteAction()); } String title = null; @@ -453,9 +473,9 @@ public class FeatureEditor * * @return */ - protected RunResponse getCancelAction() + protected Runnable getCancelAction() { - RunResponse okAction = new RunResponse(JvOptionPane.CANCEL_OPTION) + Runnable okAction = new Runnable() { @Override public void run() @@ -477,12 +497,13 @@ public class FeatureEditor * * @return */ - protected RunResponse getCreateAction() + protected Runnable getCreateAction() { - RunResponse okAction = new RunResponse(JvOptionPane.OK_OPTION) + Runnable okAction = new Runnable() { boolean useLastDefaults = features.get(0).getType() == null; + @Override public void run() { final String enteredType = name.getText().trim(); @@ -535,10 +556,11 @@ public class FeatureEditor * * @return */ - protected RunResponse getDeleteAction() + protected Runnable getDeleteAction() { - RunResponse deleteAction = new RunResponse(JvOptionPane.NO_OPTION) + Runnable deleteAction = new Runnable() { + @Override public void run() { SequenceFeature sf = features.get(featureIndex); @@ -637,16 +659,16 @@ public class FeatureEditor * * @return */ - protected RunResponse getAmendAction() + protected Runnable getAmendAction() { - RunResponse okAction = new RunResponse(JvOptionPane.OK_OPTION) + Runnable okAction = new Runnable() { boolean useLastDefaults = features.get(0).getType() == null; String featureType = name.getText(); String featureGroup = group.getText(); - + @Override public void run() { final String enteredType = name.getText().trim();