Revision 76

View differences:

org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
  <modelVersion>4.0.0</modelVersion>
4
  <artifactId>org.gvsig.jexcel.app</artifactId>
5
  <packaging>pom</packaging>
6
  <name>${project.artifactId}</name>
7
  <parent>
8
      <groupId>org.gvsig</groupId>
9
      <artifactId>org.gvsig.jexcel</artifactId>
10
      <version>1.0.11</version>
11
  </parent>
12

  
13
  <modules>
14
    <module>org.gvsig.jexcel.app.mainplugin</module>
15
  </modules>
16

  
17

  
18
</project>
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.jexcel.JExcelGUILibrary
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${project.artifactId}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>src/main/resources-plugin</directory>
21
      <outputDirectory>.</outputDirectory>
22
    </fileSet>
23
  </fileSets>
24

  
25
  <dependencySets>
26
  
27
    <dependencySet>
28
      <useProjectArtifact>false</useProjectArtifact>
29
      <useTransitiveDependencies>false</useTransitiveDependencies>
30
      <outputDirectory>lib</outputDirectory>
31
      <includes>
32
        <include>net.sourceforge.jexcelapi:jxl</include>
33
        <include>org.gvsig:org.gvsig.jexcel.provider</include>        
34
      </includes>
35
    </dependencySet>
36
    
37
  </dependencySets>
38

  
39
</assembly>
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/java/org/gvsig/jexcel/SelectPointPanel.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="1"/>
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="lblX">
18
      <Properties>
19
        <Property name="text" type="java.lang.String" value="X:"/>
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="1" gridHeight="1" fill="0" 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.JLabel" name="jLabel2">
28
      <Properties>
29
        <Property name="text" type="java.lang.String" value="Y:"/>
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="2" gridY="4" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.0" weightY="0.0"/>
34
        </Constraint>
35
      </Constraints>
36
    </Component>
37
    <Component class="javax.swing.JLabel" name="lblZ">
38
      <Properties>
39
        <Property name="text" type="java.lang.String" value="Z:"/>
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="2" gridY="6" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.0" weightY="0.0"/>
44
        </Constraint>
45
      </Constraints>
46
    </Component>
47
    <Component class="javax.swing.JComboBox" name="cboX">
48
      <Properties>
49
        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
50
          <StringArray count="0"/>
51
        </Property>
52
      </Properties>
53
      <Constraints>
54
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
55
          <GridBagConstraints gridX="4" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.1" weightY="0.0"/>
56
        </Constraint>
57
      </Constraints>
58
    </Component>
59
    <Component class="javax.swing.JComboBox" name="cboY">
60
      <Properties>
61
        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
62
          <StringArray count="0"/>
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="4" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.1" weightY="0.0"/>
68
        </Constraint>
69
      </Constraints>
70
    </Component>
71
    <Component class="javax.swing.JComboBox" name="cboZ">
72
      <Properties>
73
        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
74
          <StringArray count="0"/>
75
        </Property>
76
      </Properties>
77
      <Constraints>
78
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
79
          <GridBagConstraints gridX="4" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.1" weightY="0.0"/>
80
        </Constraint>
81
      </Constraints>
82
    </Component>
83
    <Component class="javax.swing.Box$Filler" name="filler1">
84
      <Properties>
85
        <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
86
          <Dimension value="[0, 32767]"/>
87
        </Property>
88
      </Properties>
89
      <AuxValues>
90
        <AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
91
      </AuxValues>
92
      <Constraints>
93
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
94
          <GridBagConstraints gridX="0" gridY="8" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.1"/>
95
        </Constraint>
96
      </Constraints>
97
    </Component>
98
  </SubComponents>
99
  <LayoutCode>
100
    <CodeStatement>
101
      <CodeExpression id="1_layout">
102
        <CodeVariable name="layout" type="4096" declaredType="java.awt.GridBagLayout"/>
103
        <ExpressionOrigin>
104
          <ExpressionProvider type="CodeConstructor">
105
            <CodeConstructor class="java.awt.GridBagLayout" parameterTypes=""/>
106
          </ExpressionProvider>
107
        </ExpressionOrigin>
108
      </CodeExpression>
109
      <StatementProvider type="CodeExpression">
110
        <CodeExpression id="1_layout"/>
111
      </StatementProvider>
112
    </CodeStatement>
113
    <CodeStatement>
114
      <CodeExpression id="1_layout"/>
115
      <StatementProvider type="CodeField">
116
        <CodeField name="columnWidths" class="java.awt.GridBagLayout"/>
117
      </StatementProvider>
118
      <Parameters>
119
        <CodeExpression id="2">
120
          <ExpressionOrigin>
121
            <Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor">
122
              <PropertyValue value="[0, 4, 0, 4, 0, 4, 0]"/>
123
            </Value>
124
          </ExpressionOrigin>
125
        </CodeExpression>
126
      </Parameters>
127
    </CodeStatement>
128
    <CodeStatement>
129
      <CodeExpression id="1_layout"/>
130
      <StatementProvider type="CodeField">
131
        <CodeField name="rowHeights" class="java.awt.GridBagLayout"/>
132
      </StatementProvider>
133
      <Parameters>
134
        <CodeExpression id="3">
135
          <ExpressionOrigin>
136
            <Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor">
137
              <PropertyValue value="[0, 4, 0, 4, 0, 4, 0, 4, 0]"/>
138
            </Value>
139
          </ExpressionOrigin>
140
        </CodeExpression>
141
      </Parameters>
142
    </CodeStatement>
143
    <CodeStatement>
144
      <CodeExpression id="4">
145
        <ExpressionOrigin>
146
          <ExpressionProvider type="ComponentRef">
147
            <ComponentRef name="."/>
148
          </ExpressionProvider>
149
        </ExpressionOrigin>
150
      </CodeExpression>
151
      <StatementProvider type="CodeMethod">
152
        <CodeMethod name="setLayout" class="java.awt.Container" parameterTypes="java.awt.LayoutManager"/>
153
      </StatementProvider>
154
      <Parameters>
155
        <CodeExpression id="1_layout"/>
156
      </Parameters>
157
    </CodeStatement>
158
    <CodeStatement>
159
      <CodeExpression id="5_gridBagConstraints">
160
        <CodeVariable name="gridBagConstraints" type="20480" declaredType="java.awt.GridBagConstraints"/>
161
        <ExpressionOrigin>
162
          <ExpressionProvider type="CodeConstructor">
163
            <CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
164
          </ExpressionProvider>
165
        </ExpressionOrigin>
166
      </CodeExpression>
167
      <StatementProvider type="CodeExpression">
