Revision 7990

View differences:

trunk/libraries/libUI/src/org/gvsig/gui/beans/filterPanel/filterQueryPanel/FilterQueryJPanel.java
1
package org.gvsig.gui.beans.filterPanel.filterQueryPanel;
2

  
3
import java.awt.Dimension;
4
import java.awt.GridBagConstraints;
5
import java.awt.GridBagLayout;
6
import java.io.Serializable;
7

  
8
import javax.swing.JPanel;
9
import javax.swing.JScrollPane;
10

  
11
import org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel;
12

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

  
54
/**
55
 * This class is a version of the graphical interface of "FilterDialog" which was made by Fernando and is in 'appgvSIG' project.
56
 * It's supposed that other classes will extend from this and will add the logic as is in the "FilterDialog" class.
57
 * 
58
 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
59
 */
60
public class FilterQueryJPanel extends AbstractFilterQueryJPanel implements Serializable{
61
	protected int filterJScrollPaneHeight = 100;
62
	protected int filterJScrollPanelWidth = 470;
63
	protected javax.swing.JPanel jPanel5 = null;
64
	protected javax.swing.JButton btnNuevo = null;
65
	protected javax.swing.JButton btnAdd = null;
66
	protected javax.swing.JButton btnFromSet = null;
67

  
68

  
69
	
70
	/**
71
	 * @see AbstractFilterQueryJPanel#AbstractFilterQueryJPanel()
72
	 */
73
	public FilterQueryJPanel() {
74
		super();
75
		this.initialize();
76
	}
77

  
78
	/**
79
	 * @see AbstractFilterQueryJPanel#AbstractFilterQueryJPanel(String)
80
	 */
81
	public FilterQueryJPanel(String _title) {
82
		super(_title);
83
		this.initialize();
84
	}
85

  
86
	/*
87
	 *  (non-Javadoc)
88
	 * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#initialize()
89
	 */
90
	protected void initialize() {
91
		super.initialize();
92
	}
93
	
94
	/*
95
	 *  (FilterQueryJPanel)
96
	 * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getFieldsJPanel()
97
	 */
98
	protected JPanel getFieldsJPanel() {
99
		if (fieldsJPanel == null) {
100
			fieldsJPanel = new javax.swing.JPanel();
101
			fieldsJPanel.setPreferredSize(new java.awt.Dimension(fieldsJPanelWidth, fieldsJPanelHeight));
102
			fieldsJPanel.setLayout(new GridBagLayout());
103
			GridBagConstraints gridBagConstraints = new GridBagConstraints();
104
			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
105
			gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
106
			gridBagConstraints.anchor = GridBagConstraints.NORTH;			
107
			fieldsJPanel.add(getFieldsJLabel(), gridBagConstraints);
108
			gridBagConstraints.anchor = GridBagConstraints.SOUTH;
109
			fieldsJPanel.add(getFieldsJScrollPane(), gridBagConstraints);
110
			
111
		}
112

  
113
		return fieldsJPanel;
114
	}
115

  
116
	/**
117
	 * This method initializes jScrollPane
118
	 *
119
	 * @return javax.swing.JScrollPane
120
	 */
121
	private javax.swing.JScrollPane getFieldsJScrollPane() {
122
		if (fieldsJScrollPane == null) {
123
			fieldsJScrollPane = new javax.swing.JScrollPane();
124
			fieldsJScrollPane.setPreferredSize(new java.awt.Dimension(fieldsAndValuesJScrollPaneWidth, fieldsAndValuesJScrollPaneHeight));
125
			fieldsJScrollPane.setViewportView(getLstCampos());
126
		}
127

  
128
		return fieldsJScrollPane;
129
	}
130

  
131
	/*
132
	 *  (non-Javadoc)
133
	 * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getValuesJPanel()
134
	 */
135
	protected JPanel getValuesJPanel() {
136
		if (valuesJPanel == null) {
137
			valuesJPanel = new javax.swing.JPanel();
138
			valuesJPanel.setPreferredSize(new java.awt.Dimension(valuesJPanelWidth, valuesJPanelHeight));
139
			valuesJPanel.setLayout(new GridBagLayout());
140
			GridBagConstraints gridBagConstraints = new GridBagConstraints();
141
			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
142
			gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
143
			gridBagConstraints.anchor = GridBagConstraints.NORTH;
144
			valuesJPanel.add(getValuesJLabel(), gridBagConstraints);
145
			gridBagConstraints.anchor = GridBagConstraints.SOUTH;
146
			valuesJPanel.add(getValuesJScrollPane(), gridBagConstraints);
147
		}
148

  
149
		return valuesJPanel;
150
	}
151
	
152
	/**
153
	 * This method initializes jScrollPane1
154
	 *
155
	 * @return javax.swing.JScrollPane
156
	 */
157
	private javax.swing.JScrollPane getValuesJScrollPane() {
158
		if (valuesJScrollPane == null) {
159
			valuesJScrollPane = new javax.swing.JScrollPane();
160
			valuesJScrollPane.setPreferredSize(new Dimension(fieldsAndValuesJScrollPaneWidth, fieldsAndValuesJScrollPaneHeight));
161
			valuesJScrollPane.setViewportView(getLstValores());
162
		}
163

  
164
		return valuesJScrollPane;
165
	}
166

  
167
	/*
168
	 *  (non-Javadoc)
169
	 * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getFilterJScrollPane()
170
	 */
171
	protected JScrollPane getFilterJScrollPane() {
172
		if (filterJScrollPane == null) {
173
			filterJScrollPane = new javax.swing.JScrollPane();
174
			filterJScrollPane.setPreferredSize(new java.awt.Dimension(filterJScrollPanelWidth, filterJScrollPaneHeight));
175
			filterJScrollPane.setViewportView(getTxtExpression());
176
			filterJScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
177
		}
178

  
179
		return filterJScrollPane;
180
	}	
181

  
182
	/**
183
	 * This method initializes lstCampos
184
	 *
185
	 * @return javax.swing.JList
186
	 */
187
	private javax.swing.JList getLstCampos() {
188
		if (lstCampos == null) {
189
			lstCampos = new javax.swing.JList();
190
		}
191

  
192
		return lstCampos;
193
	}
194
	
195
	/**
196
	 * This method initializes lstValores
197
	 *
198
	 * @return javax.swing.JList
199
	 */
200
	private javax.swing.JList getLstValores() {
201
		if (lstValores == null) {
202
			lstValores = new javax.swing.JList();
203
		}
204

  
205
		return lstValores;
206
	}
207
	
208
	/**
209
	 * This method initializes txtExpression
210
	 *
211
	 * @return javax.swing.JTextArea
212
	 */
213
	private javax.swing.JTextArea getTxtExpression() {
214
		if (txtExpression == null) {
215
			txtExpression = new javax.swing.JTextArea();
216
			txtExpression.setLineWrap(true);
217
		}
218

  
219
		return txtExpression;
220
	}
221
	
222
	/*
223
	 *  (non-Javadoc)
224
	 * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getBottomJPanel()
225
	 */
226
	protected JPanel getBottomJPanel() {
227
		if (bottomJPanel == null) {
228
			bottomJPanel = new JPanel();
229
			bottomJPanel.setPreferredSize(new Dimension(defaultBottomJPanelWidth, defaultBottomJPanelHeight));
230
			bottomJPanel.add(getJPanel1());
231
		}
232
		
233
		return bottomJPanel;
234
	}
235
	
236
	/*
237
	 *  (non-Javadoc)
238
	 * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getJPanel1()
239
	 */
240
	protected javax.swing.JPanel getJPanel1() {
241
		if (jPanel1 == null) {
242
			jPanel1 = new javax.swing.JPanel();			
243
			jPanel1.add(getFilterJScrollPane(), null);
244
		}
245

  
246
		return jPanel1;
247
	}
248
}
0 249

  

Also available in: Unified diff