Statistics
| Revision:

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 / DefaultDALSwingLibrary.java @ 47284

History | View | Annotate | Download (9.92 KB)

1 42104 jjdelcerro
/* gvSIG. Desktop Geographic Information System.
2
 *
3 45537 jolivas
 * Copyright � 2007-2014 gvSIG Association
4 42104 jjdelcerro
 *
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 42112 jjdelcerro
package org.gvsig.fmap.dal.swing.impl;
24 42104 jjdelcerro
25 44531 omartinez
import org.gvsig.featureform.swing.impl.DefaultJFeaturesForm;
26 44128 jjdelcerro
import org.gvsig.featureform.swing.impl.dynformfield.ImageByteArray.JDynFormFieldImageByteArrayFactory;
27
import org.gvsig.featureform.swing.impl.dynformfield.ImageFile.JDynFormFieldImageFileFactory;
28 44253 jjdelcerro
import org.gvsig.featureform.swing.impl.dynformfield.ImageURL.JDynFormFieldImageURLFactory;
29 45781 fdiaz
import org.gvsig.featureform.swing.impl.dynformfield.deprecated.linkedentities.JDynFormFieldFeaturesTableLinkFactory;
30
import org.gvsig.featureform.swing.impl.dynformfield.deprecated.linkedentity.JDynFormFieldFeatureLinkFactory;
31 44262 jjdelcerro
import org.gvsig.featureform.swing.impl.dynformfield.features.JDynFormFieldRelatedFeaturesFactory;
32 44253 jjdelcerro
import org.gvsig.featureform.swing.impl.dynformfield.linkforeingkey.JDynFormFieldForeingKeyFactory;
33 46863 jjdelcerro
import org.gvsig.featureform.swing.impl.dynformfield.dropdownforeingkey.JDynFormFieldDropdownForeingKeyFactory;
34 42775 jjdelcerro
import org.gvsig.fmap.dal.impl.DefaultEditingNotificationManager;
35 42112 jjdelcerro
import org.gvsig.fmap.dal.swing.DALSwingLibrary;
36
import org.gvsig.fmap.dal.swing.DALSwingLocator;
37 43208 jjdelcerro
import org.gvsig.fmap.dal.swing.dataStoreParameters.DataStoreParametersPanelManager;
38 47049 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.actions.CopyFormAction.CopyFormActionFactory;
39
import org.gvsig.fmap.dal.swing.impl.actions.GraphAction.GraphActionFactory;
40
import org.gvsig.fmap.dal.swing.impl.actions.ReportStoreAction.ReportStoreActionFactory;
41
import org.gvsig.fmap.dal.swing.impl.actions.SelectionAddAction.SelectionAddActionFactory;
42
import org.gvsig.fmap.dal.swing.impl.actions.SelectionFilterAction.SelectionFilterActionFactory;
43
import org.gvsig.fmap.dal.swing.impl.actions.SelectionSetAction.SelectionSetActionFactory;
44
import org.gvsig.fmap.dal.swing.impl.actions.ShowFormAction.ShowFormActionFactory;
45 45154 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.actions.ShowFormForOpenStoreParametersAction;
46 43208 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.dataStoreParameters.DataStoreDynObjectParametersPanelFactory;
47
import org.gvsig.fmap.dal.swing.impl.dataStoreParameters.DefaultDataStoreParametersPanelManager;
48 42776 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.dynobjectutils.CreateComboModelFromTable;
49 43983 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.FeatureStoreElementFactory;
50 44713 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.featurequery.DefaultFeatureQueryCalculatedColumnsPanel;
51
import org.gvsig.fmap.dal.swing.impl.featurequery.DefaultFeatureQueryGroupByPanel;
52 44712 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.featurequery.DefaultFeatureQueryOrderPanel;
53 47079 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.featuretable.SimpleFeatureReferencesTableModelImpl;
54
import org.gvsig.fmap.dal.swing.impl.featuretable.SimpleFeaturesTableModelImpl;
55 44713 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultFeatureAttributePanel;
56
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultFeatureAttributeSelectionPanel;
57
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultFeatureAttributesSelectionPanel;
58
import org.gvsig.fmap.dal.swing.impl.featuretype.DefaultFeatureTypePanel;
59 47079 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.featuretype.FeatureTypeEditorFactory;
60 47284 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.jdbc.JDBCConnectionPickerControllerImpl;
61 46569 fdiaz
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.CountAggregateOperation.CountAggregateOperationFactory;
62 45537 jolivas
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.DistinctOn;
63
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.DistinctOnFactory;
64
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.FirstAggregateOperation.FirstAggregateOperationFactory;
65
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.LastAggregateOperation.LastAggregateOperationFactory;
66
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.MaxAggregateOperation.MaxAggregateOperationFactory;
67
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.MinAggregateOperation.MinAggregateOperationFactory;
68 45998 omartinez
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.NullAggregateOperation.NullAggregateOperationFactory;
69 45537 jolivas
import org.gvsig.fmap.dal.swing.impl.searchPostProcess.distinctOn.SumAggregateOperation.SumAggregateOperationFactory;
70 44259 jjdelcerro
import org.gvsig.fmap.dal.swing.impl.searchpanel.DefaultSearchPanel;
71 44829 omartinez
import org.gvsig.fmap.dal.swing.impl.searchpanel.DefaultSearchParameters;
72 42776 jjdelcerro
import org.gvsig.tools.ToolsLocator;
73 46244 jjdelcerro
import org.gvsig.tools.dynform.spi.DynFormSPILibrary;
74 42776 jjdelcerro
import org.gvsig.tools.dynobject.DynObjectManager;
75 42104 jjdelcerro
import org.gvsig.tools.library.AbstractLibrary;
76
import org.gvsig.tools.library.LibraryException;
77 46238 jjdelcerro
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
78 43983 jjdelcerro
import org.slf4j.Logger;
79
import org.slf4j.LoggerFactory;
80 42104 jjdelcerro
81
82
/**
83
 * @author fdiaz
84
 *
85
 */
