*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
public FlightStat(GridBagLayout layout, int y, String label_text, String ... values) {
GridBagConstraints c = new GridBagConstraints();
public FlightStat(GridBagLayout layout, int y, String label_text, String ... values) {
GridBagConstraints c = new GridBagConstraints();
- value = new JTextField(values[j]);
- value.setFont(AltosUILib.value_font);
- value.setHorizontalAlignment(SwingConstants.RIGHT);
+ value[j] = new JTextField(values[j]);
+ value[j].setEditable(false);
+ value[j].setFont(AltosUILib.value_font);
+ value[j].setHorizontalAlignment(SwingConstants.RIGHT);
c.gridx = j+1; c.gridy = y;
c.anchor = GridBagConstraints.EAST;
c.fill = GridBagConstraints.BOTH;
c.weightx = 1;
c.gridx = j+1; c.gridy = y;
c.anchor = GridBagConstraints.EAST;
c.fill = GridBagConstraints.BOTH;
c.weightx = 1;
}
new FlightStat(layout, y++, "Maximum speed",
String.format("%5.0f m/s", stats.max_speed),
}
new FlightStat(layout, y++, "Maximum speed",
String.format("%5.0f m/s", stats.max_speed),
new FlightStat(layout, y++, "Maximum boost acceleration",
String.format("%5.0f m/s²", stats.max_acceleration),
String.format("%5.0f ft/s²", AltosConvert.meters_to_feet(stats.max_acceleration)),
String.format("%5.0f G", AltosConvert.meters_to_g(stats.max_acceleration)));
new FlightStat(layout, y++, "Maximum boost acceleration",
String.format("%5.0f m/s²", stats.max_acceleration),
String.format("%5.0f ft/s²", AltosConvert.meters_to_feet(stats.max_acceleration)),
String.format("%5.0f G", AltosConvert.meters_to_g(stats.max_acceleration)));
new FlightStat(layout, y++, "Average boost acceleration",
String.format("%5.0f m/s²", stats.state_accel[AltosLib.ao_flight_boost]),
String.format("%5.0f ft/s²", AltosConvert.meters_to_feet(stats.state_accel[AltosLib.ao_flight_boost])),
String.format("%5.0f G", AltosConvert.meters_to_g(stats.state_accel[AltosLib.ao_flight_boost])));
new FlightStat(layout, y++, "Average boost acceleration",
String.format("%5.0f m/s²", stats.state_accel[AltosLib.ao_flight_boost]),
String.format("%5.0f ft/s²", AltosConvert.meters_to_feet(stats.state_accel[AltosLib.ao_flight_boost])),
String.format("%5.0f G", AltosConvert.meters_to_g(stats.state_accel[AltosLib.ao_flight_boost])));
if (stats.state_speed[AltosLib.ao_flight_drogue] != AltosLib.MISSING)
new FlightStat(layout, y++, "Drogue descent rate",
String.format("%5.0f m/s", stats.state_speed[AltosLib.ao_flight_drogue]),
if (stats.state_speed[AltosLib.ao_flight_drogue] != AltosLib.MISSING)
new FlightStat(layout, y++, "Drogue descent rate",
String.format("%5.0f m/s", stats.state_speed[AltosLib.ao_flight_drogue]),