svn-gvsig-desktop / 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 / DefaultDataSwingManager.java @ 45827
History | View | Annotate | Download (20.9 KB)
1 |
/* gvSIG. Desktop Geographic Information System.
|
---|---|
2 |
*
|
3 |
* Copyright ? 2007-2014 gvSIG Association
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18 |
* MA 02110-1301, USA.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.fmap.dal.swing.impl; |
24 |
|
25 |
import java.util.Collection; |
26 |
import java.util.Collections; |
27 |
import java.util.HashMap; |
28 |
import java.util.LinkedHashMap; |
29 |
import java.util.List; |
30 |
import java.util.Map; |
31 |
import java.util.function.Predicate; |
32 |
import javax.swing.AbstractButton; |
33 |
import javax.swing.Action; |
34 |
import javax.swing.JButton; |
35 |
import javax.swing.JComboBox; |
36 |
import javax.swing.JList; |
37 |
import javax.swing.JTextField; |
38 |
import javax.swing.text.JTextComponent; |
39 |
import org.apache.commons.lang3.StringUtils; |
40 |
import org.gvsig.expressionevaluator.swing.Element; |
41 |
import org.gvsig.expressionevaluator.swing.ExpressionBuilderConfig; |
42 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingLocator; |
43 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingManager; |
44 |
import org.gvsig.expressionevaluator.swing.ExpressionPickerController; |
45 |
import org.gvsig.expressionevaluator.swing.JExpressionBuilder; |
46 |
import org.gvsig.featureform.swing.CreateJFeatureFormException; |
47 |
import org.gvsig.featureform.swing.FeaturesFormContext; |
48 |
import org.gvsig.featureform.swing.JFeatureForm; |
49 |
import org.gvsig.featureform.swing.JFeatureReferencesForm; |
50 |
|
51 |
import org.gvsig.featureform.swing.JFeaturesForm; |
52 |
import org.gvsig.featureform.swing.impl.DefaultFeaturesFormContext; |
53 |
import org.gvsig.featureform.swing.impl.DefaultJFeatureForm; |
54 |
import org.gvsig.featureform.swing.impl.DefaultJFeatureReferencesForm; |
55 |
import org.gvsig.featureform.swing.impl.DefaultJFeaturesForm; |
56 |
import org.gvsig.fmap.dal.DALLocator; |
57 |
import org.gvsig.fmap.dal.DataManager; |
58 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
59 |
import org.gvsig.fmap.dal.exception.DataException; |
60 |
import org.gvsig.fmap.dal.expressionevaluator.FeatureSymbolTable; |
61 |
import org.gvsig.fmap.dal.feature.Feature; |
62 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
63 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
64 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
65 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
66 |
import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory; |
67 |
import org.gvsig.fmap.dal.feature.FeatureType; |
68 |
import org.gvsig.fmap.dal.feature.FeatureTypeDefinitionsManager; |
69 |
import org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper; |
70 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
71 |
import org.gvsig.fmap.dal.swing.DataSwingManager; |
72 |
import org.gvsig.fmap.dal.swing.FeatureTableModel; |
73 |
import org.gvsig.fmap.dal.swing.JFeatureTable; |
74 |
import org.gvsig.fmap.dal.swing.expressionevaluator.FeatureStoreElement; |
75 |
import org.gvsig.fmap.dal.swing.featuretype.AttributeDescriptorPickerController; |
76 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypeAttributePanel; |
77 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel; |
78 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.DefaultFeatureStoreElement2; |
79 |
import org.gvsig.fmap.dal.swing.impl.featuretable.FeatureTablePanel; |
80 |
import org.gvsig.fmap.dal.swing.impl.featuretable.table.DefaultFeatureTableModel; |
81 |
import org.gvsig.fmap.dal.swing.impl.featuretable.table.EmptyFeatureTableModel; |
82 |
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultAttributeDescriptorPickerController; |
83 |
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultFeatureAttributePanel; |
84 |
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultFeatureTypePanel; |
85 |
import org.gvsig.fmap.dal.swing.impl.jdbc.DefaultJDBCConnectionPanel; |
86 |
import org.gvsig.fmap.dal.swing.impl.searchpanel.DefaultSearchPanel; |
87 |
import org.gvsig.fmap.dal.swing.impl.actions.SelectionAddAction.SelectionAddActionFactory; |
88 |
import org.gvsig.fmap.dal.swing.impl.actions.SelectionFilterAction.SelectionFilterActionFactory; |
89 |
import org.gvsig.fmap.dal.swing.impl.actions.SelectionSetAction.SelectionSetActionFactory; |
90 |
import org.gvsig.fmap.dal.swing.impl.actions.ShowFormAction.ShowFormActionFactory; |
91 |
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionPanel; |
92 |
import org.gvsig.fmap.dal.swing.searchpanel.FeatureStoreSearchPanel; |
93 |
import org.gvsig.tools.dynform.DynFormLocator; |
94 |
import org.gvsig.tools.dynobject.DynClass; |
95 |
import org.gvsig.tools.dynobject.DynStruct; |
96 |
import org.gvsig.tools.exception.BaseException; |
97 |
import org.gvsig.fmap.dal.swing.DALActionFactory; |
98 |
import org.gvsig.fmap.dal.swing.DALActionFactory.DALActionContext; |
99 |
import org.gvsig.fmap.dal.swing.ProjectionPickerController; |
100 |
import org.gvsig.fmap.dal.swing.impl.featuretable.SimpleFeaturesTableModelImpl; |
101 |
import org.gvsig.fmap.dal.swing.impl.featuretype.FeatureAttributeListCellRendererImpl; |
102 |
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultFeatureAttributesSelectionPanel; |
103 |
import org.gvsig.fmap.dal.swing.impl.jdbc.DefaultJDBCConnectionDialog; |
104 |
import org.gvsig.fmap.dal.swing.impl.jdbc.JDBCConnectionPickerController; |
105 |
import org.gvsig.fmap.dal.swing.impl.featurequery.DefaultFeatureQueryOrderPanel; |
106 |
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionDialog; |
107 |
import org.gvsig.fmap.dal.swing.searchpanel.SearchConditionPanel.SearchConditionPanelFactory; |
108 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
109 |
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryOrderPanel; |
110 |
import org.gvsig.fmap.dal.swing.featuretable.SimpleFeaturesTableModel; |
111 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributeListCellRenderer; |
112 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributesSelectionPanel; |
113 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.CheckTableFieldsSuggestionProviderFactory; |
114 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.QuotesForFieldNameSuggestionProviderFactory; |
115 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.StorePointFieldSuggestionProviderFactory; |
116 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.WrongNameFieldSuggestionProviderFactory; |
117 |
import org.gvsig.fmap.dal.swing.searchPostProcess.SearchPostProcessFactory; |
118 |
import org.gvsig.tools.dynform.DynFormDefinition; |
119 |
|
120 |
|
121 |
/**
|
122 |
* @author fdiaz
|
123 |
*
|
124 |
*/
|
125 |
@SuppressWarnings("UseSpecificCatch") |
126 |
public class DefaultDataSwingManager implements DataSwingManager { |
127 |
|
128 |
private final Map<String,DALActionFactory> featureStoreSearchActions; |
129 |
private final Map<String,SearchPostProcessFactory> searchPostProcess; |
130 |
private Map<String,SearchConditionPanelFactory> searchConditionPanelFactories; |
131 |
|
132 |
public DefaultDataSwingManager() {
|
133 |
this.featureStoreSearchActions = new LinkedHashMap<>(); |
134 |
this.registerStoreAction(new SelectionAddActionFactory()); |
135 |
this.registerStoreAction(new SelectionFilterActionFactory()); |
136 |
this.registerStoreAction(new SelectionSetActionFactory()); |
137 |
this.registerStoreAction(new ShowFormActionFactory()); |
138 |
|
139 |
this.searchPostProcess = new HashMap<>(); |
140 |
} |
141 |
|
142 |
@Override
|
143 |
public JFeaturesForm createJFeaturesForm(FeatureStore store) throws CreateJFeatureFormException { |
144 |
try {
|
145 |
FeatureType featureType = store.getDefaultFeatureType(); |
146 |
|
147 |
DefaultJFeaturesForm form = new DefaultJFeaturesForm();
|
148 |
form.bind(store, featureType2DynClass(store, featureType), null);
|
149 |
return form;
|
150 |
|
151 |
} catch (Exception ex) { |
152 |
throw new CreateJFeatureFormException(ex); |
153 |
} |
154 |
} |
155 |
|
156 |
@Override
|
157 |
public JFeaturesForm createJFeaturesForm(FeatureStore store, FeatureQuery query) throws CreateJFeatureFormException { |
158 |
try {
|
159 |
FeatureType featureType = store.getDefaultFeatureType(); |
160 |
|
161 |
DefaultJFeaturesForm form = new DefaultJFeaturesForm();
|
162 |
form.bind(store, featureType2DynClass(store, featureType), query); |
163 |
return form;
|
164 |
|
165 |
} catch (Exception ex) { |
166 |
throw new CreateJFeatureFormException(ex); |
167 |
} |
168 |
} |
169 |
|
170 |
public DynClass featureType2DynClass(FeatureStore store, FeatureType type) {
|
171 |
FeatureTypeDefinitionsManager featureTypeDefinitionsManager = DALLocator.getFeatureTypeDefinitionsManager(); |
172 |
if( featureTypeDefinitionsManager.contains(store,type) ) {
|
173 |
// Force reload next call to get.
|
174 |
featureTypeDefinitionsManager.remove(store,type); |
175 |
} |
176 |
DynClass dynClass = featureTypeDefinitionsManager.get(store,type); |
177 |
// Force reload next call to get.
|
178 |
DynFormLocator.getDynFormManager().removeDefinition(dynClass.getName()); |
179 |
return dynClass;
|
180 |
} |
181 |
|
182 |
@Override
|
183 |
public JDBCConnectionPanel createJDBCConnectionPanel() {
|
184 |
JDBCConnectionPanel x = new DefaultJDBCConnectionPanel();
|
185 |
return x;
|
186 |
} |
187 |
|
188 |
@Override
|
189 |
public JDBCConnectionDialog createJDBCConectionDialog() {
|
190 |
JDBCConnectionDialog x = new DefaultJDBCConnectionDialog();
|
191 |
return x;
|
192 |
} |
193 |
|
194 |
@Override
|
195 |
public void configureExpressionBuilder(ExpressionBuilderConfig builder, FeatureStore store) { |
196 |
DataManager dataManager = DALLocator.getDataManager(); |
197 |
ExpressionEvaluatorSwingManager swingManager = ExpressionEvaluatorSwingLocator.getManager(); |
198 |
FeatureSymbolTable featureSymbolTable = dataManager.createFeatureSymbolTable(); |
199 |
|
200 |
FeatureStoreProviderFactory storeFactory = (FeatureStoreProviderFactory) store.getProviderFactory(); |
201 |
Feature sampleFeature = store.getSampleFeature(); |
202 |
builder.setAllowedFunctions(storeFactory.allowFunction()); |
203 |
if( sampleFeature!=null ) { |
204 |
featureSymbolTable.setFeature(sampleFeature); |
205 |
builder.setPreviewSymbolTable(featureSymbolTable.createParent()); |
206 |
} |
207 |
builder.addSymbolTable(featureSymbolTable); |
208 |
FeatureStoreElement storeElement = new DefaultFeatureStoreElement2(store);
|
209 |
builder.addElement(storeElement); |
210 |
if( store.getProviderFactory().hasSQLSupport()==DataStoreProviderFactory.YES ) {
|
211 |
builder.getPreferences().setSQLCompatible(true);
|
212 |
} |
213 |
builder.addSuggestionFactory(new StorePointFieldSuggestionProviderFactory(store));
|
214 |
builder.addSuggestionFactory(new QuotesForFieldNameSuggestionProviderFactory(store));
|
215 |
builder.addSuggestionFactory(new WrongNameFieldSuggestionProviderFactory(store));
|
216 |
builder.addSuggestionFactory(new CheckTableFieldsSuggestionProviderFactory(store));
|
217 |
} |
218 |
|
219 |
@Override
|
220 |
public JExpressionBuilder createQueryFilterExpresion(FeatureStore store) {
|
221 |
return this.createJExpressionBuilder(store); |
222 |
} |
223 |
|
224 |
@Override
|
225 |
public JExpressionBuilder createJExpressionBuilder(final FeatureStore store) { |
226 |
ExpressionEvaluatorSwingManager expressionSwingManager = ExpressionEvaluatorSwingLocator.getManager(); |
227 |
final JExpressionBuilder builder = expressionSwingManager.createJExpressionBuilder();
|
228 |
this.configureExpressionBuilder(builder, store);
|
229 |
builder.expandElement( |
230 |
(Element t) -> t!=null && StringUtils.equals(t.getName(),store.getName()) |
231 |
); |
232 |
return builder;
|
233 |
} |
234 |
|
235 |
@Override
|
236 |
public ExpressionPickerController createExpressionPickerController(FeatureStore store, JTextComponent text, JButton button, JButton bookmarks, JButton history) { |
237 |
ExpressionEvaluatorSwingManager expressionSwingManager = ExpressionEvaluatorSwingLocator.getManager(); |
238 |
ExpressionPickerController builder = expressionSwingManager.createExpressionPickerController(text, button, bookmarks, history); |
239 |
this.configureExpressionBuilder(builder, store);
|
240 |
return builder;
|
241 |
} |
242 |
|
243 |
@Override
|
244 |
public JFeatureForm createJFeatureForm(FeatureStore store) throws CreateJFeatureFormException { |
245 |
JFeatureForm form = new DefaultJFeatureForm();
|
246 |
form.setStore(store); |
247 |
return form;
|
248 |
} |
249 |
|
250 |
@Override
|
251 |
public JFeatureReferencesForm createJFeatureReferencesForm(FeatureStore store, List<FeatureReference> references) throws CreateJFeatureFormException { |
252 |
JFeatureReferencesForm form = new DefaultJFeatureReferencesForm();
|
253 |
form.bind(store, references); |
254 |
return form;
|
255 |
} |
256 |
|
257 |
@Override
|
258 |
public JFeatureForm createJFeatureForm(Feature feature) throws CreateJFeatureFormException { |
259 |
JFeatureForm form = new DefaultJFeatureForm();
|
260 |
form.setFeature(feature); |
261 |
return form;
|
262 |
} |
263 |
|
264 |
@Override
|
265 |
public JFeatureForm createJFeatureForm(DynFormDefinition definicion) throws CreateJFeatureFormException { |
266 |
JFeatureForm form = new DefaultJFeatureForm();
|
267 |
form.setDefinition(definicion); |
268 |
return form;
|
269 |
} |
270 |
|
271 |
@Override
|
272 |
public JFeatureTable createJFeatureTable(FeatureTableModel model) {
|
273 |
return this.createJFeatureTable(model, true); |
274 |
} |
275 |
|
276 |
@Override
|
277 |
public JFeatureTable createJFeatureTable(FeatureTableModel model, boolean isDoubleBuffered) { |
278 |
return new FeatureTablePanel(model, isDoubleBuffered); |
279 |
} |
280 |
|
281 |
@Override
|
282 |
public FeatureTableModel createEmptyFeatureTableModel(DynStruct struct) {
|
283 |
return new EmptyFeatureTableModel(struct); |
284 |
} |
285 |
|
286 |
@Override
|
287 |
public FeatureTableModel createFeatureTableModel(FeatureStore featureStore,
|
288 |
FeatureQuery featureQuery) { |
289 |
try {
|
290 |
FeaturePagingHelper pager = DALLocator.getDataManager().createFeaturePagingHelper( |
291 |
featureStore, featureQuery, |
292 |
FeaturePagingHelper.DEFAULT_PAGE_SIZE |
293 |
); |
294 |
return this.createFeatureTableModel(pager); |
295 |
} catch (BaseException ex) {
|
296 |
throw new RuntimeException("Can't create a FeatureTableModel.", ex); |
297 |
} |
298 |
} |
299 |
|
300 |
@Override
|
301 |
public FeatureTableModel createFeatureTableModel(FeaturePagingHelper featurePager) {
|
302 |
return new DefaultFeatureTableModel(featurePager); |
303 |
} |
304 |
|
305 |
@Override
|
306 |
public ProjectionPickerController createProjectionPickerController(
|
307 |
JTextField txtProjection,
|
308 |
JButton btnSelectProjection
|
309 |
) { |
310 |
ProjectionPickerControllerImpl picker = new ProjectionPickerControllerImpl(txtProjection, btnSelectProjection);
|
311 |
return picker;
|
312 |
} |
313 |
|
314 |
@Override
|
315 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo) { |
316 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(combo, null); |
317 |
return controller;
|
318 |
} |
319 |
|
320 |
@Override
|
321 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JList list) { |
322 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(list, null); |
323 |
return controller;
|
324 |
} |
325 |
|
326 |
@Override
|
327 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo, Predicate<FeatureAttributeDescriptor> filter) { |
328 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(combo, filter);
|
329 |
return controller;
|
330 |
} |
331 |
|
332 |
@Override
|
333 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JList list, Predicate<FeatureAttributeDescriptor> filter) { |
334 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(list, filter);
|
335 |
return controller;
|
336 |
} |
337 |
|
338 |
@Override
|
339 |
public FeatureTypePanel createFeatureTypePanel() {
|
340 |
FeatureTypePanel panel = new DefaultFeatureTypePanel();
|
341 |
return panel;
|
342 |
} |
343 |
|
344 |
@Override
|
345 |
public FeatureTypeAttributePanel createFeatureTypeAttributePanel() {
|
346 |
FeatureTypeAttributePanel panel = new DefaultFeatureAttributePanel();
|
347 |
return panel;
|
348 |
} |
349 |
|
350 |
@Override
|
351 |
public FeatureStoreElement createFeatureStoreElement() {
|
352 |
FeatureStoreElement e = new DefaultFeatureStoreElement2(null); |
353 |
return e;
|
354 |
} |
355 |
|
356 |
@Override
|
357 |
public FeatureStoreElement createFeatureStoreElement(FeatureStore store) {
|
358 |
FeatureStoreElement e = new DefaultFeatureStoreElement2(store);
|
359 |
return e;
|
360 |
} |
361 |
|
362 |
@Override
|
363 |
public ExpressionPickerController createExpressionPickerController(FeatureStore store, JTextComponent text, JButton button) { |
364 |
FeatureSymbolTable previewSymbolTable = DALLocator.getManager().createFeatureSymbolTable(); |
365 |
previewSymbolTable.setFeature(store.getSampleFeature()); |
366 |
|
367 |
ExpressionPickerController controller = ExpressionEvaluatorSwingLocator.getManager().createExpressionPickerController(text, button); |
368 |
controller.addElement(this.createFeatureStoreElement(store));
|
369 |
controller.setPreviewSymbolTable(previewSymbolTable); |
370 |
|
371 |
return controller;
|
372 |
} |
373 |
|
374 |
|
375 |
@Override
|
376 |
public FeatureStoreSearchPanel createFeatureStoreSearchPanel(FeatureStore store) {
|
377 |
DefaultSearchPanel e = new DefaultSearchPanel(store);
|
378 |
return e;
|
379 |
} |
380 |
|
381 |
@Override
|
382 |
public final void registerStoreAction(DALActionFactory action) { |
383 |
this.featureStoreSearchActions.put(action.getName().toLowerCase(), action);
|
384 |
} |
385 |
|
386 |
@Override
|
387 |
public Collection<DALActionFactory> getStoreActions() { |
388 |
return Collections.unmodifiableCollection(this.featureStoreSearchActions.values()); |
389 |
} |
390 |
|
391 |
@Override
|
392 |
public DALActionFactory getStoreAction(String name) { |
393 |
DALActionFactory action = this.featureStoreSearchActions.get(name.toLowerCase());
|
394 |
return action;
|
395 |
} |
396 |
|
397 |
@Override
|
398 |
public void setStoreAction(AbstractButton component, String name, boolean preserveLabel, DALActionContext context) { |
399 |
DALActionFactory factory = this.getStoreAction(name);
|
400 |
Action action = factory.createAction(context);
|
401 |
if( preserveLabel ) {
|
402 |
String s = component.getText();
|
403 |
component.setAction(action); |
404 |
component.setText(s); |
405 |
} else {
|
406 |
component.setAction(action); |
407 |
} |
408 |
} |
409 |
|
410 |
|
411 |
@Override
|
412 |
public PickerController<JDBCServerExplorerParameters> createJDBCConnectionPickerController(
|
413 |
JComboBox cboConnection, JButton btnConnection |
414 |
) { |
415 |
JDBCConnectionPickerController x = new JDBCConnectionPickerController(cboConnection, btnConnection);
|
416 |
return x;
|
417 |
} |
418 |
|
419 |
@Override
|
420 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureStore store) {
|
421 |
try {
|
422 |
SimpleFeaturesTableModelImpl m = new SimpleFeaturesTableModelImpl(store);
|
423 |
return m;
|
424 |
} catch (DataException ex) {
|
425 |
throw new RuntimeException("Can't creatre SimpleFeaturesTableModel.", ex); |
426 |
} |
427 |
} |
428 |
|
429 |
@Override
|
430 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureType featureType, List<String> columnNames, List<Feature> features) { |
431 |
SimpleFeaturesTableModelImpl m = new SimpleFeaturesTableModelImpl(featureType, columnNames, features);
|
432 |
return m;
|
433 |
} |
434 |
|
435 |
@Override
|
436 |
public FeatureAttributeListCellRenderer createDefaultFeatureAttributeListCellRenderer() {
|
437 |
FeatureAttributeListCellRenderer r = new FeatureAttributeListCellRendererImpl();
|
438 |
return r;
|
439 |
} |
440 |
|
441 |
@Override
|
442 |
public FeatureQueryOrderPanel createFeatureStoreOrderPanel() {
|
443 |
DefaultFeatureQueryOrderPanel p = new DefaultFeatureQueryOrderPanel();
|
444 |
return p;
|
445 |
} |
446 |
|
447 |
@Override
|
448 |
public Iterable<SearchConditionPanelFactory> getSearchConditionPanels() { |
449 |
if( this.searchConditionPanelFactories==null ) { |
450 |
return Collections.EMPTY_LIST; |
451 |
} |
452 |
return this.searchConditionPanelFactories.values(); |
453 |
} |
454 |
|
455 |
@Override
|
456 |
public void registerSearchConditionPanel(SearchConditionPanelFactory factory) { |
457 |
if( this.searchConditionPanelFactories==null ) { |
458 |
this.searchConditionPanelFactories = new HashMap<>(); |
459 |
} |
460 |
this.searchConditionPanelFactories.put(factory.getName(), factory);
|
461 |
} |
462 |
|
463 |
@Override
|
464 |
public FeatureAttributesSelectionPanel createFeatureAttributeSelectionPanel() {
|
465 |
FeatureAttributesSelectionPanel p = new DefaultFeatureAttributesSelectionPanel();
|
466 |
return p;
|
467 |
} |
468 |
|
469 |
@Override
|
470 |
public void registerSearchPostProcess(SearchPostProcessFactory process) { |
471 |
this.searchPostProcess.put(process.getName(), process);
|
472 |
} |
473 |
|
474 |
@Override
|
475 |
public Map<String,SearchPostProcessFactory> getSearchPostProcess() { |
476 |
return this.searchPostProcess; |
477 |
} |
478 |
|
479 |
@Override
|
480 |
public SearchPostProcessFactory getSearchPostProcess(String name) { |
481 |
SearchPostProcessFactory process = this.searchPostProcess.get(name);
|
482 |
return process;
|
483 |
} |
484 |
|
485 |
@Override
|
486 |
public FeaturesFormContext createFeaturesFormContext(FeatureStore store) {
|
487 |
DefaultFeaturesFormContext context = new DefaultFeaturesFormContext(store);
|
488 |
return context;
|
489 |
} |
490 |
|
491 |
} |
492 |
|
493 |
|