Revision 40308

View differences:

tags/frameworks/_fwAndami/2.0.1/gpl.txt
1
		    GNU GENERAL PUBLIC LICENSE
2
		       Version 2, June 1991
3

  
4
 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6
 Everyone is permitted to copy and distribute verbatim copies
7
 of this license document, but changing it is not allowed.
8

  
9
			    Preamble
10

  
11
  The licenses for most software are designed to take away your
12
freedom to share and change it.  By contrast, the GNU General Public
13
License is intended to guarantee your freedom to share and change free
14
software--to make sure the software is free for all its users.  This
15
General Public License applies to most of the Free Software
16
Foundation's software and to any other program whose authors commit to
17
using it.  (Some other Free Software Foundation software is covered by
18
the GNU Library General Public License instead.)  You can apply it to
19
your programs, too.
20

  
21
  When we speak of free software, we are referring to freedom, not
22
price.  Our General Public Licenses are designed to make sure that you
23
have the freedom to distribute copies of free software (and charge for
24
this service if you wish), that you receive source code or can get it
25
if you want it, that you can change the software or use pieces of it
26
in new free programs; and that you know you can do these things.
27

  
28
  To protect your rights, we need to make restrictions that forbid
29
anyone to deny you these rights or to ask you to surrender the rights.
30
These restrictions translate to certain responsibilities for you if you
31
distribute copies of the software, or if you modify it.
32

  
33
  For example, if you distribute copies of such a program, whether
34
gratis or for a fee, you must give the recipients all the rights that
35
you have.  You must make sure that they, too, receive or can get the
36
source code.  And you must show them these terms so they know their
37
rights.
38

  
39
  We protect your rights with two steps: (1) copyright the software, and
40
(2) offer you this license which gives you legal permission to copy,
41
distribute and/or modify the software.
42

  
43
  Also, for each author's protection and ours, we want to make certain
44
that everyone understands that there is no warranty for this free
45
software.  If the software is modified by someone else and passed on, we
46
want its recipients to know that what they have is not the original, so
47
that any problems introduced by others will not reflect on the original
48
authors' reputations.
49

  
50
  Finally, any free program is threatened constantly by software
51
patents.  We wish to avoid the danger that redistributors of a free
52
program will individually obtain patent licenses, in effect making the
53
program proprietary.  To prevent this, we have made it clear that any
54
patent must be licensed for everyone's free use or not licensed at all.
55

  
56
  The precise terms and conditions for copying, distribution and
57
modification follow.
58

59
		    GNU GENERAL PUBLIC LICENSE
60
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61

  
62
  0. This License applies to any program or other work which contains
63
a notice placed by the copyright holder saying it may be distributed
64
under the terms of this General Public License.  The "Program", below,
65
refers to any such program or work, and a "work based on the Program"
66
means either the Program or any derivative work under copyright law:
67
that is to say, a work containing the Program or a portion of it,
68
either verbatim or with modifications and/or translated into another
69
language.  (Hereinafter, translation is included without limitation in
70
the term "modification".)  Each licensee is addressed as "you".
71

  
72
Activities other than copying, distribution and modification are not
73
covered by this License; they are outside its scope.  The act of
74
running the Program is not restricted, and the output from the Program
75
is covered only if its contents constitute a work based on the
76
Program (independent of having been made by running the Program).
77
Whether that is true depends on what the Program does.
78

  
79
  1. You may copy and distribute verbatim copies of the Program's
80
source code as you receive it, in any medium, provided that you
81
conspicuously and appropriately publish on each copy an appropriate
82
copyright notice and disclaimer of warranty; keep intact all the
83
notices that refer to this License and to the absence of any warranty;
84
and give any other recipients of the Program a copy of this License
85
along with the Program.
86

  
87
You may charge a fee for the physical act of transferring a copy, and
88
you may at your option offer warranty protection in exchange for a fee.
89

  
90
  2. You may modify your copy or copies of the Program or any portion
91
of it, thus forming a work based on the Program, and copy and
92
distribute such modifications or work under the terms of Section 1
93
above, provided that you also meet all of these conditions:
94

  
95
    a) You must cause the modified files to carry prominent notices
96
    stating that you changed the files and the date of any change.
97

  
98
    b) You must cause any work that you distribute or publish, that in
99
    whole or in part contains or is derived from the Program or any
100
    part thereof, to be licensed as a whole at no charge to all third
101
    parties under the terms of this License.
102

  
103
    c) If the modified program normally reads commands interactively
104
    when run, you must cause it, when started running for such
105
    interactive use in the most ordinary way, to print or display an
106
    announcement including an appropriate copyright notice and a
107
    notice that there is no warranty (or else, saying that you provide
108
    a warranty) and that users may redistribute the program under
109
    these conditions, and telling the user how to view a copy of this
110
    License.  (Exception: if the Program itself is interactive but
111
    does not normally print such an announcement, your work based on
112
    the Program is not required to print an announcement.)
113

114
These requirements apply to the modified work as a whole.  If
115
identifiable sections of that work are not derived from the Program,
116
and can be reasonably considered independent and separate works in
117
themselves, then this License, and its terms, do not apply to those
118
sections when you distribute them as separate works.  But when you
119
distribute the same sections as part of a whole which is a work based
120
on the Program, the distribution of the whole must be on the terms of
121
this License, whose permissions for other licensees extend to the
122
entire whole, and thus to each and every part regardless of who wrote it.
123

  
124
Thus, it is not the intent of this section to claim rights or contest
125
your rights to work written entirely by you; rather, the intent is to
126
exercise the right to control the distribution of derivative or
127
collective works based on the Program.
128

  
129
In addition, mere aggregation of another work not based on the Program
130
with the Program (or with a work based on the Program) on a volume of
131
a storage or distribution medium does not bring the other work under
132
the scope of this License.
133

  
134
  3. You may copy and distribute the Program (or a work based on it,
135
under Section 2) in object code or executable form under the terms of
136
Sections 1 and 2 above provided that you also do one of the following:
137

  
138
    a) Accompany it with the complete corresponding machine-readable
139
    source code, which must be distributed under the terms of Sections
140
    1 and 2 above on a medium customarily used for software interchange; or,
141

  
142
    b) Accompany it with a written offer, valid for at least three
143
    years, to give any third party, for a charge no more than your
144
    cost of physically performing source distribution, a complete
145
    machine-readable copy of the corresponding source code, to be
146
    distributed under the terms of Sections 1 and 2 above on a medium
147
    customarily used for software interchange; or,
148

  
149
    c) Accompany it with the information you received as to the offer
