Revision 37079

View differences:

tags/v2_0_0_Build_2038/applications/appCatalog/config/ApplicationContextAlone.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
3

  
4
<beans>
5

  
6
  <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
7
    <property name="location"><value>config/TestContext.properties</value></property>
8
  </bean>
9

  
10
  <!-- ========================= GENERAL DEFINITIONS ========================= -->
11

  
12
  <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
13
    <property name="basename"><value>messages</value></property>
14
  </bean>
15

  
16

  
17
  <!-- ========================= PERSISTENCE DEFINITIONS ========================= -->
18

  
19
  <!-- ========================= BUSINESS DEFINITIONS ========================= -->
20

  
21
  <bean id="OIDRegister" class="org.jzkit.a2j.codec.util.OIDRegister">
22
    <constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/a2j.properties</value></constructor-arg>
23
  </bean>
24

  
25
  <!-- conversion rules -->
26
  <bean id="RPNToInternalRules" class="org.jzkit.util.PropsHolder">
27
    <constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalAttrTypes.properties</value></constructor-arg>
28
  </bean>
29

  
30
  <bean id="InternalToType1ConversionRules" class="org.jzkit.z3950.QueryModel.PropsBasedInternalToType1ConversionRules">
31
    <constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalToType1Rules.properties</value></constructor-arg>
32
  </bean>
33

  
34
</beans>
tags/v2_0_0_Build_2038/applications/appCatalog/config/ApplicationContext.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
3
<beans>
4
	<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
5
    	<property name="location"><value>gvSIG/extensiones/es.gva.cit.gvsig.catalogClient/config/TestContext.properties</value></property>
6
	</bean>
7
<!-- ========================= GENERAL DEFINITIONS ========================= -->
8
	<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
9
    	<property name="basename"><value>messages</value></property>
10
	</bean>
11
<!-- ========================= PERSISTENCE DEFINITIONS ========================= -->
12

  
13
<!-- ========================= BUSINESS DEFINITIONS ========================= -->
14

  
15
	<bean id="OIDRegister" class="org.jzkit.a2j.codec.util.OIDRegister">
16
    	<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/a2j.properties</value></constructor-arg>
17
	</bean>
18

  
19
<!-- conversion rules -->
20
	<bean id="RPNToInternalRules" class="org.jzkit.util.PropsHolder">
21
    	<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalAttrTypes.properties</value></constructor-arg>
22
	</bean>
23

  
24
  	<bean id="InternalToType1ConversionRules" class="org.jzkit.z3950.QueryModel.PropsBasedInternalToType1ConversionRules">
25
    	<constructor-arg index="0"><value>/es/gva/cit/catalog/protocols/context/InternalToType1Rules.properties</value></constructor-arg>
26
	</bean>
27
</beans>
tags/v2_0_0_Build_2038/applications/appCatalog/src/org/gvsig/catalog/ui/search/SearchAditionalPropertiesPanel.java
1
package org.gvsig.catalog.ui.search;
2

  
3
import java.util.Properties;
4

  
5
import javax.swing.JPanel;
6

  
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
/* CVS MESSAGES:
48
 *
49
 * $Id: SearchAditionalPropertiesPanel.java 561 2007-07-27 06:49:30 +0000 (Fri, 27 Jul 2007) jpiera $
50
 * $Log$
51
 * Revision 1.1.2.2  2007/07/13 12:00:35  jorpiell
52
 * Add the posibility to add a new panel
53
 *
54
 * Revision 1.1.2.1  2007/07/10 11:18:03  jorpiell
55
 * Added the registers
56
 *
57
 *
58
 */
59
/**
60
 * This class has to be inherited by all the panels
61
 * that extend the search panel
62
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
63
 */
64
public abstract class SearchAditionalPropertiesPanel extends JPanel{
65
	
66
	/**
67
	 * @return the params to do the search
68
	 */
69
	public abstract Properties getProperties();	
70
}
0 71

  
tags/v2_0_0_Build_2038/applications/appCatalog/src/org/gvsig/catalog/ui/search/SearchLowerPanel.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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 2
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
package org.gvsig.catalog.ui.search;
43
import java.awt.GridBagConstraints;
44

  
45
import javax.swing.BorderFactory;
46
import javax.swing.JPanel;
47

  
48
import org.gvsig.catalog.querys.Coordinates;
49
import org.gvsig.catalog.utils.CatalogConstants;
50
import org.gvsig.catalog.utils.Doubles;
51
import org.gvsig.i18n.Messages;
52

  
53

  
54
/**
55
 * 
56
 * 
57
 * 
58
 * @author Jorge Piera Llodra (piera_jor@gva.es)
59
 */
