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