/* * Filename: STGController.java * * Author: Raf Van de Plas * * Contact: * Snail-mail: K.U.Leuven * ESAT-SCD * Kasteelpark Arenberg 10 * B-3001 Leuven-Heverlee * Belgium * Tel: +32 16 327927 * Fax: +32 16 321970 * Gsm: +32 474 243046 * E-mail: raf.vandeplas@esat.kuleuven.ac.be * WWW: http://www.esat.kuleuven.ac.be/~dna/BioI/ * * * Created on: Dec 5, 2003 * * Changed on: Dec 5, 2003 * * Version: 0.1 * * Description: * none * */ /** * @author rvdplas * * To change the template for this generated type comment go to * Window - Preferences - Java - Code Generation - Code and Comments */ public class STGController { //This class sends the messages to the model and acts on the companion objects it returns private STGModel stgModel = null; private STGViewerInterface stgViewer = null; public STGController(STGModel stgModel, STGViewerInterface stgViewer) { this.stgModel = stgModel; this.stgViewer = stgViewer; } public void actOn(String controlMessage) { //Get the object corresponding to the given controlMessage //and send it to an implementor of the WizardViewer interface //to do something useful with it. try{ StateCompanion stateComp = this.stgModel.actOnControlMessage(controlMessage); this.stgViewer.actOnStateCompanion(stateComp); } catch(STGModelException e) { System.err.println("An STGModelException occured!"); } } }