View Javadoc

1   /*
2    * @(#) ImageDataElement.java Dec 09, 2004
3    * 
4    * 
5    * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
6    * Delft, the Netherlands. All rights reserved.
7    * 
8    * See for project information <a href="http://www.simulation.tudelft.nl/">
9    * www.simulation.tudelft.nl </a>.
10   * 
11   * The source code and binary code of this software is proprietary information
12   * of Delft University of Technology.
13   */
14  package org.gscg.gameleader.animation2D;
15  
16  
17  import nl.tudelft.simulation.language.d3.DirectedPoint;
18  
19  /***
20   * The ImageDataElement contains data in order to facilitate displaying images
21   * on a remote animation panel.
22   * <p>
23   * 
24   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
25   * Delft, the Netherlands. All rights reserved.
26   * 
27   * See for project information <a href="http://www.simulation.tudelft.nl/">
28   * www.simulation.tudelft.nl </a>.
29   * 
30   * The source code and binary code of this software is proprietary information
31   * of Delft University of Technology.
32   * 
33   * @author <a
34   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
35   *         van Houten </a>
36   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:34:02 $
37   * @since 1.0.8
38   */
39  public class ImageDataElement implements ImageDataInterface
40  {
41  	/*** the serial version uid */
42  	private static final long serialVersionUID = 11L;
43  
44  	/*** the type of the image, e.g. SingleImageRenderable, or GISContentAnimation */
45  	private String type = null;
46  
47  	/*** the points for the location */
48  	private double[] points = null;
49  
50  	/*** the key of the element */
51  	private String key = null;
52  
53  	/*** the url of the images represented as a string */
54  	private String image = null;
55  
56  	/***
57  	 * constructs a new ImageDataElement
58  	 * 
59  	 * @param type the type of the image
60  	 * @param key the key
61  	 * @param location the location
62  	 * @param image the url of the image as a string
63  	 */
64  	public ImageDataElement(final String type, final String key,
65  			final DirectedPoint location, final String image)
66  	{
67  		super();
68  		this.type = type;
69  		this.key = key;
70  		this.points = new double[]{location.x, location.y, location.z};
71  		this.image = image;
72  	}
73  
74  	/***
75  	 * @see org.gscg.gameleader.animation2D.ImageDataInterface#getPoint()
76  	 */
77  	public double[] getPoint()
78  	{
79  		return this.points;
80  	}
81  
82  	/***
83  	 * @see org.gscg.gameleader.animation2D.ImageDataInterface#setPoints(double[])
84  	 */
85  	public void setPoints(final double[] points)
86  	{
87  		this.points = points;
88  	}
89  
90  	/***
91  	 * sets the directed point
92  	 * 
93  	 * @param point the directed point
94  	 */
95  	public void setPoints(final DirectedPoint point)
96  	{
97  		this.points = new double[]{point.x, point.y, point.z};
98  	}
99  
100 	/***
101 	 * @see org.gscg.gameleader.animation2D.ImageDataInterface#getKey()
102 	 */
103 	public String getKey()
104 	{
105 		return this.key;
106 	}
107 
108 	/***
109 	 * @see org.gscg.gameleader.animation2D.ImageDataInterface#getType()
110 	 */
111 	public String getType()
112 	{
113 		return this.type;
114 	}
115 
116 	/***
117 	 * @see org.gscg.gameleader.animation2D.ImageDataInterface#getImage()
118 	 */
119 	public String getImage()
120 	{
121 		return this.image;
122 	}
123 }