1 /*
2 Bloof - visualize the evolution of your software project
3 Copyright ( C ) 2003 Lukasz Pekacki <lukasz@pekacki.de>
4 http://bloof.sf.net/
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, write to the Free Software Foundation, Inc.,
16 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 $RCSfile: AbstractShell.java,v $
19 Created on $Date: 2003/09/06 08:46:35 $
20 */
21 package net.sf.bloof.script;
22
23 import java.util.HashMap;
24 import java.util.HashSet;
25 import java.util.Iterator;
26
27 import net.sf.bloof.script.events.ScriptAction;
28 import net.sf.bloof.script.events.ScriptActionListener;
29 import net.sf.bloof.script.events.ScriptEvent;
30 import net.sf.bloof.script.events.ScriptEventListener;
31
32 /***
33 *
34 * @author Lukasz Pekacki <pekacki@users.sourceforge.net>
35 * @version $Id: AbstractShell.java,v 1.1 2003/09/06 08:46:35 pekacki Exp $
36 */
37 public abstract class AbstractShell implements ScriptEventListener {
38 public AbstractShell(HashMap aParams) {
39 mControl = (ScriptController) aParams.get(ScriptController.PARAM_CONTROLLER);
40 mControl.addScriptEventListener(this);
41 addScriptActionListener(mControl);
42 }
43
44 public void addScriptActionListener(ScriptActionListener aListener) {
45 mScriptActionListeners.add(aListener);
46 }
47 protected void informScriptActionListeners(ScriptAction aBrowserAction) {
48 for (Iterator iter = mScriptActionListeners.iterator(); iter.hasNext();) {
49 ScriptActionListener element = (ScriptActionListener) iter.next();
50 element.scriptActionOccured(aBrowserAction);
51 }
52
53 }
54 private HashSet mScriptActionListeners = new HashSet();
55 protected ScriptController mControl;
56 public abstract void scriptEventOccured(ScriptEvent bE);
57 }
This page was automatically generated by Maven