Revision 44143
trunk/org.gvsig.desktop/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/Launcher.java | ||
---|---|---|
3239 | 3239 |
iconManager.setCurrent(iconTheme); |
3240 | 3240 |
} |
3241 | 3241 |
} |
3242 |
double scaleFactor; |
|
3243 |
try { |
|
3244 |
scaleFactor = prefs.getDouble("scaleFactor",1.0); |
|
3245 |
} catch(Throwable th) { |
|
3246 |
scaleFactor = 1.0; |
|
3247 |
} |
|
3248 |
iconManager.setScaleFactor(scaleFactor); |
|
3242 | 3249 |
} |
3243 | 3250 |
|
3244 | 3251 |
public static void manageUnsavedData(String prompt) throws Exception { |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.coreplugin.app/org.gvsig.coreplugin.app.mainplugin/src/main/java/org/gvsig/coreplugin/preferences/general/IconThemePageLayout.xml | ||
---|---|---|
25 | 25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
26 | 26 |
</super> |
27 | 27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.coreplugin.app/org.gvsig.coreplugin.app.mainplugin/src/main/java/org/gvsig/coreplugin/preferences/general/IconThemePageLayout.xml</at> |
28 |
<at name="path">datos/devel/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.coreplugin.app/org.gvsig.coreplugin.app.mainplugin/src/main/java/org/gvsig/coreplugin/preferences/general/IconThemePageLayout.xml</at> |
|
28 | 29 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE</at> |
29 | 30 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE</at> |
30 | 31 |
<at name="components"> |
... | ... | |
74 | 75 |
</object> |
75 | 76 |
</at> |
76 | 77 |
<at name="name">label_title</at> |
77 |
<at name="width">933</at>
|
|
78 |
<at name="width">951</at>
|
|
78 | 79 |
<at name="text">_Icon_themes_availables</at> |
79 | 80 |
<at name="fill"> |
80 | 81 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
... | ... | |
134 | 135 |
</object> |
135 | 136 |
</at> |
136 | 137 |
<at name="name">label_selection</at> |
137 |
<at name="width">933</at>
|
|
138 |
<at name="width">951</at>
|
|
138 | 139 |
<at name="text">_Select_an_icon_theme_as_default_for_use_in_the_application</at> |
139 | 140 |
<at name="fill"> |
140 | 141 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
... | ... | |
194 | 195 |
</object> |
195 | 196 |
</at> |
196 | 197 |
<at name="name">combo_selection</at> |
197 |
<at name="width">901</at>
|
|
198 |
<at name="width">919</at>
|
|
198 | 199 |
<at name="items"> |
199 | 200 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
200 | 201 |
<at name="name">items</at> |
... | ... | |
208 | 209 |
</object> |
209 | 210 |
</at> |
210 | 211 |
</item> |
212 |
<item > |
|
213 |
<at name="value"> |
|
214 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
215 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
216 |
<at name="cellconstraints"> |
|
217 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
218 |
<at name="column">2</at> |
|
219 |
<at name="row">6</at> |
|
220 |
<at name="colspan">2</at> |
|
221 |
<at name="rowspan">1</at> |
|
222 |
<at name="halign">default</at> |
|
223 |
<at name="valign">default</at> |
|
224 |
<at name="insets" object="insets">0,0,0,0</at> |
|
225 |
</object> |
|
226 |
</at> |
|
227 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
228 |
</super> |
|
229 |
<at name="id">embedded.D323b47eN16915d59eb2RD7fff</at> |
|
230 |
<at name="rowspecs">CENTER:DEFAULT:NONE</at> |
|
231 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)</at> |
|
232 |
<at name="components"> |
|
233 |
<object classname="java.util.LinkedList"> |
|
234 |
<item > |
|
235 |
<at name="value"> |
|
236 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
237 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
238 |
<at name="cellconstraints"> |
|
239 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
240 |
<at name="column">1</at> |
|
241 |
<at name="row">1</at> |
|
242 |
<at name="colspan">1</at> |
|
243 |
<at name="rowspan">1</at> |
|
244 |
<at name="halign">default</at> |
|
245 |
<at name="valign">default</at> |
|
246 |
<at name="insets" object="insets">0,0,0,0</at> |
|
247 |
</object> |
|
248 |
</at> |
|
249 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
250 |
</super> |
|
251 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
252 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
253 |
<at name="beanproperties"> |
|
254 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
255 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
256 |
<at name="properties"> |
|
257 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
258 |
<at name="border"> |
|
259 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
260 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
261 |
<at name="name">border</at> |
|
262 |
</super> |
|
263 |
<at name="borders"> |
|
264 |
<object classname="java.util.LinkedList"> |
|
265 |
<item > |
|
266 |
<at name="value"> |
|
267 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
268 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
269 |
<at name="name">border</at> |
|
270 |
</super> |
|
271 |
</object> |
|
272 |
</at> |
|
273 |
</item> |
|
274 |
</object> |
|
275 |
</at> |
|
276 |
</object> |
|
277 |
</at> |
|
278 |
<at name="name">lblScaleFactor</at> |
|
279 |
<at name="width">76</at> |
|
280 |
<at name="text">_Scale_factor</at> |
|
281 |
<at name="fill"> |
|
282 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
283 |
<at name="name">fill</at> |
|
284 |
</object> |
|
285 |
</at> |
|
286 |
<at name="height">14</at> |
|
287 |
</object> |
|
288 |
</at> |
|
289 |
</object> |
|
290 |
</at> |
|
291 |
</object> |
|
292 |
</at> |
|
293 |
</item> |
|
294 |
<item > |
|
295 |
<at name="value"> |
|
296 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
297 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
298 |
<at name="cellconstraints"> |
|
299 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
300 |
<at name="column">3</at> |
|
301 |
<at name="row">1</at> |
|
302 |
<at name="colspan">1</at> |
|
303 |
<at name="rowspan">1</at> |
|
304 |
<at name="halign">default</at> |
|
305 |
<at name="valign">default</at> |
|
306 |
<at name="insets" object="insets">0,0,0,0</at> |
|
307 |
</object> |
|
308 |
</at> |
|
309 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
310 |
</super> |
|
311 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
312 |
<at name="beanclass">javax.swing.JTextField</at> |
|
313 |
<at name="beanproperties"> |
|
314 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
315 |
<at name="classname">javax.swing.JTextField</at> |
|
316 |
<at name="properties"> |
|
317 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
318 |
<at name="border"> |
|
319 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
320 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
321 |
<at name="name">border</at> |
|
322 |
</super> |
|
323 |
<at name="borders"> |
|
324 |
<object classname="java.util.LinkedList"> |
|
325 |
<item > |
|
326 |
<at name="value"> |
|
327 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
328 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
329 |
<at name="name">border</at> |
|
330 |
</super> |
|
331 |
</object> |
|
332 |
</at> |
|
333 |
</item> |
|
334 |
</object> |
|
335 |
</at> |
|
336 |
</object> |
|
337 |
</at> |
|
338 |
<at name="name">txtScaleFactor</at> |
|
339 |
<at name="width">834</at> |
|
340 |
<at name="height">20</at> |
|
341 |
</object> |
|
342 |
</at> |
|
343 |
</object> |
|
344 |
</at> |
|
345 |
</object> |
|
346 |
</at> |
|
347 |
</item> |
|
348 |
</object> |
|
349 |
</at> |
|
350 |
<at name="properties"> |
|
351 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
352 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
353 |
<at name="properties"> |
|
354 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
355 |
<at name="border"> |
|
356 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
357 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
358 |
<at name="name">border</at> |
|
359 |
</super> |
|
360 |
<at name="borders"> |
|
361 |
<object classname="java.util.LinkedList"/> |
|
362 |
</at> |
|
363 |
</object> |
|
364 |
</at> |
|
365 |
<at name="name"></at> |
|
366 |
<at name="fill"> |
|
367 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
368 |
<at name="name">fill</at> |
|
369 |
</object> |
|
370 |
</at> |
|
371 |
<at name="scollBars"> |
|
372 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
373 |
<at name="name">scollBars</at> |
|
374 |
<at name="verticalpolicy">21</at> |
|
375 |
<at name="horizontalpolicy">31</at> |
|
376 |
</object> |
|
377 |
</at> |
|
378 |
</object> |
|
379 |
</at> |
|
380 |
</object> |
|
381 |
</at> |
|
382 |
<at name="cellpainters"> |
|
383 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
384 |
<at name="rows"> |
|
385 |
<object classname="[Ljava.lang.Object;" size="1"> |
|
386 |
<at name="item" index="0"> |
|
387 |
<object classname="[Ljava.lang.Object;" size="3"/> |
|
388 |
</at> |
|
389 |
</object> |
|
390 |
</at> |
|
391 |
</object> |
|
392 |
</at> |
|
393 |
<at name="rowgroups"> |
|
394 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
395 |
<at name="groups"> |
|
396 |
<object classname="java.util.HashMap"/> |
|
397 |
</at> |
|
398 |
</object> |
|
399 |
</at> |
|
400 |
<at name="colgroups"> |
|
401 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
402 |
<at name="groups"> |
|
403 |
<object classname="java.util.HashMap"/> |
|
404 |
</at> |
|
405 |
</object> |
|
406 |
</at> |
|
407 |
</object> |
|
408 |
</at> |
|
409 |
</item> |
|
211 | 410 |
</object> |
212 | 411 |
</at> |
213 | 412 |
<at name="properties"> |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.coreplugin.app/org.gvsig.coreplugin.app.mainplugin/src/main/java/org/gvsig/coreplugin/preferences/general/IconThemePageLayout.java | ||
---|---|---|
13 | 13 |
import javax.swing.JFrame; |
14 | 14 |
import javax.swing.JLabel; |
15 | 15 |
import javax.swing.JPanel; |
16 |
import javax.swing.JTextField; |
|
16 | 17 |
|
17 | 18 |
|
18 | 19 |
public class IconThemePageLayout extends JPanel |
... | ... | |
20 | 21 |
JLabel label_title = new JLabel(); |
21 | 22 |
JLabel label_selection = new JLabel(); |
22 | 23 |
JComboBox combo_selection = new JComboBox(); |
24 |
JLabel lblScaleFactor = new JLabel(); |
|
25 |
JTextField txtScaleFactor = new JTextField(); |
|
23 | 26 |
|
24 | 27 |
/** |
25 | 28 |
* Default constructor |
... | ... | |
126 | 129 |
combo_selection.setName("combo_selection"); |
127 | 130 |
jpanel1.add(combo_selection,cc.xy(3,4)); |
128 | 131 |
|
132 |
jpanel1.add(createPanel1(),cc.xywh(2,6,2,1)); |
|
129 | 133 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4 },new int[]{ 1,2,3,4,5,6,7,8,9 }); |
130 | 134 |
return jpanel1; |
131 | 135 |
} |
132 | 136 |
|
137 |
public JPanel createPanel1() |
|
138 |
{ |
|
139 |
JPanel jpanel1 = new JPanel(); |
|
140 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)","CENTER:DEFAULT:NONE"); |
|
141 |
CellConstraints cc = new CellConstraints(); |
|
142 |
jpanel1.setLayout(formlayout1); |
|
143 |
|
|
144 |
lblScaleFactor.setName("lblScaleFactor"); |
|
145 |
lblScaleFactor.setText("_Scale_factor"); |
|
146 |
jpanel1.add(lblScaleFactor,cc.xy(1,1)); |
|
147 |
|
|
148 |
txtScaleFactor.setName("txtScaleFactor"); |
|
149 |
jpanel1.add(txtScaleFactor,cc.xy(3,1)); |
|
150 |
|
|
151 |
addFillComponents(jpanel1,new int[]{ 2 },new int[0]); |
|
152 |
return jpanel1; |
|
153 |
} |
|
154 |
|
|
133 | 155 |
/** |
134 | 156 |
* Initializer |
135 | 157 |
*/ |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.coreplugin.app/org.gvsig.coreplugin.app.mainplugin/src/main/java/org/gvsig/coreplugin/preferences/general/IconThemePage.java | ||
---|---|---|
29 | 29 |
import javax.swing.DefaultComboBoxModel; |
30 | 30 |
import javax.swing.ImageIcon; |
31 | 31 |
import javax.swing.JPanel; |
32 |
import javax.swing.text.DocumentFilter; |
|
32 | 33 |
import org.apache.commons.lang3.StringUtils; |
33 | 34 |
|
34 | 35 |
import org.gvsig.andami.IconThemeHelper; |
... | ... | |
37 | 38 |
import org.gvsig.i18n.Messages; |
38 | 39 |
import org.gvsig.tools.swing.api.ListElement; |
39 | 40 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
41 |
import org.gvsig.tools.swing.api.documentfilters.DoubleDocumentFilter; |
|
40 | 42 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
41 | 43 |
import org.gvsig.tools.swing.icontheme.IconThemeManager; |
42 | 44 |
import org.slf4j.Logger; |
... | ... | |
83 | 85 |
final IconThemeManager iconManager = ToolsSwingLocator.getIconThemeManager(); |
84 | 86 |
Preferences prefs = Preferences.userRoot().node("gvsig.icontheme"); |
85 | 87 |
String themeId = prefs.get("default-theme",null); |
88 |
double scaleFactor; |
|
89 |
try { |
|
90 |
scaleFactor = prefs.getDouble("scaleFactor",1.0); |
|
91 |
} catch(Throwable th) { |
|
92 |
scaleFactor = 1.0; |
|
93 |
} |
|
86 | 94 |
ListElement.setSelected(panel.combo_selection, iconManager.get(themeId)); |
95 |
DoubleDocumentFilter.install(panel.txtScaleFactor); |
|
87 | 96 |
} |
88 | 97 |
|
89 | 98 |
@Override |
90 | 99 |
public void storeValues() throws StoreException { |
100 |
Preferences prefs = Preferences.userRoot().node("gvsig.icontheme"); |
|
91 | 101 |
IconTheme iconTheme = (IconTheme) ListElement.getSelected(panel.combo_selection); |
92 | 102 |
if (iconTheme != null && iconTheme != iconTheme.getDefault()) { |
93 |
Preferences prefs = Preferences.userRoot().node("gvsig.icontheme"); |
|
94 | 103 |
prefs.put("default-theme", iconTheme.getID()); |
95 | 104 |
} |
105 |
if( DoubleDocumentFilter.isValid(panel.txtScaleFactor) ) { |
|
106 |
double scaleFactor = DoubleDocumentFilter.getValue(panel.txtScaleFactor); |
|
107 |
prefs.putDouble("scaleFactor", scaleFactor); |
|
108 |
} |
|
109 |
|
|
96 | 110 |
} |
97 | 111 |
|
98 | 112 |
@Override |
... | ... | |
113 | 127 |
if (panel.combo_selection.getSelectedIndex() >= 0) { |
114 | 128 |
return true; |
115 | 129 |
} |
130 |
if( DoubleDocumentFilter.isValid(panel.txtScaleFactor) ) { |
|
131 |
double scaleFactor = DoubleDocumentFilter.getValue(panel.txtScaleFactor); |
|
132 |
Preferences prefs = Preferences.userRoot().node("gvsig.icontheme"); |
|
133 |
try { |
|
134 |
if( scaleFactor != prefs.getDouble("scaleFactor",1.0) ) { |
|
135 |
return true; |
|
136 |
} |
|
137 |
} catch(Throwable th) { |
|
138 |
} |
|
139 |
} |
|
116 | 140 |
return changed; |
117 | 141 |
} |
118 | 142 |
|
... | ... | |
138 | 162 |
} |
139 | 163 |
this.panel.combo_selection.setModel(model); |
140 | 164 |
|
165 |
Preferences prefs = Preferences.userRoot().node("gvsig.icontheme"); |
|
166 |
double scaleFactor; |
|
167 |
try { |
|
168 |
scaleFactor = prefs.getDouble("scaleFactor",1.0); |
|
169 |
} catch(Throwable th) { |
|
170 |
scaleFactor = 1.0; |
|
171 |
} |
|
172 |
this.panel.txtScaleFactor.setText(String.format("%f", scaleFactor)); |
|
173 |
|
|
141 | 174 |
// Traducir las etiquetas del panel |
142 | 175 |
panel.label_title.setText(translate(panel.label_title.getText())); |
143 | 176 |
panel.label_selection.setText(translate(panel.label_selection.getText())); |
Also available in: Unified diff