View Javadoc

1   package org.ximtec.igesture.tool.core;
2   
3   import javax.swing.JFrame;
4   
5   import org.ximtec.igesture.tool.util.ComponentFactory;
6   
7   public class DefaultView extends JFrame{
8   
9   	
10  	
11  	private Controller controller;
12  
13  	public DefaultView(Controller controller){
14  		this.controller = controller;
15  		if(this.controller == null){
16  			throw new RuntimeException("Controller must not be null.");
17  		}
18  	}
19  	
20  	/**
21  	 * Returns the controller instance of the view
22   	 * @return the controller of the  view
23  	 */
24  	public Controller getController() {
25  		return controller;
26  	}
27  	
28  	/**
29  	 * Returns the component factory
30  	 * @return the component factory
31  	 */
32  	public ComponentFactory getComponentFactory(){
33  		return controller.getLocator().getService(ComponentFactory.class.getName(), ComponentFactory.class);
34  	}
35  }