~ubuntu-branches/ubuntu/precise/jcsp/precise

« back to all changes in this revision

Viewing changes to src/org/jcsp/awt/ActiveFileDialog.java

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Landaeta
  • Date: 2010-06-20 18:12:26 UTC
  • Revision ID: james.westby@ubuntu.com-20100620181226-8yg8d9rjjjiuy7oz
Tags: upstream-1.1-rc4
ImportĀ upstreamĀ versionĀ 1.1-rc4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////
 
2
//                                                                  //
 
3
//  JCSP ("CSP for Java") Libraries                                 //
 
4
//  Copyright (C) 1996-2008 Peter Welch and Paul Austin.            //
 
5
//                2001-2004 Quickstone Technologies Limited.        //
 
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 (at your option) any later       //
 
11
//  version.                                                        //
 
12
//                                                                  //
 
13
//  This library is distributed in the hope that it will be         //
 
14
//  useful, but WITHOUT ANY WARRANTY; without even the implied      //
 
15
//  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR         //
 
16
//  PURPOSE. See the GNU Lesser General Public License for more     //
 
17
//  details.                                                        //
 
18
//                                                                  //
 
19
//  You should have received a copy of the GNU Lesser General       //
 
20
//  Public License along with this library; if not, write to the    //
 
21
//  Free Software Foundation, Inc., 59 Temple Place, Suite 330,     //
 
22
//  Boston, MA 02111-1307, USA.                                     //
 
23
//                                                                  //
 
24
//  Author contact: P.H.Welch@kent.ac.uk                             //
 
25
//                                                                  //
 
26
//                                                                  //
 
27
//////////////////////////////////////////////////////////////////////
 
28
 
 
29
package org.jcsp.awt;
 
30
 
 
31
import java.awt.*;
 
32
import java.util.Vector;
 
33
import org.jcsp.lang.*;
 
