KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > explorer > menu > AboutDialog


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Moroy.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26 package org.objectweb.openccm.explorer.menu;
27
28 import java.awt.BorderLayout JavaDoc;
29 import java.awt.Color JavaDoc;
30 import java.awt.Dimension JavaDoc;
31 import java.awt.Font JavaDoc;
32 import java.awt.Frame JavaDoc;
33 import java.awt.GridLayout JavaDoc;
34 import java.awt.Point JavaDoc;
35 import java.awt.event.ActionEvent JavaDoc;
36 import java.awt.event.ActionListener JavaDoc;
37
38 import javax.swing.Box JavaDoc;
39 import javax.swing.ImageIcon JavaDoc;
40 import javax.swing.JButton JavaDoc;
41 import javax.swing.JDialog JavaDoc;
42 import javax.swing.JLabel JavaDoc;
43 import javax.swing.JPanel JavaDoc;
44
45 /**
46  * Displays the "OpenCCM Explorer About" box.
47  *
48  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jérôme Moroy</a>,
49  * <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>.
50  *
51  * @version 0.1
52  */

53 public class AboutDialog
54      extends JDialog JavaDoc
55 {
56
57     //==================================================================
58
//
59
// Internal States.
60
//
61
// ==================================================================
62

63     // ==================================================================
64
//
65
// Constructors.
66
//
67
// ==================================================================
68

69     public AboutDialog(Frame JavaDoc owner){
70         super(owner, "About OpenCCM Explorer", true);
71
72         JPanel JavaDoc titlePanel = new JPanel JavaDoc();
73         titlePanel.setBackground(Color.white);
74         
75         Box JavaDoc box = Box.createVerticalBox();
76         box.add(new TitlePanel("OpenCCM", new Font JavaDoc("TimesRoman", Font.BOLD, 20)));
77         box.add(new TitlePanel("The Open CORBA Component Model Platform", new Font JavaDoc("TimesRoman", Font.ITALIC, 16)));
78         
79         Box JavaDoc imgBox = Box.createHorizontalBox();
80         imgBox.add(Box.createHorizontalGlue());
81         imgBox.add(new JLabel JavaDoc(Menu.createIcon("icons/OpenCCM2.png")));
82         imgBox.add(Box.createHorizontalGlue());
83         
84         box.add(imgBox);
85         box.add(new TitlePanel("Copyright © 1999-2004, ObjectWeb Consortium", new Font JavaDoc("TimesRoman", Font.ITALIC, 12)));
86         titlePanel.add(box);
87         getContentPane().add(titlePanel,BorderLayout.CENTER);
88         
89         JPanel JavaDoc buttonPanel = new JPanel JavaDoc();
90         buttonPanel.setBackground(Color.white);
91         JButton JavaDoc button = new JButton JavaDoc("OK");
92         button.addActionListener(new ActionListener JavaDoc(){
93             public void actionPerformed(ActionEvent JavaDoc e){
94                 AboutDialog.this.hide();
95             }
96         });
97         button.setPreferredSize(new Dimension JavaDoc(100,25));
98         buttonPanel.add(button);
99         getContentPane().add(buttonPanel,BorderLayout.SOUTH);
100         
101         pack();
102
103         // Locates the frame
104
Point JavaDoc p = owner.getLocation();
105         setLocation(p.x+15, p.y+15);
106
107     }
108     
109     // ==================================================================
110
//
111
// Internal methods.
112
//
113
// ==================================================================
114

115     // ==================================================================
116
//
117
// Public methods for ... interface.
118
//
119
// ==================================================================
120

121     // ==================================================================
122
//
123
// Inner classes.
124
//
125
// ==================================================================
126

127     class TitlePanel extends JPanel JavaDoc{
128         public TitlePanel(String JavaDoc title, Font JavaDoc f){
129             setBackground(Color.white);
130             JLabel JavaDoc label = new JLabel JavaDoc();
131             label.setFont(f);
132             label.setText(title);
133             add(label);
134         }
135     }
136     
137 }
138
139
Popular Tags