View Javadoc

1   /*
2    * Scalebar.java
3    * 
4    * Created on April 17, 2002, 7:23 PM Last edited on October 12, 2002
5    */
6   package nl.javel.gisbeans.map;
7   
8   import java.awt.Color;
9   import java.awt.Dimension;
10  import java.awt.Font;
11  
12  /***
13   * This class implements the ScalebarInterface
14   * 
15   * @author <a href="mailto:paul.jacobs@javel.nl">Paul Jacobs </a>
16   * @since JDK 1.0
17   * @version 1.0
18   */
19  public class Scalebar implements ScalebarInterface
20  {
21  	private Color backgroundColor = new Color(255, 255, 255, 255);
22  
23  	private Color color = new Color(0, 0, 0, 255);
24  
25  	private boolean embed = false;
26  
27  	private Font font = new Font("arial", Font.TRUETYPE_FONT, 10);
28  
29  	private Color fontColor = new Color(0, 0, 0, 255);
30  
31  	private int intervals = 4;
32  
33  	private int position = MapInterface.UC;
34  
35  	private Dimension size = new java.awt.Dimension(100, 100);
36  
37  	private boolean status = false;
38  
39  	private int units = MapInterface.METERS;
40  
41  	/***
42  	 * contructs a new instance of ScaleBar
43  	 */
44  	public Scalebar()
45  	{
46  		super();
47  	}
48  
49  	/***
50  	 * @see ScalebarInterface#getBackgroundColor()
51  	 */
52  	public java.awt.Color getBackgroundColor()
53  	{
54  		return this.backgroundColor;
55  	}
56  
57  	/***
58  	 * @see ScalebarInterface#getColor()
59  	 */
60  	public java.awt.Color getColor()
61  	{
62  		return this.color;
63  	}
64  
65  	/***
66  	 * @see ScalebarInterface#getIntervals()
67  	 */
68  	public int getIntervals()
69  	{
70  		return this.intervals;
71  	}
72  
73  	/***
74  	 * @see ScalebarInterface#getPosition()
75  	 */
76  	public int getPosition()
77  	{
78  		return this.position;
79  	}
80  
81  	/***
82  	 * @see ScalebarInterface#getSize()
83  	 */
84  	public Dimension getSize()
85  	{
86  		return this.size;
87  	}
88  
89  	/***
90  	 * @see ScalebarInterface#getUnits()
91  	 */
92  	public int getUnits()
93  	{
94  		return this.units;
95  	}
96  
97  	/***
98  	 * @see ScalebarInterface#isEmbed()
99  	 */
100 	public boolean isEmbed()
101 	{
102 		return this.embed;
103 	}
104 
105 	/***
106 	 * @see ScalebarInterface#isStatus()
107 	 */
108 	public boolean isStatus()
109 	{
110 		return this.status;
111 	}
112 
113 	/***
114 	 * @see ScalebarInterface#setBackgroundColor(Color backgroundColor)
115 	 */
116 	public void setBackgroundColor(Color backgroundColor)
117 	{
118 		this.backgroundColor = backgroundColor;
119 	}
120 
121 	/***
122 	 * @see ScalebarInterface#setColor(Color color)
123 	 */
124 	public void setColor(Color color)
125 	{
126 		this.color = color;
127 	}
128 
129 	/***
130 	 * @see ScalebarInterface#setEmbed(boolean embed)
131 	 */
132 	public void setEmbed(boolean embed)
133 	{
134 		this.embed = embed;
135 	}
136 
137 	/***
138 	 * @see ScalebarInterface#setIntervals(int intervals)
139 	 */
140 	public void setIntervals(int intervals)
141 	{
142 		this.intervals = intervals;
143 	}
144 
145 	/***
146 	 * @see ScalebarInterface#setPosition(int position)
147 	 */
148 	public void setPosition(int position)
149 	{
150 		this.position = position;
151 	}
152 
153 	/***
154 	 * @see ScalebarInterface#setSize(Dimension size)
155 	 */
156 	public void setSize(Dimension size)
157 	{
158 		this.size = size;
159 	}
160 
161 	/***
162 	 * @see ScalebarInterface#setStatus(boolean status)
163 	 */
164 	public void setStatus(boolean status)
165 	{
166 		this.status = status;
167 	}
168 
169 	/***
170 	 * @see ScalebarInterface#setUnits(int units)
171 	 */
172 	public void setUnits(int units)
173 	{
174 		this.units = units;
175 	}
176 
177 	/***
178 	 * Returns the font.
179 	 * 
180 	 * @return Font
181 	 */
182 	public Font getFont()
183 	{
184 		return this.font;
185 	}
186 
187 	/***
188 	 * Returns the fontColor.
189 	 * 
190 	 * @return Color
191 	 */
192 	public Color getFontColor()
193 	{
194 		return this.fontColor;
195 	}
196 
197 	/***
198 	 * Sets the font.
199 	 * 
200 	 * @param font The font to set
201 	 */
202 	public void setFont(Font font)
203 	{
204 		this.font = font;
205 	}
206 
207 	/***
208 	 * Sets the fontColor.
209 	 * 
210 	 * @param fontColor The fontColor to set
211 	 */
212 	public void setFontColor(Color fontColor)
213 	{
214 		this.fontColor = fontColor;
215 	}
216 
217 }