34
 
 
35
/**
 
36
 * {@link java.awt.FileDialog <TT>java.awt.FileDialog</TT>}
 
37
 * with a channel interface.
 
38
 * <H2>Process Diagram</H2>
 
39
 * <p><img src="doc-files/ActiveFileDialog1.gif"></p>
 
40
 * <H2>Description</H2>
 
41
 * <TT>ActiveFileDialog</TT> is a process extension of <TT>java.awt.FileDialog</TT>
 
42
 * with channels for run-time configuration and event notification.  The event channels
 
43
 * should be connected to one or more application-specific server processes (instead
 
44
 * of registering a passive object as a <I>Listener</I> to this component).
 
45
 * <P>
 
46
 * All channels are optional.  The <TT>configure</TT> and <TT>event</TT> channels are
 
47
 * settable from a constructor.
 
48
 * The <TT>event</TT> channel delivers directory and file names (see next paragraph).
 
49
 * Other event channels can be added to notify the occurrence of any other events
 
50
 * the component generates (by calling the appropriate
 
51
 * <TT>add</TT><I>XXX</I><TT>EventChannel</TT> method <I>before</I> the process is run).
 
52
 * Messages can be sent down the <TT>configure</TT> channel at any time to configure
 
53
 * the component.  See the <A HREF="#Protocols">table below</A> for details.
 
54
 * <P>
 
55
 * The <TT>ActiveFileDialog</TT> is made visible by sending a <TT>Boolean.TRUE</TT> down
 
56
 * its <TT>configure</TT> channel.  A <I>modal</I> dialogue takes place to select a file
 
57
 * and the selected directory and file names are output down its <TT>event</TT> channel.
 
58
 * <P>
 
59
 * All channels are managed by independent internal handler processes.  It is, therefore,
 
60
 * safe for a serial application process both to service an event channel and configure
 
61
 * the component &ndash; no deadlock can occur.
 
62
 * <P>
 
63
 * <I>IMPORTANT: it is essential that event channels from this process are
 
64
 * always serviced &ndash; otherwise the Java Event Thread will be blocked and the GUI
 
65
 * will stop responding.  A simple way to guarantee this is to use channels
 
66
 * configured with overwriting buffers.
 
67
 * For example:</I>
 
68
 * <PRE>
 
69
 *   final One2OneChannel myFileDialogConfigure = Channel.one2one ();
 
70
 *   final One2OneChannel myFileDialogEvent = Channel.one2one (new OverWriteOldestBuffer (n));
 
71
 * 
 
72
 *   final ActiveFileDialog myFileDialog =
 
73
 *     new ActiveFileDialog (myFileDialogConfigure.in (), myFileDialogEvent.out ());
 
74
 * </PRE>
 
75
 * <I>This will ensure that the Java Event Thread will never be blocked.
 
76
 * Slow or inattentive readers may miss rapidly generated events, but
 
77
 * the </I><TT>n</TT><I> most recent events will always be available.</I>
 
78
 * </P>
 
79
 * <H2><A NAME="Protocols">Channel Protocols</A></H2>
 
80
 * <CENTER>
 
81
 * <TABLE BORDER="2">
 
82
 *   <TR>
 
83
 *     <TH COLSPAN="3">Input Channels</TH>
 
84
 *   </TR>
 
85
 *   <TR>
 
86
 *     <TH ROWSPAN="3">configure</TH>
 
87
 *     <TD>String</TD>
 
88
 *     <TD>
 
89
 *       The start directory for the fileDialog
 
90
 *     </TD>
 
91
 *   </TR>
 
92
 *   <TR>
 
93
 *     <TD>Boolean</TD>
 
94
 *     <TD>
 
95
 *       <OL>
 
96
 *         <LI>If this is the <TT>Boolean.TRUE</TT> object,
 
97
 *           the fileDialog is made visible</LI>
 
98
 *         <LI>If this is the <TT>Boolean.FALSE</TT> object,
 
99
 *            the fileDialog is made invisible</LI>
 
100
 *         <LI>Other <TT>Boolean</TT> objects are ignored</LI>
 
101
 *       </OL>
 
102
 *     </TD>
 
103
 *   </TR>
 
104
 *   <TR>
 
105
 *     <TD>ActiveFileDialog.Configure</TD>
 
106
 *     <TD>Invoke the user-defined <TT>Configure.configure</TT> method on the activeFileDialog.</TD>
 
107
 *   </TR>
 
108
 *   <TR>
 
109
 *     <TH COLSPAN="3">Output Channels</TH>
 
110
 *   </TR>
 
111
 *   <TR>
 
112
 *     <TH>event</TH>
 
113
 *     <TD>String, String</TD>
 
114
 *     <TD>The directory and file names generated by the fileDialog &ndash; these may be null</TD>
 
115
 *   </TR>
 
116
 *   <TR>
 
117
 *     <TH>windowEvent</TH>
 
118
 *     <TD>WindowEvent</TD>
 
119
 *     <TD>See the {@link #addWindowEventChannel
 
120
 *         <TT>addWindowEventChannel</TT>} method.</TD>
 
121
 *   </TR>
 
122
 *   <TR>
 
123
 *     <TH>containerEvent</TH>
 
124
 *     <TD>ContainerEvent</TD>
 
125
 *     <TD>See the {@link #addContainerEventChannel
 
126
 *         <TT>addContainerEventChannel</TT>} method.</TD>
 
127
 *   </TR>
 
128
 *   <TR>
 
129
 *     <TH>componentEvent</TH>
 
130
 *     <TD>ComponentEvent</TD>
 
131
 *     <TD>See the {@link #addComponentEventChannel
 
132
 *         <TT>addComponentEventChannel</TT>} method.</TD>
 
133
 *   </TR>
 
134
 *   <TR>
 
135
 *     <TH>focusEvent</TH>
 
136
 *     <TD>FocusEvent</TD>
 
137
 *     <TD>See the {@link #addFocusEventChannel
 
138
 *         <TT>addFocusEventChannel</TT>} method.</TD>
 
139
 *   </TR>
 
140
 *   <TR>
 
141
 *     <TH>keyEvent</TH>
 
142
 *     <TD>KeyEvent</TD>
 
143
 *     <TD>See the {@link #addKeyEventChannel
 
144
 *         <TT>addKeyEventChannel</TT>} method.</TD>
 
145
 *   </TR>
 
146
 *   <TR>
 
147
 *     <TH>mouseEvent</TH>
 
148
 *     <TD>MouseEvent</TD>
 
149
 *     <TD>See the {@link #addMouseEventChannel
 
150
 *         <TT>addMouseEventChannel</TT>} method.</TD>
 
151
 *   </TR>
 
152
 *   <TR>
 
153
 *     <TH>mouseMotionEvent</TH>
 
154
 *     <TD>MouseEvent</TD>
 
155
 *     <TD>See the {@link #addMouseMotionEventChannel
 
156
 *         <TT>addMouseMotionEventChannel</TT>} method.</TD>
 
157
 *   </TR>
 
158
 * </TABLE>
 
159
 * </CENTER>
 
160
 * <H2>Example</H2>
 
161
 * <PRE>
 
162
 * import java.awt.*;
 
163
 * import org.jcsp.lang.*;
 
164
 * import org.jcsp.util.*;
 
165
 * import org.jcsp.awt.*;
 
166
 * 
 
167
 * public class ActiveFileDialogExample {
 
168
 * 
 
169
 *   public static void main (String argv[]) {
 
170
 * 
 
171
 *     final Frame root = new Frame ();
 
172
 * 
 
173
 *     final One2OneChannel configure = Channel.one2one ();
 
174
 * 
 
175
 *     final One2OneChannel event = Channel.one2one (new OverWriteOldestBuffer (10));
 
176
 * 
 
177
 *     final ActiveFileDialog fileDialog =
 
178
 *       new ActiveFileDialog (configure.in (), event.out (), root, "ActiveFileDialog Example");
 
179
 * 
 
180
 *     new Parallel (
 
181
 *       new CSProcess[] {
 
182
 *         fileDialog,
 
183
 *         new CSProcess () {
 
184
 *           public void run () {
 
185
 *             String dir = ".";           // start directory for the file dialogue
 
186
 *             String file = "";
 
187
 *             while (file != null) {
 
188
 *               configure.out ().write (dir);
 
189
 *               configure.out ().write (Boolean.TRUE);
 
190
 *               dir = (String) event.in ().read ();
 
191
 *               file = (String) event.in ().read ();
 
192
 *               if (file != null)
 
193
 *                 System.out.println ("Chosen file = `" + dir + file + "'");
 
194
 *             }
 
195
 *           System.exit (0);
 
196
 *           }
 
197
 *         }
 
198
 *       }
 
199
 *     ).run ();
 
200
 *   }
 
201
 * 
 
202
 * }
 
203
 * </PRE>
 
204
 *
 
205
 * @see java.awt.FileDialog
 
206
 * @see java.awt.event.WindowEvent
 
207
 * @see java.awt.event.ContainerEvent
 
208
 * @see java.awt.event.ComponentEvent
 
209
 * @see java.awt.event.FocusEvent
 
210
 * @see java.awt.event.KeyEvent
 
211
 * @see java.awt.event.MouseEvent
 
212
 * @see org.jcsp.util.OverWriteOldestBuffer
 
213
 *
 
214
 * @author P.D. Austin and P.H. Welch
 
215
 */
 
