View Javadoc

1   /*
2    * InteractionLayerInterface.java Created @ Jun 8, 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.interactionlayer;
15  
16  import java.rmi.RemoteException;
17  import java.util.Map;
18  
19  import nl.tudelft.simulation.dsol.simulators.DESSSimulatorInterface;
20  import nl.tudelft.simulation.event.remote.RemoteEventListenerInterface;
21  
22  import org.gscg.common.interactionlayer.GlobalInteractionLayerInterface;
23  import org.gscg.gameleader.animation2D.mouse.IntrospectionData;
24  import org.gscg.gameleader.interactionlayer.experiment.ExperimentInterface;
25  
26  
27  /***
28   * The RemoteInteraction interface defines the methods for the client-side
29   * application. <br>
30   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
31   * Delft, the Netherlands. All rights reserved.
32   * 
33   * See for project information <a href="http://www.simulation.tudelft.nl/">
34   * www.simulation.tudelft.nl </a>.
35   * 
36   * The source code and binary code of this software is proprietary information
37   * of Delft University of Technology.
38   * 
39   * @author <a
40   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
41   *         van Houten </a>
42   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:34:10 $
43   * @since 1.0.0 <br>
44   */
45  public interface RemoteInteractionLayerInterface extends ExperimentInterface,
46  		DESSSimulatorInterface, GlobalInteractionLayerInterface
47  {
48  	/***
49  	 * 
50  	 * @return returns the animation delay
51  	 * @throws RemoteException thrown in case of network failure
52  	 */
53  	long getAnimationDelay() throws RemoteException;
54  
55  	/***
56  	 * @param arg0 the animation delay
57  	 * @throws RemoteException thrown in case of network failure
58  	 */
59  	void setAnimationDelay(long arg0) throws RemoteException;
60  
61  	/***
62  	 * @return returns the map with animation bindings
63  	 * @throws RemoteException thrown in case of network failure
64  	 */
65  	Map getBindings() throws RemoteException;
66  
67  	/***
68  	 * @return returns the map with the keys for the actors. A key of the map
69  	 *         represents a reference type of an actor, e.g. a manufacturer or a
70  	 *         retailer. The object belonging to this key is a alfabetically
71  	 *         SortedSet, containing they keys for the actors. These keys can be
72  	 *         used to get the data for an actor from the server.
73  	 * @throws RemoteException thrown in case of network failure
74  	 */
75  	Map getActorKeys() throws RemoteException;
76  
77  	/***
78  	 * sets the refresh delay for the client side animation panel; the server
79  	 * responds with a GameLeaderInteractionLayer.ANIMATION_UPDATE_EVENT
80  	 * 
81  	 * @param times the number of times per second the animation should be
82  	 *        refreshed (only if an update is present)
83  	 * @param listener the listener for the event
84  	 * @throws RemoteException thrown in case of a network error
85  	 */
86  	void setAnimationRefreshDelay(double times,
87  			RemoteEventListenerInterface listener) throws RemoteException;
88  
89  	/***
90  	 * removes a listener for a refresh delay
91  	 * 
92  	 * @param listener the listener to remove
93  	 * @throws RemoteException thrown in case of network failure
94  	 */
95  	void removeAnimationRefreshDelayListener(
96  			RemoteEventListenerInterface listener) throws RemoteException;
97  
98  	/***
99  	 * saves a simulation to a persitent storage
100 	 * 
101 	 * @throws RemoteException thrown in case of network failure
102 	 */
103 	void saveSimulation() throws RemoteException;
104 
105 
106 	/***
107 	 * Method getIntrospectedObjectData returns the date of the object which has
108 	 * been introspected on a client-side animationpanel. Serverside resolving
109 	 * of this object is done using a unique key which is a combination of the
110 	 * toString() and hashCode() methods of the object.
111 	 * 
112 	 * @param key the key to use
113 	 * @return Returns the introspected data for the object if found, null
114 	 *         otherwise
115 	 * @throws RemoteException thrown in case of a network failure
116 	 */
117 	IntrospectionData getIntrospectedObjectData(String key)
118 			throws RemoteException;
119 
120 	/***
121 	 * Method updateIntrospectedObject updates an introspected object.
122 	 * 
123 	 * @param data the data for the oject
124 	 * @throws RemoteException thrown in case of a network failure
125 	 */
126 	void updateIntrospectedObject(IntrospectionData data)
127 			throws RemoteException;
128 }