From: gmungoc Date: Tue, 10 Jul 2018 10:58:14 +0000 (+0100) Subject: JAL-3048 adapt Cancel and refresh for JalviewJS X-Git-Tag: Release_2_11_4_0~45^2~18^2~554 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f5cadda2a0b026f7f9be53db4c9b5bc3c6d47a83;p=jalview.git JAL-3048 adapt Cancel and refresh for JalviewJS --- diff --git a/src/jalview/gui/TextColourChooser.java b/src/jalview/gui/TextColourChooser.java index faf19ad..86a51ab 100644 --- a/src/jalview/gui/TextColourChooser.java +++ b/src/jalview/gui/TextColourChooser.java @@ -23,6 +23,7 @@ package jalview.gui; import jalview.datamodel.SequenceGroup; import jalview.gui.JalviewColourChooser.ColourChooserListener; import jalview.util.MessageManager; +import jalview.util.dialogrunner.RunResponse; import java.awt.BorderLayout; import java.awt.Color; @@ -145,16 +146,23 @@ public class TextColourChooser } }); - int reply = JvOptionPane.showInternalOptionDialog(alignPanel, bigpanel, - MessageManager.getString( - "label.adjunst_foreground_text_colour_threshold"), - JvOptionPane.OK_CANCEL_OPTION, JvOptionPane.QUESTION_MESSAGE, - null, null, null); - - if (reply == JvOptionPane.CANCEL_OPTION) + Object[] options = new Object[] { MessageManager.getString("action.ok"), + MessageManager.getString("action.cancel") }; + String title = MessageManager + .getString("label.adjunst_foreground_text_colour_threshold"); + RunResponse action = new RunResponse(JvOptionPane.NO_OPTION) // Cancel { - restoreInitialSettings(); - } + @Override + public void run() + { + restoreInitialSettings(); + } + }; + JvOptionPane.newOptionDialog(alignPanel).response(action) + .showInternalDialog(bigpanel, title, + JvOptionPane.YES_NO_CANCEL_OPTION, + JvOptionPane.PLAIN_MESSAGE, null, options, + MessageManager.getString("action.ok")); } /** @@ -185,6 +193,8 @@ public class TextColourChooser group.textColour2 = groupColour2.get(group); group.thresholdTextColour = groupThreshold.get(group); } + + ap.paintAlignment(false, false); } /**