View Javadoc
1   package org.opentrafficsim.draw.core;
2   
3   import java.rmi.RemoteException;
4   
5   import javax.naming.NamingException;
6   
7   import nl.tudelft.simulation.dsol.animation.Locatable;
8   import nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface;
9   import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
10  
11  /**
12   * This interface extends the animation objects with an option to clone them for a new source on a new Simulator.
13   * <p>
14   * Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
15   * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
16   * </p>
17   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
18   * initial version Jan 15, 2017 <br>
19   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
20   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
21   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
22   * @param <T> the Locatable class of the source that indicates the location of the Renderable on the screen
23   */
24  public interface ClonableRenderable2DInterface<T extends Locatable> extends Renderable2DInterface<T>
25  {
26      /**
27       * Clone the animation object and register it for the new source on the new simulation.
28       * @param newSource T; the source
29       * @param newSimulator SimulatorInterface.TimeDoubleUnit; the simulator
30       * @return the generated clone
31       * @throws NamingException when animation context cannot be created or retrieved
32       * @throws RemoteException - when remote context cannot be found
33       */
34      ClonableRenderable2DInterface<T> clone(T newSource, SimulatorInterface.TimeDoubleUnit newSimulator)
35              throws NamingException, RemoteException;
36  
37  }