Revision 47264 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/searchpanel/SearchConditionPanelSimplified.java

View differences:

SearchConditionPanelSimplified.java
1 1
package org.gvsig.fmap.dal.swing.impl.searchpanel;
2 2

  
3
import java.awt.GridBagConstraints;
4
import java.awt.GridBagLayout;
5
import java.awt.Insets;
3 6
import java.awt.event.ActionEvent;
4 7
import java.util.ArrayList;
5 8
import java.util.List;
......
8 11
import javax.json.JsonObject;
9 12
import javax.json.JsonObjectBuilder;
10 13
import javax.swing.JButton;
11
import javax.swing.JComboBox;
12 14
import javax.swing.JComponent;
13
import javax.swing.JLabel;
15
import javax.swing.JPanel;
14 16
import javax.swing.event.ChangeListener;
15 17
import org.apache.commons.lang3.StringUtils;
16 18
import org.gvsig.expressionevaluator.Code;
......
113 115
    public SearchConditionPanelSimplified(
114 116
            SearchParameters parameters,
115 117
            FeatureStore store,
118
            JPanel panel,
116 119
            JButton btnAddToAccumulatedFilter,
117 120
            JButton btnRemoveAccumulatedFilter,
118
            JButton btnViewAccumulatedFilter,
119
            JLabel lblField1,
120
            JLabel lblExtraFields1,
121
            JLabel lblRelationalOperator1,
122
            JComboBox cboValue1,
123
            JLabel lblNull1,
124
            JLabel lblLogicalOperators1,
125
            JLabel lblField2,
126
            JLabel lblExtraFields2,
127
            JLabel lblRelationalOperator2,
128
            JComboBox cboValue2,
129
            JLabel lblNull2,
130
            JLabel lblLogicalOperators2,
131
            JLabel lblField3,
132
            JLabel lblExtraFields3,
133
            JLabel lblRelationalOperator3,
134
            JComboBox cboValue3,
135
            JLabel lblNull3,
136
            JLabel lblLogicalOperators3,
137
            JLabel lblField4,
138
            JLabel lblExtraFields4,
139
            JLabel lblRelationalOperator4,
140
            JComboBox cboValue4,
141
            JLabel lblNull4,
142
            JLabel lblLogicalOperators4
121
            JButton btnViewAccumulatedFilter
143 122
    ) {
144 123
        this.changeListenerHelper = ToolsSwingLocator.getToolsSwingManager().createChangeListenerHelper();
145 124
        this.store = store;
125
        
146 126
        this.searchFieldsControllers = new ArrayList<>();
147
        SearchConditionFieldController controller = new SearchConditionFieldController(
148
                parameters,
149
                store,
150
                lblField1,
151
                lblExtraFields1,
152
                lblRelationalOperator1,
153
                cboValue1,
154
                lblNull1,
155
                lblLogicalOperators1
156
        );
157
        this.searchFieldsControllers.add(controller);
158
        controller = new SearchConditionFieldController(
159
                parameters,
160
                store,
161
                lblField2,
162
                lblExtraFields2,
163
                lblRelationalOperator2,
164
                cboValue2,
165
                lblNull2,
166
                lblLogicalOperators2
167
        );
168
        this.searchFieldsControllers.add(controller);
169
        controller = new SearchConditionFieldController(
170
                parameters,
171
                store,
172
                lblField3,
173
                lblExtraFields3,
174
                lblRelationalOperator3,
175
                cboValue3,
176
                lblNull3,
177
                lblLogicalOperators3
178
        );
179
        this.searchFieldsControllers.add(controller);
180
        controller = new SearchConditionFieldController(
181
                parameters,
182
                store,
183
                lblField4,
184
                lblExtraFields4,
185
                lblRelationalOperator4,
186
                cboValue4,
187
                lblNull4,
188
                null
189
        );
190
        this.searchFieldsControllers.add(controller);
127
        int numfields = 4;
128
        GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 2), 0, 0);
129
        c.weightx = 1.0/numfields;
130
        panel.setLayout(new GridBagLayout());
131
        for (int i = 0; i < numfields; i++) {
132
            c.gridx = i;
133
            c.weightx = 1.0;
134
            SearchConditionFieldView view = new SearchConditionFieldView();
135
            panel.add(view,c);
136
            SearchConditionFieldController controller = new SearchConditionFieldController(
137
                    parameters,
138
                    store,
139
                    view
140
            );
141
            this.searchFieldsControllers.add(controller);
142
            if( i==numfields-1 ) {
143
                view.lblLogicalOperators.setVisible(false);
144
            }
145
        }        
191 146
        this.accumulatedFilter = null;
192 147
        this.btnAddAccumulatedFilter = btnAddToAccumulatedFilter;
193 148
        this.btnRemoveAccumulatedFilter = btnRemoveAccumulatedFilter;

Also available in: Unified diff