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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 package org.altusmetrum.altosuilib_11;
22 import java.awt.event.*;
25 class AltosUIDialogListener extends WindowAdapter {
26 public void windowClosing (WindowEvent e) {
27 AltosUIPreferences.unregister_ui_listener((AltosUIDialog) e.getWindow());
31 public class AltosUIDialog extends JDialog implements AltosUIListener {
33 public void ui_changed(String look_and_feel) {
34 SwingUtilities.updateComponentTreeUI(this);
38 public AltosUIDialog() {
39 AltosUIPreferences.register_ui_listener(this);
40 addWindowListener(new AltosUIDialogListener());
43 public AltosUIDialog(Frame frame, String label, boolean modal) {
44 super(frame, label, modal);
45 AltosUIPreferences.register_ui_listener(this);
46 addWindowListener(new AltosUIDialogListener());
49 public AltosUIDialog(Dialog dialog, String label, boolean modal) {
50 super(dialog, label, modal);
51 AltosUIPreferences.register_ui_listener(this);
52 addWindowListener(new AltosUIDialogListener());
55 public AltosUIDialog(Frame frame, boolean modal) {
57 AltosUIPreferences.register_ui_listener(this);
58 addWindowListener(new AltosUIDialogListener());