168
        <CodeExpression id="5_gridBagConstraints"/>
169
      </StatementProvider>
170
    </CodeStatement>
171
    <CodeStatement>
172
      <CodeExpression id="5_gridBagConstraints"/>
173
      <StatementProvider type="CodeField">
174
        <CodeField name="gridx" class="java.awt.GridBagConstraints"/>
175
      </StatementProvider>
176
      <Parameters>
177
        <CodeExpression id="6">
178
          <ExpressionOrigin>
179
            <Value type="int" value="2"/>
180
          </ExpressionOrigin>
181
        </CodeExpression>
182
      </Parameters>
183
    </CodeStatement>
184
    <CodeStatement>
185
      <CodeExpression id="5_gridBagConstraints"/>
186
      <StatementProvider type="CodeField">
187
        <CodeField name="gridy" class="java.awt.GridBagConstraints"/>
188
      </StatementProvider>
189
      <Parameters>
190
        <CodeExpression id="7">
191
          <ExpressionOrigin>
192
            <Value type="int" value="2"/>
193
          </ExpressionOrigin>
194
        </CodeExpression>
195
      </Parameters>
196
    </CodeStatement>
197
    <CodeStatement>
198
      <CodeExpression id="5_gridBagConstraints"/>
199
      <StatementProvider type="CodeField">
200
        <CodeField name="anchor" class="java.awt.GridBagConstraints"/>
201
      </StatementProvider>
202
      <Parameters>
203
        <CodeExpression id="8">
204
          <ExpressionOrigin>
205
            <Value type="int" value="21"/>
206
          </ExpressionOrigin>
207
        </CodeExpression>
208
      </Parameters>
209
    </CodeStatement>
210
    <CodeStatement>
211
      <CodeExpression id="4"/>
212
      <StatementProvider type="CodeMethod">
213
        <CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
214
      </StatementProvider>
215
      <Parameters>
216
        <CodeExpression id="9_lblX">
217
          <CodeVariable name="lblX" type="8193" declaredType="javax.swing.JLabel"/>
218
          <ExpressionOrigin>
219
            <ExpressionProvider type="ComponentRef">
220
              <ComponentRef name="lblX"/>
221
            </ExpressionProvider>
222
          </ExpressionOrigin>
223
        </CodeExpression>
224
        <CodeExpression id="5_gridBagConstraints"/>
225
      </Parameters>
226
    </CodeStatement>
227
    <CodeStatement>
228
      <CodeExpression id="10_gridBagConstraints">
229
        <CodeVariable name="gridBagConstraints"/>
230
        <ExpressionOrigin>
231
          <ExpressionProvider type="CodeConstructor">
232
            <CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
233
          </ExpressionProvider>
234
        </ExpressionOrigin>
235
      </CodeExpression>
236
      <StatementProvider type="CodeExpression">
237
        <CodeExpression id="10_gridBagConstraints"/>
238
      </StatementProvider>
239
    </CodeStatement>
240
    <CodeStatement>
241
      <CodeExpression id="10_gridBagConstraints"/>
242
      <StatementProvider type="CodeField">
243
        <CodeField name="gridx" class="java.awt.GridBagConstraints"/>
244
      </StatementProvider>
245
      <Parameters>
246
        <CodeExpression id="11">
247
          <ExpressionOrigin>
248
            <Value type="int" value="2"/>
249
          </ExpressionOrigin>
250
        </CodeExpression>
251
      </Parameters>
252
    </CodeStatement>
253
    <CodeStatement>
254
      <CodeExpression id="10_gridBagConstraints"/>
255
      <StatementProvider type="CodeField">
256
        <CodeField name="gridy" class="java.awt.GridBagConstraints"/>
257
      </StatementProvider>
258
      <Parameters>
259
        <CodeExpression id="12">
260
          <ExpressionOrigin>
261
            <Value type="int" value="4"/>
262
          </ExpressionOrigin>
263
        </CodeExpression>
264
      </Parameters>
265
    </CodeStatement>
266
    <CodeStatement>
267
      <CodeExpression id="10_gridBagConstraints"/>
268
      <StatementProvider type="CodeField">
269
        <CodeField name="anchor" class="java.awt.GridBagConstraints"/>
270
      </StatementProvider>
271
      <Parameters>
272
        <CodeExpression id="13">
273
          <ExpressionOrigin>
274
            <Value type="int" value="21"/>
275
          </ExpressionOrigin>
276
        </CodeExpression>
277
      </Parameters>
278
    </CodeStatement>
279
    <CodeStatement>
280
      <CodeExpression id="4"/>
281
      <StatementProvider type="CodeMethod">
282
        <CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
283
      </StatementProvider>
284
      <Parameters>
285
        <CodeExpression id="14_jLabel2">
286
          <CodeVariable name="jLabel2" type="8193" declaredType="javax.swing.JLabel"/>
287
          <ExpressionOrigin>
288
            <ExpressionProvider type="ComponentRef">
289
              <ComponentRef name="jLabel2"/>
290
            </ExpressionProvider>
291
          </ExpressionOrigin>
292
        </CodeExpression>
293
        <CodeExpression id="10_gridBagConstraints"/>
294
      </Parameters>
295
    </CodeStatement>
296
    <CodeStatement>
297
      <CodeExpression id="15_gridBagConstraints">
298
        <CodeVariable name="gridBagConstraints"/>
299
        <ExpressionOrigin>
300
          <ExpressionProvider type="CodeConstructor">
301
            <CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
302
          </ExpressionProvider>
303
        </ExpressionOrigin>
304
      </CodeExpression>
305
      <StatementProvider type="CodeExpression">
306
        <CodeExpression id="15_gridBagConstraints"/>
307
      </StatementProvider>
308
    </CodeStatement>
309
    <CodeStatement>
310
      <CodeExpression id="15_gridBagConstraints"/>
311
      <StatementProvider type="CodeField">
312
        <CodeField name="gridx" class="java.awt.GridBagConstraints"/>
313
      </StatementProvider>
314
      <Parameters>
315
        <CodeExpression id="16">
316
          <ExpressionOrigin>
317
            <Value type="int" value="2"/>
318
          </ExpressionOrigin>
319
        </CodeExpression>
320
      </Parameters>
321
    </CodeStatement>
322
    <CodeStatement>
323
      <CodeExpression id="15_gridBagConstraints"/>
324
      <StatementProvider type="CodeField">
325
        <CodeField name="gridy" class="java.awt.GridBagConstraints"/>
326
      </StatementProvider>
327
      <Parameters>
328
        <CodeExpression id="17">
329
          <ExpressionOrigin>
330
            <Value type="int" value="6"/>
