diff --git a/swing/src/main/java/info/openrocket/swing/gui/plot/EventGraphics.java b/swing/src/main/java/info/openrocket/swing/gui/plot/EventGraphics.java index 812c9886d..27005f4da 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/plot/EventGraphics.java +++ b/swing/src/main/java/info/openrocket/swing/gui/plot/EventGraphics.java @@ -15,7 +15,8 @@ import info.openrocket.core.simulation.FlightEvent; public class EventGraphics { - static Color getEventColor(FlightEvent.Type type) { + static Color getEventColor(FlightEvent event) { + FlightEvent.Type type = event.getType(); Color c = EVENT_COLORS.get(type); if (c != null) return c; @@ -23,7 +24,6 @@ public class EventGraphics { } static Image getEventImage(FlightEvent event) { - FlightEvent.Type type = event.getType(); if (type == FlightEvent.Type.SIM_WARN) { return MESSAGE_IMAGES.get(((Warning) event.getData()).getPriority()); @@ -48,6 +48,7 @@ public class EventGraphics { EVENT_COLORS.put(FlightEvent.Type.SIMULATION_END, new Color(128, 0, 0)); EVENT_COLORS.put(FlightEvent.Type.TUMBLE, new Color(196, 0, 255)); EVENT_COLORS.put(FlightEvent.Type.EXCEPTION, new Color(255, 0, 0)); + EVENT_COLORS.put(FlightEvent.Type.SIM_WARN, new Color(127, 127, 0)); EVENT_COLORS.put(FlightEvent.Type.SIM_ABORT, new Color(255, 0, 0)); } diff --git a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java index 0d02bc5ff..21dec76a6 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java +++ b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java @@ -183,7 +183,7 @@ public class SimulationPlot extends Plot maxOrdinal) { - color = EventGraphics.getEventColor(type); + color = EventGraphics.getEventColor(info.event); image = EventGraphics.getEventImage(info.event); maxOrdinal = type.ordinal(); } @@ -199,7 +199,7 @@ public class SimulationPlot extends Plot