From 0ffb6de3dacdb0df638a6e81fe39436ef90432a5 Mon Sep 17 00:00:00 2001 From: hneemann Date: Tue, 23 Jun 2020 08:38:43 +0200 Subject: [PATCH] fixes a color issue in the fsm editor --- distribution/ReleaseNotes.txt | 1 + src/main/java/de/neemann/digital/fsm/gui/FSMComponent.java | 2 +- .../de/neemann/digital/gui/components/CircuitComponent.java | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/distribution/ReleaseNotes.txt b/distribution/ReleaseNotes.txt index 7f704e149..33e842a41 100644 --- a/distribution/ReleaseNotes.txt +++ b/distribution/ReleaseNotes.txt @@ -1,6 +1,7 @@ Release Notes Head, planned as v0.25 +- Color schemes where added to support colorblind users. - Unipolar and bipolar stepper motors were added. - move the "lib" folder from the "examples" folder to the root folder. - Reordering of the cells in the K-Map diff --git a/src/main/java/de/neemann/digital/fsm/gui/FSMComponent.java b/src/main/java/de/neemann/digital/fsm/gui/FSMComponent.java index 4159576ec..d7d2452dc 100644 --- a/src/main/java/de/neemann/digital/fsm/gui/FSMComponent.java +++ b/src/main/java/de/neemann/digital/fsm/gui/FSMComponent.java @@ -315,7 +315,7 @@ public class FSMComponent extends JComponent { protected void paintComponent(Graphics graphics) { super.paintComponent(graphics); - graphics.setColor(Color.WHITE); + graphics.setColor(ColorScheme.getInstance().getColor(ColorKey.BACKGROUND)); graphics.fillRect(0, 0, getWidth(), getHeight()); Graphics2D gr2 = (Graphics2D) graphics; diff --git a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java index cfaacdb49..54284bc69 100644 --- a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java +++ b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java @@ -43,7 +43,6 @@ import java.io.IOException; import java.util.List; import java.util.*; -import static de.neemann.digital.draw.graphics.ColorScheme.*; import static de.neemann.digital.draw.shapes.GenericShape.SIZE; import static de.neemann.digital.draw.shapes.GenericShape.SIZE2; @@ -858,7 +857,7 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib Graphics2D gr2 = buffer.createGraphics(); enableAntiAlias(gr2); - gr2.setColor(getInstance().getColor(ColorKey.BACKGROUND)); + gr2.setColor(ColorScheme.getInstance().getColor(ColorKey.BACKGROUND)); gr2.fillRect(0, 0, getWidth(), getHeight()); if (scaleX > 0.3 && Settings.getInstance().get(Keys.SETTINGS_GRID)) @@ -916,7 +915,7 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib if (delta > max) delta = max; double sub = delta / 2.0; - gr2.setColor(getInstance().getColor(ColorKey.GRID)); + gr2.setColor(ColorScheme.getInstance().getColor(ColorKey.GRID)); for (int x = 0; x <= cx; x++) { double xx = p1.getX() + (p2.getX() - p1.getX()) * x / cx - sub; for (int y = 0; y <= cy; y++) {