331
          </ExpressionOrigin>
332
        </CodeExpression>
333
      </Parameters>
334
    </CodeStatement>
335
    <CodeStatement>
336
      <CodeExpression id="15_gridBagConstraints"/>
337
      <StatementProvider type="CodeField">
338
        <CodeField name="anchor" class="java.awt.GridBagConstraints"/>
339
      </StatementProvider>
340
      <Parameters>
341
        <CodeExpression id="18">
342
          <ExpressionOrigin>
343
            <Value type="int" value="21"/>
344
          </ExpressionOrigin>
345
        </CodeExpression>
346
      </Parameters>
347
    </CodeStatement>
348
    <CodeStatement>
349
      <CodeExpression id="4"/>
350
      <StatementProvider type="CodeMethod">
351
        <CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
352
      </StatementProvider>
353
      <Parameters>
354
        <CodeExpression id="19_lblZ">
355
          <CodeVariable name="lblZ" type="8193" declaredType="javax.swing.JLabel"/>
356
          <ExpressionOrigin>
357
            <ExpressionProvider type="ComponentRef">
358
              <ComponentRef name="lblZ"/>
359
            </ExpressionProvider>
360
          </ExpressionOrigin>
361
        </CodeExpression>
362
        <CodeExpression id="15_gridBagConstraints"/>
363
      </Parameters>
364
    </CodeStatement>
365
    <CodeStatement>
366
      <CodeExpression id="20_gridBagConstraints">
367
        <CodeVariable name="gridBagConstraints"/>
368
        <ExpressionOrigin>
369
          <ExpressionProvider type="CodeConstructor">
370
            <CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
371
          </ExpressionProvider>
372
        </ExpressionOrigin>
373
      </CodeExpression>
374
      <StatementProvider type="CodeExpression">
375
        <CodeExpression id="20_gridBagConstraints"/>
376
      </StatementProvider>
377
    </CodeStatement>
378
    <CodeStatement>
379
      <CodeExpression id="20_gridBagConstraints"/>
380
      <StatementProvider type="CodeField">
381
        <CodeField name="gridx" class="java.awt.GridBagConstraints"/>
382
      </StatementProvider>
383
      <Parameters>
384
        <CodeExpression id="21">
385
          <ExpressionOrigin>
386
            <Value type="int" value="4"/>
387
          </ExpressionOrigin>
388
        </CodeExpression>
389
      </Parameters>
390
    </CodeStatement>
391
    <CodeStatement>
392
      <CodeExpression id="20_gridBagConstraints"/>
393
      <StatementProvider type="CodeField">
394
        <CodeField name="gridy" class="java.awt.GridBagConstraints"/>
395
      </StatementProvider>
396
      <Parameters>
397
        <CodeExpression id="22">
398
          <ExpressionOrigin>
399
            <Value type="int" value="2"/>
400
          </ExpressionOrigin>
401
        </CodeExpression>
402
      </Parameters>
403
    </CodeStatement>
404
    <CodeStatement>
405
      <CodeExpression id="20_gridBagConstraints"/>
406
      <StatementProvider type="CodeField">
407
        <CodeField name="fill" class="java.awt.GridBagConstraints"/>
408
      </StatementProvider>
409
      <Parameters>
410
        <CodeExpression id="23">
411
          <ExpressionOrigin>
412
            <Value type="int" value="2"/>
413
          </ExpressionOrigin>
414
        </CodeExpression>
415
      </Parameters>
416
    </CodeStatement>
417
    <CodeStatement>
418
      <CodeExpression id="20_gridBagConstraints"/>
419
      <StatementProvider type="CodeField">
420
        <CodeField name="weightx" class="java.awt.GridBagConstraints"/>
421
      </StatementProvider>
422
      <Parameters>
423
        <CodeExpression id="24">
424
          <ExpressionOrigin>
425
            <Value type="double" value="0.1"/>
426
          </ExpressionOrigin>
427
        </CodeExpression>
428
      </Parameters>
429
    </CodeStatement>
430
    <CodeStatement>
431
      <CodeExpression id="4"/>
432
      <StatementProvider type="CodeMethod">
433
        <CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
434
      </StatementProvider>
435
      <Parameters>
436
        <CodeExpression id="25_cboX">
437
          <CodeVariable name="cboX" type="8193" declaredType="javax.swing.JComboBox"/>
438
          <ExpressionOrigin>
439
            <ExpressionProvider type="ComponentRef">
440
              <ComponentRef name="cboX"/>
441
            </ExpressionProvider>
442
          </ExpressionOrigin>
443
        </CodeExpression>
444
        <CodeExpression id="20_gridBagConstraints"/>
445
      </Parameters>
446
    </CodeStatement>
447
    <CodeStatement>
448
      <CodeExpression id="26_gridBagConstraints">
449
        <CodeVariable name="gridBagConstraints"/>
450
        <ExpressionOrigin>
451
          <ExpressionProvider type="CodeConstructor">
452
            <CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
453
          </ExpressionProvider>
454
        </ExpressionOrigin>
455
      </CodeExpression>
456
      <StatementProvider type="CodeExpression">
457
        <CodeExpression id="26_gridBagConstraints"/>
458
      </StatementProvider>
459
    </CodeStatement>
460
    <CodeStatement>
461
      <CodeExpression id="26_gridBagConstraints"/>
462
      <StatementProvider type="CodeField">
463
        <CodeField name="gridx" class="java.awt.GridBagConstraints"/>
464
      </StatementProvider>
465
      <Parameters>
466
        <CodeExpression id="27">
467
          <ExpressionOrigin>
468
            <Value type="int" value="4"/>
469
          </ExpressionOrigin>
470
        </CodeExpression>
471
      </Parameters>
472
    </CodeStatement>
473
    <CodeStatement>
474
      <CodeExpression id="26_gridBagConstraints"/>
475
      <StatementProvider type="CodeField">
476
        <CodeField name="gridy" class="java.awt.GridBagConstraints"/>
477
      </StatementProvider>
478
      <Parameters>
479
        <CodeExpression id="28">
480
          <ExpressionOrigin>
481
            <Value type="int" value="4"/>
482
          </ExpressionOrigin>
483
        </CodeExpression>
484
      </Parameters>
485
    </CodeStatement>
486
    <CodeStatement>
487
      <CodeExpression id="26_gridBagConstraints"/>
488
      <StatementProvider type="CodeField">
489
        <CodeField name="fill" class="java.awt.GridBagConstraints"/>
490
      </StatementProvider>
491
      <Parameters>
492
        <CodeExpression id="29">
493
          <ExpressionOrigin>
494
            <Value type="int" value="2"/>
