View Javadoc

1   /*
2    * Created on May 8, 2004
3    */
4   package nl.tudelft.simulation.introspection.gui;
5   
6   /***
7    * <br>
8    * (c) copyright 2003-2004 <a href="http://www.simulation.tudelft.nl">Delft
9    * University of Technology </a>, the Netherlands. <br>
10   * See for project information <a href="http://www.simulation.tudelft.nl">
11   * www.simulation.tudelft.nl </a> <br>
12   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
13   * License (GPL) </a>, no warranty <br>
14   * 
15   * @version May 29, 2004 <br>
16   * @author <a
17   *         href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
18   *         Verbraeck </a>
19   */
20  /***
21   * A simple implementation.
22   * 
23   * @author Niels Lang
24   */
25  public class DefaultModelManager implements ModelManager
26  {
27  	/*** the class of the defaultTableModel */
28  	protected Class defaultObjectTableModel = ObjectTableModel.class;
29  
30  	/*** the class of the defaultCollectionTableModel */
31  	protected Class defaultCollectionObjectTableModel = CollectionTableModel.class;
32  
33  	/***
34  	 * Constructor
35  	 */
36  	public DefaultModelManager()
37  	{
38  		this(ObjectTableModel.class, CollectionTableModel.class);
39  	}
40  
41  	/***
42  	 * Constructor
43  	 * 
44  	 * @param objectModelClass the objectModelClass
45  	 * @param collectionModelClass the collectionModelClass
46  	 */
47  	public DefaultModelManager(final Class objectModelClass,
48  			final Class collectionModelClass)
49  	{
50  		this.defaultObjectTableModel = objectModelClass;
51  		this.defaultCollectionObjectTableModel = collectionModelClass;
52  	}
53  
54  	/***
55  	 * @see nl.tudelft.simulation.introspection.gui.ModelManager
56  	 *      #getDefaultCollectionObjectTableModel()
57  	 */
58  	public Class getDefaultCollectionObjectTableModel()
59  	{
60  		return this.defaultCollectionObjectTableModel;
61  	}
62  
63  	/***
64  	 * @see nl.tudelft.simulation.introspection.gui.ModelManager
65  	 *      #getDefaultObjectTableModel()
66  	 */
67  	public Class getDefaultObjectTableModel()
68  	{
69  		return this.defaultObjectTableModel;
70  	}
71  
72  	/***
73  	 * @see nl.tudelft.simulation.introspection.gui.ModelManager
74  	 *      #setDefaultCollectionObjectTableModel(java.lang.Class)
75  	 */
76  	public void setDefaultCollectionObjectTableModel(
77  			final Class defaultCollectionObjectTableModel)
78  	{
79  		this.defaultCollectionObjectTableModel = defaultCollectionObjectTableModel;
80  	}
81  
82  	/***
83  	 * @see nl.tudelft.simulation.introspection.gui.ModelManager
84  	 *      #setDefaultObjectTableModel(java.lang.Class)
85  	 */
86  	public void setDefaultObjectTableModel(final Class defaultObjectTableModel)
87  	{
88  		this.defaultObjectTableModel = defaultObjectTableModel;
89  	}
90  }