60
public class SearchLowerPanel extends JPanel {
61
	private SearchAditionalPropertiesPanel aditionalPanel = null;
62

  
63
	private javax.swing.JLabel abstractLabel1;
64
	private javax.swing.JPanel abstractPanel1;
65
	private javax.swing.JTextField abstractText1;
66
	private javax.swing.JRadioButton allRButton;
67
	private javax.swing.JRadioButton anyRButton;
68
	private javax.swing.JLabel brxLabel;
69
	private javax.swing.JTextField brxText;
70
	private javax.swing.JLabel bryLabel;
71
	private javax.swing.JTextField bryText;
72
	private javax.swing.JComboBox cathegoryCombo;
73
	private javax.swing.JLabel cathegoryLabel;
74
	private javax.swing.JPanel cathegoryPanel;
75
	private javax.swing.ButtonGroup concordanciaGroupButton;
76
	private javax.swing.JPanel coordinatesPanel;
77
	private javax.swing.JComboBox coordinatesRelationshipCombo;
78
	private javax.swing.JPanel coordinatesRelationshipPanel;
79
	private javax.swing.JRadioButton exactRButton;
80
	private javax.swing.JLabel keywordsLabel;
81
	private javax.swing.JPanel keywordsPanel;
82
	private javax.swing.JTextField keywordsText;
83
	private javax.swing.JPanel leftDatesPanel;
84
	private javax.swing.JPanel leftPanel;
85
	private javax.swing.JPanel lowerCoordinatesPanel;
86
	private javax.swing.JLabel lowerUpdateLabel;
87
	private javax.swing.JTextField loweruperUpdateText;
88
	private javax.swing.JPanel nameOptionsPanel;
89
	private javax.swing.JLabel providerLabel;
90
	private javax.swing.JPanel providerPanel;
91
	private javax.swing.JTextField providerText;
92
	private javax.swing.JPanel rigthDatesPanel;
93
	private javax.swing.JPanel rigthPanel;
94
	private javax.swing.JPanel rigthUpperPanel;
95
	private javax.swing.JComboBox scaleCombo;
96
	private javax.swing.JLabel scaleLabel;
97
	private javax.swing.JPanel scalePanel;
98
	private javax.swing.JLabel ulxLabel;
99
	private javax.swing.JTextField ulxText;
100
	private javax.swing.JLabel ulyLabel;
101
	private javax.swing.JTextField ulyText;
102
	private javax.swing.JPanel updatePanel;
103
	private javax.swing.JLabel uperUpdateLabel;
104
	private javax.swing.JTextField uperUpdateText;
105
	private javax.swing.JPanel upperCoordinatesPanel;
106

  
107
	// End of variables declaration  
108
	public SearchLowerPanel(SearchAditionalPropertiesPanel aditionalPanel) {
109
		initComponents();
110
		initLabels();
111
		initDefaultValues();
112
		addOptionalPanel(aditionalPanel);
113
	}
114

  
115
	/**
116
	 * It adds the aditional panel
117
	 * @param aditionalPanel
118
	 */
119
	private void addOptionalPanel(SearchAditionalPropertiesPanel aditionalPanel){
120
		if (aditionalPanel != null){
121
			this.aditionalPanel = aditionalPanel;
122
			GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
123
			gridBagConstraints.gridx = 0;
124
			gridBagConstraints.gridy = 3;
125
			gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
126
			gridBagConstraints.weightx = 1.0;
127
			rigthUpperPanel.add(aditionalPanel, gridBagConstraints);
128
		}
129
	}
130

  
131
	/** This method is called from within the constructor to
132
	 * initialize the form.
133
	 * WARNING: Do NOT modify this code. The content of this method is
134
	 * always regenerated by the Form Editor.
135
	 */
136
	// <editor-fold defaultstate="collapsed" desc=" Generated Code ">                          
137
	private void initComponents() {
138
		java.awt.GridBagConstraints gridBagConstraints;
139

  
140
		concordanciaGroupButton = new javax.swing.ButtonGroup();
141
		leftPanel = new javax.swing.JPanel();
142
		nameOptionsPanel = new javax.swing.JPanel();
143
		exactRButton = new javax.swing.JRadioButton();
144
		anyRButton = new javax.swing.JRadioButton();
145
		allRButton = new javax.swing.JRadioButton();
146
		abstractPanel1 = new javax.swing.JPanel();
147
		abstractLabel1 = new javax.swing.JLabel();
148
		abstractText1 = new javax.swing.JTextField();
149
		keywordsPanel = new javax.swing.JPanel();
150
		keywordsLabel = new javax.swing.JLabel();
151
		keywordsText = new javax.swing.JTextField();
152
		cathegoryPanel = new javax.swing.JPanel();
153
		cathegoryLabel = new javax.swing.JLabel();
154
		cathegoryCombo = new javax.swing.JComboBox();
155
		scalePanel = new javax.swing.JPanel();
156
		scaleLabel = new javax.swing.JLabel();
157
		scaleCombo = new javax.swing.JComboBox();
158
		providerPanel = new javax.swing.JPanel();
159
		providerLabel = new javax.swing.JLabel();
160
		providerText = new javax.swing.JTextField();
161
		rigthPanel = new javax.swing.JPanel();
162
		rigthUpperPanel = new javax.swing.JPanel();
163
		coordinatesPanel = new javax.swing.JPanel();
164
		upperCoordinatesPanel = new javax.swing.JPanel();
165
		ulxLabel = new javax.swing.JLabel();
166
		ulxText = new javax.swing.JTextField();
167
		ulyLabel = new javax.swing.JLabel();
168
		ulyText = new javax.swing.JTextField();
169
		lowerCoordinatesPanel = new javax.swing.JPanel();
170
		brxLabel = new javax.swing.JLabel();
171
		brxText = new javax.swing.JTextField();
172
		bryLabel = new javax.swing.JLabel();
173
		bryText = new javax.swing.JTextField();
174
		coordinatesRelationshipPanel = new javax.swing.JPanel();
175
		coordinatesRelationshipCombo = new javax.swing.JComboBox();
176
		updatePanel = new javax.swing.JPanel();
177
		rigthDatesPanel = new javax.swing.JPanel();
178
		uperUpdateLabel = new javax.swing.JLabel();
179
		lowerUpdateLabel = new javax.swing.JLabel();
180
		leftDatesPanel = new javax.swing.JPanel();
181
		loweruperUpdateText = new javax.swing.JTextField();
182
		uperUpdateText = new javax.swing.JTextField();
183

  
184
		setLayout(new java.awt.GridLayout(1, 0));
185

  
186
		leftPanel.setLayout(new java.awt.GridBagLayout());
187

  
188
		leftPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 5, 2, 5));
189
		nameOptionsPanel.setLayout(new java.awt.GridBagLayout());
190

  
191
		nameOptionsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("concordancia"));
192
		concordanciaGroupButton.add(exactRButton);
193
		exactRButton.setText("jRadioButton1");
194
		exactRButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
195
		exactRButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
196
		gridBagConstraints = new java.awt.GridBagConstraints();
197
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
198
		gridBagConstraints.weightx = 1.0;
199
		gridBagConstraints.insets = new java.awt.Insets(2, 5, 5, 0);
200
		nameOptionsPanel.add(exactRButton, gridBagConstraints);
201

  
202
		concordanciaGroupButton.add(anyRButton);
203
		anyRButton.setSelected(true);
204
		anyRButton.setText("jRadioButton1");
205
		anyRButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
206
		anyRButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
207
		gridBagConstraints = new java.awt.GridBagConstraints();
208
		gridBagConstraints.gridx = 0;
