]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/threedee/ImageDefinition.java
Version 16, February 2014
[GpsPrune.git] / tim / prune / threedee / ImageDefinition.java
1 package tim.prune.threedee;
2
3 /**
4  * Holds the definition of the image to use
5  * (whether or not to use an image, and the source index and zoom)
6  */
7 public class ImageDefinition
8 {
9         private boolean _useImage    = false;
10         private int     _sourceIndex = 0;
11         private int     _zoom        = 0;
12
13
14         /**
15          * Empty constructor specifying no image
16          */
17         public ImageDefinition()
18         {
19                 this(false, 0, 0);
20         }
21
22         /**
23          * Constructor
24          * @param inUse true to use an image
25          * @param inSourceIndex index of map source
26          * @param inZoom zoom level
27          */
28         public ImageDefinition(boolean inUse, int inSourceIndex, int inZoom)
29         {
30                 setUseImage(inUse, inSourceIndex, inZoom);
31         }
32
33         /**
34          * Set the parameters
35          * @param inUse true to use an image
36          * @param inSourceIndex index of map source
37          * @param inZoom zoom level
38          */
39         public void setUseImage(boolean inUse, int inSourceIndex, int inZoom)
40         {
41                 _useImage = inUse;
42                 _sourceIndex = inSourceIndex;
43                 _zoom = inZoom;
44         }
45
46         /**
47          * @return true if image should be used, false otherwise
48          */
49         public boolean getUseImage() {
50                 return _useImage && _sourceIndex >= 0 && _zoom > 2;
51         }
52
53         /**
54          * @return source index
55          */
56         public int getSourceIndex() {
57                 return _sourceIndex;
58         }
59
60         /**
61          * @return zoom level
62          */
63         public int getZoom() {
64                 return _zoom;
65         }
66 }