diff --git a/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java b/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java index 332406660..9b376df8f 100644 --- a/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java +++ b/core/src/net/sf/openrocket/gui/plot/SimulationPlot.java @@ -132,12 +132,13 @@ public class SimulationPlot { int axis = filled.getAxis(i); String name = getLabel(type, unit); + List seriesNames = Util.generateSeriesLabels(simulation); for( int branchIndex=0; branchIndex plotx = thisBranch.get(domainType); List ploty = thisBranch.get(type); - XYSeries series = new XYSeries(thisBranch.getBranchName() + " (" + branchIndex+"): " + name, false, true); + XYSeries series = new XYSeries(seriesNames.get(branchIndex) + ": " + name, false, true); series.setDescription(thisBranch.getBranchName()+": " + name); int pointCount = plotx.size(); for (int j = 0; j < pointCount; j++) { diff --git a/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java b/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java index aa0a75065..df6e95744 100644 --- a/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java +++ b/core/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java @@ -7,6 +7,7 @@ import java.awt.event.InputEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import javax.swing.JButton; @@ -111,11 +112,10 @@ public class SimulationPlotDialog extends JDialog { //// Add series selection box //// FIXME - List stages = new ArrayList(); + ArrayList stages = new ArrayList(); stages.add("All"); - for (int i = 0; i < simulation.getSimulatedData().getBranchCount(); i++) { - stages.add(simulation.getSimulatedData().getBranch(i).getBranchName() + " (" + i + ")"); - } + stages.addAll( Util.generateSeriesLabels(simulation)); + final JComboBox stageSelection = new JComboBox(stages.toArray(new String[0])); stageSelection.addItemListener(new ItemListener() { diff --git a/core/src/net/sf/openrocket/gui/plot/SimulationPlotPanel.java b/core/src/net/sf/openrocket/gui/plot/SimulationPlotPanel.java index aa6a4e9c1..6672f6249 100644 --- a/core/src/net/sf/openrocket/gui/plot/SimulationPlotPanel.java +++ b/core/src/net/sf/openrocket/gui/plot/SimulationPlotPanel.java @@ -32,7 +32,6 @@ import net.sf.openrocket.simulation.FlightDataType; import net.sf.openrocket.simulation.FlightEvent; import net.sf.openrocket.startup.Application; import net.sf.openrocket.unit.Unit; -import net.sf.openrocket.util.ArrayList; import net.sf.openrocket.util.Utils; /** @@ -314,9 +313,6 @@ public class SimulationPlotPanel extends JPanel { }); this.add(button, "right"); - - // FIXME - add list & check boxes for data branches. - updatePlots(); }