SyslogDFrame.java
3.28 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
186
187
188
189
190
191
192
193
194
195
196
package com.sitech.ismp.ice.syslogd;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.util.*;
public class
SyslogDFrame extends Frame
implements ActionListener, ItemListener, WindowListener
{
public static final String RCS_ID = "$Id: SyslogDFrame.java,v 1.1.1.1 1998/02/22 05:47:54 time Exp $";
public static final String RCS_REV = "$Revision: 1.1.1.1 $";
public static final String RCS_NAME = "$Name: $";
protected Applet applet;
protected MenuBar mBar;
protected Menu mFile;
public
SyslogDFrame(
String title, Applet app,
int x, int y, int w, int h )
{
super( title );
this.applet = app;
this.establishMenuBar();
this.setMenuBar( this.mBar );
this.applet.setStub(null);
this.applet.init();
this.add( "Center", applet );
this.pack();
this.setLocation( x, y );
Dimension fSz = this.getSize();
if ( w == -1 ) w = fSz.width;
if ( h == -1 ) h = fSz.height;
this.setSize( w, h );
this.show();
this.applet.start();
this.addWindowListener( this );
}
public void
shutdown()
{
this.applet.stop();
this.dispose();
System.exit( 0 );
}
public void
itemStateChanged( ItemEvent event )
{
}
public void
actionPerformed( ActionEvent event )
{
String command = event.getActionCommand();
if ( command.equals( "QUIT" ) )
{
this.shutdown();
}
else if ( command.equals( "HIDE_ALL" ) )
{
this.getSyslogDApplet().hideSyslogDisplays();
}
else if ( command.equals( "SHOW_ALL" ) )
{
this.getSyslogDApplet().showSyslogDisplays();
}
else if ( command.equals( "ABOUT" ) )
{
this.showAboutDialog();
}
else if ( command.equals( "LOAD" ) )
{
}
else if ( command.equals( "RELOAD" ) )
{
}
}
public SyslogDApplet
getSyslogDApplet()
{
return (SyslogDApplet) this.applet;
}
public void
showAboutDialog()
{
AboutDialog dialog = new AboutDialog( this );
dialog.show();
}
private void
establishMenuBar()
{
MenuItem mItem;
this.mBar = new MenuBar();
this.mFile = new Menu( "File", true );
this.mBar.add( this.mFile );
mItem = new MenuItem( "Hide All Displays" );
mItem.setActionCommand( "HIDE_ALL" );
mItem.addActionListener( this );
this.mFile.add( mItem );
mItem = new MenuItem( "Show All Displays" );
mItem.setActionCommand( "SHOW_ALL" );
mItem.addActionListener( this );
this.mFile.add( mItem );
this.mFile.addSeparator();
mItem = new MenuItem( "Quit" );
mItem.setActionCommand( "QUIT" );
mItem.addActionListener( this );
this.mFile.add( mItem );
this.addAdditionalMenus( mBar );
this.setMenuBar( this.mBar );
}
public void
addAdditionalMenus( MenuBar menuBar )
{
MenuItem mItem;
Menu hMenu = new Menu( "Help", true );
this.mBar.add( hMenu );
mItem = new MenuItem( "About..." );
mItem.setActionCommand( "ABOUT" );
mItem.addActionListener( this );
hMenu.add( mItem );
}
public void
windowOpened(WindowEvent e)
{
}
public void
windowClosing(WindowEvent e)
{
this.shutdown();
}
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)
{
}
}