209
		gridBagConstraints.gridy = 1;
210
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
211
		gridBagConstraints.weightx = 1.0;
212
		gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 0);
213
		nameOptionsPanel.add(anyRButton, gridBagConstraints);
214

  
215
		concordanciaGroupButton.add(allRButton);
216
		allRButton.setText("jRadioButton2");
217
		allRButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
218
		allRButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
219
		gridBagConstraints = new java.awt.GridBagConstraints();
220
		gridBagConstraints.gridx = 0;
221
		gridBagConstraints.gridy = 2;
222
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
223
		gridBagConstraints.weightx = 1.0;
224
		gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 0);
225
		nameOptionsPanel.add(allRButton, gridBagConstraints);
226

  
227
		gridBagConstraints = new java.awt.GridBagConstraints();
228
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
229
		gridBagConstraints.weightx = 1.0;
230
		leftPanel.add(nameOptionsPanel, gridBagConstraints);
231

  
232
		abstractPanel1.setLayout(new java.awt.GridBagLayout());
233

  
234
		abstractLabel1.setText("jLabel1");
235
		gridBagConstraints = new java.awt.GridBagConstraints();
236
		gridBagConstraints.gridx = 0;
237
		gridBagConstraints.gridy = 0;
238
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
239
		gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
240
		gridBagConstraints.weightx = 1.0;
241
		gridBagConstraints.insets = new java.awt.Insets(5, 0, 2, 0);
242
		abstractPanel1.add(abstractLabel1, gridBagConstraints);
243

  
244
		abstractText1.setText("jTextField1");
245
		gridBagConstraints = new java.awt.GridBagConstraints();
246
		gridBagConstraints.gridx = 0;
247
		gridBagConstraints.gridy = 1;
248
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
249
		gridBagConstraints.weightx = 1.0;
250
		gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
251
		abstractPanel1.add(abstractText1, gridBagConstraints);
252

  
253
		gridBagConstraints = new java.awt.GridBagConstraints();
254
		gridBagConstraints.gridx = 0;
255
		gridBagConstraints.gridy = 1;
256
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
257
		gridBagConstraints.weightx = 1.0;
258
		leftPanel.add(abstractPanel1, gridBagConstraints);
259

  
260
		keywordsPanel.setLayout(new java.awt.GridBagLayout());
261

  
262
		keywordsLabel.setText("jLabel1");
263
		gridBagConstraints = new java.awt.GridBagConstraints();
264
		gridBagConstraints.gridx = 0;
265
		gridBagConstraints.gridy = 0;
266
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
267
		gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
268
		gridBagConstraints.weightx = 1.0;
269
		gridBagConstraints.insets = new java.awt.Insets(5, 0, 2, 0);
270
		keywordsPanel.add(keywordsLabel, gridBagConstraints);
271

  
272
		keywordsText.setText("jTextField1");
273
		gridBagConstraints = new java.awt.GridBagConstraints();
274
		gridBagConstraints.gridx = 0;
275
		gridBagConstraints.gridy = 1;
276
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
277
		gridBagConstraints.weightx = 1.0;
278
		gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
279
		keywordsPanel.add(keywordsText, gridBagConstraints);
280

  
281
		gridBagConstraints = new java.awt.GridBagConstraints();
282
		gridBagConstraints.gridx = 0;
283
		gridBagConstraints.gridy = 2;
284
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
285
		gridBagConstraints.weightx = 1.0;
286
		leftPanel.add(keywordsPanel, gridBagConstraints);
287

  
288
		cathegoryPanel.setLayout(new java.awt.GridBagLayout());
289

  
290
		cathegoryLabel.setText("jLabel1");
291
		gridBagConstraints = new java.awt.GridBagConstraints();
292
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
293
		gridBagConstraints.weightx = 1.0;
294
		gridBagConstraints.insets = new java.awt.Insets(5, 0, 2, 0);
295
		cathegoryPanel.add(cathegoryLabel, gridBagConstraints);
296

  
297
		cathegoryCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Art\u00edculo 1", "Art\u00edculo 2", "Art\u00edculo 3", "Art\u00edculo 4" }));
298
		gridBagConstraints = new java.awt.GridBagConstraints();
299
		gridBagConstraints.gridx = 0;
300
		gridBagConstraints.gridy = 1;
301
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
302
		gridBagConstraints.weightx = 1.0;
303
		gridBagConstraints.insets = new java.awt.Insets(2, 0, 5, 0);
304
		cathegoryPanel.add(cathegoryCombo, gridBagConstraints);
305

  
306
		gridBagConstraints = new java.awt.GridBagConstraints();
307
		gridBagConstraints.gridx = 0;
308
		gridBagConstraints.gridy = 3;
309
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
310
		gridBagConstraints.weightx = 1.0;
311
		leftPanel.add(cathegoryPanel, gridBagConstraints);
312

  
313
		scalePanel.setLayout(new java.awt.GridBagLayout());
314

  
315
		scaleLabel.setText("jLabel1");
316
		gridBagConstraints = new java.awt.GridBagConstraints();
317
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
318
		gridBagConstraints.weightx = 1.0;
319
		gridBagConstraints.insets = new java.awt.Insets(5, 0, 2, 0);
320
		scalePanel.add(scaleLabel, gridBagConstraints);
321

  
322
		scaleCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Art\u00edculo 1", "Art\u00edculo 2", "Art\u00edculo 3", "Art\u00edculo 4" }));
323
		gridBagConstraints = new java.awt.GridBagConstraints();
324
		gridBagConstraints.gridx = 0;
325
		gridBagConstraints.gridy = 1;
326
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
327
		gridBagConstraints.weightx = 1.0;
328
		gridBagConstraints.insets = new java.awt.Insets(2, 0, 5, 0);
329
		scalePanel.add(scaleCombo, gridBagConstraints);
330

  
331
		gridBagConstraints = new java.awt.GridBagConstraints();
332
		gridBagConstraints.gridx = 0;
333
		gridBagConstraints.gridy = 4;
334
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
335
		gridBagConstraints.weightx = 1.0;
336
		leftPanel.add(scalePanel, gridBagConstraints);
