Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libUI / src / org / gvsig / gui / beans / filterPanel / filterQueryPanel / FilterQueryJPanel.java @ 8237

History | View | Annotate | Download (6.46 KB)

1 7990 ppiqueras
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 8074 ppiqueras
        private static final long serialVersionUID = 6124664376623654716L;
62
63 8034 ppiqueras
        protected int filterJScrollPaneHeight = defaultBottomJPanelHeight - 10;
64
        protected int filterJScrollPanelWidth = defaultBottomJPanelWidth;
65 7990 ppiqueras
        protected javax.swing.JButton btnNuevo = null;
66
        protected javax.swing.JButton btnAdd = null;
67
        protected javax.swing.JButton btnFromSet = null;
68
69
        /**
70
         * @see AbstractFilterQueryJPanel#AbstractFilterQueryJPanel()
71
         */
72
        public FilterQueryJPanel() {
73
                super();
74
                this.initialize();
75
        }
76
77
        /**
78
         * @see AbstractFilterQueryJPanel#AbstractFilterQueryJPanel(String)
79
         */
80
        public FilterQueryJPanel(String _title) {
81
                super(_title);
82
                this.initialize();
83
        }
84
85
        /*
86
         *  (non-Javadoc)
87
         * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#initialize()
88
         */
89
        protected void initialize() {
90
                super.initialize();
91
        }
92
93
        /*
94
         *  (FilterQueryJPanel)
95
         * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getFieldsJPanel()
96
         */
97
        protected JPanel getFieldsJPanel() {
98
                if (fieldsJPanel == null) {
99
                        fieldsJPanel = new javax.swing.JPanel();
100
                        fieldsJPanel.setPreferredSize(new java.awt.Dimension(fieldsJPanelWidth, fieldsJPanelHeight));
101
                        fieldsJPanel.setLayout(new GridBagLayout());
102
                        GridBagConstraints gridBagConstraints = new GridBagConstraints();
103
                        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
104
                        gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
105
                        gridBagConstraints.anchor = GridBagConstraints.NORTH;
106
                        fieldsJPanel.add(getFieldsJLabel(), gridBagConstraints);
107
                        gridBagConstraints.anchor = GridBagConstraints.SOUTH;
108
                        fieldsJPanel.add(getFieldsJScrollPane(), gridBagConstraints);
109
110
                }
111
112
                return fieldsJPanel;
113
        }
114
115
        /**
116
         * This method initializes jScrollPane
117
         *
118
         * @return javax.swing.JScrollPane
119
         */
120
        private javax.swing.JScrollPane getFieldsJScrollPane() {
121
                if (fieldsJScrollPane == null) {
122
                        fieldsJScrollPane = new javax.swing.JScrollPane();
123
                        fieldsJScrollPane.setPreferredSize(new java.awt.Dimension(fieldsAndValuesJScrollPaneWidth, fieldsAndValuesJScrollPaneHeight));
124 8012 ppiqueras
                        fieldsJScrollPane.setViewportView(getFieldsJTree());
125 7990 ppiqueras
                }
126
127
                return fieldsJScrollPane;
128
        }
129
130
        /*
131
         *  (non-Javadoc)
132
         * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getValuesJPanel()
133
         */
134
        protected JPanel getValuesJPanel() {
135
                if (valuesJPanel == null) {
136
                        valuesJPanel = new javax.swing.JPanel();
137
                        valuesJPanel.setPreferredSize(new java.awt.Dimension(valuesJPanelWidth, valuesJPanelHeight));
138
                        valuesJPanel.setLayout(new GridBagLayout());
139
                        GridBagConstraints gridBagConstraints = new GridBagConstraints();
140
                        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
141
                        gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
142
                        gridBagConstraints.anchor = GridBagConstraints.NORTH;
143
                        valuesJPanel.add(getValuesJLabel(), gridBagConstraints);
144
                        gridBagConstraints.anchor = GridBagConstraints.SOUTH;
145
                        valuesJPanel.add(getValuesJScrollPane(), gridBagConstraints);
146
                }
147
148
                return valuesJPanel;
149
        }
150
151
        /**
152
         * This method initializes jScrollPane1
153
         *
154
         * @return javax.swing.JScrollPane
155
         */
156
        private javax.swing.JScrollPane getValuesJScrollPane() {
157
                if (valuesJScrollPane == null) {
158
                        valuesJScrollPane = new javax.swing.JScrollPane();
159
                        valuesJScrollPane.setPreferredSize(new Dimension(fieldsAndValuesJScrollPaneWidth, fieldsAndValuesJScrollPaneHeight));
160 8012 ppiqueras
                        valuesJScrollPane.setViewportView(getValuesJList());
161 7990 ppiqueras
                }
162
163
                return valuesJScrollPane;
164
        }
165
166
        /*
167
         *  (non-Javadoc)
168
         * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getFilterJScrollPane()
169
         */
170
        protected JScrollPane getFilterJScrollPane() {
171
                if (filterJScrollPane == null) {
172
                        filterJScrollPane = new javax.swing.JScrollPane();
173
                        filterJScrollPane.setPreferredSize(new java.awt.Dimension(filterJScrollPanelWidth, filterJScrollPaneHeight));
174
                        filterJScrollPane.setViewportView(getTxtExpression());
175
                        filterJScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
176
                }
177
178
                return filterJScrollPane;
179
        }
180
181
        /**
182
         * This method initializes txtExpression
183
         *
184
         * @return javax.swing.JTextArea
185
         */
186
        private javax.swing.JTextArea getTxtExpression() {
187
                if (txtExpression == null) {
188
                        txtExpression = new javax.swing.JTextArea();
189
                        txtExpression.setLineWrap(true);
190
                }
191
192
                return txtExpression;
193
        }
194
195
        /*
196
         *  (non-Javadoc)
197
         * @see org.gvsig.gui.beans.filterPanel.AbstractFilterQueryJPanel#getBottomJPanel()
198
         */
199
        protected JPanel getBottomJPanel() {
200
                if (bottomJPanel == null) {
201
                        bottomJPanel = new JPanel();
202
                        bottomJPanel.setPreferredSize(new Dimension(defaultBottomJPanelWidth, defaultBottomJPanelHeight));
203 8007 ppiqueras
                        bottomJPanel.add(getFilterJScrollPane(), null);
204 7990 ppiqueras
                }
205
206
                return bottomJPanel;
207
        }
208
}