From e0cb20bd71f4e90314f1c20ea8359d23016b64fe Mon Sep 17 00:00:00 2001 From: hansonr Date: Wed, 27 Jun 2018 11:24:43 +0100 Subject: [PATCH] JAL-3032 Dialogs Color picker -- untested commit --- src/jalview/gui/FeatureRenderer.java | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) 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 * -- 1.7.10.2