337

  
338
		providerPanel.setLayout(new java.awt.GridBagLayout());
339

  
340
		providerLabel.setText("jLabel1");
341
		gridBagConstraints = new java.awt.GridBagConstraints();
342
		gridBagConstraints.gridx = 0;
343
		gridBagConstraints.gridy = 0;
344
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
345
		gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
346
		gridBagConstraints.weightx = 1.0;
347
		gridBagConstraints.insets = new java.awt.Insets(5, 0, 2, 0);
348
		providerPanel.add(providerLabel, gridBagConstraints);
349

  
350
		providerText.setText("jTextField1");
351
		gridBagConstraints = new java.awt.GridBagConstraints();
352
		gridBagConstraints.gridx = 0;
353
		gridBagConstraints.gridy = 1;
354
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
355
		gridBagConstraints.weightx = 1.0;
356
		gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
357
		providerPanel.add(providerText, gridBagConstraints);
358

  
359
		gridBagConstraints = new java.awt.GridBagConstraints();
360
		gridBagConstraints.gridx = 0;
361
		gridBagConstraints.gridy = 5;
362
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
363
		gridBagConstraints.weightx = 1.0;
364
		leftPanel.add(providerPanel, gridBagConstraints);
365

  
366
		add(leftPanel);
367

  
368
		rigthPanel.setLayout(new java.awt.BorderLayout());
369

  
370
		rigthPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 3));
371
		rigthUpperPanel.setLayout(new java.awt.GridBagLayout());
372

  
373
		coordinatesPanel.setLayout(new java.awt.GridBagLayout());
374

  
375
		coordinatesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("coordinates"));
376
		upperCoordinatesPanel.setLayout(new java.awt.GridBagLayout());
377

  
378
		upperCoordinatesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("upper"));
379
		ulxLabel.setText("ULX:");
380
		gridBagConstraints = new java.awt.GridBagConstraints();
381
		gridBagConstraints.weightx = 0.15;
382
		upperCoordinatesPanel.add(ulxLabel, gridBagConstraints);
383

  
384
		ulxText.setText("jTextField1");
385
		gridBagConstraints = new java.awt.GridBagConstraints();
386
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
387
		gridBagConstraints.weightx = 0.35;
388
		gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 2);
389
		upperCoordinatesPanel.add(ulxText, gridBagConstraints);
390

  
391
		ulyLabel.setText("ULY:");
392
		gridBagConstraints = new java.awt.GridBagConstraints();
393
		gridBagConstraints.weightx = 0.15;
394
		gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 0);
395
		upperCoordinatesPanel.add(ulyLabel, gridBagConstraints);
396

  
397
		ulyText.setText("jTextField1");
398
		gridBagConstraints = new java.awt.GridBagConstraints();
399
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
400
		gridBagConstraints.weightx = 0.35;
401
		upperCoordinatesPanel.add(ulyText, gridBagConstraints);
402

  
403
		gridBagConstraints = new java.awt.GridBagConstraints();
404
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
405
		gridBagConstraints.weightx = 1.0;
406
		coordinatesPanel.add(upperCoordinatesPanel, gridBagConstraints);
407

  
408
		lowerCoordinatesPanel.setLayout(new java.awt.GridBagLayout());
409

  
410
		lowerCoordinatesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("lower"));
411
		brxLabel.setText("ULX:");
412
		gridBagConstraints = new java.awt.GridBagConstraints();
413
		gridBagConstraints.weightx = 0.15;
414
		lowerCoordinatesPanel.add(brxLabel, gridBagConstraints);
415

  
416
		brxText.setText("jTextField1");
417
		gridBagConstraints = new java.awt.GridBagConstraints();
418
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
419
		gridBagConstraints.weightx = 0.35;
420
		gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 2);
421
		lowerCoordinatesPanel.add(brxText, gridBagConstraints);
422

  
423
		bryLabel.setText("ULY:");
424
		gridBagConstraints = new java.awt.GridBagConstraints();
425
		gridBagConstraints.weightx = 0.15;
426
		gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 0);
427
		lowerCoordinatesPanel.add(bryLabel, gridBagConstraints);
428

  
429
		bryText.setText("jTextField1");
430
		gridBagConstraints = new java.awt.GridBagConstraints();
431
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
432
		gridBagConstraints.weightx = 0.35;
433
		lowerCoordinatesPanel.add(bryText, gridBagConstraints);
434

  
435
		gridBagConstraints = new java.awt.GridBagConstraints();
436
		gridBagConstraints.gridx = 0;
437
		gridBagConstraints.gridy = 1;
438
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
439
		gridBagConstraints.weightx = 1.0;
440
		coordinatesPanel.add(lowerCoordinatesPanel, gridBagConstraints);
441

  
442
		coordinatesRelationshipPanel.setLayout(new java.awt.GridBagLayout());
443

  
444
		coordinatesRelationshipCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Art\u00edculo 1", "Art\u00edculo 2", "Art\u00edculo 3", "Art\u00edculo 4" }));
445
		gridBagConstraints = new java.awt.GridBagConstraints();
446
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
447
		gridBagConstraints.weightx = 1.0;
448
		coordinatesRelationshipPanel.add(coordinatesRelationshipCombo, gridBagConstraints);
449

  
450
		gridBagConstraints = new java.awt.GridBagConstraints();
451
		gridBagConstraints.gridx = 0;
452
		gridBagConstraints.gridy = 2;
453
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
454
		gridBagConstraints.weightx = 1.0;
455
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
456
		coordinatesPanel.add(coordinatesRelationshipPanel, gridBagConstraints);
457

  
458
		gridBagConstraints = new java.awt.GridBagConstraints();
459
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
460
		gridBagConstraints.weightx = 1.0;
461
		rigthUpperPanel.add(coordinatesPanel, gridBagConstraints);
462

  
463
		updatePanel.setLayout(new java.awt.GridBagLayout());
464

  
465
		updatePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("update"));
466
		rigthDatesPanel.setLayout(new java.awt.GridBagLayout());
467

  
468
		uperUpdateLabel.setText("jLabel1");
469
		gridBagConstraints = new java.awt.GridBagConstraints();