495
          </ExpressionOrigin>
496
        </CodeExpression>
497
      </Parameters>
498
    </CodeStatement>
499
    <CodeStatement>
500
      <CodeExpression id="26_gridBagConstraints"/>
501
      <StatementProvider type="CodeField">
502
        <CodeField name="weightx" class="java.awt.GridBagConstraints"/>
503
      </StatementProvider>
504
      <Parameters>
505
        <CodeExpression id="30">
506
          <ExpressionOrigin>
507
            <Value type="double" value="0.1"/>
508
          </ExpressionOrigin>
509
        </CodeExpression>
510
      </Parameters>
511
    </CodeStatement>
512
    <CodeStatement>
513
      <CodeExpression id="4"/>
514
      <StatementProvider type="CodeMethod">
515
        <CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
516
      </StatementProvider>
517
      <Parameters>
518
        <CodeExpression id="31_cboY">
519
          <CodeVariable name="cboY" type="8193" declaredType="javax.swing.JComboBox"/>
520
          <ExpressionOrigin>
521
            <ExpressionProvider type="ComponentRef">
522
              <ComponentRef name="cboY"/>
523
            </ExpressionProvider>
524
          </ExpressionOrigin>
525
        </CodeExpression>
526
        <CodeExpression id="26_gridBagConstraints"/>
527
      </Parameters>
528
    </CodeStatement>
529
    <CodeStatement>
530
      <CodeExpression id="32_gridBagConstraints">
531
        <CodeVariable name="gridBagConstraints"/>
532
        <ExpressionOrigin>
533
          <ExpressionProvider type="CodeConstructor">
534
            <CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
535
          </ExpressionProvider>
536
        </ExpressionOrigin>
537
      </CodeExpression>
538
      <StatementProvider type="CodeExpression">
539
        <CodeExpression id="32_gridBagConstraints"/>
540
      </StatementProvider>
541
    </CodeStatement>
542
    <CodeStatement>
543
      <CodeExpression id="32_gridBagConstraints"/>
544
      <StatementProvider type="CodeField">
545
        <CodeField name="gridx" class="java.awt.GridBagConstraints"/>
546
      </StatementProvider>
547
      <Parameters>
548
        <CodeExpression id="33">
549
          <ExpressionOrigin>
550
            <Value type="int" value="4"/>
551
          </ExpressionOrigin>
552
        </CodeExpression>
553
      </Parameters>
554
    </CodeStatement>
555
    <CodeStatement>
556
      <CodeExpression id="32_gridBagConstraints"/>
557
      <StatementProvider type="CodeField">
558
        <CodeField name="gridy" class="java.awt.GridBagConstraints"/>
559
      </StatementProvider>
560
      <Parameters>
561
        <CodeExpression id="34">
562
          <ExpressionOrigin>
563
            <Value type="int" value="6"/>
564
          </ExpressionOrigin>
565
        </CodeExpression>
566
      </Parameters>
567
    </CodeStatement>
568
    <CodeStatement>
569
      <CodeExpression id="32_gridBagConstraints"/>
570
      <StatementProvider type="CodeField">
571
        <CodeField name="fill" class="java.awt.GridBagConstraints"/>
572
      </StatementProvider>
573
      <Parameters>
574
        <CodeExpression id="35">
575
          <ExpressionOrigin>
576
            <Value type="int" value="2"/>
577
          </ExpressionOrigin>
578
        </CodeExpression>
579
      </Parameters>
580
    </CodeStatement>
581
    <CodeStatement>
582
      <CodeExpression id="32_gridBagConstraints"/>
583
      <StatementProvider type="CodeField">
584
        <CodeField name="weightx" class="java.awt.GridBagConstraints"/>
585
      </StatementProvider>
586
      <Parameters>
587
        <CodeExpression id="36">
588
          <ExpressionOrigin>
589
            <Value type="double" value="0.1"/>
590
          </ExpressionOrigin>
591
        </CodeExpression>
592
      </Parameters>
593
    </CodeStatement>
594
    <CodeStatement>
595
      <CodeExpression id="4"/>
596
      <StatementProvider type="CodeMethod">
597
        <CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
598
      </StatementProvider>
599
      <Parameters>
600
        <CodeExpression id="37_cboZ">
601
          <CodeVariable name="cboZ" type="8193" declaredType="javax.swing.JComboBox"/>
602
          <ExpressionOrigin>
603
            <ExpressionProvider type="ComponentRef">
604
              <ComponentRef name="cboZ"/>
605
            </ExpressionProvider>
606
          </ExpressionOrigin>
607
        </CodeExpression>
608
        <CodeExpression id="32_gridBagConstraints"/>
609
      </Parameters>
610
    </CodeStatement>
611
    <CodeStatement>
612
      <CodeExpression id="38_gridBagConstraints">
613
        <CodeVariable name="gridBagConstraints"/>
614
        <ExpressionOrigin>
615
          <ExpressionProvider type="CodeConstructor">
616
            <CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
617
          </ExpressionProvider>
618
        </ExpressionOrigin>
619
      </CodeExpression>
620
      <StatementProvider type="CodeExpression">
621
        <CodeExpression id="38_gridBagConstraints"/>
622
      </StatementProvider>
623
    </CodeStatement>
624
    <CodeStatement>
625
      <CodeExpression id="38_gridBagConstraints"/>
626
      <StatementProvider type="CodeField">
627
        <CodeField name="gridx" class="java.awt.GridBagConstraints"/>
628
      </StatementProvider>
629
      <Parameters>
630
        <CodeExpression id="39">
631
          <ExpressionOrigin>
632
            <Value type="int" value="0"/>
633
          </ExpressionOrigin>
634
        </CodeExpression>
635
      </Parameters>
636
    </CodeStatement>
637
    <CodeStatement>
638
      <CodeExpression id="38_gridBagConstraints"/>
639
      <StatementProvider type="CodeField">
640
        <CodeField name="gridy" class="java.awt.GridBagConstraints"/>
641
      </StatementProvider>
642
      <Parameters>
643
        <CodeExpression id="40">
644
          <ExpressionOrigin>
645
            <Value type="int" value="8"/>
646
          </ExpressionOrigin>
647
        </CodeExpression>
648
      </Parameters>
649
    </CodeStatement>
650
    <CodeStatement>
651
      <CodeExpression id="38_gridBagConstraints"/>
652
      <StatementProvider type="CodeField">
653
        <CodeField name="weighty" class="java.awt.GridBagConstraints"/>
654
      </StatementProvider>
655
      <Parameters>
656
        <CodeExpression id="41">
657
          <ExpressionOrigin>
658
            <Value type="double" value="0.1"/>