150
    to distribute corresponding source code.  (This alternative is
151
    allowed only for noncommercial distribution and only if you
152
    received the program in object code or executable form with such
153
    an offer, in accord with Subsection b above.)
154

  
155
The source code for a work means the preferred form of the work for
156
making modifications to it.  For an executable work, complete source
157
code means all the source code for all modules it contains, plus any
158
associated interface definition files, plus the scripts used to
159
control compilation and installation of the executable.  However, as a
160
special exception, the source code distributed need not include
161
anything that is normally distributed (in either source or binary
162
form) with the major components (compiler, kernel, and so on) of the
163
operating system on which the executable runs, unless that component
164
itself accompanies the executable.
165

  
166
If distribution of executable or object code is made by offering
167
access to copy from a designated place, then offering equivalent
168
access to copy the source code from the same place counts as
169
distribution of the source code, even though third parties are not
170
compelled to copy the source along with the object code.
171

172
  4. You may not copy, modify, sublicense, or distribute the Program
173
except as expressly provided under this License.  Any attempt
174
otherwise to copy, modify, sublicense or distribute the Program is
175
void, and will automatically terminate your rights under this License.
176
However, parties who have received copies, or rights, from you under
177
this License will not have their licenses terminated so long as such
178
parties remain in full compliance.
179

  
180
  5. You are not required to accept this License, since you have not
181
signed it.  However, nothing else grants you permission to modify or
182
distribute the Program or its derivative works.  These actions are
183
prohibited by law if you do not accept this License.  Therefore, by
184
modifying or distributing the Program (or any work based on the
185
Program), you indicate your acceptance of this License to do so, and
186
all its terms and conditions for copying, distributing or modifying
187
the Program or works based on it.
188

  
189
  6. Each time you redistribute the Program (or any work based on the
190
Program), the recipient automatically receives a license from the
191
original licensor to copy, distribute or modify the Program subject to
192
these terms and conditions.  You may not impose any further
193
restrictions on the recipients' exercise of the rights granted herein.
194
You are not responsible for enforcing compliance by third parties to
195
this License.
196

  
197
  7. If, as a consequence of a court judgment or allegation of patent
198
infringement or for any other reason (not limited to patent issues),
199
conditions are imposed on you (whether by court order, agreement or
200
otherwise) that contradict the conditions of this License, they do not
201
excuse you from the conditions of this License.  If you cannot
202
distribute so as to satisfy simultaneously your obligations under this
203
License and any other pertinent obligations, then as a consequence you
204
may not distribute the Program at all.  For example, if a patent
205
license would not permit royalty-free redistribution of the Program by
206
all those who receive copies directly or indirectly through you, then
207
the only way you could satisfy both it and this License would be to
208
refrain entirely from distribution of the Program.
209

  
210
If any portion of this section is held invalid or unenforceable under
211
any particular circumstance, the balance of the section is intended to
212
apply and the section as a whole is intended to apply in other
213
circumstances.
214

  
215
It is not the purpose of this section to induce you to infringe any
216
patents or other property right claims or to contest validity of any
217
such claims; this section has the sole purpose of protecting the
218
integrity of the free software distribution system, which is
219
implemented by public license practices.  Many people have made
220
generous contributions to the wide range of software distributed
221
through that system in reliance on consistent application of that
222
system; it is up to the author/donor to decide if he or she is willing
223
to distribute software through any other system and a licensee cannot
224
impose that choice.
225

  
226
This section is intended to make thoroughly clear what is believed to
227
be a consequence of the rest of this License.
228

229
  8. If the distribution and/or use of the Program is restricted in
230
certain countries either by patents or by copyrighted interfaces, the
231
original copyright holder who places the Program under this License
232
may add an explicit geographical distribution limitation excluding
233
those countries, so that distribution is permitted only in or among
234
countries not thus excluded.  In such case, this License incorporates
235
the limitation as if written in the body of this License.
236

  
237
  9. The Free Software Foundation may publish revised and/or new versions
238
of the General Public License from time to time.  Such new versions will
239
be similar in spirit to the present version, but may differ in detail to
240
address new problems or concerns.
241

  
242
Each version is given a distinguishing version number.  If the Program
243
specifies a version number of this License which applies to it and "any
244
later version", you have the option of following the terms and conditions
245
either of that version or of any later version published by the Free
246
Software Foundation.  If the Program does not specify a version number of
247
this License, you may choose any version ever published by the Free Software
248
Foundation.
249

  
250
  10. If you wish to incorporate parts of the Program into other free
251
programs whose distribution conditions are different, write to the author
252
to ask for permission.  For software which is copyrighted by the Free
253
Software Foundation, write to the Free Software Foundation; we sometimes
254
make exceptions for this.  Our decision will be guided by the two goals
255
of preserving the free status of all derivatives of our free software and
256
of promoting the sharing and reuse of software generally.
257

  
258
			    NO WARRANTY
259

  
260
  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
REPAIR OR CORRECTION.
269

  
270
  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
POSSIBILITY OF SUCH DAMAGES.
279

  
280
		     END OF TERMS AND CONDITIONS
281

282
	    How to Apply These Terms to Your New Programs
283

  
284
  If you develop a new program, and you want it to be of the greatest
285
possible use to the public, the best way to achieve this is to make it
286
free software which everyone can redistribute and change under these terms.
287

  
288
  To do so, attach the following notices to the program.  It is safest
289
to attach them to the start of each source file to most effectively
290
convey the exclusion of warranty; and each file should have at least
291
the "copyright" line and a pointer to where the full notice is found.
292

  
293
    <one line to give the program's name and a brief idea of what it does.>
294
    Copyright (C) <year>  <name of author>
295

  
296
    This program is free software; you can redistribute it and/or modify
297
    it under the terms of the GNU General Public License as published by
298
    the Free Software Foundation; either version 2 of the License, or
299
    (at your option) any later version.
300

  
301
    This program is distributed in the hope that it will be useful,
302
    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
    GNU General Public License for more details.
305

  
306
    You should have received a copy of the GNU General Public License
307
    along with this program; if not, write to the Free Software
308
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
309

  
310

  
311
Also add information on how to contact you by electronic and paper mail.
312

  
313
If the program is interactive, make it output a short notice like this
314
when it starts in an interactive mode:
315

  
316
    Gnomovision version 69, Copyright (C) year name of author
317
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
    This is free software, and you are welcome to redistribute it