470
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
471
		rigthDatesPanel.add(uperUpdateLabel, gridBagConstraints);
472

  
473
		lowerUpdateLabel.setText("jLabel1");
474
		gridBagConstraints = new java.awt.GridBagConstraints();
475
		gridBagConstraints.gridx = 0;
476
		gridBagConstraints.gridy = 1;
477
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
478
		rigthDatesPanel.add(lowerUpdateLabel, gridBagConstraints);
479

  
480
		gridBagConstraints = new java.awt.GridBagConstraints();
481
		gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
482
		updatePanel.add(rigthDatesPanel, gridBagConstraints);
483

  
484
		leftDatesPanel.setLayout(new java.awt.GridBagLayout());
485

  
486
		loweruperUpdateText.setText("jTextField1");
487
		gridBagConstraints = new java.awt.GridBagConstraints();
488
		gridBagConstraints.gridx = 0;
489
		gridBagConstraints.gridy = 1;
490
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
491
		gridBagConstraints.weightx = 1.0;
492
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
493
		leftDatesPanel.add(loweruperUpdateText, gridBagConstraints);
494

  
495
		uperUpdateText.setText("jTextField1");
496
		gridBagConstraints = new java.awt.GridBagConstraints();
497
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
498
		gridBagConstraints.weightx = 1.0;
499
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
500
		leftDatesPanel.add(uperUpdateText, gridBagConstraints);
501

  
502
		gridBagConstraints = new java.awt.GridBagConstraints();
503
		gridBagConstraints.gridx = 1;
504
		gridBagConstraints.gridy = 0;
505
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
506
		gridBagConstraints.weightx = 1.0;
507
		updatePanel.add(leftDatesPanel, gridBagConstraints);
508

  
509
		gridBagConstraints = new java.awt.GridBagConstraints();
510
		gridBagConstraints.gridx = 0;
511
		gridBagConstraints.gridy = 1;
512
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
513
		gridBagConstraints.weightx = 1.0;
514
		rigthUpperPanel.add(updatePanel, gridBagConstraints);
515

  
516
		rigthPanel.add(rigthUpperPanel, java.awt.BorderLayout.NORTH);
517

  
518
		add(rigthPanel);
519
	}// </editor-fold>                
520

  
521
	private void initLabels(){
522
		nameOptionsPanel.setBorder(BorderFactory.createTitledBorder(Messages.getText("concordancia")));
523
		exactRButton.setText(Messages.getText("exactSentence"));
524
		anyRButton.setText(Messages.getText("anyWord"));
525
		allRButton.setText(Messages.getText("allWords"));
526
		abstractLabel1.setText(Messages.getText("abstract"));
527
		keywordsLabel.setText(Messages.getText("keyWords"));
528
		cathegoryLabel.setText(Messages.getText("cathegory"));
529
		scaleLabel.setText(Messages.getText("scale"));
530
		providerLabel.setText(Messages.getText("provider"));
531
		coordinatesPanel.setBorder(BorderFactory.createTitledBorder(Messages.getText("coordinates")));
532
		upperCoordinatesPanel.setBorder(BorderFactory.createTitledBorder(Messages.getText("upperCoordinates")));
533
		lowerCoordinatesPanel.setBorder(BorderFactory.createTitledBorder(Messages.getText("lowerCoordinates")));
534
		ulxLabel.setText(Messages.getText("ULX") + ":");
535
		ulyLabel.setText(Messages.getText("ULY") + ":");
536
		brxLabel.setText(Messages.getText("BRX") + ":");
537
		bryLabel.setText(Messages.getText("BRY") + ":");
538
		uperUpdateLabel.setText(Messages.getText("from") + ":");
539
		lowerUpdateLabel.setText(Messages.getText("to") + ":");
540
	}
541

  
542
	/**
543
	 * Initializae some components with their default values
544
	 */
545
	private void initDefaultValues(){
546
		cathegoryCombo.removeAllItems();
547
		scaleCombo.removeAllItems();
548
		coordinatesRelationshipCombo.removeAllItems();
549
		abstractText1.setText("");
550
		keywordsText.setText("");
551
		providerText.setText("");
552
		ulxText.setText("");
553
		ulyText.setText("");
554
		brxText.setText("");
555
		bryText.setText("");
556
		uperUpdateText.setText("");
557
		loweruperUpdateText.setText("");
558
	}
559

  
560
	/**
561
	 * Add a coordinates relationship
562
	 * @param text
563
	 */
564
	public void addCoordinatesRelationship(String text) {
565
		coordinatesRelationshipCombo.addItem(text);		
566
	}
567

  
568
	/**
569
	 * Adds a new cathegory
570
	 * @param text
571
	 */
572
	public void addCathegory(String text) {
573
		cathegoryCombo.addItem(text);		
574
	}
575

  
576
	/**
577
	 * Adds a new scale
578
	 * @param text
579
	 */
580
	public void addScale(String text) {
581
		scaleCombo.addItem(text);		
582
	}
583

  
584
	/**
585
	 * @return the title option
586
	 */
587
	public String getTitleOption() {
588
		if (exactRButton.isSelected()) {
589
			return CatalogConstants.EXACT_WORDS;
590
		}else if (anyRButton.isSelected()) {
591
			return CatalogConstants.ANY_WORD;
592
		}else if (allRButton.isSelected()) {
593
			return CatalogConstants.ALL_WORDS;
594
		}
595
		return CatalogConstants.ANY_WORD;
596
	}
597

  
598
	/**
599
	 * @return the abstract
600
	 */
601
	public String getAbstract() {
602
		if (abstractText1.getText().equals("")){
603
			return null;
604
		}
605
		return abstractText1.getText();
606
	}
607

  
608
	/**
609
	 * @return the keyword field
610
	 */
611
	public String getKeys() {
612
		if (keywordsText.getText().equals("")){
613
			return null;
614
		}
615
		return keywordsText.getText();
616
	}
617

  
618
	/**
619
	 * @return the cathegory
620
	 */
621
	public String getCathegory() {
622
		String cathegory = (String)cathegoryCombo.getSelectedItem();
623
		if (cathegory.compareTo(Messages.getText("cathegoryAny")) == 0){
624
			return null;
625
		}
626
		return cathegory;
627
	}
