Revision 2066
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.tools.util.ToolsUtilLibrary |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/desktopopen/DesktopOpen.java | ||
---|---|---|
1 |
package org.gvsig.desktopopen; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.net.URI; |
|
5 |
|
|
6 |
public interface DesktopOpen { |
|
7 |
|
|
8 |
public boolean browse(URI uri); |
|
9 |
|
|
10 |
public boolean edit(File file); |
|
11 |
|
|
12 |
public boolean open(File file); |
|
13 |
|
|
14 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/htmlbuilder/HTMLBuilder.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.htmlbuilder; |
|
3 |
|
|
4 |
import java.awt.Color; |
|
5 |
import java.util.Date; |
|
6 |
import java.util.List; |
|
7 |
import java.util.Map; |
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
* @author jjdelcerro |
|
12 |
*/ |
|
13 |
public interface HTMLBuilder { |
|
14 |
|
|
15 |
|
|
16 |
public static final String accesskey = "accesskey"; |
|
17 |
public static final String class_ = "class"; |
|
18 |
public static final String contenteditable = "contenteditable"; |
|
19 |
public static final String content = "content"; |
|
20 |
public static final String dir = "dir"; |
|
21 |
public static final String draggable = "draggable"; |
|
22 |
public static final String dropzone = "dropzone"; |
|
23 |
public static final String hidden = "hidden"; |
|
24 |
public static final String id = "id"; |
|
25 |
public static final String lang = "lang"; |
|
26 |
public static final String spellcheck = "spellcheck"; |
|
27 |
public static final String style = "style"; |
|
28 |
public static final String tabindex = "tabindex"; |
|
29 |
public static final String title = "title"; |
|
30 |
public static final String translate = "translate"; |
|
31 |
|
|
32 |
public static final String alt = "alt"; |
|
33 |
public static final String coords = "coords"; |
|
34 |
public static final String download = "download"; |
|
35 |
public static final String href = "href"; |
|
36 |
public static final String hreflang = "hreflang"; |
|
37 |
public static final String media = "media"; |
|
38 |
public static final String nohref = "nohref"; |
|
39 |
public static final String rel = "rel"; |
|
40 |
public static final String shape = "shape"; |
|
41 |
public static final String target = "target"; |
|
42 |
public static final String type = "type"; |
|
43 |
|
|
44 |
public static final String autofocus = "autofocus"; |
|
45 |
public static final String disabled = "disabled"; |
|
46 |
public static final String form = "form"; |
|
47 |
public static final String formaction = "formaction"; |
|
48 |
public static final String formenctype = "formenctype"; |
|
49 |
public static final String formmethod = "formmethod"; |
|
50 |
public static final String formnovalidate = "formnovalidate"; |
|
51 |
public static final String formtarget = "formtarget"; |
|
52 |
public static final String framename = "framename"; |
|
53 |
public static final String name = "name"; |
|
54 |
public static final String value = "value"; |
|
55 |
public static final String height = "height"; |
|
56 |
public static final String width = "width"; |
|
57 |
public static final String align = "align"; |
|
58 |
public static final String open = "open"; |
|
59 |
public static final String size = "size"; |
|
60 |
public static final String color = "color"; |
|
61 |
public static final String face = "face"; |
|
62 |
public static final String noshade = "noshade"; |
|
63 |
public static final String xmlns = "xmlns"; |
|
64 |
public static final String for_ = "for"; |
|
65 |
public static final String charset = "charset"; |
|
66 |
|
|
67 |
public static final String max = "max"; |
|
68 |
public static final String min = "min"; |
|
69 |
public static final String low = "low"; |
|
70 |
public static final String hight = "hight"; |
|
71 |
public static final String optimun = "optimun"; |
|
72 |
|
|
73 |
public static final String compact = "compact"; |
|
74 |
public static final String reversed = "reversed"; |
|
75 |
public static final String start = "start"; |
|
76 |
|
|
77 |
public static final String multiple = "multiple"; |
|
78 |
public static final String required = "required"; |
|
79 |
|
|
80 |
public static final String bgcolor = "bgcolor"; |
|
81 |
public static final String border = "border"; |
|
82 |
public static final String cellpadding = "cellpadding"; |
|
83 |
public static final String cellspacing = "cellspacing"; |
|
84 |
|
|
85 |
public static final String colspan = "colspan"; |
|
86 |
public static final String nowrap = "nowrap"; |
|
87 |
public static final String valign = "valign"; |
|
88 |
|
|
89 |
public static final String cols = "cols"; |
|
90 |
public static final String dirname = "dirname"; |
|
91 |
public static final String maxlength = "maxlength"; |
|
92 |
public static final String placeholder = "placeholder"; |
|
93 |
public static final String readonly = "readonly"; |
|
94 |
public static final String rows = "rows"; |
|
95 |
public static final String wrap = "wrap"; |
|
96 |
|
|
97 |
public static final String datetime = "datetime"; |
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
public static final String target_blank = "_blank"; |
|
105 |
public static final String target_self = "_self"; |
|
106 |
public static final String target_parent = "_parent"; |
|
107 |
public static final String target_top = "_top"; |
|
108 |
|
|
109 |
public static final String method_get = "get"; |
|
110 |
public static final String method_post = "post"; |
|
111 |
|
|
112 |
public static final String type_button = "button"; |
|
113 |
public static final String type_reset = "reset"; |
|
114 |
public static final String type_submit = "submit"; |
|
115 |
|
|
116 |
public static final String valign_top = "top"; |
|
117 |
public static final String valign_middle = "middle"; |
|
118 |
public static final String valign_bottom = "bottom"; |
|
119 |
public static final String valign_baseline = "baseline"; |
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
public interface HTMLElement { |
|
124 |
public boolean allowContents(); |
|
125 |
|
|
126 |
public boolean allowAttributes(); |
|
127 |
|
|
128 |
public String toHTML(); |
|
129 |
} |
|
130 |
|
|
131 |
public interface HTMLElementWithAttributes extends HTMLElement { |
|
132 |
public Map<String,String> getAttributes(); |
|
133 |
|
|
134 |
public Map<String,String> getStyle(); |
|
135 |
|
|
136 |
public HTMLElementWithAttributes set(String name, String value); |
|
137 |
|
|
138 |
public HTMLElementWithAttributes set(String name, int value); |
|
139 |
|
|
140 |
public HTMLElementWithAttributes set(String name, double value); |
|
141 |
|
|
142 |
public HTMLElementWithAttributes set(String name, HTMLColor color); |
|
143 |
|
|
144 |
public HTMLElementWithAttributes set(String name); |
|
145 |
|
|
146 |
public HTMLElementWithAttributes style(String name, String value); |
|
147 |
|
|
148 |
public HTMLElementWithAttributes style(String name, int value); |
|
149 |
|
|
150 |
public HTMLElementWithAttributes style(String name, double value); |
|
151 |
|
|
152 |
public HTMLElementWithAttributes style(String name, HTMLColor color); |
|
153 |
|
|
154 |
} |
|
155 |
|
|
156 |
public interface HTMLElementWithContents extends HTMLElement { |
|
157 |
|
|
158 |
public HTMLElementWithContents contents(Object... values); |
|
159 |
|
|
160 |
public List<HTMLElement> getContents(); |
|
161 |
} |
|
162 |
|
|
163 |
public interface HTMLComplexElement |
|
164 |
extends HTMLElementWithContents, HTMLElementWithAttributes |
|
165 |
{ |
|
166 |
@Override |
|
167 |
public HTMLComplexElement contents(Object... values); |
|
168 |
|
|
169 |
@Override |
|
170 |
public HTMLComplexElement set(String name, String value); |
|
171 |
|
|
172 |
@Override |
|
173 |
public HTMLComplexElement set(String name, int value); |
|
174 |
|
|
175 |
@Override |
|
176 |
public HTMLComplexElement set(String name, double value); |
|
177 |
|
|
178 |
@Override |
|
179 |
public HTMLComplexElement set(String name, HTMLColor color); |
|
180 |
|
|
181 |
@Override |
|
182 |
public HTMLComplexElement set(String name); |
|
183 |
|
|
184 |
@Override |
|
185 |
public HTMLComplexElement style(String name, String value); |
|
186 |
|
|
187 |
@Override |
|
188 |
public HTMLComplexElement style(String name, int value); |
|
189 |
|
|
190 |
@Override |
|
191 |
public HTMLComplexElement style(String name, double value); |
|
192 |
|
|
193 |
@Override |
|
194 |
public HTMLComplexElement style(String name, HTMLColor color); |
|
195 |
|
|
196 |
} |
|
197 |
|
|
198 |
public interface HTMLColor extends HTMLElement { |
|
199 |
|
|
200 |
} |
|
201 |
|
|
202 |
HTMLColor color(Color color); |
|
203 |
|
|
204 |
HTMLColor color(String color); |
|
205 |
|
|
206 |
HTMLColor color(int r, int g, int b); |
|
207 |
|
|
208 |
HTMLElement contents(HTMLElement... values); |
|
209 |
|
|
210 |
HTMLElement custom(String value); |
|
211 |
|
|
212 |
HTMLElement plain(String value); |
|
213 |
|
|
214 |
HTMLElement plainWithNl(String value); |
|
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
219 |
HTMLComplexElement a(Object... contents); |
|
220 |
|
|
221 |
HTMLComplexElement a(String link, Object... contents); |
|
222 |
|
|
223 |
HTMLComplexElement abbr(Object... contents); |
|
224 |
|
|
225 |
HTMLComplexElement acronym(Object... contents); |
|
226 |
|
|
227 |
HTMLComplexElement address(Object... contents); |
|
228 |
|
|
229 |
HTMLComplexElement area(Object... contents); |
|
230 |
|
|
231 |
HTMLComplexElement article(Object... contents); |
|
232 |
|
|
233 |
HTMLComplexElement aside(Object... contents); |
|
234 |
|
|
235 |
HTMLComplexElement b(Object... contents); |
|
236 |
|
|
237 |
HTMLElementWithAttributes base(); |
|
238 |
|
|
239 |
HTMLElementWithAttributes basefont(); |
|
240 |
|
|
241 |
HTMLComplexElement bdi(Object... contents); |
|
242 |
|
|
243 |
HTMLComplexElement bdo(Object... contents); |
|
244 |
|
|
245 |
HTMLElementWithContents big(Object... contents); |
|
246 |
|
|
247 |
HTMLComplexElement blockquote(Object... contents); |
|
248 |
|
|
249 |
HTMLComplexElement body(Object... contents); |
|
250 |
|
|
251 |
HTMLElement br(); |
|
252 |
|
|
253 |
HTMLComplexElement button(Object... contents); |
|
254 |
|
|
255 |
HTMLComplexElement canvas(Object... contents); |
|
256 |
|
|
257 |
HTMLComplexElement caption(Object... contents); |
|
258 |
|
|
259 |
HTMLElementWithContents center(Object... contents); |
|
260 |
|
|
261 |
HTMLComplexElement cite(Object... contents); |
|
262 |
|
|
263 |
HTMLComplexElement code(Object... contents); |
|
264 |
|
|
265 |
HTMLElementWithAttributes col(); |
|
266 |
|
|
267 |
HTMLComplexElement colgroup(Object... contents); |
|
268 |
|
|
269 |
HTMLComplexElement data(Object... contents); |
|
270 |
|
|
271 |
HTMLComplexElement datalist(Object... contents); |
|
272 |
|
|
273 |
HTMLComplexElement dd(Object... contents); |
|
274 |
|
|
275 |
HTMLComplexElement del(Object... contents); |
|
276 |
|
|
277 |
HTMLComplexElement details(Object... contents); |
|
278 |
|
|
279 |
HTMLComplexElement dfn(Object... contents); |
|
280 |
|
|
281 |
HTMLComplexElement dialog(Object... contents); |
|
282 |
|
|
283 |
HTMLElementWithContents dir(Object... contents); |
|
284 |
|
|
285 |
HTMLComplexElement div(Object... contents); |
|
286 |
|
|
287 |
HTMLComplexElement dl(Object... contents); |
|
288 |
|
|
289 |
HTMLComplexElement dt(Object... contents); |
|
290 |
|
|
291 |
HTMLComplexElement em(Object... contents); |
|
292 |
|
|
293 |
HTMLElementWithAttributes embed(); |
|
294 |
|
|
295 |
HTMLComplexElement fieldset(Object... contents); |
|
296 |
|
|
297 |
HTMLComplexElement figcaption(Object... contents); |
|
298 |
|
|
299 |
HTMLComplexElement figure(Object... contents); |
|
300 |
|
|
301 |
HTMLComplexElement font(Object... contents); |
|
302 |
|
|
303 |
HTMLComplexElement font(int size, HTMLColor color); |
|
304 |
|
|
305 |
HTMLComplexElement font(int size, HTMLColor color, String face, Object... contents); |
|
306 |
|
|
307 |
HTMLComplexElement footer(Object... contents); |
|
308 |
|
|
309 |
HTMLComplexElement form(Object... contents); |
|
310 |
|
|
311 |
HTMLComplexElement frame(Object... contents); |
|
312 |
|
|
313 |
HTMLComplexElement frameset(Object... contents); |
|
314 |
|
|
315 |
HTMLComplexElement h1(Object... contents); |
|
316 |
|
|
317 |
HTMLComplexElement h2(Object... contents); |
|
318 |
|
|
319 |
HTMLComplexElement h3(Object... contents); |
|
320 |
|
|
321 |
HTMLComplexElement h4(Object... contents); |
|
322 |
|
|
323 |
HTMLComplexElement h5(Object... contents); |
|
324 |
|
|
325 |
HTMLComplexElement h6(Object... contents); |
|
326 |
|
|
327 |
HTMLComplexElement head(Object... contents); |
|
328 |
|
|
329 |
HTMLComplexElement header(Object... contents); |
|
330 |
|
|
331 |
HTMLComplexElement hr(Object... contents); |
|
332 |
|
|
333 |
HTMLComplexElement html(Object... contents); |
|
334 |
|
|
335 |
HTMLComplexElement i(Object... contents); |
|
336 |
|
|
337 |
HTMLComplexElement iframe(Object... contents); |
|
338 |
|
|
339 |
HTMLElementWithAttributes img(); |
|
340 |
|
|
341 |
HTMLElementWithAttributes input(Object... contents); |
|
342 |
|
|
343 |
HTMLComplexElement ins(Object... contents); |
|
344 |
|
|
345 |
HTMLComplexElement kbd(Object... contents); |
|
346 |
|
|
347 |
HTMLComplexElement label(Object... contents); |
|
348 |
|
|
349 |
HTMLComplexElement legend(Object... contents); |
|
350 |
|
|
351 |
HTMLComplexElement li(Object... contents); |
|
352 |
|
|
353 |
HTMLElementWithAttributes link(); |
|
354 |
|
|
355 |
HTMLElementWithAttributes link(String rel, String type, String href); |
|
356 |
|
|
357 |
HTMLComplexElement main(Object... contents); |
|
358 |
|
|
359 |
HTMLComplexElement map(Object... contents); |
|
360 |
|
|
361 |
HTMLComplexElement mark(Object... contents); |
|
362 |
|
|
363 |
HTMLElementWithAttributes meta(); |
|
364 |
|
|
365 |
HTMLElementWithAttributes meta(String charset); |
|
366 |
|
|
367 |
HTMLElementWithAttributes meta(String name, String content); |
|
368 |
|
|
369 |
HTMLComplexElement meter(Object... contents); |
|
370 |
|
|
371 |
HTMLComplexElement nav(Object... contents); |
|
372 |
|
|
373 |
HTMLElementWithContents noframes(Object... contents); |
|
374 |
|
|
375 |
HTMLElementWithContents noscript(Object... contents); |
|
376 |
|
|
377 |
HTMLComplexElement object(Object... contents); |
|
378 |
|
|
379 |
HTMLComplexElement ol(Object... contents); |
|
380 |
|
|
381 |
HTMLComplexElement optgroup(Object... contents); |
|
382 |
|
|
383 |
HTMLComplexElement option(Object... contents); |
|
384 |
|
|
385 |
HTMLComplexElement output(Object... contents); |
|
386 |
|
|
387 |
HTMLComplexElement p(Object... contents); |
|
388 |
|
|
389 |
HTMLElementWithAttributes param(); |
|
390 |
|
|
391 |
HTMLComplexElement pre(Object... contents); |
|
392 |
|
|
393 |
HTMLComplexElement progress(Object... contents); |
|
394 |
|
|
395 |
HTMLComplexElement q(Object... contents); |
|
396 |
|
|
397 |
HTMLComplexElement rp(Object... contents); |
|
398 |
|
|
399 |
HTMLComplexElement rt(Object... contents); |
|
400 |
|
|
401 |
HTMLComplexElement ruby(Object... contents); |
|
402 |
|
|
403 |
HTMLComplexElement s(Object... contents); |
|
404 |
|
|
405 |
HTMLComplexElement samp(Object... contents); |
|
406 |
|
|
407 |
HTMLComplexElement script(Object... contents); |
|
408 |
|
|
409 |
HTMLComplexElement section(Object... contents); |
|
410 |
|
|
411 |
HTMLComplexElement select(Object... contents); |
|
412 |
|
|
413 |
HTMLComplexElement small(Object... contents); |
|
414 |
|
|
415 |
HTMLComplexElement source(Object... contents); |
|
416 |
|
|
417 |
HTMLComplexElement span(Object... contents); |
|
418 |
|
|
419 |
HTMLElementWithContents strike(Object... contents); |
|
420 |
|
|
421 |
HTMLComplexElement strong(Object... contents); |
|
422 |
|
|
423 |
HTMLComplexElement style(Object... contents); |
|
424 |
|
|
425 |
HTMLComplexElement sub(Object... contents); |
|
426 |
|
|
427 |
HTMLComplexElement summary(Object... contents); |
|
428 |
|
|
429 |
HTMLComplexElement sup(Object... contents); |
|
430 |
|
|
431 |
HTMLComplexElement svg(Object... contents); |
|
432 |
|
|
433 |
HTMLComplexElement table(Object... contents); |
|
434 |
|
|
435 |
HTMLComplexElement table(int border, int cellpadding, int cellspacing); |
|
436 |
|
|
437 |
HTMLComplexElement table(int border, int cellpadding, int cellspacing, int widthpercent); |
|
438 |
|
|
439 |
HTMLComplexElement tbody(Object... contents); |
|
440 |
|
|
441 |
HTMLComplexElement td(Object... contents); |
|
442 |
|
|
443 |
HTMLComplexElement td(boolean wrap, int colspan); |
|
444 |
|
|
445 |
HTMLComplexElement td(boolean wrap, int colspan, String valign); |
|
446 |
|
|
447 |
HTMLComplexElement template(Object... contents); |
|
448 |
|
|
449 |
HTMLComplexElement textarea(Object... contents); |
|
450 |
|
|
451 |
HTMLComplexElement textarea(int rows, int cols); |
|
452 |
|
|
453 |
HTMLComplexElement textarea(int rows, int cols, int maxlength); |
|
454 |
|
|
455 |
HTMLComplexElement tfoot(Object... contents); |
|
456 |
|
|
457 |
HTMLComplexElement th(Object... contents); |
|
458 |
|
|
459 |
HTMLComplexElement thead(Object... contents); |
|
460 |
|
|
461 |
HTMLComplexElement time(Object... contents); |
|
462 |
|
|
463 |
HTMLComplexElement time(Date datetime); |
|
464 |
|
|
465 |
HTMLComplexElement time(String datetime); |
|
466 |
|
|
467 |
HTMLComplexElement title(Object... contents); |
|
468 |
|
|
469 |
HTMLComplexElement tr(Object... contents); |
|
470 |
|
|
471 |
HTMLComplexElement tr(HTMLColor color); |
|
472 |
|
|
473 |
HTMLComplexElement tr(String valign); |
|
474 |
|
|
475 |
HTMLComplexElement tr(String valign, HTMLColor color); |
|
476 |
|
|
477 |
HTMLComplexElement track(Object... contents); |
|
478 |
|
|
479 |
HTMLElementWithContents tt(Object... contents); |
|
480 |
|
|
481 |
HTMLComplexElement u(Object... contents); |
|
482 |
|
|
483 |
HTMLComplexElement ul(Object... contents); |
|
484 |
|
|
485 |
HTMLComplexElement var(Object... contents); |
|
486 |
|
|
487 |
HTMLComplexElement video(Object... contents); |
|
488 |
|
|
489 |
HTMLComplexElement wbr(Object... contents); |
|
490 |
|
|
491 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/svgsupport/SVGSupportManager.java | ||
---|---|---|
1 |
package org.gvsig.svgsupport; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.io.IOException; |
|
5 |
import java.net.URL; |
|
6 |
|
|
7 |
public interface SVGSupportManager { |
|
8 |
|
|
9 |
public SVGRenderer createRenderer(); |
|
10 |
public SVGRenderer createRenderer(URL source) throws IOException ; |
|
11 |
public SVGRenderer createRenderer(File source) throws IOException ; |
|
12 |
|
|
13 |
|
|
14 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/svgsupport/SVGRenderer.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* 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 |
* |
|
11 |
* 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 |
* |
|
16 |
* 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 |
* |
|
20 |
* For any additional information, do not hesitate to contact us at info AT |
|
21 |
* gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.svgsupport; |
|
24 |
|
|
25 |
import java.awt.Graphics2D; |
|
26 |
import java.awt.geom.Rectangle2D; |
|
27 |
import java.io.File; |
|
28 |
import java.io.IOException; |
|
29 |
import java.net.URL; |
|
30 |
|
|
31 |
public interface SVGRenderer { |
|
32 |
|
|
33 |
public Rectangle2D getBounds(); |
|
34 |
|
|
35 |
public void drawInsideRectangle( |
|
36 |
Graphics2D g, |
|
37 |
Rectangle2D rect, |
|
38 |
boolean keepAspectRatio |
|
39 |
); |
|
40 |
|
|
41 |
public void setSource(URL url) throws IOException; |
|
42 |
public void setSource(File f) throws IOException; |
|
43 |
|
|
44 |
|
|
45 |
public URL getSource(); |
|
46 |
|
|
47 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/ToolsUtilManager.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
import org.gvsig.desktopopen.DesktopOpen; |
|
4 |
import org.gvsig.htmlbuilder.HTMLBuilder; |
|
5 |
|
|
6 |
/** |
|
7 |
* gvSIG. Desktop Geographic Information System. |
|
8 |
* |
|
9 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
10 |
* |
|
11 |
* This program is free software; you can redistribute it and/or modify it under |
|
12 |
* the terms of the GNU General Public License as published by the Free Software |
|
13 |
* Foundation; either version 3 of the License, or (at your option) any later |
|
14 |
* version. |
|
15 |
* |
|
16 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
17 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
18 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
19 |
* details. |
|
20 |
* |
|
21 |
* You should have received a copy of the GNU General Public License along with |
|
22 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
23 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
24 |
* |
|
25 |
* For any additional information, do not hesitate to contact us at info AT |
|
26 |
* gvsig.com, or visit our website www.gvsig.com. |
|
27 |
*/ |
|
28 |
/** |
|
29 |
* @author fdiaz |
|
30 |
* |
|
31 |
*/ |
|
32 |
public interface ToolsUtilManager { |
|
33 |
|
|
34 |
/** |
|
35 |
* @return |
|
36 |
*/ |
|
37 |
public InformationBuilder createInformationBuilder(); |
|
38 |
|
|
39 |
public DesktopOpen createDesktopOpen(); |
|
40 |
|
|
41 |
public HTMLBuilder createHTMLBuilder(); |
|
42 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/InformationBuilder.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
public interface InformationBuilder { |
|
4 |
|
|
5 |
public interface Element { |
|
6 |
|
|
7 |
public Element value(String format, Object... args); |
|
8 |
public String build(); |
|
9 |
} |
|
10 |
|
|
11 |
public interface TitleElement extends Element { |
|
12 |
|
|
13 |
@Override |
|
14 |
public TitleElement value(String format, Object... args); |
|
15 |
public TitleElement label(String label); |
|
16 |
public TitleElement labelkey(String labelkey); |
|
17 |
} |
|
18 |
|
|
19 |
public interface RawElement extends Element { |
|
20 |
|
|
21 |
@Override |
|
22 |
public RawElement value(String format, Object... args); |
|
23 |
} |
|
24 |
|
|
25 |
public interface TextElement extends RawElement { |
|
26 |
|
|
27 |
@Override |
|
28 |
public TextElement value(String format, Object... args); |
|
29 |
|
|
30 |
} |
|
31 |
|
|
32 |
public interface PropertyElement extends TextElement { |
|
33 |
|
|
34 |
public PropertyElement monospace(); |
|
35 |
|
|
36 |
public PropertyElement label(String label); |
|
37 |
|
|
38 |
public PropertyElement labelkey(String labelkey); |
|
39 |
|
|
40 |
@Override |
|
41 |
public PropertyElement value(String format, Object... args); |
|
42 |
|
|
43 |
} |
|
44 |
|
|
45 |
public InformationBuilder backgroundColor(String color); |
|
46 |
|
|
47 |
public InformationBuilder backgroundColorTitle(String color); |
|
48 |
|
|
49 |
public InformationBuilder backgroundColorPropertyLabel(String color); |
|
50 |
|
|
51 |
public InformationBuilder backgroundColorPropertyValue1(String color); |
|
52 |
|
|
53 |
public InformationBuilder backgroundColorPropertyValue2(String color); |
|
54 |
|
|
55 |
public TitleElement title(); |
|
56 |
|
|
57 |
public PropertyElement property(); |
|
58 |
|
|
59 |
public TextElement text(); |
|
60 |
|
|
61 |
public RawElement raw(); |
|
62 |
|
|
63 |
public String build(); |
|
64 |
|
|
65 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/ToolsUtilLocator.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
/** |
|
4 |
* gvSIG. Desktop Geographic Information System. |
|
5 |
* |
|
6 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or modify it under |
|
9 |
* the terms of the GNU General Public License as published by the Free Software |
|
10 |
* Foundation; either version 3 of the License, or (at your option) any later |
|
11 |
* version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
14 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
15 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
16 |
* details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License along with |
|
19 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
20 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
21 |
* |
|
22 |
* For any additional information, do not hesitate to contact us at info AT |
|
23 |
* gvsig.com, or visit our website www.gvsig.com. |
|
24 |
*/ |
|
25 |
|
|
26 |
import org.gvsig.configurableactions.ConfigurableActionsMamager; |
|
27 |
import org.gvsig.filedialogchooser.FileDialogChooserManager; |
|
28 |
import org.gvsig.imageviewer.ImageViewerManager; |
|
29 |
import org.gvsig.propertypage.PropertiesPageManager; |
|
30 |
import org.gvsig.svgsupport.SVGSupportManager; |
|
31 |
import org.gvsig.tools.locator.AbstractLocator; |
|
32 |
import org.gvsig.tools.locator.Locator; |
|
33 |
import org.gvsig.tools.locator.LocatorException; |
|
34 |
|
|
35 |
/** |
|
36 |
* @author gvSIG Team |
|
37 |
* |
|
38 |
*/ |
|
39 |
@SuppressWarnings("rawtypes") |
|
40 |
public class ToolsUtilLocator extends AbstractLocator { |
|
41 |
|
|
42 |
private static final String LOCATOR_NAME = "ToolsUtilLocator"; |
|
43 |
|
|
44 |
public static final String TOOLS_UTIL_MANAGER_NAME = "org.gvsig.tools.util.manager"; |
|
45 |
private static final String TOOLS_UTIL_MANAGER_DESCRIPTION = "Tools utilities."; |
|
46 |
|
|
47 |
public static final String PROPERTIES_PAGE_MANAGER_NAME = "org.gvsig.tools.properties.page.manager"; |
|
48 |
private static final String PROPERTIES_PAGE_MANAGER_DESCRIPTION = "Properties page manager"; |
|
49 |
|
|
50 |
public static final String FILE_DIALOG_CHOOSER_MANAGER_NAME = "org.gvsig.filedialogchooser.manager"; |
|
51 |
private static final String FILE_DIALOG_CHOOSER_MANAGER_DESCRIPTION = "File dialog chooser."; |
|
52 |
|
|
53 |
public static final String PLUGINS_SVGSUPPORT_MANAGER_NAME = "SVGSupportManager"; |
|
54 |
private static final String PLUGINS_SVGSUPPORT_MANAGER_DESCRIPTION = "SVGSupportManager"; |
|
55 |
|
|
56 |
public static final String PLUGINS_IMAGEVIEWER_MANAGER_NAME = "ImageViewerManager"; |
|
57 |
private static final String PLUGINS_IMAGEVIEWER_MANAGER_DESCRIPTION = "ImageViewerManager"; |
|
58 |
|
|
59 |
public static final String CONFIGURABLE_ACTIONS_MANAGER_NAME = "ConfigurableActionsMamager"; |
|
60 |
private static final String CONFIGURABLE_ACTIONS_MANAGER_DESCRIPTION = "ConfigurableActionsMamager"; |
|
61 |
|
|
62 |
private static final ToolsUtilLocator instance = new ToolsUtilLocator(); |
|
63 |
|
|
64 |
private ToolsUtilLocator() { |
|
65 |
|
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* Return the singleton instance. |
|
70 |
* |
|
71 |
* @return the singleton instance |
|
72 |
*/ |
|
73 |
public static ToolsUtilLocator getInstance() { |
|
74 |
return instance; |
|
75 |
} |
|
76 |
|
|
77 |
@Override |
|
78 |
public String getLocatorName() { |
|
79 |
return LOCATOR_NAME; |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* Return a reference to ToolsUtilManager. |
|
84 |
* |
|
85 |
* @return a reference to ToolsUtilManager |
|
86 |
* @throws LocatorException if there is no access to the class or the class |
|
87 |
* cannot be instantiated |
|
88 |
* @see Locator#get(String) |
|
89 |
*/ |
|
90 |
public static ToolsUtilManager getToolsUtilManager() |
|
91 |
throws LocatorException { |
|
92 |
return (ToolsUtilManager) getInstance().get(TOOLS_UTIL_MANAGER_NAME); |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* Registers the Class implementing the ToolsUtilManager interface. |
|
97 |
* |
|
98 |
* @param clazz implementing the ToolsUtilManager interface |
|
99 |
*/ |
|
100 |
public static void registerToolsUtilManager(Class clazz) { |
|
101 |
getInstance().register(TOOLS_UTIL_MANAGER_NAME, |
|
102 |
TOOLS_UTIL_MANAGER_DESCRIPTION, clazz); |
|
103 |
} |
|
104 |
|
|
105 |
public static void registerDefaultToolsUtilManager(Class clazz) { |
|
106 |
getInstance().registerDefault(TOOLS_UTIL_MANAGER_NAME, |
|
107 |
TOOLS_UTIL_MANAGER_DESCRIPTION, clazz); |
|
108 |
} |
|
109 |
|
|
110 |
public static FileDialogChooserManager getFileDialogChooserManager() |
|
111 |
throws LocatorException { |
|
112 |
return (FileDialogChooserManager) getInstance().get(FILE_DIALOG_CHOOSER_MANAGER_NAME); |
|
113 |
} |
|
114 |
|
|
115 |
public static void registerFileDialogChooserManager(Class clazz) { |
|
116 |
getInstance().register(FILE_DIALOG_CHOOSER_MANAGER_NAME, |
|
117 |
FILE_DIALOG_CHOOSER_MANAGER_DESCRIPTION, clazz); |
|
118 |
} |
|
119 |
|
|
120 |
public static void registerDefaultFileDialogChooserManager(Class clazz) { |
|
121 |
getInstance().registerDefault(FILE_DIALOG_CHOOSER_MANAGER_NAME, |
|
122 |
FILE_DIALOG_CHOOSER_MANAGER_DESCRIPTION, clazz); |
|
123 |
} |
|
124 |
|
|
125 |
//SVG support |
|
126 |
public static SVGSupportManager getSVGSupportManager() throws LocatorException { |
|
127 |
return (SVGSupportManager) getInstance().get(PLUGINS_SVGSUPPORT_MANAGER_NAME); |
|
128 |
} |
|
129 |
|
|
130 |
public static void registerSVGSupportManager(Class clazz) { |
|
131 |
getInstance().register(PLUGINS_SVGSUPPORT_MANAGER_NAME, PLUGINS_SVGSUPPORT_MANAGER_DESCRIPTION, |
|
132 |
clazz); |
|
133 |
} |
|
134 |
|
|
135 |
public static void registerDefaultSVGSupportManager(Class clazz) { |
|
136 |
getInstance().registerDefault(PLUGINS_SVGSUPPORT_MANAGER_NAME, |
|
137 |
PLUGINS_SVGSUPPORT_MANAGER_DESCRIPTION, clazz); |
|
138 |
} |
|
139 |
|
|
140 |
public static ImageViewerManager getImageViewerManager() throws LocatorException { |
|
141 |
return (ImageViewerManager) getInstance().get(PLUGINS_IMAGEVIEWER_MANAGER_NAME); |
|
142 |
} |
|
143 |
|
|
144 |
public static void registerImageViewertManager(Class clazz) { |
|
145 |
getInstance().register(PLUGINS_IMAGEVIEWER_MANAGER_NAME, PLUGINS_IMAGEVIEWER_MANAGER_DESCRIPTION, |
|
146 |
clazz); |
|
147 |
} |
|
148 |
|
|
149 |
public static void registerDefaultImageViewerManager(Class clazz) { |
|
150 |
getInstance().registerDefault(PLUGINS_IMAGEVIEWER_MANAGER_NAME, |
|
151 |
PLUGINS_IMAGEVIEWER_MANAGER_DESCRIPTION, clazz); |
|
152 |
} |
|
153 |
|
|
154 |
|
|
155 |
public static ConfigurableActionsMamager getConfigurableActionsMamager() throws LocatorException { |
|
156 |
return (ConfigurableActionsMamager) getInstance().get(CONFIGURABLE_ACTIONS_MANAGER_NAME); |
|
157 |
} |
|
158 |
|
|
159 |
public static void registerConfigurableActionsMamager(Class clazz) { |
|
160 |
getInstance().register(CONFIGURABLE_ACTIONS_MANAGER_NAME, CONFIGURABLE_ACTIONS_MANAGER_DESCRIPTION, |
|
161 |
clazz); |
|
162 |
} |
|
163 |
|
|
164 |
public static void registerDefaultConfigurableActionsMamager(Class clazz) { |
|
165 |
getInstance().registerDefault(CONFIGURABLE_ACTIONS_MANAGER_NAME, |
|
166 |
CONFIGURABLE_ACTIONS_MANAGER_DESCRIPTION, clazz); |
|
167 |
} |
|
168 |
|
|
169 |
|
|
170 |
public static PropertiesPageManager getPropertiesPageManager() throws LocatorException { |
|
171 |
return (PropertiesPageManager) getInstance().get(PROPERTIES_PAGE_MANAGER_NAME); |
|
172 |
} |
|
173 |
|
|
174 |
public static void registerPropertiesPageManager(Class clazz) { |
|
175 |
getInstance().register(PROPERTIES_PAGE_MANAGER_NAME, |
|
176 |
PROPERTIES_PAGE_MANAGER_DESCRIPTION, |
|
177 |
clazz); |
|
178 |
} |
|
179 |
|
|
180 |
public static void registerDefaultPropertiesPageManager(Class clazz) { |
|
181 |
getInstance().registerDefault( |
|
182 |
PROPERTIES_PAGE_MANAGER_NAME, |
|
183 |
PROPERTIES_PAGE_MANAGER_DESCRIPTION, clazz); |
|
184 |
} |
|
185 |
|
|
186 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/tools/util/ToolsUtilLibrary.java | ||
---|---|---|
1 |
package org.gvsig.tools.util; |
|
2 |
|
|
3 |
import org.gvsig.tools.ToolsLibrary; |
|
4 |
import org.gvsig.tools.library.AbstractLibrary; |
|
5 |
import org.gvsig.tools.library.LibraryException; |
|
6 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
7 |
|
|
8 |
/** |
|
9 |
* gvSIG. Desktop Geographic Information System. |
|
10 |
* |
|
11 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or |
|
14 |
* modify it under the terms of the GNU General Public License |
|
15 |
* as published by the Free Software Foundation; either version 3 |
|
16 |
* of the License, or (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
26 |
* MA 02110-1301, USA. |
|
27 |
* |
|
28 |
* For any additional information, do not hesitate to contact us |
|
29 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
30 |
*/ |
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
@SuppressWarnings("unchecked") |
|
35 |
public class ToolsUtilLibrary extends AbstractLibrary { |
|
36 |
|
|
37 |
public void doRegistration() { |
|
38 |
super.doRegistration(); |
|
39 |
registerAsAPI(ToolsUtilLibrary.class); |
|
40 |
this.require(ToolsLibrary.class); |
|
41 |
} |
|
42 |
|
|
43 |
protected void doInitialize() throws LibraryException { |
|
44 |
|
|
45 |
} |
|
46 |
|
|
47 |
protected void doPostInitialize() throws LibraryException { |
|
48 |
// Validate there is any implementation registered. |
|
49 |
ToolsUtilManager manager = ToolsUtilLocator.getToolsUtilManager(); |
|
50 |
if (manager == null) { |
|
51 |
throw new ReferenceNotRegisteredException( |
|
52 |
ToolsUtilLocator.TOOLS_UTIL_MANAGER_NAME, ToolsUtilLocator |
|
53 |
.getInstance()); |
|
54 |
} |
|
55 |
|
|
56 |
} |
|
57 |
|
|
58 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/configurableactions/ConfigurableActionsMamager.java | ||
---|---|---|
1 |
package org.gvsig.configurableactions; |
|
2 |
|
|
3 |
import java.util.Collection; |
|
4 |
import javax.swing.Action; |
|
5 |
import javax.swing.JComponent; |
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
public interface ConfigurableActionsMamager { |
|
10 |
|
|
11 |
public void addConfigurableAction(String panelid, Action action); |
|
12 |
|
|
13 |
public void removeConfigurableAction(String panelid, String actionName); |
|
14 |
|
|
15 |
public void removeAllConfigurableActions(String panelid); |
|
16 |
|
|
17 |
public Collection<Action> getConfigurableActions(String panelid); |
|
18 |
|
|
19 |
public JComponent getConfigurableActionsComponent(String panelid, Object source); |
|
20 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/propertypage/PropertiesPageFactory.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.propertypage; |
|
3 |
|
|
4 |
public interface PropertiesPageFactory { |
|
5 |
|
|
6 |
public String getName(); |
|
7 |
|
|
8 |
/** |
|
9 |
* Return the group identifier. |
|
10 |
* The group identifier identify the object that store the properties that |
|
11 |
* this property page handle. Bty excample: |
|
12 |
* - Project |
|
13 |
* - View |
|
14 |
* - Layer |
|
15 |
* |
|
16 |
* @return the group identifier |
|
17 |
*/ |
|
18 |
public String getGroupID(); |
|
19 |
|
|
20 |
/** |
|
21 |
* Return true if this propeties page is enabled for the object. |
|
22 |
* |
|
23 |
* @param obj object that store the properties of this properties page. |
|
24 |
* @return true if the page is enabled |
|
25 |
*/ |
|
26 |
public boolean isVisible(Object obj); |
|
27 |
|
|
28 |
/** |
|
29 |
* Create a instance of the propeties page for the object. |
|
30 |
* |
|
31 |
* @param container, Container of the new page, usually the dialog. |
|
32 |
* @param data object that store the properties of this properties page. |
|
33 |
* @return the properties page |
|
34 |
*/ |
|
35 |
public PropertiesPage create(Object container, Object data); |
|
36 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/propertypage/BasePropertiesPagePanelLayout.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
|
|
7 |
package org.gvsig.propertypage; |
|
8 |
|
|
9 |
import java.awt.Dimension; |
|
10 |
import java.awt.GridBagConstraints; |
|
11 |
import java.awt.GridBagLayout; |
|
12 |
import javax.swing.BorderFactory; |
|
13 |
import javax.swing.Box; |
|
14 |
import javax.swing.JButton; |
|
15 |
import javax.swing.JLabel; |
|
16 |
import javax.swing.JPanel; |
|
17 |
import javax.swing.JScrollPane; |
|
18 |
import javax.swing.JTextArea; |
|
19 |
import javax.swing.border.BevelBorder; |
|
20 |
import javax.swing.border.SoftBevelBorder; |
|
21 |
import org.jdesktop.layout.GroupLayout; |
|
22 |
|
|
23 |
/** |
|
24 |
* |
|
25 |
* @author usuario |
|
26 |
*/ |
|
27 |
public class BasePropertiesPagePanelLayout extends javax.swing.JPanel { |
|
28 |
|
|
29 |
/** |
|
30 |
* Creates new form BasePropertiesPagePanelLayout |
|
31 |
*/ |
|
32 |
public BasePropertiesPagePanelLayout() { |
|
33 |
initComponents(); |
|
34 |
} |
|
35 |
|
|
36 |
/** |
|
37 |
* This method is called from within the constructor to |
|
38 |
* initialize the form. |
|
39 |
* WARNING: Do NOT modify this code. The content of this method is |
|
40 |
* always regenerated by the Form Editor. |
|
41 |
*/ |
|
42 |
@SuppressWarnings("unchecked") |
|
43 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|
44 |
private void initComponents() { |
|
45 |
java.awt.GridBagConstraints gridBagConstraints; |
|
46 |
|
|
47 |
titleLabel = new javax.swing.JLabel(); |
|
48 |
applyButton = new javax.swing.JButton(); |
|
49 |
cancelButton = new javax.swing.JButton(); |
|
50 |
acceptButton = new javax.swing.JButton(); |
|
51 |
content = new javax.swing.JPanel(); |
|
52 |
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); |
|
53 |
|
|
54 |
java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); |
|
55 |
layout.columnWidths = new int[] {0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0}; |
|
56 |
layout.rowHeights = new int[] {0, 4, 0, 4, 0, 4, 0, 4, 0}; |
|
57 |
setLayout(layout); |
|
58 |
|
|
59 |
titleLabel.setText("jLabel1"); |
|
60 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
61 |
gridBagConstraints.gridx = 2; |
|
62 |
gridBagConstraints.gridy = 2; |
|
63 |
gridBagConstraints.gridwidth = 7; |
|
64 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
65 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
66 |
add(titleLabel, gridBagConstraints); |
|
67 |
|
|
68 |
applyButton.setText("Apply"); |
|
69 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
70 |
gridBagConstraints.gridx = 6; |
|
71 |
gridBagConstraints.gridy = 6; |
|
72 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
73 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; |
|
74 |
gridBagConstraints.weightx = 0.1; |
|
75 |
add(applyButton, gridBagConstraints); |
|
76 |
|
|
77 |
cancelButton.setText("Cancel"); |
|
78 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
79 |
gridBagConstraints.gridx = 4; |
|
80 |
gridBagConstraints.gridy = 6; |
|
81 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
82 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; |
|
83 |
gridBagConstraints.weightx = 0.1; |
|
84 |
add(cancelButton, gridBagConstraints); |
|
85 |
|
|
86 |
acceptButton.setText("Accept"); |
|
87 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
88 |
gridBagConstraints.gridx = 8; |
|
89 |
gridBagConstraints.gridy = 6; |
|
90 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
91 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; |
|
92 |
gridBagConstraints.weightx = 0.1; |
|
93 |
add(acceptButton, gridBagConstraints); |
|
94 |
|
|
95 |
content.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); |
|
96 |
|
|
97 |
org.jdesktop.layout.GroupLayout contentLayout = new org.jdesktop.layout.GroupLayout(content); |
|
98 |
content.setLayout(contentLayout); |
|
99 |
contentLayout.setHorizontalGroup( |
|
100 |
contentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
101 |
.add(0, 388, Short.MAX_VALUE) |
|
102 |
); |
|
103 |
contentLayout.setVerticalGroup( |
|
104 |
contentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
|
105 |
.add(0, 234, Short.MAX_VALUE) |
|
106 |
); |
|
107 |
|
|
108 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
109 |
gridBagConstraints.gridx = 2; |
|
110 |
gridBagConstraints.gridy = 4; |
|
111 |
gridBagConstraints.gridwidth = 7; |
|
112 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
|
113 |
gridBagConstraints.weightx = 1.0; |
|
114 |
gridBagConstraints.weighty = 1.0; |
|
115 |
add(content, gridBagConstraints); |
|
116 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
117 |
gridBagConstraints.gridx = 2; |
|
118 |
gridBagConstraints.gridy = 6; |
|
119 |
gridBagConstraints.weightx = 1.0; |
|
120 |
add(filler1, gridBagConstraints); |
|
121 |
}// </editor-fold>//GEN-END:initComponents |
|
122 |
|
|
123 |
|
|
124 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
|
125 |
protected javax.swing.JButton acceptButton; |
|
126 |
protected javax.swing.JButton applyButton; |
|
127 |
protected javax.swing.JButton cancelButton; |
|
128 |
protected javax.swing.JPanel content; |
|
129 |
protected javax.swing.Box.Filler filler1; |
|
130 |
protected javax.swing.JLabel titleLabel; |
|
131 |
// End of variables declaration//GEN-END:variables |
|
132 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/propertypage/BasePropertiesPageDialog.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.propertypage; |
|
3 |
|
|
4 |
import java.awt.BorderLayout; |
|
5 |
import java.awt.Component; |
|
6 |
import java.awt.event.ActionEvent; |
|
7 |
import java.awt.event.ActionListener; |
|
8 |
import java.util.List; |
|
9 |
import javax.swing.JComponent; |
|
10 |
import javax.swing.JTabbedPane; |
|
11 |
import org.gvsig.propertypage.PropertiesPage.SetPageEnabledEvent; |
|
12 |
import org.gvsig.tools.ToolsLocator; |
|
13 |
import org.gvsig.tools.i18n.I18nManager; |
|
14 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
|
15 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
16 |
import org.gvsig.tools.util.Invocable; |
|
17 |
import org.gvsig.tools.util.ToolsUtilLocator; |
|
18 |
|
|
19 |
|
|
20 |
public class BasePropertiesPageDialog extends BasePropertiesPagePanelLayout implements org.gvsig.tools.swing.api.Component { |
|
21 |
public static final int ACTION_CANCEL = 0; |
|
22 |
public static final int ACTION_ACCEPT = 1; |
|
23 |
public static final int ACTION_APPLY = 2; |
|
24 |
|
|
25 |
private Object obj; |
|
26 |
private String groupID; |
|
27 |
private List<PropertiesPage> pages = null; |
|
28 |
private int userAction = ACTION_ACCEPT; |
|
29 |
private JTabbedPane tabbedPane = null; |
|
30 |
|
|
31 |
public BasePropertiesPageDialog() { |
|
32 |
} |
|
33 |
|
|
34 |
public BasePropertiesPageDialog(Object obj, String groupID) { |
|
35 |
init(groupID, obj); |
|
36 |
} |
|
37 |
|
|
38 |
protected void init(String groupID, Object obj) { |
|
39 |
this.obj = obj; |
|
40 |
this.groupID = groupID; |
|
41 |
PropertiesPageManager manager = ToolsUtilLocator.getPropertiesPageManager(); |
|
42 |
this.pages = manager.getPages(this.groupID, this, this.obj); |
|
43 |
initComponents(); |
|
44 |
} |
|
45 |
|
|
46 |
protected void initComponents() { |
|
47 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
48 |
|
|
49 |
this.content.setLayout(new BorderLayout()); |
|
50 |
Component contents = createPropertiesPagesPanel(); |
|
51 |
if( contents instanceof JTabbedPane ) { |
|
52 |
this.tabbedPane = (JTabbedPane) contents; |
|
53 |
} |
|
54 |
this.content.add(contents, BorderLayout.CENTER ); |
|
55 |
|
|
56 |
this.titleLabel.setText(""); |
|
57 |
|
|
58 |
this.acceptButton.setText(i18nManager.getTranslation("accept")); |
|
59 |
this.acceptButton.addActionListener( new ActionListener() { |
|
60 |
@Override |
|
61 |
public void actionPerformed(ActionEvent ae) { |
|
62 |
whenAccept(); |
|
63 |
} |
|
64 |
}); |
|
65 |
this.applyButton.setText(i18nManager.getTranslation("apply")); |
|
66 |
this.applyButton.addActionListener( new ActionListener() { |
|
67 |
@Override |
|
68 |
public void actionPerformed(ActionEvent ae) { |
|
69 |
whenApply(); |
|
70 |
} |
|
71 |
}); |
|
72 |
this.cancelButton.setText(i18nManager.getTranslation("cancel")); |
|
73 |
this.cancelButton.addActionListener( new ActionListener() { |
|
74 |
@Override |
|
75 |
public void actionPerformed(ActionEvent ae) { |
|
76 |
whenCancel(); |
|
77 |
} |
|
78 |
}); |
|
79 |
|
|
80 |
} |
|
81 |
|
|
82 |
protected List<PropertiesPage> getPages() { |
|
83 |
return pages; |
|
84 |
} |
|
85 |
|
|
86 |
protected PropertiesPage getPage(Class<? extends PropertiesPage> theClass) { |
|
87 |
for (PropertiesPage page : pages) { |
|
88 |
if( theClass.isInstance(page) ) { |
|
89 |
return page; |
|
90 |
} |
|
91 |
} |
|
92 |
return null; |
|
93 |
} |
|
94 |
|
|
95 |
protected boolean isButtonVisible(int button) { |
|
96 |
switch(button) { |
|
97 |
case WindowManager_v2.BUTTON_APPLY: |
|
98 |
return this.applyButton.isVisible(); |
|
99 |
case WindowManager_v2.BUTTON_OK: |
|
100 |
return acceptButton.isVisible(); |
|
101 |
case WindowManager_v2.BUTTON_CANCEL: |
|
102 |
return cancelButton.isVisible(); |
|
103 |
} |
|
104 |
return false; |
|
105 |
} |
|
106 |
|
|
107 |
protected void setButtonVisible(int button, boolean visible) { |
|
108 |
switch(button) { |
|
109 |
case WindowManager_v2.BUTTON_APPLY: |
|
110 |
this.applyButton.setVisible(visible); |
|
111 |
break; |
|
112 |
case WindowManager_v2.BUTTON_OK: |
|
113 |
this.acceptButton.setVisible(visible); |
|
114 |
break; |
|
115 |
case WindowManager_v2.BUTTON_CANCEL: |
|
116 |
this.cancelButton.setVisible(visible); |
|
117 |
break; |
|
118 |
} |
|
119 |
} |
|
120 |
|
|
121 |
protected void setButtonLabel(int button, String label) { |
|
122 |
switch(button) { |
|
123 |
case WindowManager_v2.BUTTON_APPLY: |
|
124 |
this.applyButton.setText(label); |
|
125 |
break; |
|
126 |
case WindowManager_v2.BUTTON_OK: |
|
127 |
this.acceptButton.setText(label); |
|
128 |
break; |
|
129 |
case WindowManager_v2.BUTTON_CANCEL: |
|
130 |
this.cancelButton.setText(label); |
|
131 |
break; |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
135 |
protected boolean isButtonEnabled(int button) { |
|
136 |
switch(button) { |
|
137 |
case WindowManager_v2.BUTTON_APPLY: |
|
138 |
return this.applyButton.isEnabled(); |
|
139 |
case WindowManager_v2.BUTTON_OK: |
|
140 |
return acceptButton.isEnabled(); |
|
141 |
case WindowManager_v2.BUTTON_CANCEL: |
|
142 |
return cancelButton.isEnabled(); |
|
143 |
} |
|
144 |
return false; |
|
145 |
} |
|
146 |
|
|
147 |
protected void setButtonEnabled(int button, boolean visible) { |
|
148 |
switch(button) { |
|
149 |
case WindowManager_v2.BUTTON_APPLY: |
|
150 |
this.applyButton.setEnabled(visible); |
|
151 |
break; |
|
152 |
case WindowManager_v2.BUTTON_OK: |
|
153 |
this.acceptButton.setEnabled(visible); |
|
154 |
break; |
|
155 |
case WindowManager_v2.BUTTON_CANCEL: |
|
156 |
this.cancelButton.setEnabled(visible); |
|
157 |
break; |
|
158 |
} |
|
159 |
} |
|
160 |
|
|
161 |
protected Component createPropertiesPagesPanel() { |
|
162 |
if( this.pages.size()==1 && !useTabsAlwais() ) { |
|
163 |
PropertiesPage page = this.pages.get(0); |
|
164 |
return page.asJComponent(); |
|
165 |
} else { |
|
166 |
JTabbedPane theTabbedPane = new JTabbedPane(); |
|
167 |
for( int i=0; i<this.pages.size(); i++ ) { |
|
168 |
PropertiesPage page = this.pages.get(i); |
|
169 |
if( page instanceof ActionListenerSupport ) { |
|
170 |
((ActionListenerSupport)page).addActionListener(new ActionListener() { |
|
171 |
@Override |
|
172 |
public void actionPerformed(ActionEvent e) { |
|
173 |
if( e instanceof SetPageEnabledEvent ) { |
|
174 |
SetPageEnabledEvent ee = (SetPageEnabledEvent) e; |
|
175 |
setEnabledAt(ee.getFilter(), ee.isEnabled()); |
|
176 |
} |
|
177 |
} |
|
178 |
}); |
|
179 |
} |
|
180 |
theTabbedPane.addTab(page.getTitle(), page.asJComponent()); |
|
181 |
} |
|
182 |
return theTabbedPane; |
|
183 |
} |
|
184 |
} |
|
185 |
|
|
186 |
protected boolean useTabsAlwais() { |
|
187 |
return false; |
|
188 |
} |
|
189 |
|
|
190 |
public void whenAccept() { |
|
191 |
for( int i=0; i<this.pages.size(); i++ ) { |
|
192 |
PropertiesPage page = this.pages.get(i); |
|
193 |
if( ! page.whenAccept() ) { |
|
194 |
return; |
|
195 |
} |
|
196 |
} |
|
197 |
this.userAction = ACTION_ACCEPT; |
|
198 |
this.closeDialog(); |
|
199 |
} |
|
200 |
|
|
201 |
public void whenApply() { |
|
202 |
for( int i=0; i<this.pages.size(); i++ ) { |
|
203 |
PropertiesPage page = this.pages.get(i); |
|
204 |
if( ! page.whenApply() ) { |
|
205 |
return; |
|
206 |
} |
|
207 |
} |
|
208 |
this.userAction = ACTION_APPLY; |
|
209 |
} |
|
210 |
|
|
211 |
public void whenCancel() { |
|
212 |
for( int i=0; i<this.pages.size(); i++ ) { |
|
213 |
PropertiesPage page = this.pages.get(i); |
|
214 |
if( ! page.whenCancel() ) { |
|
215 |
return; |
|
216 |
} |
|
217 |
} |
|
218 |
this.userAction = ACTION_CANCEL; |
|
219 |
this.closeDialog(); |
|
220 |
} |
|
221 |
|
|
222 |
public int getUserAction() { |
|
223 |
return this.userAction; |
|
224 |
} |
|
225 |
|
|
226 |
protected void closeDialog() { |
|
227 |
this.setVisible(false); |
|
228 |
} |
|
229 |
|
|
230 |
@Override |
|
231 |
public JComponent asJComponent() { |
|
232 |
return this; |
|
233 |
} |
|
234 |
|
|
235 |
public void setEnabledAt(Invocable filter, boolean enabled) { |
|
236 |
if( this.tabbedPane==null ) { |
|
237 |
return; |
|
238 |
} |
|
239 |
for( int i=0; i<this.pages.size(); i++ ) { |
|
240 |
PropertiesPage page = this.pages.get(i); |
|
241 |
if( (Boolean)(filter.call(page)) ) { |
|
242 |
this.tabbedPane.setEnabledAt(i, enabled); |
|
243 |
} |
|
244 |
} |
|
245 |
} |
|
246 |
|
|
247 |
} |
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.207/org.gvsig.tools.util/org.gvsig.tools.util.api/src/main/java/org/gvsig/propertypage/BasePropertiesPagePanelLayout.form | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
|
|
3 |
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> |
|
4 |
<AuxValues> |
|
5 |
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> |
|
6 |
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
|
7 |
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="false"/> |
|
8 |
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> |
|
9 |
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> |
|
10 |
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> |
|
11 |
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> |
|
12 |
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> |
|
13 |
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="4"/> |
|
14 |
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/> |
|
15 |
</AuxValues> |
|
16 |
<SubComponents> |
|
17 |
<Component class="javax.swing.JLabel" name="titleLabel"> |
|
18 |
<Properties> |
|
19 |
<Property name="text" type="java.lang.String" value="jLabel1"/> |
|
20 |
</Properties> |
|
21 |
<Constraints> |
|
22 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
23 |
<GridBagConstraints gridX="2" gridY="2" gridWidth="7" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.0" weightY="0.0"/> |
|
24 |
</Constraint> |
|
25 |
</Constraints> |
|
26 |
</Component> |
|
27 |
<Component class="javax.swing.JButton" name="applyButton"> |
|
28 |
<Properties> |
|
29 |
<Property name="text" type="java.lang.String" value="Apply"/> |
|
30 |
</Properties> |
|
31 |
<Constraints> |
|
32 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
33 |
<GridBagConstraints gridX="6" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="22" weightX="0.1" weightY="0.0"/> |
|
34 |
</Constraint> |
|
35 |
</Constraints> |
|
36 |
</Component> |
|
37 |
<Component class="javax.swing.JButton" name="cancelButton"> |
|
38 |
<Properties> |
|
39 |
<Property name="text" type="java.lang.String" value="Cancel"/> |
|
40 |
</Properties> |
|
41 |
<Constraints> |
|
42 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
43 |
<GridBagConstraints gridX="4" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="22" weightX="0.1" weightY="0.0"/> |
|
44 |
</Constraint> |
|
45 |
</Constraints> |
|
46 |
</Component> |
|
47 |
<Component class="javax.swing.JButton" name="acceptButton"> |
|
48 |
<Properties> |
|
49 |
<Property name="text" type="java.lang.String" value="Accept"/> |
|
50 |
</Properties> |
|
51 |
<Constraints> |
|
52 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
53 |
<GridBagConstraints gridX="8" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="22" weightX="0.1" weightY="0.0"/> |
|
54 |
</Constraint> |
|
55 |
</Constraints> |
|
56 |
</Component> |
|
57 |
<Container class="javax.swing.JPanel" name="content"> |
|
58 |
<Properties> |
|
59 |
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
|
60 |
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> |
|
61 |
<EmptyBorder/> |
|
62 |
</Border> |
|
63 |
</Property> |
|
64 |
</Properties> |
|
65 |
<Constraints> |
|
66 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
67 |
<GridBagConstraints gridX="2" gridY="4" gridWidth="7" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/> |
|
68 |
</Constraint> |
|
69 |
</Constraints> |
|
70 |
|
|
71 |
<Layout> |
|
72 |
<DimensionLayout dim="0"> |
|
73 |
<Group type="103" groupAlignment="0" attributes="0"> |
|
74 |
<EmptySpace min="0" pref="388" max="32767" attributes="0"/> |
|
75 |
</Group> |
|
76 |
</DimensionLayout> |
|
77 |
<DimensionLayout dim="1"> |
|
78 |
<Group type="103" groupAlignment="0" attributes="0"> |
Also available in: Unified diff