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 @ 46050
History | View | Annotate | Download (21.1 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.actions.GraphAction.GraphActionFactory; |
114 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.CheckTableFieldsSuggestionProviderFactory; |
115 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.QuotesForFieldNameSuggestionProviderFactory; |
116 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.StorePointFieldSuggestionProviderFactory; |
117 |
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.suggestions.WrongNameFieldSuggestionProviderFactory; |
118 |
import org.gvsig.fmap.dal.swing.searchPostProcess.SearchPostProcessFactory; |
119 |
import org.gvsig.tools.dynform.DynFormDefinition; |
120 |
|
121 |
|
122 |
/**
|
123 |
* @author fdiaz
|
124 |
*
|
125 |
*/
|
126 |
@SuppressWarnings("UseSpecificCatch") |
127 |
public class DefaultDataSwingManager implements DataSwingManager { |
128 |
|
129 |
private final Map<String,DALActionFactory> featureStoreSearchActions; |
130 |
private final Map<String,SearchPostProcessFactory> searchPostProcess; |
131 |
private Map<String,SearchConditionPanelFactory> searchConditionPanelFactories; |
132 |
|
133 |
public DefaultDataSwingManager() {
|
134 |
this.featureStoreSearchActions = new LinkedHashMap<>(); |
135 |
this.registerStoreAction(new SelectionAddActionFactory()); |
136 |
this.registerStoreAction(new SelectionFilterActionFactory()); |
137 |
this.registerStoreAction(new SelectionSetActionFactory()); |
138 |
this.registerStoreAction(new ShowFormActionFactory()); |
139 |
this.registerStoreAction(new GraphActionFactory()); |
140 |
|
141 |
this.searchPostProcess = new HashMap<>(); |
142 |
} |
143 |
|
144 |
@Override
|
145 |
public JFeaturesForm createJFeaturesForm(FeatureStore store) throws CreateJFeatureFormException { |
146 |
try {
|
147 |
FeatureType featureType = store.getDefaultFeatureType(); |
148 |
|
149 |
DefaultJFeaturesForm form = new DefaultJFeaturesForm();
|
150 |
form.bind(store, featureType2DynClass(store, featureType), null);
|
151 |
return form;
|
152 |
|
153 |
} catch (Exception ex) { |
154 |
throw new CreateJFeatureFormException(ex); |
155 |
} |
156 |
} |
157 |
|
158 |
@Override
|
159 |
public JFeaturesForm createJFeaturesForm(FeatureStore store, FeatureQuery query) throws CreateJFeatureFormException { |
160 |
try {
|
161 |
FeatureType featureType = store.getDefaultFeatureType(); |
162 |
|
163 |
DefaultJFeaturesForm form = new DefaultJFeaturesForm();
|
164 |
form.bind(store, featureType2DynClass(store, featureType), query); |
165 |
return form;
|
166 |
|
167 |
} catch (Exception ex) { |
168 |
throw new CreateJFeatureFormException(ex); |
169 |
} |
170 |
} |
171 |
|
172 |
public DynClass featureType2DynClass(FeatureStore store, FeatureType type) {
|
173 |
FeatureTypeDefinitionsManager featureTypeDefinitionsManager = DALLocator.getFeatureTypeDefinitionsManager(); |
174 |
if( featureTypeDefinitionsManager.contains(store,type) ) {
|
175 |
// Force reload next call to get.
|
176 |
featureTypeDefinitionsManager.remove(store,type); |
177 |
} |
178 |
DynClass dynClass = featureTypeDefinitionsManager.get(store,type); |
179 |
// Force reload next call to get.
|
180 |
DynFormLocator.getDynFormManager().removeDefinition(dynClass.getName()); |
181 |
return dynClass;
|
182 |
} |
183 |
|
184 |
@Override
|
185 |
public JDBCConnectionPanel createJDBCConnectionPanel() {
|
186 |
JDBCConnectionPanel x = new DefaultJDBCConnectionPanel();
|
187 |
return x;
|
188 |
} |
189 |
|
190 |
@Override
|
191 |
public JDBCConnectionDialog createJDBCConectionDialog() {
|
192 |
JDBCConnectionDialog x = new DefaultJDBCConnectionDialog();
|
193 |
return x;
|
194 |
} |
195 |
|
196 |
@Override
|
197 |
public void configureExpressionBuilder(ExpressionBuilderConfig builder, FeatureStore store) { |
198 |
DataManager dataManager = DALLocator.getDataManager(); |
199 |
ExpressionEvaluatorSwingManager swingManager = ExpressionEvaluatorSwingLocator.getManager(); |
200 |
FeatureSymbolTable featureSymbolTable = dataManager.createFeatureSymbolTable(); |
201 |
|
202 |
builder.removeAllElements(); |
203 |
FeatureStoreProviderFactory storeFactory = (FeatureStoreProviderFactory) store.getProviderFactory(); |
204 |
Feature sampleFeature = store.getSampleFeature(); |
205 |
builder.setAllowedFunctions(storeFactory.allowFunction()); |
206 |
if( sampleFeature!=null ) { |
207 |
featureSymbolTable.setFeature(sampleFeature); |
208 |
builder.setPreviewSymbolTable(featureSymbolTable.createParent()); |
209 |
} |
210 |
builder.addSymbolTable(featureSymbolTable); |
211 |
FeatureStoreElement storeElement = new DefaultFeatureStoreElement2(store);
|
212 |
builder.addElement(storeElement); |
213 |
if( store.getProviderFactory().hasSQLSupport()==DataStoreProviderFactory.YES ) {
|
214 |
builder.getPreferences().setSQLCompatible(true);
|
215 |
} |
216 |
builder.addSuggestionFactory(new StorePointFieldSuggestionProviderFactory(store));
|
217 |
builder.addSuggestionFactory(new QuotesForFieldNameSuggestionProviderFactory(store));
|
218 |
builder.addSuggestionFactory(new WrongNameFieldSuggestionProviderFactory(store));
|
219 |
builder.addSuggestionFactory(new CheckTableFieldsSuggestionProviderFactory(store));
|
220 |
} |
221 |
|
222 |
@Override
|
223 |
public JExpressionBuilder createQueryFilterExpresion(FeatureStore store) {
|
224 |
return this.createJExpressionBuilder(store); |
225 |
} |
226 |
|
227 |
@Override
|
228 |
public JExpressionBuilder createJExpressionBuilder(final FeatureStore store) { |
229 |
ExpressionEvaluatorSwingManager expressionSwingManager = ExpressionEvaluatorSwingLocator.getManager(); |
230 |
final JExpressionBuilder builder = expressionSwingManager.createJExpressionBuilder();
|
231 |
this.configureExpressionBuilder(builder, store);
|
232 |
builder.expandElement( |
233 |
(Element t) -> t!=null && StringUtils.equals(t.getName(),store.getName()) |
234 |
); |
235 |
return builder;
|
236 |
} |
237 |
|
238 |
@Override
|
239 |
public ExpressionPickerController createExpressionPickerController(FeatureStore store, JTextComponent text, JButton button, JButton bookmarks, JButton history) { |
240 |
ExpressionEvaluatorSwingManager expressionSwingManager = ExpressionEvaluatorSwingLocator.getManager(); |
241 |
ExpressionPickerController builder = expressionSwingManager.createExpressionPickerController(text, button, bookmarks, history); |
242 |
this.configureExpressionBuilder(builder, store);
|
243 |
return builder;
|
244 |
} |
245 |
|
246 |
@Override
|
247 |
public JFeatureForm createJFeatureForm(FeatureStore store) throws CreateJFeatureFormException { |
248 |
JFeatureForm form = new DefaultJFeatureForm();
|
249 |
form.setStore(store); |
250 |
return form;
|
251 |
} |
252 |
|
253 |
@Override
|
254 |
public JFeatureReferencesForm createJFeatureReferencesForm(FeatureStore store, List<FeatureReference> references) throws CreateJFeatureFormException { |
255 |
JFeatureReferencesForm form = new DefaultJFeatureReferencesForm();
|
256 |
form.bind(store, references); |
257 |
return form;
|
258 |
} |
259 |
|
260 |
@Override
|
261 |
public JFeatureForm createJFeatureForm(Feature feature) throws CreateJFeatureFormException { |
262 |
JFeatureForm form = new DefaultJFeatureForm();
|
263 |
form.setFeature(feature); |
264 |
return form;
|
265 |
} |
266 |
|
267 |
@Override
|
268 |
public JFeatureForm createJFeatureForm(DynFormDefinition definicion) throws CreateJFeatureFormException { |
269 |
JFeatureForm form = new DefaultJFeatureForm();
|
270 |
form.setDefinition(definicion); |
271 |
return form;
|
272 |
} |
273 |
|
274 |
@Override
|
275 |
public JFeatureTable createJFeatureTable(FeatureTableModel model) {
|
276 |
return this.createJFeatureTable(model, true); |
277 |
} |
278 |
|
279 |
@Override
|
280 |
public JFeatureTable createJFeatureTable(FeatureTableModel model, boolean isDoubleBuffered) { |
281 |
return new FeatureTablePanel(model, isDoubleBuffered); |
282 |
} |
283 |
|
284 |
@Override
|
285 |
public FeatureTableModel createEmptyFeatureTableModel(DynStruct struct) {
|
286 |
return new EmptyFeatureTableModel(struct); |
287 |
} |
288 |
|
289 |
@Override
|
290 |
public FeatureTableModel createFeatureTableModel(FeatureStore featureStore,
|
291 |
FeatureQuery featureQuery) { |
292 |
try {
|
293 |
FeaturePagingHelper pager = DALLocator.getDataManager().createFeaturePagingHelper( |
294 |
featureStore, featureQuery, |
295 |
FeaturePagingHelper.DEFAULT_PAGE_SIZE |
296 |
); |
297 |
return this.createFeatureTableModel(pager); |
298 |
} catch (BaseException ex) {
|
299 |
throw new RuntimeException("Can't create a FeatureTableModel.", ex); |
300 |
} |
301 |
} |
302 |
|
303 |
@Override
|
304 |
public FeatureTableModel createFeatureTableModel(FeaturePagingHelper featurePager) {
|
305 |
return new DefaultFeatureTableModel(featurePager); |
306 |
} |
307 |
|
308 |
@Override
|
309 |
public ProjectionPickerController createProjectionPickerController(
|
310 |
JTextField txtProjection,
|
311 |
JButton btnSelectProjection
|
312 |
) { |
313 |
ProjectionPickerControllerImpl picker = new ProjectionPickerControllerImpl(txtProjection, btnSelectProjection);
|
314 |
return picker;
|
315 |
} |
316 |
|
317 |
@Override
|
318 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo) { |
319 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(combo, null); |
320 |
return controller;
|
321 |
} |
322 |
|
323 |
@Override
|
324 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JList list) { |
325 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(list, null); |
326 |
return controller;
|
327 |
} |
328 |
|
329 |
@Override
|
330 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo, Predicate<FeatureAttributeDescriptor> filter) { |
331 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(combo, filter);
|
332 |
return controller;
|
333 |
} |
334 |
|
335 |
@Override
|
336 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JList list, Predicate<FeatureAttributeDescriptor> filter) { |
337 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(list, filter);
|
338 |
return controller;
|
339 |
} |
340 |
|
341 |
@Override
|
342 |
public FeatureTypePanel createFeatureTypePanel() {
|
343 |
FeatureTypePanel panel = new DefaultFeatureTypePanel();
|
344 |
return panel;
|
345 |
} |
346 |
|
347 |
@Override
|
348 |
public FeatureTypeAttributePanel createFeatureTypeAttributePanel() {
|
349 |
FeatureTypeAttributePanel panel = new DefaultFeatureAttributePanel();
|
350 |
return panel;
|
351 |
} |
352 |
|
353 |
@Override
|
354 |
public FeatureStoreElement createFeatureStoreElement() {
|
355 |
FeatureStoreElement e = new DefaultFeatureStoreElement2(null); |
356 |
return e;
|
357 |
} |
358 |
|
359 |
@Override
|
360 |
public FeatureStoreElement createFeatureStoreElement(FeatureStore store) {
|
361 |
FeatureStoreElement e = new DefaultFeatureStoreElement2(store);
|
362 |
return e;
|
363 |
} |
364 |
|
365 |
@Override
|
366 |
public ExpressionPickerController createExpressionPickerController(FeatureStore store, JTextComponent text, JButton button) { |
367 |
FeatureSymbolTable previewSymbolTable = DALLocator.getManager().createFeatureSymbolTable(); |
368 |
previewSymbolTable.setFeature(store.getSampleFeature()); |
369 |
|
370 |
ExpressionPickerController controller = ExpressionEvaluatorSwingLocator.getManager().createExpressionPickerController(text, button); |
371 |
controller.addElement(this.createFeatureStoreElement(store));
|
372 |
controller.setPreviewSymbolTable(previewSymbolTable); |
373 |
|
374 |
return controller;
|
375 |
} |
376 |
|
377 |
|
378 |
@Override
|
379 |
public FeatureStoreSearchPanel createFeatureStoreSearchPanel(FeatureStore store) {
|
380 |
DefaultSearchPanel e = new DefaultSearchPanel(store);
|
381 |
return e;
|
382 |
} |
383 |
|
384 |
@Override
|
385 |
public final void registerStoreAction(DALActionFactory action) { |
386 |
this.featureStoreSearchActions.put(action.getName().toLowerCase(), action);
|
387 |
} |
388 |
|
389 |
@Override
|
390 |
public Collection<DALActionFactory> getStoreActions() { |
391 |
return Collections.unmodifiableCollection(this.featureStoreSearchActions.values()); |
392 |
} |
393 |
|
394 |
@Override
|
395 |
public DALActionFactory getStoreAction(String name) { |
396 |
DALActionFactory action = this.featureStoreSearchActions.get(name.toLowerCase());
|
397 |
return action;
|
398 |
} |
399 |
|
400 |
@Override
|
401 |
public void setStoreAction(AbstractButton component, String name, boolean preserveLabel, DALActionContext context) { |
402 |
DALActionFactory factory = this.getStoreAction(name);
|
403 |
Action action = factory.createAction(context);
|
404 |
if( preserveLabel ) {
|
405 |
String s = component.getText();
|
406 |
component.setAction(action); |
407 |
component.setText(s); |
408 |
} else {
|
409 |
component.setAction(action); |
410 |
} |
411 |
} |
412 |
|
413 |
|
414 |
@Override
|
415 |
public PickerController<JDBCServerExplorerParameters> createJDBCConnectionPickerController(
|
416 |
JComboBox cboConnection, JButton btnConnection |
417 |
) { |
418 |
JDBCConnectionPickerController x = new JDBCConnectionPickerController(cboConnection, btnConnection);
|
419 |
return x;
|
420 |
} |
421 |
|
422 |
@Override
|
423 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureStore store) {
|
424 |
try {
|
425 |
SimpleFeaturesTableModelImpl m = new SimpleFeaturesTableModelImpl(store);
|
426 |
return m;
|
427 |
} catch (DataException ex) {
|
428 |
throw new RuntimeException("Can't creatre SimpleFeaturesTableModel.", ex); |
429 |
} |
430 |
} |
431 |
|
432 |
@Override
|
433 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureType featureType, List<String> columnNames, List<Feature> features) { |
434 |
SimpleFeaturesTableModelImpl m = new SimpleFeaturesTableModelImpl(featureType, columnNames, features);
|
435 |
return m;
|
436 |
} |
437 |
|
438 |
@Override
|
439 |
public FeatureAttributeListCellRenderer createDefaultFeatureAttributeListCellRenderer() {
|
440 |
FeatureAttributeListCellRenderer r = new FeatureAttributeListCellRendererImpl();
|
441 |
return r;
|
442 |
} |
443 |
|
444 |
@Override
|
445 |
public FeatureQueryOrderPanel createFeatureStoreOrderPanel() {
|
446 |
DefaultFeatureQueryOrderPanel p = new DefaultFeatureQueryOrderPanel();
|
447 |
return p;
|
448 |
} |
449 |
|
450 |
@Override
|
451 |
public Iterable<SearchConditionPanelFactory> getSearchConditionPanels() { |
452 |
if( this.searchConditionPanelFactories==null ) { |
453 |
return Collections.EMPTY_LIST; |
454 |
} |
455 |
return this.searchConditionPanelFactories.values(); |
456 |
} |
457 |
|
458 |
@Override
|
459 |
public void registerSearchConditionPanel(SearchConditionPanelFactory factory) { |
460 |
if( this.searchConditionPanelFactories==null ) { |
461 |
this.searchConditionPanelFactories = new HashMap<>(); |
462 |
} |
463 |
this.searchConditionPanelFactories.put(factory.getName(), factory);
|
464 |
} |
465 |
|
466 |
@Override
|
467 |
public FeatureAttributesSelectionPanel createFeatureAttributeSelectionPanel() {
|
468 |
FeatureAttributesSelectionPanel p = new DefaultFeatureAttributesSelectionPanel();
|
469 |
return p;
|
470 |
} |
471 |
|
472 |
@Override
|
473 |
public void registerSearchPostProcess(SearchPostProcessFactory process) { |
474 |
this.searchPostProcess.put(process.getName(), process);
|
475 |
} |
476 |
|
477 |
@Override
|
478 |
public Map<String,SearchPostProcessFactory> getSearchPostProcess() { |
479 |
return this.searchPostProcess; |
480 |
} |
481 |
|
482 |
@Override
|
483 |
public SearchPostProcessFactory getSearchPostProcess(String name) { |
484 |
SearchPostProcessFactory process = this.searchPostProcess.get(name);
|
485 |
return process;
|
486 |
} |
487 |
|
488 |
@Override
|
489 |
public FeaturesFormContext createFeaturesFormContext(FeatureStore store) {
|
490 |
DefaultFeaturesFormContext context = new DefaultFeaturesFormContext(store);
|
491 |
return context;
|
492 |
} |
493 |
|
494 |
} |
495 |
|
496 |
|