628

  
629
	/**
630
	 * @return the scale
631
	 */
632
	public String getScale() {
633
		String scale = (String)scaleCombo.getSelectedItem();
634
		if (scale.compareTo(Messages.getText("scaleAny")) == 0){
635
			return null;
636
		}
637
		return scale;
638
	}
639

  
640
	/**
641
	 * @return the provider
642
	 */
643
	public String getProvider() {
644
		if (providerText.getText().equals("")){
645
			return null;
646
		}
647
		return providerText.getText();
648
	}
649

  
650
	/**
651
	 * @return the date from field
652
	 */
653
	public String getDateFrom() {
654
		if (uperUpdateText.getText().equals("")){
655
			return null;
656
		}
657
		return uperUpdateText.getText();
658
	}
659

  
660
	/**
661
	 * @return the date to field
662
	 */
663
	public String getDateTo() {
664
		if (loweruperUpdateText.getText().equals("")){
665
			return null;
666
		}
667
		return loweruperUpdateText.getText();
668
	}
669

  
670
	/**
671
	 * @return the coordinates
672
	 */
673
	public Coordinates getCoordinates() {        
674
		return new Coordinates(ulxText.getText(), ulyText.getText(),
675
				brxText.getText(), bryText.getText());
676
	} 
677

  
678
	/**
679
	 * @return the coordinates relationship
680
	 */
681
	public String getCoordinatesOption() {        
682
		return (String) coordinatesRelationshipCombo.getSelectedItem();
683
	} 
684

  
685

  
686
	/**
687
	 * Set the coordinates
688
	 * @param coordinates
689
	 * The coordinates to set
690
	 */
691
	public void setCoordinates(Coordinates coordinates) {        
692
		ulxText.setText(Doubles.get5Decimals(coordinates.ulx));
693
		ulyText.setText(Doubles.get5Decimals(coordinates.uly));
694
		brxText.setText(Doubles.get5Decimals(coordinates.brx));
695
		bryText.setText(Doubles.get5Decimals(coordinates.bry));
696
	} 
697

  
698
}
0 699

  
tags/v2_0_0_Build_2038/applications/appCatalog/src/org/gvsig/catalog/ui/search/SearchButtonPanel.java
1
package org.gvsig.catalog.ui.search;
2

  
3
import java.awt.event.ActionListener;
4

  
5
import javax.swing.JPanel;
6

  
7
import org.gvsig.catalog.utils.CatalogConstants;
8
import org.gvsig.i18n.Messages;
9

  
10

  
11
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
12
 *
13
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
14
 *
15
 * This program is free software; you can redistribute it and/or
16
 * modify it under the terms of the GNU General Public License
17
 * as published by the Free Software Foundation; either version 2
18
 * of the License, or (at your option) any later version.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 * GNU General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU General Public License
26
 * along with this program; if not, write to the Free Software
27
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
28
 *
29
 * For more information, contact:
30
 *
31
 *  Generalitat Valenciana
32
 *   Conselleria d'Infraestructures i Transport
33
 *   Av. Blasco Ib??ez, 50
34
 *   46010 VALENCIA
35
 *   SPAIN
36
 *
37
 *      +34 963862235
38
 *   gvsig@gva.es
39
 *      www.gvsig.gva.es
40
 *
41
 *    or
42
 *
43
 *   IVER T.I. S.A
44
 *   Salamanca 50
45
 *   46005 Valencia
46
 *   Spain
47
 *
48
 *   +34 963163400
49
 *   dac@iver.es
50
 */
51
/* CVS MESSAGES:
52
 *
53
 * $Id: SearchButtonPanel.java 561 2007-07-27 06:49:30 +0000 (Fri, 27 Jul 2007) jpiera $
54
 * $Log$
55
 * Revision 1.1.2.4  2007/07/24 09:45:52  jorpiell
56
 * Fix some interface bugs
57
 *
58
 * Revision 1.1.2.3  2007/07/23 07:14:24  jorpiell
59
 * Catalog refactoring
60
 *
61
 * Revision 1.1.2.2  2007/07/13 12:00:35  jorpiell
62
 * Add the posibility to add a new panel
63
 *
64
 * Revision 1.1.2.1  2007/07/11 13:01:50  jorpiell
65
 * Catalog UI updated
66
 *
67
 * Revision 1.1.2.1  2007/07/10 11:18:03  jorpiell
68
 * Added the registers
69
 *
70
 *
71
 */
72
/**
73
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
74
 */
