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.api / src / main / java / org / gvsig / fmap / dal / swing / DataSwingManager.java @ 47049
History | View | Annotate | Download (11.4 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; |
24 |
|
25 |
import java.awt.Component; |
26 |
import java.util.Collection; |
27 |
import java.util.List; |
28 |
import java.util.Map; |
29 |
import java.util.function.Predicate; |
30 |
import javax.json.JsonObject; |
31 |
import javax.swing.AbstractButton; |
32 |
import javax.swing.Action; |
33 |
import javax.swing.Icon; |
34 |
import javax.swing.JButton; |
35 |
import javax.swing.JComboBox; |
36 |
import javax.swing.JList; |
37 |
import javax.swing.JPanel; |
38 |
import javax.swing.JTextField; |
39 |
import javax.swing.JTree; |
40 |
import javax.swing.text.JTextComponent; |
41 |
import javax.swing.tree.TreeModel; |
42 |
import org.gvsig.expressionevaluator.Expression; |
43 |
import org.gvsig.expressionevaluator.swing.ExpressionBuilderConfig; |
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 |
import org.gvsig.featureform.swing.JFeaturesForm; |
51 |
import org.gvsig.fmap.dal.StoresRepository; |
52 |
import org.gvsig.fmap.dal.feature.Feature; |
53 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
54 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
55 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
56 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
57 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
58 |
import org.gvsig.fmap.dal.feature.FeatureType; |
59 |
import org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper; |
60 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
61 |
import org.gvsig.fmap.dal.swing.DALActionFactory.DALActionContext; |
62 |
import org.gvsig.fmap.dal.swing.expressionevaluator.FeatureStoreElement; |
63 |
import org.gvsig.fmap.dal.swing.featuretype.AttributeDescriptorPickerController; |
64 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypeAttributePanel; |
65 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel; |
66 |
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionPanel; |
67 |
import org.gvsig.fmap.dal.swing.searchpanel.FeatureStoreSearchPanel; |
68 |
import org.gvsig.tools.dynobject.DynStruct; |
69 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
70 |
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionDialog; |
71 |
import org.gvsig.fmap.dal.swing.searchpanel.SearchConditionPanel.SearchConditionPanelFactory; |
72 |
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryOrderPanel; |
73 |
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryPickerController; |
74 |
import org.gvsig.fmap.dal.swing.featuretable.SimpleFeaturesTableModel; |
75 |
import org.gvsig.fmap.dal.swing.featuretype.AttributeDescriptorAndExpressionPickerController; |
76 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributeListCellRenderer; |
77 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributeTableCellRenderer; |
78 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureAttributesSelectionPanel; |
79 |
import org.gvsig.fmap.dal.swing.report.ReportAction; |
80 |
import org.gvsig.fmap.dal.swing.report.ReportActionFactory; |
81 |
import org.gvsig.fmap.dal.swing.report.ReportActionFactory.ReportCustomActionFactory; |
82 |
|
83 |
import org.gvsig.fmap.dal.swing.searchPostProcess.SearchPostProcessFactory; |
84 |
import org.gvsig.fmap.dal.swing.searchpanel.SearchParameters; |
85 |
import org.gvsig.fmap.dal.swing.storesrepository.StoresRepositoryController; |
86 |
import org.gvsig.tools.dynform.DynFormDefinition; |
87 |
|
88 |
|
89 |
/**
|
90 |
* @author fdiaz
|
91 |
*
|
92 |
*/
|
93 |
public interface DataSwingManager { |
94 |
public static final String FEATURE_STORE_EXPRESSION_ELEMENT = "DAL.FeatureStoreExpressionElement"; |
95 |
|
96 |
public JFeaturesForm createJFeaturesForm(FeatureStore store) throws CreateJFeatureFormException; |
97 |
|
98 |
public JFeaturesForm createJFeaturesForm(FeatureStore store, FeatureQuery query) throws CreateJFeatureFormException; |
99 |
|
100 |
public JFeatureForm createJFeatureForm(FeatureStore store) throws CreateJFeatureFormException; |
101 |
|
102 |
public JFeatureReferencesForm createJFeatureReferencesForm(FeatureStore store, List<FeatureReference> references) throws CreateJFeatureFormException; |
103 |
|
104 |
public JFeatureForm createJFeatureForm(DynFormDefinition definicion) throws CreateJFeatureFormException; |
105 |
|
106 |
public JFeatureForm createJFeatureForm(Feature feature) throws CreateJFeatureFormException; |
107 |
|
108 |
public JDBCConnectionPanel createJDBCConnectionPanel();
|
109 |
|
110 |
public JDBCConnectionDialog createJDBCConectionDialog();
|
111 |
|
112 |
public JExpressionBuilder createQueryFilterExpresion(FeatureStore store);
|
113 |
|
114 |
public void configureExpressionBuilder(ExpressionBuilderConfig builder, FeatureStore store); |
115 |
|
116 |
public void resetExpressionBuilder(ExpressionBuilderConfig builder); |
117 |
|
118 |
public void addToExpressionBuilder(ExpressionBuilderConfig builder, FeatureStore store, String name); |
119 |
|
120 |
public void addToExpressionBuilder(ExpressionBuilderConfig builder, FeatureStore store, String name, boolean useHostVariable); |
121 |
|
122 |
public ExpressionPickerController createExpressionPickerController(FeatureStore store, JTextComponent text, JButton button, JButton bookmarks, JButton history); |
123 |
|
124 |
public AttributeDescriptorAndExpressionPickerController createExpressionPickerController(FeatureStore store, JComboBox combo, JButton button, JButton bookmarks, JButton history); |
125 |
|
126 |
public JExpressionBuilder createJExpressionBuilder(final FeatureStore store); |
127 |
|
128 |
public FeatureTableModel createFeatureTableModel(FeatureStore featureStore, FeatureQuery featureQuery);
|
129 |
|
130 |
public FeatureTableModel createFeatureTableModel(FeaturePagingHelper featurePager);
|
131 |
|
132 |
public FeatureTableModel createEmptyFeatureTableModel(DynStruct struct);
|
133 |
|
134 |
public JFeatureTable createJFeatureTable(FeatureTableModel model);
|
135 |
|
136 |
public JFeatureTable createJFeatureTable(FeatureTableModel model, boolean isDoubleBuffered); |
137 |
|
138 |
public ProjectionPickerController createProjectionPickerController(
|
139 |
JTextField txtProjection,
|
140 |
JButton btnSelectProjection
|
141 |
); |
142 |
|
143 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo); |
144 |
|
145 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JList list); |
146 |
|
147 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo, Predicate<FeatureAttributeDescriptor> filter); |
148 |
|
149 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JList list, Predicate<FeatureAttributeDescriptor> filter); |
150 |
|
151 |
public FeatureTypePanel createFeatureTypePanel();
|
152 |
|
153 |
public FeatureTypeAttributePanel createFeatureTypeAttributePanel();
|
154 |
|
155 |
public FeatureStoreElement createFeatureStoreElement();
|
156 |
|
157 |
public FeatureStoreElement createFeatureStoreElement(FeatureStore store);
|
158 |
|
159 |
public ExpressionPickerController createExpressionPickerController(FeatureStore store, JTextComponent text, JButton button); |
160 |
|
161 |
public FeatureStoreSearchPanel createFeatureStoreSearchPanel(FeatureStore store);
|
162 |
|
163 |
public void registerStoreAction(DALActionFactory action); |
164 |
|
165 |
public Collection<DALActionFactory> getStoreActions(); |
166 |
|
167 |
public Collection<DALActionFactory> getApplicableStoreActions(DALActionContext context); |
168 |
|
169 |
public DALActionFactory getStoreAction(String name); |
170 |
|
171 |
public void setStoreAction(AbstractButton component, String name, boolean preserveLabel, DALActionContext context); |
172 |
|
173 |
public PickerController<JDBCServerExplorerParameters> createJDBCConnectionPickerController(
|
174 |
JComboBox cboConnection, JButton btnConnection |
175 |
); |
176 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureStore store);
|
177 |
|
178 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureType featureType, List<String> columnNames, List<Feature> features); |
179 |
|
180 |
public SimpleFeaturesTableModel createSimpleFeaturesTableModel(FeatureStore store, Expression filter); |
181 |
|
182 |
public SimpleFeaturesTableModel createSimpleEditedFeaturesTableModel(FeatureStore store, Expression filter); |
183 |
|
184 |
public SimpleFeaturesTableModel createSimpleSelectedFeaturesTableModel(FeatureStore store, Expression filter); |
185 |
|
186 |
public FeatureAttributeListCellRenderer createDefaultFeatureAttributeListCellRenderer();
|
187 |
|
188 |
public FeatureAttributeTableCellRenderer createDefaultFeatureAttributeTableCellRenderer();
|
189 |
|
190 |
public FeatureQueryOrderPanel createFeatureStoreOrderPanel();
|
191 |
|
192 |
public Iterable<SearchConditionPanelFactory> getSearchConditionPanels(); |
193 |
|
194 |
public void registerSearchConditionPanel(SearchConditionPanelFactory factory); |
195 |
|
196 |
public FeatureAttributesSelectionPanel createFeatureAttributeSelectionPanel();
|
197 |
|
198 |
public void registerSearchPostProcess(SearchPostProcessFactory process); |
199 |
|
200 |
public Map<String,SearchPostProcessFactory> getSearchPostProcess(); |
201 |
|
202 |
public SearchPostProcessFactory getSearchPostProcess(String name); |
203 |
|
204 |
public FeaturesFormContext createFeaturesFormContext(FeatureStore store);
|
205 |
|
206 |
public TreeModel createTreeModel(StoresRepository repository); |
207 |
|
208 |
String getAttributeDescriptorLabel(FeatureAttributeDescriptor attrdesc);
|
209 |
|
210 |
String getAttributeDescriptorLabel(FeatureAttributeDescriptor attrdesc, String tableName); |
211 |
|
212 |
/**
|
213 |
* @return the useLabels
|
214 |
*/
|
215 |
Integer getUseLabels();
|
216 |
|
217 |
/**
|
218 |
* @param useLabels the useLabels to set
|
219 |
*/
|
220 |
void setUseLabels(Integer useLabels); |
221 |
|
222 |
public SearchParameters createFeatureStoreSearchPanelParameters();
|
223 |
|
224 |
public FeatureQueryPickerController createFeatureQueryPickerController(JTextComponent text, JButton button, JButton history, JButton bookmarks); |
225 |
|
226 |
public StoresRepositoryController createStoresRepositoryController(JTree tree); |
227 |
|
228 |
public Icon getStoreGeometryIcon(FeatureStore store); |
229 |
|
230 |
|
231 |
public static final int STOP_EDITING_SAVE = 0; |
232 |
public static final int STOP_EDITING_DISCARD = 1; |
233 |
public static final int STOP_EDITING_CONTINUE = 2; |
234 |
public static final int STOP_EDITING_EXPORT = 3; |
235 |
|
236 |
/**
|
237 |
* Ask user if finish editing.
|
238 |
* return YES_OPTION for finish, CANCEL_OPTION for cancel editing and
|
239 |
* NO_OPTION for continue editing.
|
240 |
*
|
241 |
* @param featureStore
|
242 |
* @return
|
243 |
*/
|
244 |
public int askUserStopEditing(FeatureStore featureStore); |
245 |
|
246 |
public int askUserStopEditing(FeatureStore featureStore, boolean allowContinue); |
247 |
|
248 |
public int askUserStopEditing(Component parent, FeatureStore featureStore, boolean allowContinue); |
249 |
|
250 |
public JPanel createVisualdbModelerPanel(); |
251 |
|
252 |
public void registerReportAction(ReportActionFactory factory); |
253 |
|
254 |
public Collection<ReportActionFactory> getReportActionFactories(); |
255 |
|
256 |
public void registerReportsCustomAction(ReportCustomActionFactory factory, boolean insertSeparator); |
257 |
|
258 |
public ReportActionFactory getReportActionFactory(String name); |
259 |
} |