From: hansonr Date: Wed, 27 Jun 2018 10:24:43 +0000 (+0100) Subject: JAL-3032 Dialogs Color picker -- untested commit X-Git-Tag: Release_2_11_4_0~45^2~18^2~631 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e0cb20bd71f4e90314f1c20ea8359d23016b64fe;p=jalview.git JAL-3032 Dialogs Color picker -- untested commit --- diff --git a/src/jalview/gui/FeatureRenderer.java b/src/jalview/gui/FeatureRenderer.java index 46f574e..3b9c622 100644 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@ -194,14 +194,13 @@ public class FeatureRenderer { if (fcol.isSimpleColour()) { - Color col = JColorChooser.showDialog(Desktop.desktop, + // BH 2018 JavaScript-compatible color dialog + Desktop.desktop.dialogData = new Object[] { + "label.select_feature_colour", this, mainPanel, colour }; + Desktop.desktop + .onDialogReturn(JColorChooser.showDialog(Desktop.desktop, MessageManager.getString("label.select_feature_colour"), - fcol.getColour()); - if (col != null) - { - fcol = new FeatureColour(col); - updateColourButton(mainPanel, colour, fcol); - } + fcol.getColour())); } else { @@ -500,6 +499,17 @@ public class FeatureRenderer return true; } + void processColorDialog(Color col) + { + JPanel mainPanel = (JPanel) Desktop.desktop.dialogData[2]; + JLabel colour = (JLabel) Desktop.desktop.dialogData[3]; + if (col != null) + { + fcol = new FeatureColour(col); + updateColourButton(mainPanel, colour, fcol); + } + } + /** * Show a warning message if the entered type is one that is currently hidden *