+ public void units_changed(boolean imperial_units) {
+ for (int c = 0; c < columns.length; c++)
+ columns[c].units_changed(imperial_units);
+ int r = 0;
+ for (int flag = 1; flag <= AltosPyro.pyro_all; flag <<= 1) {
+ String n = AltosPyro.pyro_to_name(flag);
+ if (n != null) {
+ labels[r].setText(n);
+ r++;
+ }
+ }
+ }
+
+ /* A window listener to catch closing events and tell the config code */
+ class ConfigListener extends WindowAdapter {
+ AltosConfigPyroUI ui;
+ AltosConfigUI owner;
+
+ public ConfigListener(AltosConfigPyroUI this_ui, AltosConfigUI this_owner) {
+ ui = this_ui;
+ owner = this_owner;
+ }
+
+ public void windowClosing(WindowEvent e) {
+ ui.setVisible(false);
+ }
+ }
+
+ /* Listen for events from our buttons */
+ public void actionPerformed(ActionEvent e) {
+ String cmd = e.getActionCommand();
+
+ if (cmd.equals("Close"))
+ setVisible(false);
+ }
+