AboutDialog.java
4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
** Copyright (c) 1997 by Timothy Gerard Endres
**
** This program is free software.
**
** You may redistribute it and/or modify it under the terms of the GNU
** General Public License as published by the Free Software Foundation.
** Version 2 of the license should be included with this distribution in
** the file LICENSE, as well as License.html. If the license is not
** included with this distribution, you may find a copy at the FSF web
** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/
package com.sitech.ismp.ice.syslogd;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
import java.applet.*;
import com.sitech.ismp.ice.util.AWTUtilities;
import com.sitech.ismp.ice.util.UserProperties;
import com.sitech.ismp.ice.widget.BorderPanel;
/**
* Shows the application's "About" dialog box.
*
* @version $Revision: 1.1.1.1 $
* @author Timothy Gerard Endres,
* <a href="mailto:time@ice.com">time@ice.com</a>.
*/
public class
AboutDialog extends Dialog
implements ActionListener, WindowListener
{
public static final String RCS_ID = "$Id: AboutDialog.java,v 1.1.1.1 1998/02/22 05:47:55 time Exp $";
public static final String RCS_REV = "$Revision: 1.1.1.1 $";
public static final String RCS_NAME = "$Name: $";
private String messageString;
private TextArea messageText;
public
AboutDialog( Frame parent )
{
super( parent, "About SyslogD", true );
this.messageString = null;
this.establishDialogContents();
this.pack();
int width =
UserProperties.getProperty
( "aboutDialog.width", 540 );
int height =
UserProperties.getProperty
( "aboutDialog.height", 320 );
this.setSize( width, height );
Point location =
AWTUtilities.computeDialogLocation
( this, width, height );
this.setLocation( location.x, location.y );
this.addWindowListener( this );
}
public void
actionPerformed( ActionEvent evt )
{
String command = evt.getActionCommand();
if ( command.compareTo( "OK" ) == 0 )
{
this.dispose();
}
}
public void
establishDialogContents()
{
Button button;
BorderPanel controlPanel;
this.messageText = new TextArea( 12, 64 );
this.messageText.setEditable( false );
this.messageText.setFont(
UserProperties.getFont(
"aboutDialog.font",
new Font( "Serif", Font.BOLD, 12 ) ) );
this.messageText.setText(
"SyslogD, version " +
SyslogD.VERSION_STR +
", a Unix Syslog Server\n" +
"\n" +
"Written by Tim Endres, time@ice.com\n" +
"Copyright (c) 1997 by Timothy Gerard Endres\n" +
"\n" +
"SyslogD is free software, which is licensed to you under the\n" +
"GNU General Public License, version 2. Please see the file\n" +
"LICENSE for more details, or visit 'www.gnu.org'.\n" +
"\n" +
"This software is provided AS-IS, with ABSOLUTELY NO WARRANTY.\n" +
"\n" +
"YOU ASSUME ALL RESPONSIBILITY FOR ANY AND ALL CONSEQUENCES\n" +
"THAT MAY RESULT FROM THE USE OF THIS SOFTWARE!"
);
controlPanel = new BorderPanel
( 7, 2, 5, BorderPanel.RIDGE );
controlPanel.setLayout( new GridLayout( 1, 1, 20, 20 ) );
button = new Button( "Ok" );
button.addActionListener( this );
button.setActionCommand( "OK" );
controlPanel.add( button );
this.setLayout( new GridBagLayout() );
AWTUtilities.constrain(
this, this.messageText,
GridBagConstraints.BOTH,
GridBagConstraints.CENTER,
0, 0, 1, 1, 1.0, 1.0 );
AWTUtilities.constrain(
this, controlPanel,
GridBagConstraints.HORIZONTAL,
GridBagConstraints.CENTER,
0, 1, 1, 1, 1.0, 0.0 );
}
public void
windowOpened(WindowEvent e)
{
}
public void
windowClosing(WindowEvent e)
{
this.dispose();
}
public void
windowClosed(WindowEvent e)
{
}
public void
windowActivated(WindowEvent e)
{
}
public void
windowDeactivated(WindowEvent e)
{
}
public void
windowIconified(WindowEvent e)
{
}
public void
windowDeiconified(WindowEvent e)
{
}
}