[#2161] Improve "data will be plotted in time order" warning
This commit is contained in:
parent
3f86a868ee
commit
657f8b761a
@ -1,5 +1,6 @@
|
|||||||
package net.sf.openrocket.gui.simulation;
|
package net.sf.openrocket.gui.simulation;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
@ -106,6 +107,7 @@ public class SimulationPlotPanel extends JPanel {
|
|||||||
|
|
||||||
private int modifying = 0;
|
private int modifying = 0;
|
||||||
|
|
||||||
|
private DescriptionArea simPlotPanelDesc;
|
||||||
|
|
||||||
public SimulationPlotPanel(final Simulation simulation) {
|
public SimulationPlotPanel(final Simulation simulation) {
|
||||||
super(new MigLayout("fill"));
|
super(new MigLayout("fill"));
|
||||||
@ -170,6 +172,14 @@ public class SimulationPlotPanel extends JPanel {
|
|||||||
if (modifying > 0)
|
if (modifying > 0)
|
||||||
return;
|
return;
|
||||||
FlightDataType type = (FlightDataType) domainTypeSelector.getSelectedItem();
|
FlightDataType type = (FlightDataType) domainTypeSelector.getSelectedItem();
|
||||||
|
if (type == FlightDataType.TYPE_TIME) {
|
||||||
|
simPlotPanelDesc.setVisible(false);
|
||||||
|
simPlotPanelDesc.setText("");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
simPlotPanelDesc.setVisible(true);
|
||||||
|
simPlotPanelDesc.setText(trans.get("simplotpanel.Desc"));
|
||||||
|
}
|
||||||
configuration.setDomainAxisType(type);
|
configuration.setDomainAxisType(type);
|
||||||
domainUnitSelector.setUnitGroup(type.getUnitGroup());
|
domainUnitSelector.setUnitGroup(type.getUnitGroup());
|
||||||
domainUnitSelector.setSelectedUnit(configuration.getDomainAxisUnit());
|
domainUnitSelector.setSelectedUnit(configuration.getDomainAxisUnit());
|
||||||
@ -193,9 +203,13 @@ public class SimulationPlotPanel extends JPanel {
|
|||||||
this.add(domainUnitSelector, "width 40lp, gapright para");
|
this.add(domainUnitSelector, "width 40lp, gapright para");
|
||||||
|
|
||||||
//// The data will be plotted in time order even if the X axis type is not time.
|
//// The data will be plotted in time order even if the X axis type is not time.
|
||||||
DescriptionArea desc = new DescriptionArea(trans.get("simplotpanel.Desc"), 2, -2f);
|
simPlotPanelDesc = new DescriptionArea("", 2, -2f, false);
|
||||||
desc.setViewportBorder(BorderFactory.createEmptyBorder());
|
simPlotPanelDesc.setVisible(false);
|
||||||
this.add(desc, "width 1px, growx 1, wrap unrel");
|
simPlotPanelDesc.setForeground(Color.RED);
|
||||||
|
|
||||||
|
simPlotPanelDesc.setViewportBorder(BorderFactory.createEmptyBorder());
|
||||||
|
this.add(simPlotPanelDesc, "width 1px, growx 1, wrap unrel");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user