View Javadoc

1   /*
2    * @(#)DSOLApplicationDistributorGame.java Jul 7, 2004
3    * 
4    * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
5    * Delft, the Netherlands. All rights reserved.
6    * 
7    * See for project information <a href="http://www.simulation.tudelft.nl/">
8    * www.simulation.tudelft.nl </a>.
9    * 
10   * The source code and binary code of this software is proprietary information
11   * of Delft University of Technology.
12   */
13  
14  package org.gscg.gameleader;
15  
16  import java.net.URL;
17  
18  import nl.tudelft.simulation.dsol.experiment.Experiment;
19  import nl.tudelft.simulation.dsol.gui.DSOLApplication;
20  import nl.tudelft.simulation.dsol.gui.panels.GUIExperimentParsingThread;
21  import nl.tudelft.simulation.event.EventInterface;
22  import nl.tudelft.simulation.event.EventListenerInterface;
23  import nl.tudelft.simulation.language.io.URLResource;
24  import nl.tudelft.simulation.xml.dsol.ExperimentParsingThread;
25  
26  /***
27   * <br>
28   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
29   * Delft, the Netherlands. All rights reserved.
30   * 
31   * See for project information <a href="http://www.simulation.tudelft.nl/">
32   * www.simulation.tudelft.nl </a>.
33   * 
34   * The source code and binary code of this software is proprietary information
35   * of Delft University of Technology.
36   * 
37   * @author <a
38   *         href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
39   *         Verbraeck </a>
40   * @version $Revision: 1.2 $ $Date: 2005/08/03 08:52:51 $
41   * @since 1.0.0 <br>
42   */
43  public class DSOLApplicationDistributorGame extends DSOLApplication implements
44  		EventListenerInterface
45  {
46  	/*** the serial version uid */
47  	private static final long serialVersionUID = 11L;
48  
49  	/***
50  	 * constructs a new DSOLApplicationDistributorGame
51  	 */
52  	public DSOLApplicationDistributorGame()
53  	{
54  		super(URLResource.getResource("/xml/navigation.xml"));
55  		this.properties.put("dsol-gui.animation.panel.extent",
56  				"-180;-90;360;180");
57  		this.properties.put("dsol-gui.animation.panel.size", "1224;768");
58  
59  		// we use our customized implementation of an editor input listener
60  		// it is used to prevent showing the introspection panel
61  		this.properties.put("dsol-gui.animation.panel.mouseEditor",
62  				"org.gscg.gameleader.mouse.GameMouseInputListener");
63  
64  		this.addListener(this, ExperimentParsingThread.EXPERIMENT_PARSED_EVENT);
65  
66  		new GUIExperimentParsingThread(this, null, URLResource
67  				.getResource("/experiment.xml")).start();
68  	}
69  
70  	/***
71  	 * @see nl.tudelft.simulation.event.EventListenerInterface
72  	 *      #notify(nl.tudelft.simulation.event.EventInterface)
73  	 */
74  	public void notify(final EventInterface event)
75  	{
76  		this.setExperiment((Experiment) event.getContent());
77  	}
78  
79  	/***
80  	 * @see nl.tudelft.simulation.dsol.gui.DSOLApplication#main(java.lang.String[])
81  	 */
82  	public static void main(final String[] args)
83  	{
84  		URL url = URLResource.getResource("/navigation.xml");
85  		System.out.println("URL: " + url);
86  		new DSOLApplicationDistributorGame();
87  	}
88  }