2 * Copyright © 2011 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 package org.altusmetrum.altosuilib_1;
21 import java.awt.event.*;
24 class AltosUIDialogListener extends WindowAdapter {
25 public void windowClosing (WindowEvent e) {
26 AltosUIPreferences.unregister_ui_listener((AltosUIDialog) e.getWindow());
30 public class AltosUIDialog extends JDialog implements AltosUIListener {
32 public void ui_changed(String look_and_feel) {
33 SwingUtilities.updateComponentTreeUI(this);
37 public AltosUIDialog() {
38 AltosUIPreferences.register_ui_listener(this);
39 addWindowListener(new AltosUIDialogListener());
42 public AltosUIDialog(Frame frame, String label, boolean modal) {
43 super(frame, label, modal);
44 AltosUIPreferences.register_ui_listener(this);
45 addWindowListener(new AltosUIDialogListener());
48 public AltosUIDialog(Dialog dialog, String label, boolean modal) {
49 super(dialog, label, modal);
50 AltosUIPreferences.register_ui_listener(this);
51 addWindowListener(new AltosUIDialogListener());
54 public AltosUIDialog(Frame frame, boolean modal) {
56 AltosUIPreferences.register_ui_listener(this);
57 addWindowListener(new AltosUIDialogListener());