{
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
{
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
*