© 2006-2007 ETH Zurich

org.ximtec.igesture.tool.core
Class DefaultController

java.lang.Object
  extended by org.ximtec.igesture.tool.core.DefaultController
All Implemented Interfaces:
PropertyChangeListener, EventListener, Controller
Direct Known Subclasses:
AdminController, BatchController, CompositeController, DeviceManagerController, ExplorerTreeController, MainController, TestbenchController, TestSetController, WelcomeController

public abstract class DefaultController
extends Object
implements Controller

Default implementation of the controller interface.

Version:
1.0 09.04.2008
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, bsigner@vub.ac.be

Constructor Summary
DefaultController(Controller parentController)
           
 
Method Summary
 void addAction(String actionName, LocateableAction action)
           
 void addController(Controller controller)
          Adds a controller to this controller.
 void execute(Command command)
          Executes a given command.
 LocateableAction getAction(String actionName)
          Returns the action instance for the given class.
 List<Controller> getControllers()
          Returns a list of all controllers.
 Locator getLocator()
          Returns the applications locator
 Controller getParent()
          Returns the parent controller.
 boolean isRoot()
          Returns true if this is the root controller.
 void propertyChange(PropertyChangeEvent event)
           
 void removeAllControllers()
          Removes all controllers.
 void removeController(Controller controller)
          Removes a controller from this controller.
 void setLocator(Locator locator)
           
 void setParent(Controller controller)
          Sets the parent controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ximtec.igesture.tool.core.Controller
getView
 

Constructor Detail

DefaultController

public DefaultController(Controller parentController)
Method Detail

addController

public void addController(Controller controller)
Description copied from interface: Controller
Adds a controller to this controller.

Specified by:
addController in interface Controller
Parameters:
controller - the controller to be added.

getControllers

public List<Controller> getControllers()
Description copied from interface: Controller
Returns a list of all controllers.

Specified by:
getControllers in interface Controller

removeAllControllers

public void removeAllControllers()
Description copied from interface: Controller
Removes all controllers.

Specified by:
removeAllControllers in interface Controller

removeController

public void removeController(Controller controller)
Description copied from interface: Controller
Removes a controller from this controller.

Specified by:
removeController in interface Controller
Parameters:
controller - the controller to be removed.

execute

public final void execute(Command command)
Description copied from interface: Controller
Executes a given command.

Specified by:
execute in interface Controller
Parameters:
command - the command to be executed.

propertyChange

public void propertyChange(PropertyChangeEvent event)
Specified by:
propertyChange in interface PropertyChangeListener

getParent

public Controller getParent()
Description copied from interface: Controller
Returns the parent controller. Each controller has at most one parent controller. If the controller does not have a parent, it is the root controller of the application.

Specified by:
getParent in interface Controller
Returns:
the parent controller.

setParent

public void setParent(Controller controller)
Description copied from interface: Controller
Sets the parent controller. See getParent().

Specified by:
setParent in interface Controller
Parameters:
controller - the parent controller to be set.

getAction

public LocateableAction getAction(String actionName)
Description copied from interface: Controller
Returns the action instance for the given class.

Specified by:
getAction in interface Controller
Returns:
the action instance for the given class.

addAction

public void addAction(String actionName,
                      LocateableAction action)

getLocator

public Locator getLocator()
Description copied from interface: Controller
Returns the applications locator

Specified by:
getLocator in interface Controller
Returns:
the applications locator

setLocator

public void setLocator(Locator locator)

isRoot

public boolean isRoot()
Returns true if this is the root controller.

Returns:

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.