216
 
 
217
public class ActiveFileDialog extends FileDialog implements CSProcess
 
218
{
 
219
   /**
 
220
    * The Vector construct containing the handlers.
 
221
    */
 
222
   private Vector vec = new Vector();
 
223
   
 
224
   /**
 
225
    * The channel from which configuration messages arrive.
 
226
    */
 
227
   private ChannelInput configure;
 
228
   
 
229
   /**
 
230
    * The channel to which the selected directory and file names are sent.
 
231
    */
 
232
   private ChannelOutput event;
 
233
   
 
234
   /**
 
235
    * Constructs a new <TT>ActiveDialog</TT> with a blank title for loading a file
 
236
    * and with no configuration or event channels.
 
237
    * Constructs a new <TT>ActiveFileDialog</TT>.
 
238
    *
 
239
    * @param parent the parent frame for the fileDialog.
 
240
    */
 
241
   public ActiveFileDialog(Frame parent)
 
242
   {
 
243
      this(null, null, parent, "", LOAD);
 
244
   }
 
245
   
 
246
   /**
 
247
    * Constructs a new <TT>ActiveFileDialog</TT> with a blank title
 
248
    * and no configuration or event channels.
 
249
    *
 
250
    * @param parent the parent frame for the fileDialog.
 
251
    * @param mode java.awt.FileDialog.LOAD or java.awt.FileDialog.SAVE.
 
252
    */
 
253
   public ActiveFileDialog(Frame parent, int mode)
 
254
   {
 
255
      this(null, null, parent, "", mode);
 
256
   }
 
257
   
 
258
   /**
 
259
    * Constructs a new <TT>ActiveFileDialog</TT> for loading a file
 
260
    * and no configuration or event channels.
 
261
    *
 
262
    * @param parent the parent frame for the fileDialog.
 
263
    * @param title the title of the fileDialog.
 
264
    */
 
265
   public ActiveFileDialog(Frame parent, String title)
 
266
   {
 
267
      this(null, null, parent, title, LOAD);
 
268
   }
 
269
   
 
270
   /**
 
271
    * Constructs a new <TT>ActiveFileDialog</TT>
 
272
    * with no configuration or event channels.
 
273
    *
 
274
    * @param parent the parent frame for the fileDialog.
 
275
    * @param title the title of the fileDialog.
 
276
    * @param mode java.awt.FileDialog.LOAD or java.awt.FileDialog.SAVE.
 
277
    */
 
278
   public ActiveFileDialog(Frame parent, String title, int mode)
 
279
   {
 
280
      this(null, null, parent, title, mode);
 
281
   }
 
282
   
 
283
   /**
 
284
    * Constructs a new <TT>ActiveFileDialog</TT> with a blank title for loading a file.
 
285
    *
 
286
    * @param configure the channel for configuration events
 
287
    * &ndash; can be null if no configuration is required.
 
288
    * @param event the directory and file names will be output whenever selected
 
289
    * &ndash; can be null if no notification is required.
 
290
    * @param parent the parent frame for the fileDialog.
 
291
    */
 
292
   public ActiveFileDialog(ChannelInput configure, ChannelOutput event, Frame parent)
 
293
   {
 
294
      this(configure, event, parent, "", LOAD);
 
295
   }
 
296
   
 
297
   /**
 
298
    * Constructs a new <TT>ActiveFileDialog</TT> with a blank title.
 
299
    *
 
300
    * @param configure the channel for configuration events
 
301
    * &ndash; can be null if no configuration is required.
 
302
    * @param event the directory and file names will be output whenever selected
 
303
    * &ndash; can be null if no notification is required.
 
304
    * @param parent the parent frame for the fileDialog.
 
305
    * @param mode java.awt.FileDialog.LOAD or java.awt.FileDialog.SAVE.
 
306
    */
 
307
   public ActiveFileDialog(ChannelInput configure, ChannelOutput event, Frame parent, int mode)
 
308
   {
 
309
      this(configure, event, parent, "", mode);
 
310
   }
 
311
   
 
312
   /**
 
313
    * Constructs a new <TT>ActiveFileDialog</TT> for loading a file.
 
314
    *
 
315
    * @param configure the channel for configuration events
 
316
    * &ndash; can be null if no configuration is required.
 
317
    * @param event the directory and file names will be output whenever selected
 
318
    * &ndash; can be null if no notification is required.
 
319
    * @param parent the parent frame for the fileDialog.
 
320
    * @param title the title of the fileDialog.
 
321
    */
 
322
   public ActiveFileDialog(ChannelInput configure, ChannelOutput event, Frame parent, String title)
 
323
   {
 
324
      this(configure, event, parent, title, LOAD);
 
325
   }
 
326
   
 
327
   /**
 
328
    * Constructs a new <TT>ActiveFileDialog</TT>.
 
329
    *
 
330
    * @param configure the channel for configuration events
 
331
    * &ndash; can be null if no configuration is required.
 
332
    * @param event the directory and file names will be output whenever selected
 
333
    * &ndash; can be null if no notification is required.
 
334
    * @param parent the parent frame for the fileDialog.
 
335
    * @param title the title of the fileDialog.
 
336
    * @param mode java.awt.FileDialog.LOAD or java.awt.FileDialog.SAVE.
 
337
    * <!-- @param modal if true, fileDialog blocks input to the parent window when shown. -->
 
338
    */
 
339
   public ActiveFileDialog(ChannelInput configure, ChannelOutput event, Frame parent, String title, int mode)
 
340
   {
 
341
      super(parent, title, mode);
 
342
      this.configure = configure;
 
343
      this.event = event;
 
344
   }
 
345
   
 
346
   /**
 
347
    * Sets the configuration channel for this <TT>ActiveFileDialog</TT>.
 
348
    * This method overwrites any configuration channel set in the constructor.
 
349
    *
 
350
    * @param configure the channel for configuration events
 
351
    * &ndash; can be null if no configuration is required.
 
352
    */
 
353
   public void setConfigureChannel(ChannelInput configure)
 
354
   {
 
355
      this.configure = configure;
 
356
   }
 
357
   
 
358
   /**
 
359
    * Add a new channel to this component that will be used to notify that
 
360
    * a <TT>WindowEvent</TT> has occurred. <I>This should be used
 
361
    * instead of registering a WindowListener with the component.</I> It is
 
362
    * possible to add more than one channel by calling this method multiple times
 
363
    * If the channel passed is <TT>null</TT>, no action will be taken.
 
364
    * <P>
 
365
    * <I>NOTE: This method must be called before this process is run.</I>
 
366
    *
 
367
    * @param windowEvent the channel down which to send ContainerEvents.
 
368
    */
 
369
   public void addWindowEventChannel(ChannelOutput windowEvent)
 
370
   {
 
371
      if (windowEvent != null)
 
372
      {
 
373
         WindowEventHandler handler = new WindowEventHandler(windowEvent);
 
374
         addWindowListener(handler);
 
375
         vec.addElement(handler);
 
376
      }
 
377
   }
 
378
   
 
379
   /**
 
380
    * Add a new channel to this component that will be used to notify that
 
381
    * a <TT>ContainerEvent</TT> has occurred. <I>This should be used
 
382
    * instead of registering a ContainerListener with the component.</I> It is
 
383
    * possible to add more than one Channel by calling this method multiple times
 
384
    * If the channel passed is <TT>null</TT>, no action will be taken.
 
385
    * <P>
 
386
    * <I>NOTE: This method must be called before this process is run.</I>
 
387
    *
 
388
    * @param containerEvent the channel down which to send ContainerEvents.
 
389
    */
 
390
   public void addContainerEventChannel(ChannelOutput containerEvent)
 
391
   {
 
392
      if (containerEvent != null)
 
393
      {
 
394
         ContainerEventHandler handler = new ContainerEventHandler(containerEvent);
 
395
         addContainerListener(handler);
 
396
         vec.addElement(handler);
 
397
      }
 
398
   }
 
399
   
 
400
   /**
 
401
    * Add a new channel to this component that will be used to notify that
 
402
    * a <TT>ComponentEvent</TT> has occurred. <I>This should be used
 
403
    * instead of registering a ComponentListener with the component.</I> It is
 
404
    * possible to add more than one Channel by calling this method multiple times
 
405
    * If the channel passed is <TT>null</TT>, no action will be taken.
 
406
    * <P>
 
407
    * <I>NOTE: This method must be called before this process is run.</I>
 
408
    *
 
409
    * @param componentEvent the channel down which to send ComponentEvents.
 
410
    */
 
411
   public void addComponentEventChannel(ChannelOutput componentEvent)
 
412
   {
 
413
      if (componentEvent != null)
 
414
      {
 
415
         ComponentEventHandler handler = new ComponentEventHandler(componentEvent);
 
416
         addComponentListener(handler);
 
417
         vec.addElement(handler);
 
418
      }
 
419
   }
 
420
   
 
421
   /**
 
422
    * Add a new channel to this component that will be used to notify that
 
423
    * a <TT>FocusEvent</TT> has occurred. <I>This should be used
 
424
    * instead of registering a FocusListener with the component.</I> It is
 
425
    * possible to add more than one Channel by calling this method multiple times
 
426
    * If the channel passed is <TT>null</TT>, no action will be taken.
 
427
    * <P>
 
428
    * <I>NOTE: This method must be called before this process is run.</I>
 
429
    *
 
430
    * @param focusEvent the channel down which to send FocusEvents.
 
431
    */
 
432
   public void addFocusEventChannel(ChannelOutput focusEvent)
 
433
   {
 
434
      if (focusEvent != null)
 
435
      {
 
436
         FocusEventHandler handler = new FocusEventHandler(focusEvent);
 
437
         addFocusListener(handler);
 
438
         vec.addElement(handler);
 
439
      }
 
440
   }
 
441
   
 
442
   /**
 
443
    * Add a new channel to this component that will be used to notify that
 
444
    * a <TT>KeyEvent</TT> has occurred. <I>This should be used
 
445
    * instead of registering a KeyListener with the component.</I> It is
 
446
    * possible to add more than one Channel by calling this method multiple times
 
447
    * If the channel passed is <TT>null</TT>, no action will be taken.
 
448
    * <P>
 
449
    * <I>NOTE: This method must be called before this process is run.</I>
 
450
    *
 
451
    * @param keyEvent the channel down which to send KeyEvents.
 
452
    */
 
453
   public void addKeyEventChannel(ChannelOutput keyEvent)
 
454
   {
 
455
      if (keyEvent != null)
 
456
      {
 
457
         KeyEventHandler handler = new KeyEventHandler(keyEvent);
 
458
         addKeyListener(handler);
 
459
         vec.addElement(handler);
 
460
      }
 
461
   }
 
462
   
 
463
   /**
 
464
    * Add a new channel to this component that will be used to notify that
 
465
    * a <TT>MouseEvent</TT> has occurred. <I>This should be used
 
466
    * instead of registering a MouseListener with the component.</I> It is
 
467
    * possible to add more than one Channel by calling this method multiple times
 
468
    * If the channel passed is <TT>null</TT>, no action will be taken.
 
469
    * <P>
 
470
    * <I>NOTE: This method must be called before this process is run.</I>
 
471
    *
 
472
    * @param mouseEvent the channel down which to send MouseEvents.
 
473
    */
 
474
   public void addMouseEventChannel(ChannelOutput mouseEvent)
 
475
   {
 
476
      if (mouseEvent != null)
 
477
      {
 
478
         MouseEventHandler handler = new MouseEventHandler(mouseEvent);
 
479
         addMouseListener(handler);
 
480
         vec.addElement(handler);
 
481
      }
 
482
   }
 
483
   
 
484
   /**
 
485
    * Add a new channel to this component that will be used to notify that
 
486
    * a <TT>MouseMotionEvent</TT> has occurred. <I>This should be used
 
487
    * instead of registering a MouseMotionListener with the component.</I> It is
 
488
    * possible to add more than one Channel by calling this method multiple times
 
489
    * If the channel passed is <TT>null</TT>, no action will be taken.
 
490
    * <P>
 
491
    * <I>NOTE: This method must be called before this process is run.</I>
 
492
    *
 
493
    * @param mouseMotionEvent the channel down which to send MouseMotionEvents.
 
494
    */
 
495
   public void addMouseMotionEventChannel(ChannelOutput mouseMotionEvent)
 
496
   {
 
497
      if (mouseMotionEvent != null)
 
498
      {
 
499
         MouseMotionEventHandler handler = new MouseMotionEventHandler(mouseMotionEvent);
 
500
         addMouseMotionListener(handler);
 
501
         vec.addElement(handler);
 
502
      }
 
503
   }
 
504
   
 
505
   /**
 
506
    * This enables general configuration of this component.  Any object implementing
 
507
    * this interface and sent down the <TT>configure</TT> channel to this component will have its
 
508
    * <TT>configure</TT> method invoked on this component.
 
509
    * <P>
 
510
    * For an example, see {@link ActiveApplet.Configure}.
 
511
    */
 
512
   static public interface Configure
 
513
   {
 
514
      /**
 
515
       * @param fileDialog the FileDialog being configured.
 
516
       */
 
517
      public void configure(final FileDialog fileDialog);
 
518
   }
 
519
   
 
520
   /**
 
521
    * The main body of this process.
 
522
    */
 
523
   public void run()
 
524
   {
 
525
      if (configure != null)
 
526
      {
 
527
         while (true)
 
528
         {
 
529
            Object message = configure.read();
 
530
            if (message instanceof Boolean)
 
531
            {
 
532
               if (message == Boolean.TRUE)
 
533
               {
 
534
                  setVisible(true);
 
535
                  if (event != null)
 
536
                  {
 
537
                     event.write(getDirectory());
 
538
                     event.write(getFile());
 
539
                  }
 
540
               }
 
541
               else if (message == Boolean.FALSE)
 
542
                  setVisible(false);
 
543
            }
 
544
            else if (message instanceof String)
 
545
               setDirectory((String) message);
 
546
            else if (message instanceof Configure)
 
547
               ((Configure) message).configure(this);
 
548
         }
 
549
      }
 
550
   }  
 
551
}