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

« back to all changes in this revision

Viewing changes to src/org/jcsp/awt/ContainerEventHandler.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.event.*;
 
32
import org.jcsp.lang.*;
 
33
 
 
34
/**
 
35
 * @author P.D. Austin and P.H. Welch
 
36
 */
 
37
class ContainerEventHandler implements ContainerListener
 
38
{
 
39
   /**
 
40
    * The Channel action event notifications are sent down.
 
41
    */
 
42
   private ChannelOutput event;
 
43
   
 
44
   /**
 
45
    * constructs a new ContainerEventHandler with the specified event output
 
46
    * Channel.
 
47
    *
 
48
    * @param event The Channel to send the event notification down
 
49
    */
 
50
   public ContainerEventHandler(ChannelOutput event)
 
51
   {
 
52
      this.event  = event;
 
53
   }
 
54
   
 
55
   /**
 
56
    * Invoked when the Container the event handler is listening to has a new
 
57
    * Component added to it. Notifies the event process that a
 
58
    * ContainerEvent has occurred by sending the ContainerEvent Object.
 
59
    * Some notifications will be lost so there are no guarantees that all
 
60
    * events generated will be processed.
 
61
    *
 
62
    * @param e The parameters associated with this event
 
63
    */
 
64
   public void componentAdded(ContainerEvent e)
 
65
   {
 
66
      event.write(e);
 
67
   }
 
68
   
 
69
   /**
 
70
    * Invoked when the Container the event handler is listening to has a new
 
71
    * Component removed from it. Notifies the event process that a
 
72
    * ContainerEvent has occurred by sending the ContainerEvent Object.
 
73
    * Some notifications will be lost so there are no guarantees that all
 
74
    * events generated will be processed.
 
75
    *
 
76
    * @param e The parameters associated with this event
 
77
    */
 
78
   public void componentRemoved(ContainerEvent e)
 
79
   {
 
80
      event.write(e);
 
81
   }
 
82
}
 
 
b'\\ No newline at end of file'