View Javadoc

    1   /*
    2    * @(#) SingleImageRenderable.java Apr 30, 2004
    3    *
    4    * Copyright (c) 2003 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
    5    * the Netherlands All rights reserved.
    6    *
    7    * This software is proprietary information of Delft University of Technology
    8    * The code is published under the General Public License
    9    */
    10  package nl.tudelft.simulation.dsol.animation.D2;
    11
    12  import java.awt.Dimension;
    13  import java.awt.geom.Point2D;
    14  import java.net.URL;
    15
    16  import nl.tudelft.simulation.dsol.animation.LocatableInterface;
    17  import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
    18  import nl.tudelft.simulation.language.d3.DirectedPoint;
    19
    20  /***
    21   * <p>
    22   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
    23   * University of Technology </a>, the Netherlands. <br>
    24   * See for project information <a
    25   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
    26   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
    27   * License (GPL) </a>, no warranty <br>
    28   *
    29   * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
    30   *         Jacobs </a>
    31   * @version 1.2 Apr 30, 2004
    32   * @since 1.4
    33   */
    34  public class SingleImageRenderable extends ImageRenderable
    35  {
    36  	/***
    37  	 * constructs a new SingleImageRenderable
    38  	 *
    39  	 * @param source the moving source
    40  	 * @param simulator the simulator
    41  	 * @param image the image to animate
    42  	 */
    43  	public SingleImageRenderable(final LocatableInterface source,
    44  			final SimulatorInterface simulator, final URL image)
    45  	{
    46  		super(source, simulator, new URL[]{image});
    47  	}
    48
    49  	/***
    50  	 * constructs a new SingleImageRenderable
    51  	 *
    52  	 * @param staticLocation the static location
    53  	 * @param size the size
    54  	 * @param simulator the simulator
    55  	 * @param image the image
    56  	 */
    57  	public SingleImageRenderable(final Point2D staticLocation,
    58  			final Dimension size, final SimulatorInterface simulator,
    59  			final URL image)
    60  	{
    61  		super(staticLocation, size, simulator, new URL[]{image});
    62  	}
    63
    64  	/***
    65  	 * constructs a new SingleImageRenderable
    66  	 *
    67  	 * @param staticLocation the static location
    68  	 * @param size the size of the image
    69  	 * @param simulator the simulator
    70  	 * @param image the image
    71  	 */
    72  	public SingleImageRenderable(final DirectedPoint staticLocation,
    73  			final Dimension size, final SimulatorInterface simulator,
    74  			final URL image)
    75  	{
    76  		super(staticLocation, size, simulator, new URL[]{image});
    77  	}
    78
    79  	/***
    80  	 * @see nl.tudelft.simulation.dsol.animation.D2.ImageRenderable
    81  	 *      #selectImage()
    82  	 */
    83  	public int selectImage()
    84  	{
    85  		//We only have one image to show. Let's use this one.
    86  		return 0;
    87  	}
    88  }