75
public class SearchButtonPanel extends JPanel{
76
	private javax.swing.JButton cancelButton;
77
    private javax.swing.JButton closeButton;
78
    private javax.swing.JButton lastButton;
79
    private javax.swing.JButton searchButton;
80
  
81
    /** Creates new form SearchButtonsPanel */
82
    public SearchButtonPanel() {
83
        initComponents();
84
        initLabels();
85
        initButtonSize();
86
    }
87
    
88
    /** This method is called from within the constructor to
89
     * initialize the form.
90
     * WARNING: Do NOT modify this code. The content of this method is
91
     * always regenerated by the Form Editor.
92
     */
93
    // <editor-fold defaultstate="collapsed" desc=" C?digo Generado  ">                          
94
    private void initComponents() {
95
    	 searchButton = new javax.swing.JButton();
96
         cancelButton = new javax.swing.JButton();
97
         lastButton = new javax.swing.JButton();
98
         closeButton = new javax.swing.JButton();
99

  
100
         setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
101

  
102
         setPreferredSize(new java.awt.Dimension(200, 35));
103
         searchButton.setText("jButton1");
104
         add(searchButton);
105

  
106
         cancelButton.setText("jButton2");
107
         add(cancelButton);
108

  
109
         lastButton.setText("jButton3");
110
         add(lastButton);
111

  
112
         closeButton.setText("jButton4");
113
         add(closeButton);
114
    }// </editor-fold>                    
115
    
116
    /**
117
	 * Rewrite the labels
118
	 */
119
	private void initLabels(){
120
		searchButton.setText(Messages.getText("searchButton"));
121
		closeButton.setText(Messages.getText("close"));
122
		lastButton.setText(Messages.getText("last"));
123
		cancelButton.setText(Messages.getText("cancel"));
124
	}
125
	
126
	/**
127
	 * Initialize the buttons size
128
	 */
129
	private void initButtonSize(){
130
		searchButton.setPreferredSize(CatalogConstants.BUTTON_SIZE);
131
		closeButton.setPreferredSize(CatalogConstants.BUTTON_SIZE);
132
		lastButton.setPreferredSize(CatalogConstants.BUTTON_SIZE);
133
		cancelButton.setPreferredSize(CatalogConstants.BUTTON_SIZE);
134
	}
135
	
136
    /**
137
     * Add a listener for the buttons
138
     * @param listener
139
     * Listener to add
140
     */
141
    public void addActionListener(ActionListener listener){
142
    	cancelButton.addActionListener(listener);
143
    	cancelButton.setActionCommand(CatalogConstants.CANCEL_BUTTON_ACTION_COMMAND);
144
    	closeButton.addActionListener(listener);
145
    	closeButton.setActionCommand(CatalogConstants.CLOSE_BUTTON_ACTION_COMMAND);
146
    	lastButton.addActionListener(listener);
147
    	lastButton.setActionCommand(CatalogConstants.LAST_BUTTON_ACTION_COMMAND);
148
    	searchButton.addActionListener(listener);
149
    	searchButton.setActionCommand(CatalogConstants.SEARCH_BUTTON_ACTION_COMMAND);
150
    }
151
    
152
}
0 153

  
tags/v2_0_0_Build_2038/applications/appCatalog/src/org/gvsig/catalog/ui/search/SearchUpperPanel.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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 2
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
package org.gvsig.catalog.ui.search;
43
import java.awt.Dimension;
44
import java.awt.event.ActionListener;
45

  
46
import javax.swing.Icon;
47
import javax.swing.JPanel;
48

  
49
import org.gvsig.catalog.querys.Search;
50
import org.gvsig.catalog.utils.CatalogConstants;
51
import org.gvsig.i18n.Messages;
52

  
53

  
54
/**
55
 * @author Jorge Piera Llodra (piera_jor@gva.es)
56
 */
57
public class SearchUpperPanel extends JPanel {
58
	private javax.swing.JCheckBox areaCheckBox;
59
	private javax.swing.JPanel areaPanel;
60
	private javax.swing.JPanel leftPanel;
61
	private javax.swing.JPanel leftUpperPanel;
62
	private javax.swing.JButton resizeButton;
63
	private javax.swing.JPanel resizePanel;
64
	private javax.swing.JPanel rigthPanel;
65
	private javax.swing.JPanel rigthUpperPanel;
66
	private javax.swing.JComboBox serviceCombo;
67
	private javax.swing.JLabel serviceLabel;
68
	private javax.swing.JPanel servicePanel;
69
	private javax.swing.JLabel titleLabel;
70
	private javax.swing.JPanel titlePanel;
71
	private javax.swing.JTextField titleText;
72
    
73
	/** Creates new form upperPanel */
74
	public SearchUpperPanel() {
75
		initComponents();
76
		initLabels();
77
		initDefaultValues();
78
	}
79

  
80
	/** This method is called from within the constructor to
81
	 * initialize the form.
82
	 * WARNING: Do NOT modify this code. The content of this method is
83
	 * always regenerated by the Form Editor.
84
	 */
85
	// <editor-fold defaultstate="collapsed" desc=" C?digo Generado  ">                          
86
	private void initComponents() {
87
	    java.awt.GridBagConstraints gridBagConstraints;
88

  
89
        leftPanel = new javax.swing.JPanel();
90
        titlePanel = new javax.swing.JPanel();
91
        titleLabel = new javax.swing.JLabel();
92
        titleText = new javax.swing.JTextField();
93
        servicePanel = new javax.swing.JPanel();
94
        serviceLabel = new javax.swing.JLabel();
95
        serviceCombo = new javax.swing.JComboBox();
96
        rigthPanel = new javax.swing.JPanel();
97
        areaPanel = new javax.swing.JPanel();
98
        areaCheckBox = new javax.swing.JCheckBox();
99
        resizePanel = new javax.swing.JPanel();
100
        resizeButton = new javax.swing.JButton();
101

  
102
        setLayout(new java.awt.GridLayout(1, 0));
103

  
104
        leftPanel.setLayout(new java.awt.GridBagLayout());
105

  
106
        titlePanel.setLayout(new java.awt.GridBagLayout());
107

  
108
        titleLabel.setText("jLabel1");
109
        gridBagConstraints = new java.awt.GridBagConstraints();
110
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
111
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
112
        gridBagConstraints.weightx = 1.0;
113
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 2);
114
        titlePanel.add(titleLabel, gridBagConstraints);
115

  
116
        titleText.setText("jTextField1");
117
        gridBagConstraints = new java.awt.GridBagConstraints();
118
        gridBagConstraints.gridx = 0;
119
        gridBagConstraints.gridy = 1;
120
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
121
        gridBagConstraints.weightx = 1.0;
122
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 2);
123
        titlePanel.add(titleText, gridBagConstraints);
124

  
125
        gridBagConstraints = new java.awt.GridBagConstraints();
126
        gridBagConstraints.gridx = 0;
127
        gridBagConstraints.gridy = 1;
128
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
129
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
130
        gridBagConstraints.weightx = 0.5;
131
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 5);
132
        leftPanel.add(titlePanel, gridBagConstraints);
133

  
134
        servicePanel.setLayout(new java.awt.GridBagLayout());
135

  
136
        serviceLabel.setText("jLabel1");
137
        gridBagConstraints = new java.awt.GridBagConstraints();
138
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
139
        gridBagConstraints.weightx = 1.0;
140
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 2);
141
        servicePanel.add(serviceLabel, gridBagConstraints);
142

  
143
        serviceCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
144
        gridBagConstraints = new java.awt.GridBagConstraints();
145
        gridBagConstraints.gridx = 0;
146
        gridBagConstraints.gridy = 1;
147
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
148
        gridBagConstraints.weightx = 1.0;
