01: package net.xoetrope.builder.editor.dialog;
02:
03: import java.awt.Rectangle;
04: import java.awt.event.ActionEvent;
05: import java.awt.event.ActionListener;
06: import javax.swing.ImageIcon;
07: import javax.swing.JButton;
08: import javax.swing.JDialog;
09: import javax.swing.JFrame;
10: import javax.swing.JToggleButton;
11: import javax.swing.border.EmptyBorder;
12:
13: import net.xoetrope.builder.editor.XEditorResourceManager;
14: import net.xoetrope.builder.editor.XuiDefaults;
15: import net.xoetrope.swing.XButton;
16: import net.xoetrope.swing.XLabel;
17: import net.xoetrope.xui.XComponentFactory;
18: import net.xoetrope.xui.XPage;
19: import javax.swing.JLabel;
20:
21: /**
22: * <p>An about dialog for XUI</p>
23: * <p>Copyright (c) Xoetrope Ltd., 1998-2003</p>
24: * $Revision: 1.9 $
25: */
26: public class XAboutDialog extends JDialog implements ActionListener {
27: protected JButton btnOK;
28:
29: public XAboutDialog(JFrame frame) {
30: setTitle("About this XUI Editor");
31: getContentPane().setLayout(null);
32: setModal(true);
33:
34: setFont(XuiDefaults.defaultFont);
35:
36: JLabel tool = new JLabel();
37: ImageIcon icon = new ImageIcon(XEditorResourceManager
38: .getImage("xui_logo.gif"));
39: tool.setIcon(icon);
40: tool.setBounds(10, 10, 161, 67);
41: tool.setBorder(new EmptyBorder(0, 0, 0, 0));
42: getContentPane().add(tool);
43:
44: XComponentFactory factory = new XComponentFactory(
45: XPage.XUI_SWING_PACKAGE);
46: factory.setParentComponent(getContentPane());
47:
48: XLabel xlabel = (XLabel) factory.addComponent(XPage.LABEL, 180,
49: 10, 150, 16, "XUI Editor/IDE");
50: xlabel = (XLabel) factory.addComponent(XPage.LABEL, 180, 26,
51: 150, 16, "Version 1.0.4");
52: xlabel.setFont(XuiDefaults.defaultFont);
53:
54: xlabel = (XLabel) factory.addComponent(XPage.LABEL, 180, 46,
55: 280, 16, "XUI: Copyright © Xoetrope Ltd. 2001-2004");
56: xlabel.setFont(XuiDefaults.defaultFont);
57:
58: xlabel = (XLabel) factory
59: .addComponent(XPage.LABEL, 180, 62, 280, 16,
60: "Ant: Copyright (c) 1999 The Apache Software Foundation");
61: xlabel.setFont(XuiDefaults.defaultFont);
62:
63: xlabel = (XLabel) factory.addComponent(XPage.LABEL, 180, 82,
64: 150, 16, "All rights reserved");
65: xlabel.setFont(XuiDefaults.defaultFont);
66:
67: XButton xbutton = (XButton) factory.addComponent(XPage.BUTTON,
68: 180, 120, 280, 20, "OK");
69: xbutton.setFont(XuiDefaults.defaultFont);
70: xbutton.addActionListener(this );
71:
72: Rectangle rect = frame.getBounds();
73: setLocation((rect.width - 377) / 2, (rect.height - 162) / 2);
74: setSize(477, 182);
75: setModal(true);
76: }
77:
78: public void actionPerformed(ActionEvent evt) {
79: hide();
80: }
81: }
|