659
          </ExpressionOrigin>
660
        </CodeExpression>
661
      </Parameters>
662
    </CodeStatement>
663
    <CodeStatement>
664
      <CodeExpression id="4"/>
665
      <StatementProvider type="CodeMethod">
666
        <CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
667
      </StatementProvider>
668
      <Parameters>
669
        <CodeExpression id="42_filler1">
670
          <CodeVariable name="filler1" type="8193" declaredType="javax.swing.Box$Filler"/>
671
          <ExpressionOrigin>
672
            <ExpressionProvider type="ComponentRef">
673
              <ComponentRef name="filler1"/>
674
            </ExpressionProvider>
675
          </ExpressionOrigin>
676
        </CodeExpression>
677
        <CodeExpression id="38_gridBagConstraints"/>
678
      </Parameters>
679
    </CodeStatement>
680
  </LayoutCode>
681
</Form>
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/java/org/gvsig/jexcel/JDynFormFieldSelectExcelSheetFactory.java
1

  
2
package org.gvsig.jexcel;
3

  
4
import org.gvsig.tools.ToolsLocator;
5
import org.gvsig.tools.dataTypes.DataTypes;
6
import org.gvsig.tools.dynform.services.dynformfield.Boolean.JDynFormFieldBoolean;
7
import org.gvsig.tools.dynform.spi.DynFormSPILocator;
8
import org.gvsig.tools.dynform.spi.DynFormSPIManager;
9
import org.gvsig.tools.dynform.spi.JDynFormFieldFactory;
10
import org.gvsig.tools.dynobject.DynField;
11
import org.gvsig.tools.dynobject.DynObject;
12
import org.gvsig.tools.dynobject.DynObjectManager;
13
import org.gvsig.tools.dynobject.DynStruct;
14
import org.gvsig.tools.service.Service;
15
import org.gvsig.tools.service.ServiceException;
16
import org.gvsig.tools.service.spi.ServiceManager;
17

  
18
public class JDynFormFieldSelectExcelSheetFactory implements JDynFormFieldFactory {
19

  
20
	private String name = null;
21
	private DynStruct parametersDefinition = null;
22
	
23
	public String getName() {
24
		if( name == null ) {
25
			DynFormSPIManager manager = DynFormSPILocator.getDynFormSPIManager();
26
			this.name = manager.makeServiceName(DataTypes.INT,"jexcel.sheet.selector");
27
		}
28
		return this.name;
29
	}
30

  
31

  
32
	public Service create(DynObject parameters, ServiceManager serviceManager)
33
			throws ServiceException {
34
		return new JDynFormFieldSelectExcelSheet(parameters, serviceManager);
35
	}
36

  
37
	public DynObject createParameters() {
38
		return ToolsLocator.getDynObjectManager().createDynObject(parametersDefinition);
39
	}
40

  
41
	public void initialize() {
42
		if( this.parametersDefinition == null ) {
43
			String serviceName = this.getName();
44
    		DynObjectManager manager = ToolsLocator.getDynObjectManager();
45
    		this.parametersDefinition = manager.createDynClass(
46
    				serviceName, "Parameters definition for the selector of sheet of the JExcel provider in dynamic forms");
47
    		this.parametersDefinition.addDynFieldObject(DynFormSPIManager.FIELD_FIELDDEFINITION)
48
				.setClassOfValue(DynField.class).setMandatory(true);
49
    		this.parametersDefinition.addDynFieldObject(DynFormSPIManager.FIELD_VALUE)
50
				.setClassOfValue(DynField.class).setMandatory(true);
51
		}
52
	}
53

  
54
    
55
}
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/java/org/gvsig/jexcel/JDynFormFieldSelectPointFactory.java
1

  
2
package org.gvsig.jexcel;
3

  
4
import org.gvsig.tools.ToolsLocator;
5
import org.gvsig.tools.dataTypes.DataTypes;
6
import org.gvsig.tools.dynform.services.dynformfield.Boolean.JDynFormFieldBoolean;
7
import org.gvsig.tools.dynform.spi.DynFormSPILocator;
8
import org.gvsig.tools.dynform.spi.DynFormSPIManager;
9
import org.gvsig.tools.dynform.spi.JDynFormFieldFactory;
10
import org.gvsig.tools.dynobject.DynField;
11
import org.gvsig.tools.dynobject.DynObject;
12
import org.gvsig.tools.dynobject.DynObjectManager;
13
import org.gvsig.tools.dynobject.DynStruct;
14
import org.gvsig.tools.service.Service;
15
import org.gvsig.tools.service.ServiceException;
16
import org.gvsig.tools.service.spi.ServiceManager;
17

  
18
public class JDynFormFieldSelectPointFactory implements JDynFormFieldFactory {
19

  
20
	private String name = null;
21
	private DynStruct parametersDefinition = null;
22
	
23
	public String getName() {
24
		if( name == null ) {
25
			DynFormSPIManager manager = DynFormSPILocator.getDynFormSPIManager();
26
			this.name = manager.makeServiceName(DataTypes.STRING,"jexcel.point.selector");
27
		}
28
		return this.name;
29
	}
30

  
31

  
32
	public Service create(DynObject parameters, ServiceManager serviceManager)
33
			throws ServiceException {
34
		return new JDynFormFieldSelectPoint(parameters, serviceManager);
35
	}
36

  
37
	public DynObject createParameters() {
38
		return ToolsLocator.getDynObjectManager().createDynObject(parametersDefinition);
39
	}
40

  
41
	public void initialize() {
42
		if( this.parametersDefinition == null ) {
43
			String serviceName = this.getName();
44
    		DynObjectManager manager = ToolsLocator.getDynObjectManager();
45
    		this.parametersDefinition = manager.createDynClass(
46
    				serviceName, "Parameters definition for the selector of sheet of the JExcel provider in dynamic forms");
47
    		this.parametersDefinition.addDynFieldObject(DynFormSPIManager.FIELD_FIELDDEFINITION)
48
				.setClassOfValue(DynField.class).setMandatory(true);
49
    		this.parametersDefinition.addDynFieldObject(DynFormSPIManager.FIELD_VALUE)
50
				.setClassOfValue(DynField.class).setMandatory(true);
51
		}
52
	}
53

  
54
    
55
}
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/java/org/gvsig/jexcel/JExcelGUILibrary.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
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA 02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.jexcel;
25

  
26
import org.gvsig.fmap.dal.store.jexcel.JExcelLibrary;
27
import org.gvsig.tools.dynform.spi.DynFormSPILocator;
28
import org.gvsig.tools.dynform.spi.DynFormSPIManager;
29
import org.gvsig.tools.library.AbstractLibrary;
30
import org.gvsig.tools.library.LibraryException;
31

  
32
public class JExcelGUILibrary extends AbstractLibrary {
33

  
34
    public void doRegistration() {
35
        require(JExcelLibrary.class);
36
    }
37

  
38
    protected void doInitialize() throws LibraryException {
39
    }
40

  
41
    protected void doPostInitialize() throws LibraryException {
42
        DynFormSPIManager manager = DynFormSPILocator.getDynFormSPIManager();
43
        manager.addServiceFactory(new JDynFormFieldSelectExcelSheetFactory());
44
    }
45
}
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/java/org/gvsig/jexcel/JDynFormFieldSelectExcelSheet.java
1
package org.gvsig.jexcel;
2

  
3
import java.io.File;
4
import javax.swing.DefaultComboBoxModel;
5
import javax.swing.JComboBox;
6
import jxl.Workbook;
7
import org.gvsig.tools.dynform.JDynForm;
8
import org.gvsig.tools.dynform.JDynFormField;
9
import org.gvsig.tools.dynform.JDynFormField.JDynFormFieldListener;
10
import org.gvsig.tools.dynform.services.dynformfield.Integer.JDynFormFieldInteger;
11
import org.gvsig.tools.dynobject.DynObject;
12
import org.gvsig.tools.dynobject.DynObjectValueItem;
13
import org.gvsig.tools.service.spi.ServiceManager;
14
import org.slf4j.Logger;
15
import org.slf4j.LoggerFactory;
16

  
17
public class JDynFormFieldSelectExcelSheet extends JDynFormFieldInteger {
18

  
19
    private static final Logger logger = LoggerFactory.getLogger(JDynFormFieldSelectExcelSheet.class);
20
    private boolean listenerAdded = false;
21

  
22
    public JDynFormFieldSelectExcelSheet(DynObject parameters, ServiceManager serviceManager) {
23
        super(parameters, serviceManager);
24
    }
25

  
26
    public void initComponent() {
27
        DefaultComboBoxModel model = null;
28
        model = new DefaultComboBoxModel();
29
        this.contents = new JComboBox(model);
30
        this.contents.addFocusListener(this);
31
        if ( this.getDefinition().isReadOnly() ) {
32
            this.getJComboBox().setEditable(false);
33
        }
34
    }
35

  
36
    public void setValue(Object value) {
37
        if( !this.listenerAdded ) {
38
            this.addListenerToFile();
39
        }
40
        super.setValue(value);
41
    }
42

  
43
    public void addListenerToFile() {
44
        if( this.listenerAdded ) {
45
            return;
46
        }
47
        JDynForm form = this.getForm();
48
        JDynFormField fileField = form.getField("file");
49
        if( fileField == null ) {
50
            return;
51
        }
52
        fileField.addListener(new JDynFormFieldListener() {
53

  
54
            public void fieldEnter(JDynFormField field) {
55
            }
56

  
57
            public void fieldExit(JDynFormField field) {
58
            }
59

  
60
            public void fieldChanged(JDynFormField field) {
61
                doChangeFile(field);
62
            }
63

  
64
            public void message(JDynFormField field, String message) {
65
            }
66
        });
67
        this.listenerAdded = true;
68
        doChangeFile(fileField);
69
    }
70

  
71
    protected DynObjectValueItem[] getAvailableSheets(File file) {
72
        try {
73
            if ( file == null ) {
74
                return null;
75
            }
76
            Workbook workbook = Workbook.getWorkbook(file);
77
            DynObjectValueItem[] values = new DynObjectValueItem[workbook.getNumberOfSheets()];
78
            String[] names = workbook.getSheetNames();
79
            for ( int i = 0; i < workbook.getNumberOfSheets(); i++ ) {
80
                values[i] = new DynObjectValueItem(
81
                        new Integer(i),
82
                        names[i]
83
                );
84
            }
85
            return values;
86
        } catch (Exception ex) {
87
            logger.warn("Can't retrieve the number of sheets.", ex);
88
            return null;
89
        }
90
    }
91

  
92
    public void doChangeFile(JDynFormField field) {
93
        DynObjectValueItem[] availableValues = this.getAvailableSheets(
94
                (File) field.getValue()
95
        );
96
        DefaultComboBoxModel model = (DefaultComboBoxModel) this.getJComboBox().getModel();
97
        model.removeAllElements();
98
        if ( availableValues != null ) {
99
            for ( int i = 0; i < availableValues.length; i++ ) {
100
                model.addElement(availableValues[i]);
101
            }
102
        }
103
        if ( model.getSize() > 0 ) {
104
            this.getJComboBox().setSelectedIndex(0);
105
        }
106
    }
107

  
108
}
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/java/org/gvsig/jexcel/JDynFormFieldSelectPoint.java
1
package org.gvsig.jexcel;
2

  
3
import java.io.File;
4
import javax.swing.DefaultComboBoxModel;
5
import javax.swing.JComboBox;
6
import jxl.Workbook;
7
import org.gvsig.tools.dynform.JDynForm;
8
import org.gvsig.tools.dynform.JDynFormField;
9
import org.gvsig.tools.dynform.JDynFormField.JDynFormFieldListener;
10
import org.gvsig.tools.dynform.services.dynformfield.Integer.JDynFormFieldInteger;
11
import org.gvsig.tools.dynobject.DynObject;
12
import org.gvsig.tools.dynobject.DynObjectValueItem;
13
import org.gvsig.tools.service.spi.ServiceManager;
14
import org.slf4j.Logger;
15
import org.slf4j.LoggerFactory;
16

  
17
public class JDynFormFieldSelectPoint extends JDynFormFieldInteger {
18

  
19
    private static final Logger logger = LoggerFactory.getLogger(JDynFormFieldSelectPoint.class);
20
    private boolean listenerAdded = false;
21
    private SelectPointPanel pointPanel = null;
22

  
23
    public JDynFormFieldSelectPoint(DynObject parameters, ServiceManager serviceManager) {
24
        super(parameters, serviceManager);
25
    }
26

  
27
    public void initComponent() {
28
        this.pointPanel = new SelectPointPanel();
29
        if ( this.getDefinition().isReadOnly() ) {
30
            this.pointPanel.setEnabled(false);
31
        }
32
        this.contents = this.pointPanel;
33
    }
34

  
35
    public void setValue(Object value) {
36
        if( !this.listenerAdded ) {
37
            this.addListenerToFile();
38
        }
39
//        super.setValue(value);
40
    }
41

  
42
    public void addListenerToFile() {
43
        if( this.listenerAdded ) {
44
            return;
45
        }
46
        JDynForm form = this.getForm();
47
        JDynFormField fileField = form.getField("file");
48
        if( fileField == null ) {
49
            return;
50
        }
51
        fileField.addListener(new JDynFormFieldListener() {
52

  
53
            public void fieldEnter(JDynFormField field) {
54
            }
55

  
56
            public void fieldExit(JDynFormField field) {
57
            }
58

  
59
            public void fieldChanged(JDynFormField field) {
60
                doChangeFile(field);
61
            }
62

  
63
            public void message(JDynFormField field, String message) {
64
            }
65
        });
66
        this.listenerAdded = true;
67
        doChangeFile(fileField);
68
    }
69

  
70
    protected DynObjectValueItem[] getAvailableFields(File file) {
71
        try {
72
            return null;
73
        } catch (Exception ex) {
74
            logger.warn("Can't retrieve the columns.", ex);
75
            return null;
76
        }
77
    }
78

  
79
    public void doChangeFile(JDynFormField field) {
80
        DynObjectValueItem[] availableValues = this.getAvailableFields(
81
                (File) field.getValue()
82
        );
83
//        DefaultComboBoxModel model = (DefaultComboBoxModel) this.getJComboBox().getModel();
84
//        model.removeAllElements();
85
//        if ( availableValues != null ) {
86
//            for ( int i = 0; i < availableValues.length; i++ ) {
87
//                model.addElement(availableValues[i]);
88
//            }
89
//        }
90
//        if ( model.getSize() > 0 ) {
91
//            this.getJComboBox().setSelectedIndex(0);
92
//        }
93
    }
94

  
95
}
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/java/org/gvsig/jexcel/SelectPointPanel.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.jexcel;
8

  
9
import java.awt.Dimension;
10
import java.awt.GridBagConstraints;
11
import java.awt.GridBagLayout;
12
import javax.swing.Box;
13
import javax.swing.DefaultComboBoxModel;
14
import javax.swing.JComboBox;
15
import javax.swing.JLabel;
16
import org.jdesktop.layout.GroupLayout;
17

  
18
/**
19
 *
20
 * @author usuario
21
 */
