fixed crash in export dialog
package io.github.mzmine.gui.chartbasics.graphicsexport;
import io.github.mzmine.util.color.SimpleColorPalette;
+import io.github.mzmine.util.javafx.FxColorUtil;
import java.awt.Color;
import java.io.File;
import java.util.logging.Level;
@@ -116,6 +117,9 @@ public class GraphicsExportDialogFX extends ParameterSetupDialog {
protected void applyTheme() {
// update param
updateParameterSetFromComponents();
+ chartParam = (ChartThemeParameters) parameterSet
+ .getParameter(GraphicsExportParameters.chartParameters).getValue();
+ colors = parameterSet.getParameter(GraphicsExportParameters.colorPalette).getValue();
// apply settings
chartParam.applyToChartTheme(theme);
setStandardColors();
@@ -130,7 +134,10 @@ public class GraphicsExportDialogFX extends ParameterSetupDialog {
}
protected void setStandardColors() {
- Color[] clrs = colors.toArray(new Color[0]);
+ Color[] clrs = new Color[colors.size()];
+ for(int i = 0; i < colors.size(); i++)
+ clrs[i] = colors.getAWT(i);
+
DrawingSupplier ds = new DefaultDrawingSupplier(clrs, clrs, clrs,
DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
