added awt color methods to SimpleColorPalette to remove redundant code
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.logging.Logger;
+import javafx.collections.FXCollections;
import javax.annotation.Nonnull;
import org.jfree.chart.plot.DefaultDrawingSupplier;
import org.w3c.dom.Element;
@@ -128,6 +129,10 @@ public class SimpleColorPalette extends ModifiableObservableListBase<Color> impl
return get(next - 1);
}
+ public java.awt.Color getNextColorAWT(int index) {
+ return FxColorUtil.fxColorToAWT(getNextColor());
+ }
+
@Nonnull
public Color getMainColor() {
if (isValidPalette()) {
@@ -136,6 +141,10 @@ public class SimpleColorPalette extends ModifiableObservableListBase<Color> impl
return Color.BLACK;
}
+ public java.awt.Color getMainColor(int index) {
+ return FxColorUtil.fxColorToAWT(getMainColor());
+ }
+
public boolean isValidPalette() {
if (this.isEmpty()) {
return false;
@@ -326,6 +335,10 @@ public class SimpleColorPalette extends ModifiableObservableListBase<Color> impl
return positiveColor;
}
+ public java.awt.Color getPositiveColorAWT() {
+ return FxColorUtil.fxColorToAWT(getPositiveColor());
+ }
+
public void setPositiveColor(Color positiveColor) {
this.positiveColor = positiveColor;
}
@@ -334,6 +347,10 @@ public class SimpleColorPalette extends ModifiableObservableListBase<Color> impl
return negativeColor;
}
+ public java.awt.Color getNegativeColorAWT() {
+ return FxColorUtil.fxColorToAWT(getNegativeColor());
+ }
+
public void setNegativeColor(Color negativeColor) {
this.negativeColor = negativeColor;
}
@@ -342,6 +359,10 @@ public class SimpleColorPalette extends ModifiableObservableListBase<Color> impl
return neutralColor;
}
+ public java.awt.Color getNeutralColorAWT() {
+ return FxColorUtil.fxColorToAWT(getNeutralColor());
+ }
+
public void setNeutralColor(Color neutralColor) {
this.neutralColor = neutralColor;
}
@@ -353,6 +374,10 @@ public class SimpleColorPalette extends ModifiableObservableListBase<Color> impl
return delegate.get(index);
}
+ public java.awt.Color getAWT(int index) {
+ return FxColorUtil.fxColorToAWT(get(index));
+ }
+
@Override
public int size() {
return delegate.size();