319
    under certain conditions; type `show c' for details.
320

  
321
The hypothetical commands `show w' and `show c' should show the appropriate
322
parts of the General Public License.  Of course, the commands you use may
323
be called something other than `show w' and `show c'; they could even be
324
mouse-clicks or menu items--whatever suits your program.
325

  
326
You should also get your employer (if you work as a programmer) or your
327
school, if any, to sign a "copyright disclaimer" for the program, if
328
necessary.  Here is a sample; alter the names:
329

  
330
  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
  `Gnomovision' (which makes passes at compilers) written by James Hacker.
332

  
333
  <signature of Ty Coon>, 1 April 1989
334
  Ty Coon, President of Vice
335

  
336
This General Public License does not permit incorporating your program into
337
proprietary programs.  If your program is a subroutine library, you may
338
consider it more useful to permit linking proprietary applications with the
339
library.  If this is what you want to do, use the GNU Library General
340
Public License instead of this License.
0 341

  
tags/frameworks/_fwAndami/2.0.1/theme/andami-theme.xml
1
<AndamiProperties>
2
	<ApplicationImages>
3
		<SplashImages>
4
			<Splash
5
				path="splash.png"
6
				timer="10000"
7
				x="270" y="240"
8
				fontsize="18" color="80,170,240"
9
				version="2.0.0"/>
10
		</SplashImages>
11
		<!-- 
12
		<BackgroundImage path="gvsig-icon16x16.png"/>
13
		 -->
14
		<WallpaperType value="CENTERED"/>
15
		<Icon path="gvsig-icon16x16.png"/>
16
	</ApplicationImages>
17
	<ApplicationName value="Andami 2.0.0"/>
18
</AndamiProperties>
0 19

  
tags/frameworks/_fwAndami/2.0.1/theme/README.txt
1
Use those files as a template for your own andami theme. 
2

  
3
If none provided by any plugin, this theme will be used as the default one.
tags/frameworks/_fwAndami/2.0.1/schemas/andami-config.xml
1
<andami-config locale-language="es" locale-country="ES" locale-variant="es" pluginsDirectory="c:\tirar">
2
	<andami update="yes"/>
3
	<plugin name="com.iver.cit.gvsig" update="yes"/>
4
	<plugin name="com.iver.core" update="no"/>
5
	<andami-options>
6
	  <option name="CustomOption1" value="customValue1"/>
7
	  <icon-theme name="DefaultTheme" resource="iconThemes/default" basedir="iconThemes" />
8
	</andami-options>
9
</andami-config>
0 10

  
tags/frameworks/_fwAndami/2.0.1/schemas/sample-plugins-persistence.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugins-status>
3
	<plugin name="gvsig" lastUpdate="237628686">
4
		<xml-entity name="config">
5
			<property name="dataDirectory" value="c:\"/>
6
			<xml-entity>
7
				<property name="dataDirectory" value="c:\"/>
8
				<property name="dataDirectory" value="c:\"/>
9
				<property name="dataDirectory" value="c:\"/>
10
			</xml-entity>
11
		</xml-entity>
12
		<bookmarks>
13
			<bookmark text="Recientes/raster">
14
				<xml-entity>
15
					<property name="projection" value="EPSG:3403"/>
16
					<property name="boundinBox" value="12,12,115,115"/>
17
				</xml-entity>
18
			</bookmark>
19
		</bookmarks>
20
		<windows>
21
			<window id="0" rectangle="0,0,150,150"/>
22
			<window id="2" rectangle="50,50,150,150"/>
23
			<window id="8" rectangle="100,100,150,150"/>
24
			<window id="12" rectangle="150,150,150,150"/>
25
		</windows>
26
	</plugin>
27
	<tool-bars>
28
		<tool-bar name="gvsig.herramientas" x-position="0" y-position="1"/>
29
		<tool-bar name="gvsig.herramientas" x-position="0" y-position="0"/>
30
	</tool-bars>
31
</plugins-status>
0 32

  
tags/frameworks/_fwAndami/2.0.1/schemas/sample-config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<icon src="images/logoGVA.gif" text="gvSIG"/>
4
	<resourceBundle name="text"/>
5
	<import plugin-name="com.iver.cit.gvsig" />
6
	<labelSet class="com.iver.cit.gvsig.gui.View">
7
		<label id="1" size="100"/>
8
		<label id="2" size="230"/>
9
	</labelSet>
10
	<libraries>
11
		<library file="com.iver.cit.gvsig.jar"/>
12
		<library file="wmsclient.jar"/>	
13
	</libraries>
14
	<extensions>
15
		<extension>
16
			<class name="com.iver.cit.gvsig.ProjectExtension"/>
17
			<menu text="Archivo/nuevo_proyecto" 
18
				key="n" mnemonic="n" 
19
				tooltip="nuevo_tooltip"
20
				action-command="NUEVO" icon="images/new.png"/>
21
			<menu text="Archivo/abrir_proyecto" 
22
				key="a" mnemonic="a" 
23
				tooltip="abrir_tooltip"
24
				action-command="ABRIR" icon="images/open.png"/>
25
			<menu text="Archivo/guardar_proyecto" 
26
				key="g" mnemonic="g" 
27
				tooltip="guardar_tooltip"
28
				action-command="GUARDAR" icon="images/save.png"/>
29

  
30
			<toolBar>
31
				<tool icon="images/new.png" tooltip="nuevo_tooltip"
32
					action-command="NUEVO"/>
33
				<tool icon="images/open.png" tooltip="abrir_tooltip"
34
					action-command="ABRIR"/>
35
				<tool icon="images/save.png" tooltip="guardar_tooltip"
36
					action-command="GUARDAR"/>
37

  
38
				<!-- these will be added to the containing toolbar -->
39
				<combo-scale
40
					name="JPEG Quality"
41
					elements="15;30;60;70;80;90;100"
42
					value="80"
43
					action-command="JPEG_QUALITY" />
44

  
45
				<combo-button
46
					name="Copy/paste tools">
47
				  <combo-button-element icon="images/scissor.png" action-command="CUT" />
48
				  <combo-button-element icon="images/paste.png" action-command="PASTE" />
49
				  <combo-button-element icon="images/copy.png" action-command="COPY" />
50
				</combo-button>
51
			</toolBar>
52

  
53
		</extension>
54

  
55
		<extension>
56
			<class name="com.iver.cit.gvsig.ZoomPrev"/>
57
			<menu text="Vista/Zoom_Previo" icon="images/ZoomPrevio.png"/>
58
			<tool-bar name="Herramientas">
59
				<action-tool icon="images/ZoomPrevio.png" action-command="ZOOM_PREV" tooltip="Zoom_Previo" position="11"/>
60
			</tool-bar>
61
			
62
			<!-- these will be added to the status-bar (because they are not contained in any toolbar) -->					
63
			<combo-scale 
64
		  		name="Scale"
65
		  		label="Scale:"
66
		  		elements="1000;2000;5000;10000;25000;50000;100000;200000;500000;1000000;2000000;5000000"
67
	  			value="10000"
68
	  			action-command="CHANGE_SCALE" />
69

  
70
			<combo-button
71
				name="Tool Mode">
72
			  <combo-button-element icon="images/once.png" action-command="USE_ONCE" />
73
			  <combo-button-element icon="images/sticky-tool.png" action-command="UNTIL_CHANGED" />
74
			</combo-button>
75
		</extension>
76
		<extension processing-position="2">
77
			<class name="com.iver.cit.gvsig.ViewControls"/>
78
			<menus>
79
				<menu text="Vista/Zoom_Completo" action-command="FULL" icon="images/MapContents.png" tooltip="Zoom completo a la v?sta"/>
80
				<menu text="Vista/Zoom_Select" action-command="ZOOM_SELECT" icon="image/Select.png"/>
81
				<menu text="Vista/Encuadre" action-command="ENCUADRE" icon="images/encuadre.png"/>
82
				<menu text="Vista/Seleccion_por_tema" action-command="SELECTIONBYSHAPE"/>
83
				<menu text="Vista/configurar_localizador" action-command="CONFIG_LOCATOR"/>		
84
				<menu text="Vista/propiedades" action-command="PROPERTIES"/>
85
			</menus>
86
			<tool-bar name="Herramientas" y-position="1">
87
				<action-tool icon="images/MapContents.png" action-command="FULL" tooltip="Zoom_Completo" position="1"/>
88
				<action-tool icon="images/encuadre.png" action-command="ENCUADRE" tooltip="gestion_encuadre" last="true" position="2"/>			
89
				<selectable-tool group="grupo1" default="true" icon="images/ZoomIn.png" action-command="ZOOM_IN" tooltip="Zoom_M?s" position="3"/>
90
				<selectable-tool group="grupo1" icon="images/ZoomOut.png" action-command="ZOOM_OUT" position="4"/>
91
				<selectable-tool group="grupo1" icon="images/Pan.png" action-command="PAN"  tooltip="Encuadre" position="5"/>
92
				<selectable-tool group="grupo1" icon="images/Identify.png" action-command="INFO"  tooltip="informacion" position="6" />
93
				<selectable-tool group="grupo2" icon="images/Distancia.png" action-command="MEDICION"  tooltip="medir_distancias" position="7"/>
94
				<selectable-tool group="grupo2" icon="images/Poligono16.png" action-command="AREA"  tooltip="medir_area" position="8"/>
95
				<selectable-tool group="grupo2" default="true" icon="images/Select.png" action-command="SELPOINT"  tooltip="seleccionar_por_punto" position="9"/>
96
				<selectable-tool group="grupo2" icon="images/SelEspacial2b.png" action-command="SELRECT"  tooltip="seleccionar_por_rectangulo" position="10"/>
97
			</tool-bar>
98
		</extension>
99
		<extension>
100
			<class name="com.iver.cit.gvsig.ThemeControls"/>
101
			<menu text="Tema/propiedades"/>
102
		</extension>
103
	</extensions>
104

  
105
	<file-extensions>
106
		<file-extension description="DGNfiles" ends-with="dgn" dialog="openLayer">
107
			<class name="com.iver.cit.gvsig.DGNFileExtension"/>
108
		</file-extension>
109
		<file-extension description="Rasterfiles" ends-with="ecw,tif,tiff,jpg,png" dialog="openLayer">
110
			<class name="com.iver.cit.gvsig.RasterFileExtension"/>
111
		</file-extension>
112
	</file-extensions>
113
</plugin-config>
0 114

  
tags/frameworks/_fwAndami/2.0.1/src-test/org/gvsig/andami/AllTests.java
1
package org.gvsig.andami;
2

  
3
import junit.framework.Test;
4
import junit.framework.TestSuite;
5

  
6
public class AllTests {
7

  
8
	public static Test suite() {
9
		TestSuite suite = new TestSuite("Test for com.iver.andami");
10
		//$JUnit-BEGIN$
11

  
12
		//$JUnit-END$
13
		return suite;
14
	}
15

  
16
}
0 17

  
tags/frameworks/_fwAndami/2.0.1/castor.properties
1
org.exolab.castor.indent=true
0 2

  
tags/frameworks/_fwAndami/2.0.1/compile-classpath.xml
1
<project name="_fwAndami.compile-classpath" basedir=".">
2
	<!-- defines the classpath to be used for batch-compilation -->
3
	<property name="andami" location="../_fwAndami"/>
4
	<property name="andamiLibs" location="${andami}/lib"/>
5
	<path id="_fwAndami.compile-classpath">
6
	    <pathelement location="${andamiLibs}/beans.jar"/>
7
   	    <pathelement location="${andamiLibs}/castor-0.9.5.3-xml.jar"/>
8
  	    <pathelement location="${andamiLibs}/gvsig-i18n.jar"/>
9
	    <pathelement location="${andamiLibs}/iver-utiles.jar"/>
10
	    <pathelement location="${andamiLibs}/javaws.jar"/>
11
	    <pathelement location="${andamiLibs}/JWizardComponent.jar"/>
12
	    <pathelement location="${andamiLibs}/log4j-1.2.8.jar"/>
13
	    <pathelement location="${andamiLibs}/tempFileManager.jar"/>
14
	    <pathelement location="${andamiLibs}/xercesImpl.jar"/>
15
	    <pathelement location="${andamiLibs}/xml-apis.jar"/>
16
	    <pathelement location="${andamiLibs}/kxml2.jar"/>
17
	    <pathelement location="${andamiLibs}/jcalendar.jar"/>
18
	</path>
19
</project>
0 20

  
tags/frameworks/_fwAndami/2.0.1/src/org/gvsig/andami/impl/DefaultPluginsManager.java
1
package org.gvsig.andami.impl;
2

  
3
import java.io.File;
4
import java.util.ArrayList;
5
import java.util.Enumeration;
6
import java.util.Iterator;
7
import java.util.List;
8

  
9
import org.gvsig.andami.Launcher;
10
import org.gvsig.andami.PluginServices;
11
import org.gvsig.andami.PluginsManager;
12
import org.gvsig.andami.config.generate.AndamiConfig;
13
import org.gvsig.andami.config.generate.Plugin;
14
import org.gvsig.andami.plugins.ExclusiveUIExtension;
15
import org.gvsig.andami.plugins.IExtension;
16
import org.gvsig.andami.plugins.PluginClassLoader;
17
import org.gvsig.installer.lib.api.PackageInfo;
18
import org.gvsig.tools.ToolsLocator;
19
import org.gvsig.tools.packageutils.PackageManager;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22

  
23
public class DefaultPluginsManager implements PluginsManager{
24

  
25
    private static Logger logger =
26
        LoggerFactory.getLogger(DefaultPluginsManager.class);
27
    
28
	private File pluginsFolder = null;
29
	
30
	public ExclusiveUIExtension getExclusiveUIExtension() {
31
		return PluginServices.getExclusiveUIExtension();
32
	}
33

  
34
	public IExtension getExtension(Class<? extends IExtension> extension) {
35
		return PluginServices.getExtension(extension);
36
	}
37

  
38
	@SuppressWarnings("unchecked")
39
	public Iterator<IExtension> getExtensions() {
40
		return PluginServices.getExtensions();
41
	}
42

  
43
	/**
44
	 * Return the associated pluginServices to the extension class passed as parameter.
45
	 *  
46
	 */
47
	public PluginServices getPlugin(Class<? extends IExtension> extension) {
48
	    String pluginName = ((PluginClassLoader)extension.getClassLoader()).getPluginName();
49
		return  this.getPlugin(pluginName);
50
	}
51

  
52
	public PluginServices getPlugin(String pluginName) {
53
		return Launcher.getPluginServices(pluginName);
54
	}
55

  
56
	public PackageInfo getPackageInfo(Class<? extends IExtension> extension) {
57
	    PackageManager pkgmgr = ToolsLocator.getPackageManager();
58
        File pinfo_file = new File(this.getPlugin(extension).getPluginDirectory(), "package.info");
59
        
60
        PackageInfo packageInfo = null;
61
        try {
62
            packageInfo = pkgmgr.createPackageInfo(pinfo_file);
63
        } catch (Exception e) {
64
			logger.info("Error while reading package info file from "
65
					+ pinfo_file.toString(), e);
66
        }
67
        return packageInfo;
68
	}
69
	
70
	public PackageInfo getPackageInfo(String pluginName) {
71
		PackageManager pkgmgr = ToolsLocator.getPackageManager();
72
		File pinfo_file = new File(this.getPlugin(pluginName)
73
				.getPluginDirectory(), "package.info");
74

  
75
		PackageInfo packageInfo = null;
76
		try {
77
			packageInfo = pkgmgr.createPackageInfo(pinfo_file);
78
		} catch (Exception e) {
79
			logger.info("Error while reading package info file from "
80
					+ pinfo_file.toString(), e);
81
		}
82
		return packageInfo;
83
	}
84
	
85
	@SuppressWarnings("unchecked")
86
	public List<PluginServices> getPlugins() {
87
		List<PluginServices> pluginServices = new ArrayList<PluginServices>();
88
		
89
		AndamiConfig config = Launcher.getAndamiConfig();
90
		Enumeration<Plugin> plugins = config.enumeratePlugin();
91
		while( plugins.hasMoreElements()) {
92
			Plugin plugin =   plugins.nextElement();
93
			pluginServices.add(PluginServices.getPluginServices(plugin.getName()));
94
		}
95
		return pluginServices;
96
	}
97

  
98
	public void setExclusiveUIExtension(ExclusiveUIExtension extension) {
99
		PluginServices.setExclusiveUIExtension(extension);
100
	}
101

  
102
	public String getText(Object obj, String msg) {
103
	    return PluginServices.getText(obj, msg);
104
	}
105
	
106
    public File getPluginsDirectory() {
107
        return getPluginsFolder();
108
    }
109

  
110
    public File getApplicationFolder() {
111
    	return Launcher.getApplicationFolder();
112
    }
113

  
114
    public File getPluginsFolder() {
115
    	if( this.pluginsFolder!=null ) {
116
    		return this.pluginsFolder;
117
    	}
118
    	String folder = "gvSIG/extensiones";
119
    	if( !(Launcher.getAndamiConfig() == null || Launcher.getAndamiConfig().getPluginsDirectory()==null) ) {
120
    		folder = Launcher.getAndamiConfig().getPluginsDirectory();
121
    	}
122
        this.pluginsFolder = new File(getApplicationFolder(), folder);
123
        return this.pluginsFolder;
124
    }
125

  
126
    public File getInstallFolder() {
127
        return new File(getApplicationFolder(), "install");
128
    }
129

  
130
    public File getApplicationHomeFolder() {
131
        return Launcher.getApplicationHomeFolder();
132
    }
133
}
0 134

  
tags/frameworks/_fwAndami/2.0.1/src/org/gvsig/andami/preferences/GenericDlgPreferences.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.andami.preferences;
42

  
43
import java.awt.BorderLayout;
44
import java.awt.Component;
45
import java.awt.Dimension;
46
import java.awt.FlowLayout;
47
import java.awt.Font;
48
import java.awt.event.ActionEvent;
49
import java.awt.event.ActionListener;
50
import java.util.ArrayList;
51
import java.util.Enumeration;
52
import java.util.Hashtable;
53
import java.util.Iterator;
54
import java.util.Map;
55

  
56
import javax.swing.JButton;
57
import javax.swing.JLabel;
58
import javax.swing.JOptionPane;
59
import javax.swing.JPanel;
60
import javax.swing.JScrollPane;
61
import javax.swing.JSeparator;
62
import javax.swing.JSplitPane;
63
import javax.swing.JTree;
64
import javax.swing.UIManager;
65
import javax.swing.tree.DefaultMutableTreeNode;
66
import javax.swing.tree.DefaultTreeCellRenderer;
67
import javax.swing.tree.DefaultTreeModel;
68
import javax.swing.tree.TreeSelectionModel;
69

  
70
import org.gvsig.andami.PluginServices;
71
import org.gvsig.andami.ui.mdiManager.IWindow;
72
import org.gvsig.andami.ui.mdiManager.WindowInfo;
73
import org.gvsig.tools.ToolsLocator;
74
import org.gvsig.tools.extensionpoint.ExtensionPoint;
75
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
76

  
77

  
78
/**
79
 * @author fjp
80
 *
81
 * The reason behind this class is to have the opportunity of use a DlgPreferences
82
 * in a local way. Then, you don't need to be a SingletonView.
83
 */
84
public class GenericDlgPreferences extends JPanel implements IWindow {
85

  
86
    private static final long serialVersionUID = -6561660591523322611L;
87

  
88
    private WindowInfo viewInfo = null;
89
	private IPreference activePreference;
90

  
91
    private Map<String, IPreference> preferences =
92
        new Hashtable<String, IPreference>();
93
	DefaultTreeModel treeModel = null;
94

  
95
	private JTree jTreePlugins = null;
96

  
97
	private JPanel jPanelButtons = null;
98

  
99
	private JButton jButtonOK = null;
100

  
101
	private JButton jButtonCancel = null;
102
	private DefaultMutableTreeNode root = new DefaultMutableTreeNode();
103

  
104
	private JPanel jPanelCenter = null;
105

  
106
	private JLabel jLabelBigTitle = null;
107

  
108
	private JScrollPane jScrollPane = null;
109

  
110
	private JSplitPane jSplitPaneCenter = null;
111

  
112
	private JPanel jPanelContainer = null;
113
	private JButton jButtonRestore;
114
	private ActionListener action;
115
	private boolean dirtyTree = false;
116
	private ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager();
117

  
118

  
119
	private class MyTreeCellRenderer extends DefaultTreeCellRenderer
120
	{
121

  
122
        private static final long serialVersionUID = 1833782141342096776L;
123

  
124
        public MyTreeCellRenderer() {
125
			}
126

  
127
			public Component getTreeCellRendererComponent(
128
													JTree tree,
129
													Object value,
130
													boolean sel,
131
													boolean expanded,
132
													boolean leaf,
133
													int row,
134
													boolean hasFocus) {
135

  
136
					super.getTreeCellRendererComponent(
137
													tree, value, sel,
138
													expanded, leaf, row,
139
													hasFocus);
140
					if (value instanceof DefaultMutableTreeNode)
141
					{
142
						DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
143
						if (node.getUserObject() instanceof IPreference)
144
						{
145
							IPreference pref = (IPreference) node.getUserObject();
146
							this.setText(pref.getTitle());
147
						}
148
					}
149
					return this;
150
			}
151

  
152
	}
153

  
154

  
155
	public GenericDlgPreferences() {
156
		super();
157
		this.action = new ActionListener() {
158
			public void actionPerformed(ActionEvent e) {
159
				PluginServices.getMDIManager().setWaitCursor();
160
				String actionCommand = e.getActionCommand();
161
				if ("RESTORE".equals(actionCommand)) {
162
					// Restore default values in current page
163
					if (activePreference!=null) {
164
						activePreference.initializeDefaults();
165
//	bug 240
166
//						try {
167
//							activePreference.saveValues();
168
//						} catch (StoreException sEx) {
169
//							/*
170
//							 * If you reach this code you coded your page
171
//							 * with wrong factory default values.
172
//							 * Check them out.
173
//							 */
174
//							PluginServices.getMDIManager().restoreCursor();
175
//
176
//							// Show error message
177
//							JOptionPane.showMessageDialog((Component) PluginServices.
178
//									getMainFrame(),sEx.getMessage());
179
//
180
//						}
181
					}
182
				} else {
183
                    Iterator<String> it = preferences.keySet().iterator();
184

  
185
					if ("CANCEL".equals(actionCommand)) {
186
						// Restore previous values in all pages
187
						while (it.hasNext()) {
188
                            IPreference pref = preferences.get(it.next());
189
							if (pref.isValueChanged()) {
190
								pref.initializeValues(); //
191
							}
192
						}
193
						closeView();
194
					} else if ("OK".equals(actionCommand)) {
195
						// Apply values in all pages
196
						boolean shouldClose = true;
197
						while (it.hasNext()) {
198
                                IPreference preference =
199
                                    preferences.get(it.next());
200
							try{
201
								if (preference.isValueChanged()) {
202
									preference.saveValues();
203
									preference.initializeValues();
204
								}
205
							}catch (StoreException ex) {
206
								// Reach this code should mean that the page has wrong values
207
								shouldClose = false;
208
								PluginServices.getMDIManager().restoreCursor();
209

  
210
								// Show error message
211
								JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),ex.getMessage());
212

  
213
								// Focus on error page
214
								setActivePage(preference);
215
							}
216
						}
217
						if (shouldClose) {
218
							closeView();
219
						}
220
					}
221
				}
222
				PluginServices.getMDIManager().restoreCursor();
223
			}
224
		};
225
		initialize();
226
	}
227

  
228
	private void initialize() {
229
		setLayout(new BorderLayout());
230
		setSize(new java.awt.Dimension(750,479));
231
		super.add(getJPanelButtons(), BorderLayout.SOUTH);
232
		setPreferredSize(new java.awt.Dimension(390,369));
233
		super.add(getJSplitPaneCenter(), java.awt.BorderLayout.CENTER);
234
		getJSplitPaneCenter().setLeftComponent(getJScrollPane());
235
		getJSplitPaneCenter().setRightComponent(getJPanelNorth());
236
		treeModel = new DefaultTreeModel(root);
237
	}
238

  
239
	public void refreshExtensionPoints() {
240
		ExtensionPoint ep = this.extensionPoints.add("AplicationPreferences", "");
241

  
242

  
243
        @SuppressWarnings("unchecked")
244
        Iterator<ExtensionPoint.Extension> iterator = ep.iterator();
245
		while (iterator.hasNext()) {
246
			try {
247
                IPreference obj = (IPreference) (iterator.next()).create();
248
				this.addPreferencePage(obj);
249
			} catch (InstantiationException e) {
250
				e.printStackTrace();
251
			} catch (IllegalAccessException e) {
252
				e.printStackTrace();
253
			} catch (ClassCastException e) {
254
				e.printStackTrace();
255
			}
256
		}
257
		ArrayList<IPreference> prefList = new ArrayList<IPreference>(preferences.values());
258
		addPreferencePages(prefList);
259
	}
260

  
261
	//	TODO este m?todo es un parche provisional mientras se hace un refactoring de
262
	//las PreferencePages para disponer de un m?todo que inicialize las variables
263
	//a partir de las preferencias.
264
    public void storeValues() {
265
        Iterator<IPreference> iter = preferences.values().iterator();
266

  
267
        while (iter.hasNext()) {
268
            IPreference preference = iter.next();
269

  
270
            try {
271
                preference.saveValues();
272
            } catch (StoreException e) {
273
                /*
274
                 * If you reach this code you coded your page
275
                 * with wrong factory default values.
276
                 * Check them out.
277
                 */
278
                PluginServices.getMDIManager().restoreCursor();
279
                // Show error message
280
                JOptionPane.showMessageDialog(
281
                    (Component) PluginServices.getMainFrame(), e.getMessage());
282
            }
283
        }
284
    }
285

  
286
	/**
287
	 * It is very common to be confused with this method. But
288
	 * the one you are looking for is addPreferencePage(IPreference)
289
	 */
290
	public Component add(Component c) {
291
		//throw new Error("Do not use com.iver.cit.gvsig.gui.preferences.DlgPreferences.add(Component) use com.iver.cit.gvsig.gui.preferences.DlgPreferences.addPreferencePage(IPreference) instead");
292
		throw new Error("Do not use org.gvsig.app.gui.preferences.DlgPreferences.add(Component) register an extension point instead");
293
	}
294

  
295
	public Component add(Component c, int i) {
296
		return add(c);
297
	}
298

  
299
	public void add(Component c, Object o) {
300
		add(c);
301
	}
302

  
303
	public void add(Component c, Object o, int i) {
304
		add(c);
305
	}
306

  
307
	public WindowInfo getWindowInfo() {
308
		if (viewInfo == null) {
309
			viewInfo = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE | WindowInfo.PALETTE);
310
			viewInfo.setTitle(PluginServices.getText(this,
311
					"Preferences"));
312
			viewInfo.setWidth(this.getWidth()+8);
313
			viewInfo.setHeight(this.getHeight());
314
		}
315
		return viewInfo;
316
	}
317

  
318
	/**
319
	 * This method initializes jTreePlugins
320
	 *
321
	 * @return javax.swing.JTree
322
	 */
323
	private JTree getJTreePlugins() {
324
		if (jTreePlugins == null) {
325
			jTreePlugins = new JTree();
326
			jTreePlugins.setRootVisible(false);
327
			MyTreeCellRenderer treeCellRenderer = new MyTreeCellRenderer();
328
			treeCellRenderer.setOpenIcon(null);
329
			treeCellRenderer.setClosedIcon(null);
330
			treeCellRenderer.setLeafIcon(null);
331

  
332
			jTreePlugins.setCellRenderer(treeCellRenderer);
333
			jTreePlugins.setShowsRootHandles(true);
334
			jTreePlugins
335
					.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
336
						public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
337
							 DefaultMutableTreeNode node = (DefaultMutableTreeNode)
338
													 jTreePlugins.getLastSelectedPathComponent();
339

  
340
							 	if (node == null) {
341
									return;
342
								}
343
							 	setActivePage((IPreference) node.getUserObject());
344
						}
345
					});
346
			jTreePlugins.putClientProperty("JTree.linestyle", "Angled");
347
			jTreePlugins.getSelectionModel().
348
				setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
349
		}
350

  
351
		return jTreePlugins;
352
	}
353

  
354
	/**
355
	 * It takes an IPreference page and adds it to the application's preferences
356
	 * dialog. The preference page is added in alphabetical order within the
357
	 * branch where the page is hanging on, and defined by its title.
358
	 * @param page
359
	 */
360
	public void addPreferencePage(IPreference page)
361
	{
362
		if (preferences.containsKey(page.getID())) {
363
			return;
364
		}
365
		preferences.put(page.getID(), page);
366
		page.initializeValues(); // init values from the last settings
367
		if (dirtyTree) {
368
			// rebuild page tree
369
			dirtyTree = false;
370

  
371
			DefaultTreeModel model = new DefaultTreeModel(root);
372
			treeModel = model;
373
			jTreePlugins.setModel(model);
374
		}
375

  
376
		doInsertNode(treeModel, page);
377
		getJTreePlugins().setModel(treeModel);
378
		getJTreePlugins().repaint();
379
	}
380
	private void addPreferencePages(ArrayList<IPreference> prefs){
381
		while (prefs.size()>0){
382
			IPreference pref=prefs.get(0);
383
//				System.err.println("IPreference a persistir=  "+pref.getID());
384
			if (pref.getParentID()!=null && preferences.get(pref.getParentID())==null){
385
				prefs.remove(pref);
386
				addPreferencePages(prefs);
387
//				System.err.println("IPreference =  "+pref.getID());
388
				addPreference(pref);
389
			}else{
390
//				System.err.println("IPreference =  "+pref.getID());
391
				addPreference(pref);
392
				prefs.remove(pref);
393
			}
394
		}
395
	}
396
	private void addPreference(IPreference pref) {
397
		DefaultTreeModel model = new DefaultTreeModel(root);
398
		doInsertNode(model, pref);
399
	}
400

  
401
	private DefaultMutableTreeNode findNode(String searchID)
402
	{
403
        @SuppressWarnings("unchecked")
404
        Enumeration<DefaultMutableTreeNode> e = root.breadthFirstEnumeration();
405
		while (e.hasMoreElements())
406
		{
407
            DefaultMutableTreeNode nodeAux = e.nextElement();
408
			if (nodeAux != null)
409
			{
410
				IPreference pref = (IPreference) nodeAux.getUserObject();
411
				if (pref == null) {
412
					continue; // Root node
413
				}
414
				if (pref.getID().equals(searchID))
415
				{
416
					return nodeAux;
417
				}
418
			}
419
		}
420
		return null;
421

  
422
	}
423

  
424
	private void doInsertNode(DefaultTreeModel treeModel, IPreference page)
425
	{
426

  
427
		dirtyTree = ((page.getParentID() != null) && (findNode(page.getParentID())==null));
428
		if (findNode(page.getID()) != null) {
429
			return;
430
		}
431
		if (page.getParentID() != null)
432
		{
433
			if (preferences.containsKey(page.getParentID()))
434
			{
435
				IPreference parent = (IPreference) preferences.get(page.getParentID());
436
				DefaultMutableTreeNode nodeParent = findNode(parent.getID());
437
				if (nodeParent == null) // the parent is empty
438
				{
439
					// Recursively add it
440
					doInsertNode(treeModel, parent);
441
				}
442
				else
443
				{
444
					DefaultMutableTreeNode nodeValue = new DefaultMutableTreeNode(page);
445
					int children = nodeParent.getChildCount();
446
					int pos=0;
447
					for (int i = 0; i < children; i++) {
448
						DefaultMutableTreeNode node = (DefaultMutableTreeNode) treeModel.getChild(nodeParent, i);
449
						if (node.getUserObject() instanceof IPreference) {
450
							String pageTitle = ((IPreference) node.getUserObject()).getTitle();
451
							if (pageTitle.compareTo(page.getTitle()) < 0) {
452
								++pos;
453
							}
454
						}
455
					}
456
					treeModel.insertNodeInto(nodeValue, nodeParent, pos);
457
				}
458
			}
459
		}
460
		else // First level node ("General", "Edition")
461
		{
462
			DefaultMutableTreeNode nodeValue = new DefaultMutableTreeNode(page);
463
			int children = root.getChildCount();
464
			int pos=0;
465
			for (int i = 0; i < children; i++) {
466
				DefaultMutableTreeNode node = (DefaultMutableTreeNode) treeModel.getChild(root, i);
467
				if (node.getUserObject() instanceof IPreference) {
468
					String pageTitle = ((IPreference) node.getUserObject()).getTitle();
469
					if (pageTitle.compareTo(page.getTitle()) < 0) {
470
						++pos;
471
					}
472
				}
473
			}
474
			treeModel.insertNodeInto(nodeValue, root, pos);
475
		}
476
	}
477

  
478
	/**
479
	 * This method initializes jPanelButtons
480
	 *
481
	 * @return javax.swing.JPanel
482
	 */
483
	private JPanel getJPanelButtons() {
484
		if (jPanelButtons == null) {
485
			jPanelButtons = new JPanel(new BorderLayout());
486
			JPanel jPanelAux = new JPanel();
487
			JLabel l = new JLabel();
488
			l.setPreferredSize(new Dimension(40, 20));
489
			jPanelButtons.add(new JSeparator(JSeparator.HORIZONTAL), BorderLayout.NORTH);
490
			jPanelAux.add(getJButtonRestore(), BorderLayout.WEST);
491
			jPanelAux.add(l, BorderLayout.CENTER);
492
			jPanelAux.add(getJButtonOK(), BorderLayout.EAST);
493
			jPanelAux.add(getJButtonCancel(), BorderLayout.EAST);
494

  
495
			jPanelButtons.add(jPanelAux);
496
		}
497
		return jPanelButtons;
498
	}
499

  
500
	/**
501
	 * This method initializes jPanelButtons
502
	 *
503
	 * @return javax.swing.JPanel
504
	 */
505

  
506

  
507
	/**
508
	 * This method initializes jButtonOK
509
	 *
510
	 * @return JButton
511
	 */
512
	private JButton getJButtonOK() {
513
		if (jButtonOK == null) {
514
			jButtonOK = new JButton();
515
			jButtonOK.setText(PluginServices.getText(this, "aceptar"));
516
			jButtonOK.setActionCommand("OK");
517
			jButtonOK.addActionListener(action);
518
		}
519
		return jButtonOK;
520
	}
521

  
522
	/**
523
	 * This method initializes jButtonOK
524
	 *
525
	 * @return JButton
526
	 */
527
	private JButton getJButtonRestore() {
528
		if (jButtonRestore == null) {
529
			jButtonRestore = new JButton();
530
			jButtonRestore.setText(PluginServices.getText(this, "restore_defaults"));
531
			jButtonRestore.setActionCommand("RESTORE");
532
			jButtonRestore.addActionListener(action);
533
		}
534
		return jButtonRestore;
535
	}
536

  
537
	private void closeView() {
538
		PluginServices.getMDIManager().closeWindow(this);
539
	}
540

  
541
	/**
542
	 * This method initializes jButtonCancel
543
	 *
544
	 * @return JButton
545
	 */
546
	private JButton getJButtonCancel() {
547
		if (jButtonCancel == null) {
548
			jButtonCancel = new JButton();
549
			jButtonCancel.setText(PluginServices.getText(this, "cancelar"));
550
			jButtonCancel.setActionCommand("CANCEL");
551
			jButtonCancel.addActionListener(action);
552
		}
553
		return jButtonCancel;
554
	}
555

  
556
	/**
557
	 * This method initializes jPanelNorth
558
	 *
559
	 * @return javax.swing.JPanel
560
	 */
561
	private JPanel getJPanelNorth() {
562
		if (jPanelCenter == null) {
563
			jLabelBigTitle = new JLabel();
564
			jLabelBigTitle.setText("General");
565
		    Font font = jLabelBigTitle.getFont();
566
		    font = font.deriveFont(Font.BOLD, font.getSize() + 1.0f);
567
		    jLabelBigTitle.setFont(font);
568
			jLabelBigTitle.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING);
569
			jLabelBigTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
570
			jPanelCenter = new JPanel();
571
			JPanel jPanelPageTitle = new JPanel(new BorderLayout());
572
			JPanel jPanelAux = new JPanel(new BorderLayout());
573
			jPanelAux.add(jLabelBigTitle, java.awt.BorderLayout.NORTH);
574
			jPanelPageTitle.add(jPanelAux, java.awt.BorderLayout.WEST);
575
			jPanelPageTitle.add(new JSeparator(JSeparator.HORIZONTAL), BorderLayout.SOUTH);
576
			jPanelCenter.setLayout(new BorderLayout());
577
			jPanelCenter.add(jPanelPageTitle, BorderLayout.NORTH);
578
			jPanelCenter.add(getJPanelContainer(), java.awt.BorderLayout.CENTER);
579

  
580
		}
581
		return jPanelCenter;
582
	}
583

  
584
	/**
585
	 * This method initializes jScrollPane
586
	 *
587
	 * @return javax.swing.JScrollPane
588
	 */
589
	private JScrollPane getJScrollPane() {
590
		if (jScrollPane == null) {
591
			jScrollPane = new JScrollPane();
592
			jScrollPane.setPreferredSize(new java.awt.Dimension(140,322));
593
			jScrollPane.setViewportView(getJTreePlugins());
594
		}
595
		return jScrollPane;
596
	}
597

  
598
	/**
599
	 * This method initializes jSplitPaneCenter
600
	 *
601
	 * @return javax.swing.JSplitPane
602
	 */
603
	private JSplitPane getJSplitPaneCenter() {
604
		if (jSplitPaneCenter == null) {
605
			jSplitPaneCenter = new JSplitPane();
606
			jSplitPaneCenter.setResizeWeight(0.2);
607
			jSplitPaneCenter.setDividerLocation(200);
608
		}
609
		return jSplitPaneCenter;
610
	}
611

  
612
	/**
613
	 * This method initializes jPanelContainer
614
	 *
615
	 * @return javax.swing.JPanel
616
	 */
617
	private JPanel getJPanelContainer() {
618
		if (jPanelContainer == null) {
619
			jPanelContainer = new JPanel();
620
		}
621
		return jPanelContainer;
622
	}
623

  
624
	/**
625
	 *
626
	 */
627
	public void setActivePage(IPreference page) {
628
		activePreference = page;
629
		jLabelBigTitle.setText(activePreference.getTitle());
630
		JPanel prefPanel = activePreference.getPanel();
631
		jLabelBigTitle.setIcon(activePreference.getIcon());
632
		jPanelContainer.removeAll();
633
		if ((prefPanel instanceof AbstractPreferencePage) &&
634
				((AbstractPreferencePage) prefPanel).isResizeable()) {
635
			jPanelContainer.setLayout(new BorderLayout());
636
			jPanelContainer.add(prefPanel, BorderLayout.CENTER);
637
		} else {
638
			jPanelContainer.setLayout(new FlowLayout());
639
			jPanelContainer.add(prefPanel);
640
		}
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff