svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / ProjectPreferences.java @ 47804
History | View | Annotate | Download (16.1 KB)
1 | 40558 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2013 gvSIG Association.
|
||
5 | *
|
||
6 | 43095 | jjdelcerro | * This program is free software; you can redistribute it and/or modify it under
|
7 | * the terms of the GNU General Public License as published by the Free Software
|
||
8 | * Foundation; either version 3 of the License, or (at your option) any later
|
||
9 | * version.
|
||
10 | 40558 | jjdelcerro | *
|
11 | 43095 | jjdelcerro | * This program is distributed in the hope that it will be useful, but WITHOUT
|
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
14 | * details.
|
||
15 | 40558 | jjdelcerro | *
|
16 | 43095 | jjdelcerro | * You should have received a copy of the GNU General Public License along with
|
17 | * this program; if not, write to the Free Software Foundation, Inc., 51
|
||
18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
19 | 40558 | jjdelcerro | *
|
20 | 43095 | jjdelcerro | * For any additional information, do not hesitate to contact us at info AT
|
21 | * gvsig.com, or visit our website www.gvsig.com.
|
||
22 | 40558 | jjdelcerro | */
|
23 | 40435 | jjdelcerro | package org.gvsig.app.project; |
24 | |||
25 | import java.awt.Color; |
||
26 | 45661 | jjdelcerro | import javax.swing.UIManager; |
27 | 41311 | jjdelcerro | import org.apache.commons.lang.StringUtils; |
28 | 43095 | jjdelcerro | import org.apache.commons.lang3.BooleanUtils; |
29 | 40435 | jjdelcerro | import org.cresques.cts.IProjection; |
30 | import org.gvsig.andami.PluginServices; |
||
31 | 43095 | jjdelcerro | import org.gvsig.andami.PluginsLocator; |
32 | 40435 | jjdelcerro | import org.gvsig.app.imp.DefaultPreferencesNode; |
33 | import org.gvsig.fmap.crs.CRSFactory; |
||
34 | import org.gvsig.fmap.mapcontext.MapContext; |
||
35 | import org.gvsig.fmap.mapcontext.MapContextLocator; |
||
36 | 43095 | jjdelcerro | import org.gvsig.tools.dynobject.DynObject; |
37 | 40435 | jjdelcerro | import org.gvsig.utils.StringUtilities; |
38 | import org.gvsig.utils.XMLEntity; |
||
39 | |||
40 | /**
|
||
41 | * Clase que representa las preferencias para el proyecto
|
||
42 | *
|
||
43 | 43095 | jjdelcerro | * @author 2009- Joaquin del Cerro
|
44 | *
|
||
45 | 40435 | jjdelcerro | */
|
46 | public class ProjectPreferences extends DefaultPreferencesNode { |
||
47 | |||
48 | 41311 | jjdelcerro | public static final String DEFAULT_PROJECTION_KEY_NAME = "DefaultProjection"; |
49 | 43095 | jjdelcerro | private static final String ZOOM_IN_FACTOR = "ZoomInFactor"; |
50 | private static final String ZOOM_OUT_FACTOR = "ZoomOutFactor"; |
||
51 | private static final String KEEP_SCALE_ON_RESIZING = "KeepScaleOnResizing"; |
||
52 | private static final String OPEN_WITH_A_NEW_MAXIMIZED_VIEW = "OpenWithANewMaximizedView"; |
||
53 | private static final String ADD_NEW_LAYERS_IN_INVISIBLE_MODE = "NewLayersInInvisibleMode"; |
||
54 | 40435 | jjdelcerro | |
55 | 43095 | jjdelcerro | private IProjection defaultProjection = null; |
56 | 40435 | jjdelcerro | |
57 | 43095 | jjdelcerro | private final IProjection defaultFactoryProjection |
58 | = MapContextLocator.getMapContextManager().getDefaultCRS(); |
||
59 | 40435 | jjdelcerro | |
60 | 47790 | fdiaz | private Color defaultSelectionColor = MapContext.DEFAULT_SELECTION_COLOR; |
61 | 40435 | jjdelcerro | |
62 | 45661 | jjdelcerro | private Color defaultViewBackColor = null; // Color.WHITE; |
63 | 40435 | jjdelcerro | |
64 | 45661 | jjdelcerro | private Color defaultOverviewBackColor = null; //Color.WHITE; |
65 | 40435 | jjdelcerro | |
66 | 43095 | jjdelcerro | private int defaultMapUnits = -1; |
67 | 40435 | jjdelcerro | |
68 | 43095 | jjdelcerro | private int defaultDistanceUnits = -1; |
69 | 40435 | jjdelcerro | |
70 | 43095 | jjdelcerro | private int defaultDistanceArea = -1; |
71 | |||
72 | 43100 | jjdelcerro | private final PluginServices plugin; |
73 | private final DynObject pluginPreferences; |
||
74 | |||
75 | 43095 | jjdelcerro | public ProjectPreferences() {
|
76 | 43100 | jjdelcerro | this.plugin = PluginsLocator.getManager().getPlugin(this); |
77 | this.pluginPreferences = plugin.getPluginProperties();
|
||
78 | 43095 | jjdelcerro | } |
79 | |||
80 | /**
|
||
81 | * Sets the projection used when no projection is defined
|
||
82 | *
|
||
83 | * @param defaultProjection
|
||
84 | */
|
||
85 | public void setDefaultProjection(IProjection defaultProjection) { |
||
86 | this.defaultProjection = defaultProjection;
|
||
87 | if (defaultProjection != null) { |
||
88 | XMLEntity xml = plugin.getPersistentXML(); |
||
89 | xml.putProperty(DEFAULT_PROJECTION_KEY_NAME, defaultProjection.getAbrev()); |
||
90 | } |
||
91 | } |
||
92 | |||
93 | public void setDefaultProjection(String defaultProjection) { |
||
94 | if (!StringUtils.isEmpty(defaultProjection)) {
|
||
95 | this.setDefaultProjection(CRSFactory.getCRS(defaultProjection));
|
||
96 | } |
||
97 | } |
||
98 | |||
99 | public IProjection getDefaultProjection() {
|
||
100 | if (this.defaultProjection == null) { |
||
101 | XMLEntity xml = plugin.getPersistentXML(); |
||
102 | if (xml.contains(DEFAULT_PROJECTION_KEY_NAME)) {
|
||
103 | String projCode = xml.getStringProperty(DEFAULT_PROJECTION_KEY_NAME);
|
||
104 | this.defaultProjection = CRSFactory.getCRS(projCode);
|
||
105 | } else {
|
||
106 | this.defaultProjection = defaultFactoryProjection;
|
||
107 | 41311 | jjdelcerro | } |
108 | 43095 | jjdelcerro | } |
109 | return this.defaultProjection; |
||
110 | } |
||
111 | |||
112 | @Override
|
||
113 | public int getInt(String name, int defaultValue) { |
||
114 | if (name.equalsIgnoreCase("DefaultDistanceUnits")) { |
||
115 | return this.getDefaultDistanceUnits(); |
||
116 | } else if (name.equalsIgnoreCase("DefaultDistanceArea")) { |
||
117 | return this.getDefaultDistanceArea(); |
||
118 | } else if (name.equalsIgnoreCase("DefaultMapUnits")) { |
||
119 | return this.getDefaultMapUnits(); |
||
120 | } |
||
121 | |||
122 | return super.getInt(name, defaultValue); |
||
123 | } |
||
124 | |||
125 | /**
|
||
126 | * Sets the default selection color that will be used in subsequent
|
||
127 | * projects.
|
||
128 | *
|
||
129 | * @param color
|
||
130 | */
|
||
131 | public void setDefaultSelectionColor(Color color) { |
||
132 | 47790 | fdiaz | if(color == null){ |
133 | return;
|
||
134 | } |
||
135 | 43095 | jjdelcerro | defaultSelectionColor = color; |
136 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
137 | 43095 | jjdelcerro | xml.putProperty("DefaultSelectionColor", StringUtilities.color2String(color));
|
138 | } |
||
139 | |||
140 | /**
|
||
141 | * Returns the current default selection color defined which is the color
|
||
142 | * defined when the user does not define any other one
|
||
143 | *
|
||
144 | * @return java.awt.Color
|
||
145 | */
|
||
146 | public Color getDefaultSelectionColor() { |
||
147 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
148 | 43095 | jjdelcerro | if (xml.contains("DefaultSelectionColor")) { |
149 | defaultSelectionColor = StringUtilities.string2Color(xml |
||
150 | .getStringProperty("DefaultSelectionColor"));
|
||
151 | } |
||
152 | 47790 | fdiaz | if(defaultSelectionColor == null) { |
153 | this.defaultSelectionColor = MapContext.DEFAULT_SELECTION_COLOR;
|
||
154 | } |
||
155 | 43095 | jjdelcerro | return defaultSelectionColor;
|
156 | } |
||
157 | |||
158 | public Color getDefaultViewBackColor() { |
||
159 | XMLEntity xml = PluginServices.getPluginServices("org.gvsig.app").getPersistentXML();
|
||
160 | if (xml.contains("DefaultViewBackColor")) { |
||
161 | defaultViewBackColor = StringUtilities. |
||
162 | string2Color(xml.getStringProperty("DefaultViewBackColor"));
|
||
163 | 45661 | jjdelcerro | } |
164 | if( defaultViewBackColor == null ) { |
||
165 | defaultViewBackColor = UIManager.getColor("EditorPane.background"); |
||
166 | if( defaultViewBackColor == null ) { |
||
167 | defaultViewBackColor = Color.WHITE;
|
||
168 | } |
||
169 | 43095 | jjdelcerro | } |
170 | return defaultViewBackColor;
|
||
171 | } |
||
172 | |||
173 | public void setDefaultViewBackColor(Color color) { |
||
174 | defaultViewBackColor = color; |
||
175 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
176 | 43095 | jjdelcerro | xml.putProperty("DefaultViewBackColor", StringUtilities.color2String(color));
|
177 | } |
||
178 | |||
179 | public Color getDefaultOverviewBackColor() { |
||
180 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
181 | 43095 | jjdelcerro | if (xml.contains("defaultOverviewBackColor")) { |
182 | defaultOverviewBackColor = StringUtilities.string2Color(xml |
||
183 | .getStringProperty("defaultOverviewBackColor"));
|
||
184 | 45661 | jjdelcerro | } |
185 | if( defaultOverviewBackColor == null ) { |
||
186 | defaultOverviewBackColor = UIManager.getColor("EditorPane.background"); |
||
187 | if( defaultOverviewBackColor == null ) { |
||
188 | defaultOverviewBackColor = Color.WHITE;
|
||
189 | } |
||
190 | 43095 | jjdelcerro | } |
191 | return defaultOverviewBackColor;
|
||
192 | |||
193 | } |
||
194 | |||
195 | public void setDefaultOverviewBackColor(Color color) { |
||
196 | defaultOverviewBackColor = color; |
||
197 | } |
||
198 | |||
199 | /**
|
||
200 | * Returns the user's default map units. This is the cartography data
|
||
201 | * distance units.
|
||
202 | *
|
||
203 | * @return int (index of the <b>Attributes.NAMES array</b>)
|
||
204 | */
|
||
205 | public int getDefaultMapUnits() { |
||
206 | if (defaultMapUnits == -1) { |
||
207 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
208 | 43095 | jjdelcerro | if (xml.contains("DefaultMapUnits")) { |
209 | defaultMapUnits = xml.getIntProperty("DefaultMapUnits");
|
||
210 | } else {
|
||
211 | // first app run case
|
||
212 | String[] unitNames = MapContext.getDistanceNames(); |
||
213 | for (int i = 0; i < unitNames.length; i++) { |
||
214 | // meter is the factory default's map unit
|
||
215 | if (unitNames[i].equals("Metros")) { |
||
216 | defaultMapUnits = i; |
||
217 | break;
|
||
218 | } |
||
219 | } |
||
220 | 41311 | jjdelcerro | } |
221 | 43095 | jjdelcerro | if (defaultMapUnits == -1 || defaultMapUnits >= MapContext.getDistanceNames().length) { |
222 | defaultMapUnits = MapContext.getDistancePosition("Metros");
|
||
223 | } |
||
224 | 41311 | jjdelcerro | } |
225 | 43095 | jjdelcerro | return defaultMapUnits;
|
226 | } |
||
227 | |||
228 | /**
|
||
229 | * Returns the user's default view units for measuring distances. This is
|
||
230 | * the units that the user will see in the status bar of the view.
|
||
231 | *
|
||
232 | * @return int (index of the <b>Attributes.NAMES array</b>)
|
||
233 | */
|
||
234 | public int getDefaultDistanceUnits() { |
||
235 | if (defaultDistanceUnits == -1) { |
||
236 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
237 | 43095 | jjdelcerro | if (xml.contains("DefaultDistanceUnits")) { |
238 | defaultDistanceUnits = xml |
||
239 | .getIntProperty("DefaultDistanceUnits");
|
||
240 | } else {
|
||
241 | // first app run case
|
||
242 | String[] unitNames = MapContext.getDistanceNames(); |
||
243 | for (int i = 0; i < unitNames.length; i++) { |
||
244 | // meter is the factory default's distance unit
|
||
245 | if (unitNames[i].equals("Metros")) { |
||
246 | defaultDistanceUnits = i; |
||
247 | break;
|
||
248 | } |
||
249 | 41311 | jjdelcerro | } |
250 | } |
||
251 | 43095 | jjdelcerro | if (defaultDistanceUnits == -1 || defaultDistanceUnits >= MapContext.getDistanceNames().length) { |
252 | defaultDistanceUnits = MapContext.getDistancePosition("Metros");
|
||
253 | } |
||
254 | } |
||
255 | return defaultDistanceUnits;
|
||
256 | } |
||
257 | 40435 | jjdelcerro | |
258 | 43095 | jjdelcerro | /**
|
259 | * Returns the user's default view units for measuring areas. This is the
|
||
260 | * units that the user will see in the status bar of the view.
|
||
261 | *
|
||
262 | * @return int (index of the <b>Attributes.NAMES array</b>)
|
||
263 | */
|
||
264 | public int getDefaultDistanceArea() { |
||
265 | if (defaultDistanceArea == -1) { |
||
266 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
267 | 43095 | jjdelcerro | if (xml.contains("DefaultDistanceArea")) { |
268 | defaultDistanceArea = xml |
||
269 | .getIntProperty("DefaultDistanceArea");
|
||
270 | } else {
|
||
271 | // first app run case
|
||
272 | String[] unitNames = MapContext.getAreaNames(); |
||
273 | for (int i = 0; i < unitNames.length; i++) { |
||
274 | // meter is the factory default's distance unit
|
||
275 | if (unitNames[i].equals("Metros")) { |
||
276 | defaultDistanceArea = i; |
||
277 | break;
|
||
278 | } |
||
279 | } |
||
280 | } |
||
281 | if (defaultDistanceArea == -1 || defaultDistanceArea >= MapContext.getAreaNames().length) { |
||
282 | defaultDistanceArea = getDefaultDistanceUnits(); |
||
283 | } |
||
284 | } |
||
285 | return defaultDistanceArea;
|
||
286 | } |
||
287 | 40435 | jjdelcerro | |
288 | 43095 | jjdelcerro | /**
|
289 | * Sets the default map unit (the units used by the data).
|
||
290 | *
|
||
291 | * @param mapUnits
|
||
292 | */
|
||
293 | public void setDefaultMapUnits(int mapUnits) { |
||
294 | defaultMapUnits = mapUnits; |
||
295 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
296 | 43095 | jjdelcerro | xml.putProperty("DefaultMapUnits", mapUnits);
|
297 | } |
||
298 | 40435 | jjdelcerro | |
299 | 43095 | jjdelcerro | /**
|
300 | * Sets the default distance units (the units shown in the status bar)
|
||
301 | *
|
||
302 | * @param distanceUnits
|
||
303 | */
|
||
304 | public void setDefaultDistanceUnits(int distanceUnits) { |
||
305 | defaultDistanceUnits = distanceUnits; |
||
306 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
307 | 43095 | jjdelcerro | xml.putProperty("DefaultDistanceUnits", distanceUnits);
|
308 | } |
||
309 | 40435 | jjdelcerro | |
310 | 43095 | jjdelcerro | /**
|
311 | * Sets the default distance area (the units shown in the status bar)
|
||
312 | *
|
||
313 | * @param distanceArea
|
||
314 | */
|
||
315 | public void setDefaultDistanceArea(int distanceArea) { |
||
316 | defaultDistanceArea = distanceArea; |
||
317 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
318 | 43095 | jjdelcerro | xml.putProperty("DefaultDistanceArea", distanceArea);
|
319 | } |
||
320 | 40435 | jjdelcerro | |
321 | 43095 | jjdelcerro | public boolean getAddNewLayersInInvisibleMode() { |
322 | 43100 | jjdelcerro | Boolean addNewLayersInInvisibleMode = (Boolean) this.pluginPreferences.getDynValue(ADD_NEW_LAYERS_IN_INVISIBLE_MODE); |
323 | 43095 | jjdelcerro | if (addNewLayersInInvisibleMode == null) { |
324 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
325 | 43095 | jjdelcerro | if (xml.contains(ADD_NEW_LAYERS_IN_INVISIBLE_MODE)) {
|
326 | addNewLayersInInvisibleMode = xml.getBooleanProperty(ADD_NEW_LAYERS_IN_INVISIBLE_MODE); |
||
327 | } else {
|
||
328 | addNewLayersInInvisibleMode = false;
|
||
329 | } |
||
330 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(ADD_NEW_LAYERS_IN_INVISIBLE_MODE, addNewLayersInInvisibleMode);
|
331 | 43095 | jjdelcerro | } |
332 | return BooleanUtils.isTrue(addNewLayersInInvisibleMode);
|
||
333 | } |
||
334 | 40435 | jjdelcerro | |
335 | 43095 | jjdelcerro | public void setAddNewLayersInInvisibleMode(boolean addNewLayersInInvisibleMode) { |
336 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(ADD_NEW_LAYERS_IN_INVISIBLE_MODE, addNewLayersInInvisibleMode);
|
337 | 43095 | jjdelcerro | } |
338 | 40435 | jjdelcerro | |
339 | 43095 | jjdelcerro | public boolean getOpenWithANewMaximizedView() { |
340 | 43100 | jjdelcerro | Boolean openWithANewMaximizedView = (Boolean) this.pluginPreferences.getDynValue(OPEN_WITH_A_NEW_MAXIMIZED_VIEW); |
341 | 43095 | jjdelcerro | if (openWithANewMaximizedView == null) { |
342 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
343 | 43095 | jjdelcerro | if (xml.contains(OPEN_WITH_A_NEW_MAXIMIZED_VIEW)) {
|
344 | openWithANewMaximizedView = xml.getBooleanProperty(OPEN_WITH_A_NEW_MAXIMIZED_VIEW); |
||
345 | } else {
|
||
346 | openWithANewMaximizedView = true;
|
||
347 | } |
||
348 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(OPEN_WITH_A_NEW_MAXIMIZED_VIEW, openWithANewMaximizedView);
|
349 | 43095 | jjdelcerro | } |
350 | return BooleanUtils.isTrue(openWithANewMaximizedView);
|
||
351 | } |
||
352 | 40435 | jjdelcerro | |
353 | 43095 | jjdelcerro | public void setOpenWithANewMaximizedView(boolean openWithANewMaximizedView) { |
354 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(OPEN_WITH_A_NEW_MAXIMIZED_VIEW, openWithANewMaximizedView);
|
355 | 43095 | jjdelcerro | } |
356 | 40435 | jjdelcerro | |
357 | 43095 | jjdelcerro | public boolean getKeepScaleOnResizing() { |
358 | 43100 | jjdelcerro | Boolean keepScaleOnResizing = (Boolean) this.pluginPreferences.getDynValue(KEEP_SCALE_ON_RESIZING); |
359 | 43095 | jjdelcerro | if (keepScaleOnResizing == null) { |
360 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
361 | 43095 | jjdelcerro | if (xml.contains(KEEP_SCALE_ON_RESIZING)) {
|
362 | keepScaleOnResizing = xml.getBooleanProperty(KEEP_SCALE_ON_RESIZING); |
||
363 | } else {
|
||
364 | keepScaleOnResizing = false;
|
||
365 | } |
||
366 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(KEEP_SCALE_ON_RESIZING, keepScaleOnResizing);
|
367 | 43095 | jjdelcerro | } |
368 | return BooleanUtils.isTrue(keepScaleOnResizing);
|
||
369 | } |
||
370 | |||
371 | public void setKeepScaleOnResizing(boolean keepScaleOnResizing) { |
||
372 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(KEEP_SCALE_ON_RESIZING, keepScaleOnResizing);
|
373 | 43095 | jjdelcerro | } |
374 | |||
375 | public double getZoomInFactor() { |
||
376 | 43100 | jjdelcerro | Double zoomInFactor = (Double) this.pluginPreferences.getDynValue(ZOOM_IN_FACTOR); |
377 | 43095 | jjdelcerro | if (zoomInFactor == null) { |
378 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
379 | 43095 | jjdelcerro | if (xml.contains(ZOOM_IN_FACTOR)) {
|
380 | zoomInFactor = xml.getDoubleProperty(ZOOM_IN_FACTOR); |
||
381 | } else {
|
||
382 | zoomInFactor = MapContext.ZOOMINFACTOR; |
||
383 | } |
||
384 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(ZOOM_IN_FACTOR, zoomInFactor);
|
385 | 43095 | jjdelcerro | } |
386 | return zoomInFactor;
|
||
387 | } |
||
388 | 43100 | jjdelcerro | |
389 | 43095 | jjdelcerro | public void setZoomInFactor(double zoomInFactor) { |
390 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(ZOOM_IN_FACTOR, zoomInFactor);
|
391 | 43095 | jjdelcerro | } |
392 | |||
393 | public double getZoomOutFactor() { |
||
394 | 43100 | jjdelcerro | Double zoomOutFactor = (Double) this.pluginPreferences.getDynValue(ZOOM_OUT_FACTOR); |
395 | 43095 | jjdelcerro | if (zoomOutFactor == null) { |
396 | 43100 | jjdelcerro | XMLEntity xml = plugin.getPersistentXML(); |
397 | 43095 | jjdelcerro | if (xml.contains(ZOOM_OUT_FACTOR)) {
|
398 | zoomOutFactor = xml.getDoubleProperty(ZOOM_OUT_FACTOR); |
||
399 | } else {
|
||
400 | 47804 | fdiaz | zoomOutFactor = MapContext.ZOOMOUTFACTOR; |
401 | 43095 | jjdelcerro | } |
402 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(ZOOM_OUT_FACTOR, zoomOutFactor);
|
403 | 43095 | jjdelcerro | } |
404 | return zoomOutFactor;
|
||
405 | } |
||
406 | 43100 | jjdelcerro | |
407 | 43095 | jjdelcerro | public void setZoomOutFactor(double zoomOutFactor) { |
408 | 43100 | jjdelcerro | this.pluginPreferences.setDynValue(ZOOM_OUT_FACTOR, zoomOutFactor);
|
409 | 43095 | jjdelcerro | } |
410 | |||
411 | 43100 | jjdelcerro | public boolean getHideLegendInToCOfNonVisibleLayers() { |
412 | Boolean hideLegendInToCOfNonVisibleLayers = (Boolean)this.pluginPreferences.getDynValue("hideLegendInToCOfNonVisibleLayers"); |
||
413 | return BooleanUtils.toBooleanDefaultIfNull(hideLegendInToCOfNonVisibleLayers,true); |
||
414 | } |
||
415 | 43095 | jjdelcerro | |
416 | 43100 | jjdelcerro | public void setHideLegendInToCOfNonVisibleLayers(boolean hideLegendInToCOfNonVisibleLayers) { |
417 | this.pluginPreferences.setDynValue("hideLegendInToCOfNonVisibleLayers", hideLegendInToCOfNonVisibleLayers); |
||
418 | } |
||
419 | |||
420 | 40435 | jjdelcerro | } |