149
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 3, 2);
150
        servicePanel.add(serviceCombo, gridBagConstraints);
151

  
152
        gridBagConstraints = new java.awt.GridBagConstraints();
153
        gridBagConstraints.gridx = 0;
154
        gridBagConstraints.gridy = 0;
155
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
156
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
157
        gridBagConstraints.weightx = 0.5;
158
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 5);
159
        leftPanel.add(servicePanel, gridBagConstraints);
160

  
161
        add(leftPanel);
162

  
163
        rigthPanel.setLayout(new java.awt.GridBagLayout());
164

  
165
        rigthPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(72, 1, 1, 1));
166
        rigthPanel.setPreferredSize(new java.awt.Dimension(100, 40));
167
        areaPanel.setLayout(new java.awt.GridBagLayout());
168

  
169
        areaPanel.setPreferredSize(new java.awt.Dimension(200, 20));
170
        areaCheckBox.setText("jCheckBox1");
171
        areaCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
172
        areaCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
173
        gridBagConstraints = new java.awt.GridBagConstraints();
174
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
175
        areaPanel.add(areaCheckBox, gridBagConstraints);
176

  
177
        gridBagConstraints = new java.awt.GridBagConstraints();
178
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
179
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
180
        gridBagConstraints.weightx = 0.3;
181
        rigthPanel.add(areaPanel, gridBagConstraints);
182

  
183
        resizePanel.setLayout(new java.awt.GridBagLayout());
184

  
185
        resizePanel.setMaximumSize(null);
186
        resizePanel.setPreferredSize(new java.awt.Dimension(30, 30));
187
        resizeButton.setPreferredSize(new java.awt.Dimension(25, 25));
188
 
189
        gridBagConstraints = new java.awt.GridBagConstraints();
190
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
191
        gridBagConstraints.weightx = 1.0;
192
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 5);
193
        resizePanel.add(resizeButton, gridBagConstraints);
194

  
195
        gridBagConstraints = new java.awt.GridBagConstraints();
196
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
197
        gridBagConstraints.weightx = 0.7;
198
        rigthPanel.add(resizePanel, gridBagConstraints);
199

  
200
        add(rigthPanel);
201
	}// </editor-fold> 
202

  
203
	/**
204
	 * Initializae some components with their default values
205
	 */
206
	private void initDefaultValues(){
207
		serviceCombo.removeAllItems();
208
	}
209
	
210
	/**
211
	 * Rewrite the labels
212
	 */
213
	private void initLabels(){
214
		serviceLabel.setText(Messages.getText("services"));
215
		titleText.setText("");
216
		titleLabel.setText(Messages.getText("title"));
217
		areaCheckBox.setText(Messages.getText("restrictArea"));
218
		resizeButton.setPreferredSize(new Dimension(CatalogConstants.RESIZE_WINDOW_BUTTON_SIZE, 
219
				CatalogConstants.RESIZE_WINDOW_BUTTON_SIZE));		
220
	}
221

  
222
	/**
223
	 * Add a listener for the buttons
224
	 * @param listener
225
	 * Listener to add
226
	 */
227
	public void addActionListener(ActionListener listener){
228
		resizeButton.addActionListener(listener);
229
		resizeButton.setActionCommand("resize");
230
	}
231

  
232
	/**
233
	 * Sets the down triangle icon (to maximize)
234
	 */
235
	public void setIcon(Icon icon) {        
236
		resizeButton.setIcon(icon);	
237
	} 
238
	
239
	/**
240
	 * @return if the are check is clicked
241
	 */
242
    public boolean isRestrictAreaClicked() {        
243
        return areaCheckBox.isSelected();
244
    } 
245
    
246
    /**
247
     * @return the title 
248
     */
249
    public String getTitle(){
250
    	if (titleText.getText().equals("")){
251
    		return null;
252
    	}
253
    	return titleText.getText();
254
    }
255

  
256
    /**
257
     * Adds a new service
258
     * @param service
259
     */
260
    public void addService(Search service){
261
    	serviceCombo.addItem(service);
262
    }
263
    
264
    /**
265
     * @return the service
266
     */
267
	public Search getService() {
268
		return (Search)serviceCombo.getSelectedItem();
269
	 }
270

  
271
	/**
272
	 * @return if the area checkbox is clicked
273
	 */
274
	public boolean getRestrictAreaClicked() {
275
		return areaCheckBox.isSelected();
276
	}
277
}
0 278

  
tags/v2_0_0_Build_2038/applications/appCatalog/src/org/gvsig/catalog/ui/search/SearchDialog.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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 2
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
package org.gvsig.catalog.ui.search;
43
import java.awt.event.WindowEvent;
44
import java.awt.event.WindowListener;
45

  
46
import javax.swing.JFrame;
47

  
48
import org.gvsig.catalog.CatalogClient;
49

  
50

  
51
/**
52
 * DOCUMENT ME!
53
 * 
54
 * 
55
 * @author luisw
56
 */
57
public class SearchDialog extends JFrame implements WindowListener {
58

  
59
	/**
60
	 * Crea un nuevo SearchDialog.
61
	 * 
62
	 * @param cliente DOCUMENT ME!
63
	 * 
64
	 * @param client 
65
	 * @param isMinimized DOCUMENT ME!
66
	 * @param title DOCUMENT ME!
67
	 */
68
	public  SearchDialog(CatalogClient client, Object serverConnectFrame) {        
69
		super();
70
		initialize(client, serverConnectFrame);
71
	} 
72

  
73
	/**
74
	 * This method initializes jDialog
75
	 * @param client 
76
	 * @param isMinimized DOCUMENT ME!
77
	 * @param title DOCUMENT ME!
78
	 */
79
	private void initialize(CatalogClient client, Object serverConnectFrame) {        
80
		setBounds(0, 0, 525, 165);
81
		this.setTitle("B?squeda de Cat?logo");
82
		setName("search");
83
		SearchDialogPanel panel = new SearchDialogPanel(client,serverConnectFrame);
84
		panel.setParent(this);
85
		getContentPane().add(panel);
86
		setVisible(true);
87
	} 
88
	/* (non-Javadoc)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff