01: /*
02: * SwingML Copyright (C) 2002 SwingML Team
03: *
04: * This library is free software; you can redistribute it and/or modify it under
05: * the terms of the GNU Lesser General Public License as published by the Free
06: * Software Foundation; either version 2 of the License, or (at your option) any
07: * later version.
08: *
09: * This library is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12: * details.
13: *
14: * You should have received a copy of the GNU Lesser General Public License
15: * along with this library; if not, write to the Free Software Foundation, Inc.,
16: * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: *
18: * Authors: Ezequiel Cuellar <ecuellar@crosslogic.com> Robert Morris
19: * <robertj@morris.net>
20: *
21: */
22:
23: package org.swingml.view.renderer;
24:
25: import java.awt.*;
26: import java.awt.event.*;
27:
28: import org.swingml.*;
29: import org.swingml.component.*;
30: import org.swingml.event.*;
31: import org.swingml.model.*;
32: import org.swingml.view.*;
33:
34: public class JDialogRenderer extends RendererUtil implements Renderer {
35:
36: public Container render(AbstractSwingMLModel aModel,
37: Container aParent) {
38: JDialogComponent theDialog = new JDialogComponent(
39: (JDialogModel) aModel);
40: theDialog.setLocationRelativeTo(aParent);
41: theDialog.setOwner(aParent);
42: theDialog.addWindowListener(aModel);
43: theDialog.addWindowListener(new WindowListener() {
44:
45: public void windowActivated(WindowEvent e) {
46: }
47:
48: public void windowClosed(WindowEvent e) {
49: WindowNotificationRegistrar.sole().windowRemoved(
50: e.getWindow());
51: }
52:
53: public void windowClosing(WindowEvent e) {
54: WindowNotificationRegistrar.sole().windowRemoved(
55: e.getWindow());
56: }
57:
58: public void windowDeactivated(WindowEvent e) {
59: }
60:
61: public void windowDeiconified(WindowEvent e) {
62: }
63:
64: public void windowIconified(WindowEvent e) {
65: }
66:
67: public void windowOpened(WindowEvent e) {
68: }
69: });
70: super .iterate(aModel, theDialog.getContentPane());
71: WindowNotificationRegistrar.sole().windowAdded(theDialog);
72: theDialog.setVisible(true);
73:
74: return theDialog;
75: }
76: }
|