22
public class SelectPointPanel extends javax.swing.JPanel {
23

  
24
    /**
25
     * Creates new form SelectPointPanel
26
     */
27
    public SelectPointPanel() {
28
        initComponents();
29
    }
30

  
31
    /**
32
     * This method is called from within the constructor to
33
     * initialize the form.
34
     * WARNING: Do NOT modify this code. The content of this method is
35
     * always regenerated by the Form Editor.
36
     */
37
    @SuppressWarnings("unchecked")
38
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
39
    private void initComponents() {
40
        GridBagConstraints gridBagConstraints;
41

  
42
        lblX = new JLabel();
43
        jLabel2 = new JLabel();
44
        lblZ = new JLabel();
45
        cboX = new JComboBox();
46
        cboY = new JComboBox();
47
        cboZ = new JComboBox();
48
        filler1 = new Box.Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(0, 32767));
49

  
50
        GridBagLayout layout = new GridBagLayout();
51
        layout.columnWidths = new int[] {0, 4, 0, 4, 0, 4, 0};
52
        layout.rowHeights = new int[] {0, 4, 0, 4, 0, 4, 0, 4, 0};
53
        setLayout(layout);
54

  
55
        lblX.setText("X:");
56
        gridBagConstraints = new GridBagConstraints();
57
        gridBagConstraints.gridx = 2;
58
        gridBagConstraints.gridy = 2;
59
        gridBagConstraints.anchor = GridBagConstraints.LINE_START;
60
        add(lblX, gridBagConstraints);
61

  
62
        jLabel2.setText("Y:");
63
        gridBagConstraints = new GridBagConstraints();
64
        gridBagConstraints.gridx = 2;
65
        gridBagConstraints.gridy = 4;
66
        gridBagConstraints.anchor = GridBagConstraints.LINE_START;
67
        add(jLabel2, gridBagConstraints);
68

  
69
        lblZ.setText("Z:");
70
        gridBagConstraints = new GridBagConstraints();
71
        gridBagConstraints.gridx = 2;
72
        gridBagConstraints.gridy = 6;
73
        gridBagConstraints.anchor = GridBagConstraints.LINE_START;
74
        add(lblZ, gridBagConstraints);
75

  
76
        gridBagConstraints = new GridBagConstraints();
77
        gridBagConstraints.gridx = 4;
78
        gridBagConstraints.gridy = 2;
79
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
80
        gridBagConstraints.weightx = 0.1;
81
        add(cboX, gridBagConstraints);
82

  
83
        gridBagConstraints = new GridBagConstraints();
84
        gridBagConstraints.gridx = 4;
85
        gridBagConstraints.gridy = 4;
86
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
87
        gridBagConstraints.weightx = 0.1;
88
        add(cboY, gridBagConstraints);
89

  
90
        gridBagConstraints = new GridBagConstraints();
91
        gridBagConstraints.gridx = 4;
92
        gridBagConstraints.gridy = 6;
93
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
94
        gridBagConstraints.weightx = 0.1;
95
        add(cboZ, gridBagConstraints);
96
        gridBagConstraints = new GridBagConstraints();
97
        gridBagConstraints.gridx = 0;
98
        gridBagConstraints.gridy = 8;
99
        gridBagConstraints.weighty = 0.1;
100
        add(filler1, gridBagConstraints);
101
    }// </editor-fold>//GEN-END:initComponents