86 45133 jjdelcerro
@SuppressWarnings("UseSpecificCatch")
87 42112 jjdelcerro
public class DefaultDALSwingLibrary  extends AbstractLibrary{
88 42104 jjdelcerro
89 46863 jjdelcerro
    public static final String LIBRARY_NAME = "DataAccessSwingLibrary";
90
91 43983 jjdelcerro
    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDALSwingLibrary.class);
92 42104 jjdelcerro
93 42775 jjdelcerro
    @Override
94 42104 jjdelcerro
    public void doRegistration() {
95 42112 jjdelcerro
        registerAsImplementationOf(DALSwingLibrary.class);
96 46244 jjdelcerro
        require(DynFormSPILibrary.class);
97 42104 jjdelcerro
    }
98
99
100 42775 jjdelcerro
    @Override
101 42104 jjdelcerro
    protected void doInitialize() throws LibraryException {
102 42112 jjdelcerro
        DALSwingLocator.registerSwingManager(DefaultDataSwingManager.class);
103 42775 jjdelcerro
        DALSwingLocator.registerEditingNotificationManager(DefaultEditingNotificationManager.class);
104 43208 jjdelcerro
105
        DALSwingLocator.registerDataStoreParametersPanelManager(DefaultDataStoreParametersPanelManager.class);
106 42104 jjdelcerro
    }
107
108
109 42775 jjdelcerro
    @Override
