From 4035e711c596efd783b557f4328817ce67fc5eb8 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Tue, 6 Nov 2012 09:31:52 -0600 Subject: [PATCH] Add stage number to series labels to ensure uniqueness. --- .../gui/plot/SimulationPlotDialog.java | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java b/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java index d76ad7968..b53c58ad2 100644 --- a/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java +++ b/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java @@ -80,8 +80,7 @@ public class SimulationPlotDialog extends JDialog { private static final Translator trans = Application.getTranslator(); private static final Color DEFAULT_EVENT_COLOR = new Color(0, 0, 0); - private static final Map EVENT_COLORS = - new HashMap(); + private static final Map EVENT_COLORS = new HashMap(); static { EVENT_COLORS.put(FlightEvent.Type.LAUNCH, new Color(255, 0, 0)); EVENT_COLORS.put(FlightEvent.Type.LIFTOFF, new Color(0, 80, 196)); @@ -96,8 +95,7 @@ public class SimulationPlotDialog extends JDialog { EVENT_COLORS.put(FlightEvent.Type.SIMULATION_END, new Color(128, 0, 0)); } - private static final Map EVENT_IMAGES = - new HashMap(); + private static final Map EVENT_IMAGES = new HashMap(); static { loadImage(FlightEvent.Type.LAUNCH, "pix/eventicons/event-launch.png"); loadImage(FlightEvent.Type.LIFTOFF, "pix/eventicons/event-liftoff.png"); @@ -164,26 +162,10 @@ public class SimulationPlotDialog extends JDialog { if (domainType == null) { throw new IllegalArgumentException("Domain axis type not specified."); } - /* FIXME - is this code dead too? - List x = mainBranch.get(domainType); - */ // Get plot length (ignore trailing NaN's) int typeCount = filled.getTypeCount(); - /* FIXME - is this code dead? - int dataLength = 0; - for (int i = 0; i < typeCount; i++) { - FlightDataType type = filled.getType(i); - List y = mainBranch.get(type); - - for (int j = dataLength; j < y.size(); j++) { - if (!Double.isNaN(y.get(j)) && !Double.isInfinite(y.get(j))) - dataLength = j; - } - } - dataLength = Math.min(dataLength, x.size()); - */ // Create the XYSeries objects from the flight data and store into the collections String[] axisLabel = new String[2]; @@ -199,7 +181,7 @@ public class SimulationPlotDialog extends JDialog { // Store data in provided units List plotx = thisBranch.get(domainType); List ploty = thisBranch.get(type); - XYSeries series = new XYSeries(thisBranch.getBranchName() + ": " + name, false, true); + XYSeries series = new XYSeries(thisBranch.getBranchName() + "-" + branchCount+": " + name, false, true); int pointCount = plotx.size(); for (int j = 0; j < pointCount; j++) { series.add(domainUnit.toUnit(plotx.get(j)), unit.toUnit(ploty.get(j)));