102

  
103

  
104
    // Variables declaration - do not modify//GEN-BEGIN:variables
105
    public JComboBox cboX;
106
    public JComboBox cboY;
107
    public JComboBox cboZ;
108
    public Box.Filler filler1;
109
    public JLabel jLabel2;
110
    public JLabel lblX;
111
    public JLabel lblZ;
112
    // End of variables declaration//GEN-END:variables
113
}
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/userdoc/user_manual.rst
1
jexcel plugin user manual v0.2
2
=================================
3

  
4
.. contents:: Contents
5

  
6
Introduction
7
--------------
8

  
9
The jexcel plugin add to gvSIG the following functionalities:
10

  
11
* Load Microsoft Excel spreadsheets as tables.
12
* Load Microsoft Excel spreadsheets as layers.
13
* Export a table to Excel spreadsheet format.
14

  
15
It supports the following Excel spreadsheet versions:
16

  
17
* Reading: Excel 95, 97, 2000, XP, and 2003 workbooks.
18
* Writing: Excel 2000
19

  
20
Installation
21
--------------
22

  
23
(TODO)
24

  
25
Loading a table from an Excel spreadsheet
26
------------------------------------------
27

  
28
From the gvSIG project manager, select the “Table” document (1) and click on “New” (2). In the “New table” window the “File” tab is selected by default. Click on “Add” (3) and find the Excel file that contains the spreadsheet you want to load (4). Finally click on “Open” (5).
29

  
30
|
31

  
32
.. image:: Selection_088.png
33
  :align: center