110 42104 jjdelcerro
    protected void doPostInitialize() throws LibraryException {
111 43983 jjdelcerro
        try {
112 44253 jjdelcerro
            JDynFormFieldFeatureLinkFactory.selfRegister();
113
            JDynFormFieldFeaturesTableLinkFactory.selfRegister();
114 44259 jjdelcerro
115 44253 jjdelcerro
            JDynFormFieldImageByteArrayFactory.selfRegister();
116
            JDynFormFieldImageFileFactory.selfRegister();
117
            JDynFormFieldImageURLFactory.selfRegister();
118
            JDynFormFieldForeingKeyFactory.selfRegister();
119 46863 jjdelcerro
            JDynFormFieldDropdownForeingKeyFactory.selfRegister();
120 44262 jjdelcerro
            JDynFormFieldRelatedFeaturesFactory.selfRegister();
121 44259 jjdelcerro
122 44713 jjdelcerro
            DefaultFeatureAttributePanel.selfRegister();
123
            DefaultFeatureAttributeSelectionPanel.selfRegister();
124
            DefaultFeatureAttributesSelectionPanel.selfRegister();
125
            DefaultFeatureTypePanel.selfRegister();
126
127
            DefaultFeatureQueryCalculatedColumnsPanel.selfRegister();
128
            DefaultFeatureQueryGroupByPanel.selfRegister();
129 44712 jjdelcerro
            DefaultFeatureQueryOrderPanel.selfRegister();
130 44713 jjdelcerro
131 44259 jjdelcerro
            DefaultSearchPanel.selfRegister();
132 44713 jjdelcerro
133 47284 jjdelcerro
            JDBCConnectionPickerControllerImpl.selfRegister();
134 44531 omartinez
            DefaultJFeaturesForm.selfRegister();
135 44829 omartinez
            DefaultSearchParameters.registerPersistence();
136 44253 jjdelcerro
137 43983 jjdelcerro
            DynObjectManager dynObjectmanager = ToolsLocator.getDynObjectManager();
138
            dynObjectmanager.registerDynMethod(new CreateComboModelFromTable("DAL.createComboModelFromTable", "XXXXXXXXXXXXXXXXXXXX."));
139 44829 omartinez
140 46238 jjdelcerro
141
            DataStoreParametersPanelManager dataStoreParametersPanelManager;
142
            try {
143
                dataStoreParametersPanelManager = DALSwingLocator.getDataStoreParametersPanelManager();
144
                dataStoreParametersPanelManager.registerFactory(new DataStoreDynObjectParametersPanelFactory());
145
            } catch(ReferenceNotRegisteredException ex) {
146
                LOGGER.debug("Can't locate DataStoreParametersPanelManager");
147
            }
148
149 45133 jjdelcerro
150
            DefaultEditingNotificationManager.selfRegister();
151 45602 jjdelcerro
            ProjectionPickerControllerImpl.selfRegister();
152 45154 jjdelcerro
153 45537 jolivas
            DistinctOnFactory.selfRegister();
154
            DistinctOn.registerAggregateOperation(new MinAggregateOperationFactory());
155
            DistinctOn.registerAggregateOperation(new MaxAggregateOperationFactory());
156
            DistinctOn.registerAggregateOperation(new SumAggregateOperationFactory());
157 46569 fdiaz
            DistinctOn.registerAggregateOperation(new CountAggregateOperationFactory());
158 45537 jolivas
            DistinctOn.registerAggregateOperation(new FirstAggregateOperationFactory());
159
            DistinctOn.registerAggregateOperation(new LastAggregateOperationFactory());
160 45998 omartinez
            DistinctOn.registerAggregateOperation(new NullAggregateOperationFactory());
161 45537 jolivas
162 45154 jjdelcerro
            ShowFormForOpenStoreParametersAction.selfRegister();
163 47049 jjdelcerro
164
            SelectionAddActionFactory.selfRegister();
165
            SelectionFilterActionFactory.selfRegister();
166
            SelectionSetActionFactory.selfRegister();
167
            ShowFormActionFactory.selfRegister();
168
            CopyFormActionFactory.selfRegister();
169
            ReportStoreActionFactory.selfRegister();
170
            GraphActionFactory.selfRegister();
171 47079 jjdelcerro
172
            SimpleFeaturesTableModelImpl.selfRegister();
173 47049 jjdelcerro
174 47079 jjdelcerro
            FeatureTypeEditorFactory.selfRegister();
175 43983 jjdelcerro
        } catch(Exception ex) {
176
            LOGGER.warn("Can't register DAL components in DynForms",ex);
177 42775 jjdelcerro
        }
178 43983 jjdelcerro
        try {
179
            FeatureStoreElementFactory.selfRegister();
180
        } catch(Exception ex) {
181
            LOGGER.warn("Can't register DAL components in ExpressionEvaluator",ex);
182
        }
183 42104 jjdelcerro
    }
184
185
}