1 /*
2 * @(#)$Id: Controller.java 747 2009-08-16 00:09:28Z bsigner $
3 *
4 * Author : Ueli Kurmann, igesture@uelikurmann.ch
5 *
6 * Purpose : The controller interface to be implemented by any
7 * controller component.
8 *
9 * -----------------------------------------------------------------------
10 *
11 * Revision Information:
12 *
13 * Date Who Reason
14 *
15 * 23.03.2008 ukurmann Initial Release
16 *
17 * -----------------------------------------------------------------------
18 *
19 * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20 *
21 * This software is the proprietary information of ETH Zurich.
22 * Use is subject to license terms.
23 *
24 */
25
26
27 package org.ximtec.igesture.tool.core;
28
29 import java.beans.PropertyChangeListener;
30 import java.util.List;
31
32 import org.ximtec.igesture.tool.locator.Locator;
33
34
35 /**
36 * The controller interface to be implemented by any controller component.
37 *
38 * @version 1.0 23.03.2008
39 * @author Ueli Kurmann, igesture@uelikurmann.ch
40 * @author Beat Signer, bsigner@vub.ac.be
41 */
42 public interface Controller extends PropertyChangeListener {
43
44 /**
45 * Adds a controller to this controller.
46 *
47 * @param controller the controller to be added.
48 */
49 void addController(Controller controller);
50
51
52 /**
53 * Removes a controller from this controller.
54 *
55 * @param controller the controller to be removed.
56 */
57 void removeController(Controller controller);
58
59
60 /**
61 * Removes all controllers.
62 */
63 void removeAllControllers();
64
65
66 /**
67 * Returns a list of all controllers.
68 */
69 List<Controller> getControllers();
70
71
72 /**
73 * Returns the view component for this specific controller.
74 *
75 * @return the view component for this specific controller.
76 */
77 TabbedView getView();
78
79
80 /**
81 * Executes a given command.
82 *
83 * @param command the command to be executed.
84 */
85 void execute(Command command);
86
87
88 /**
89 * Returns the parent controller. Each controller has at most one parent
90 * controller. If the controller does not have a parent, it is the root
91 * controller of the application.
92 *
93 * @return the parent controller.
94 */
95 Controller getParent();
96
97
98 /**
99 * Sets the parent controller. See getParent().
100 *
101 * @param controller the parent controller to be set.
102 */
103 void setParent(Controller controller);
104
105
106 /**
107 * Returns the action instance for the given class.
108 * @param actionName
109 * @return the action instance for the given class.
110 */
111 public LocateableAction getAction(String actionName);
112
113
114 /**
115 * Returns the applications locator
116 * @return the applications locator
117 */
118 public Locator getLocator();
119
120 }