34
  :scale: 150
35

  
36
Once the file appears in the “New table” window, click on “Properties” (7) in order to set up the following parameters:
37

  
38
Data source properties
39
+++++++++++++++++++++++
40

  
41
General tab (default)
42
^^^^^^^^^^^^^^^^^^^^^^
43

  
44
 - **File:** File path.
45
 - **Locale:** Localization configuration. This determines the characters used as decimal and thousands separators.
46
 - **Sheet to load:** Position within the spreadsheet file of the sheet that we want to load. First position corresponds with the number "0", second with "1" and so on.
47
 - **Use first row as header:** In case this option is checked it will consider the first row values as the field names.
48
 - **CRS:** In case the sheet contains coordinates this parameter sets its Coordinate Reference System.
49
 - **Point (X,Y,Z):** Position of the fields that contains the coordinates. It should be provided at least two fields for X,Y coordinates.
50

  
51
|
52

  
53
.. image:: Selection_091.png
54
  :align: center
55
  :scale: 150
56

  
57
Advanced tab
58
^^^^^^^^^^^^^^
59

  
60
 - **ProviderName:** The provider name (internal use).
61
 - **Header:** In case the sheet doesn't have a header we can define it here. We have to type the name of the fields separated by a comma.
62
 - **Field types:** The is useful if we want to force the program to load the table with a specific field types. 
63
 - **Automatic types detection:** This options is checked by default. It tryes to figure out what the field types are. 
64
 - **Ignore errors:** This option forces the program to load the table even in case it finds erros.
65

  
66
|
67

  
68
.. image:: Selection_090.png
69
  :align: center
70
  :scale: 150
71

  
72
Once all the needed parameters have been set up click on “Accept” and finally on “Ok”. If everything worked fine the table should appear.
73

  
74
|
75

  
76
.. image:: Selection_092.png
77
  :align: center
78
  :scale: 150
79

  
80
Loading a layer from an Excel Spreadsheet
81
------------------------------------------
82

  
83
From the gvSIG project manager, select the “View” document (1) and click on “New” (2). In the “Add layer” window the “File” tab is selected by default. Click on “Add” (4) and find the Excel file that contains the spreadsheet you want to load (5). Finally click on “Open” (6).
84

  
85
|
86

  
87
.. image:: Selection_095.png
88
  :align: center
89
  :scale: 150
90

  
91
Once the file appears in the “Add layer” window, click on “Properties” (7) in order to set up the following parameters:
92

  
93
Data source properties
94
+++++++++++++++++++++++
95

  
96
General tab (default)
97
^^^^^^^^^^^^^^^^^^^^^^
98

  
99
 - **File:** File path.
100
 - **Locale:** Localization configuration. This determines the characters used as decimal and thousands separators.
101
 - **Sheet to load:** Position within the spreadsheet file of the sheet that we want to load. First position corresponds with the number "0", second with "1" and so on.
102
 - **Use first row as header:** In case this option is checked it will consider the first row values as the field names.
103
 - **CRS:** In case the sheet contains coordinates this parameter sets its Coordinate Reference System.
104
 - **Point (X,Y,Z):** Position of the fields that contains the coordinates. It should be provided at least two fields for X,Y coordinates.
105

  
106
|
107

  
108
.. image:: Selection_096.png
109
  :align: center
110
  :scale: 150
111

  
112
Advanced tab
113
^^^^^^^^^^^^^^
114

  
115
 - **ProviderName:** The provider name (internal use).
116
 - **Header:** In case the sheet doesn't have a header we can define it here. We have to type the name of the fields separated by a comma.
117
 - **Field types:** The is useful if we want to force the program to load the table with a specific field types. 
118
 - **Automatic types detection:** This options is checked by default. It tryes to figure out what the field types are. 
119
 - **Ignore errors:** This option forces the program to load the table even in case it finds erros.
120

  
121
|
122

  
123
.. image:: Selection_097.png
124
  :align: center
125
  :scale: 150
126

  
127
Once all the needed parameters have been set up click on “Accept” and finally on “Ok”. If everything worked fine the layer should appear in the view.
128

  
129
|
130

  
131
.. image:: Selection_098.png
132
  :align: center
133
  :scale: 150
134

  
135
Exporting a table to Excel spreadsheet format
136
----------------------------------------------
137

  
138
(TODO)
org.gvsig.jexcel/tags/org.gvsig.jexcel-1.0.11/org.gvsig.jexcel.app/org.gvsig.jexcel.app.mainplugin/src/main/resources-plugin/test1.txt
1
>>> from  jxl import Workbook
2
>>> Workbook.getWorkbook
3
<java function getWorkbook 1>
4
>>> from java.io import File
5
>>> f=File("/home/usuario/datos/geodata/tables/torrent_4-es-excel2003.xls")
6
>>> f.exists()
7
1
8
>>> w=Workbook.getWorkbook(f)
9
>>> dir(w)
10
['XCTRecords', 'addInFunctionNames', 'buttonPropertySet', 'class', 'close', 'compoundFile', 'containsMacros', 'countryRecord', 'createWorkbook', 'drawingGroup', 'equals', 'externalSheetRecord', 'findByName', 'findCellByName', 'fonts', 'formattingRecords', 'getAddInFunctionNames', 'getButtonPropertySet', 'getCell', 'getClass', 'getCompoundFile', 'getCountryRecord', 'getDrawingGroup', 'getExternalSheetIndex', 'getExternalSheetName', 'getExternalSheetRecord', 'getFonts', 'getFormattingRecords', 'getIndex', 'getLastExternalSheetIndex', 'getLastExternalSheetName', 'getMsoDrawingGroupRecord', 'getName', 'getNameIndex', 'getNameRecords', 'getNumberOfSheets', 'getRangeNames', 'getReadSheet', 'getSettings', 'getSheet', 'getSheetNames', 'getSheets', 'getSupbookRecords', 'getVersion', 'getWorkbook', 'getWorkbookBof', 'getXCTRecords', 'hashCode', 'isProtected', 'msoDrawingGroupRecord', 'nameRecords', 'notify', 'notifyAll', 'numberOfSheets', 'protected', 'rangeNames', 'settings', 'sheetNames', 'sheets', 'supbookRecords', 'toString', 'wait', 'workbookBof']
11
>>> w.numberOfSheets
12
1
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff