Revision 44202 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
DefaultDataSwingManager.java | ||
---|---|---|
38 | 38 |
import org.gvsig.featureform.swing.impl.DefaultJFeaturesForm; |
39 | 39 |
import org.gvsig.fmap.dal.DALLocator; |
40 | 40 |
import org.gvsig.fmap.dal.DataManager; |
41 |
import org.gvsig.fmap.dal.DataStoreProvider; |
|
42 | 41 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
43 | 42 |
import org.gvsig.fmap.dal.exception.DataException; |
44 | 43 |
import org.gvsig.fmap.dal.expressionevaluator.FeatureSymbolTable; |
... | ... | |
82 | 81 |
public JFeaturesForm createJFeaturesForm(FeatureStore store) throws CreateJFeatureFormException { |
83 | 82 |
try { |
84 | 83 |
FeatureType featureType = store.getDefaultFeatureType(); |
85 |
FeatureTypeDefinitionsManager featureTypeDefinitionsManager = DALLocator.getFeatureTypeDefinitionsManager(); |
|
86 |
if( featureTypeDefinitionsManager.contains(store,featureType) ) { |
|
87 |
// Force reload next call to get. |
|
88 |
featureTypeDefinitionsManager.remove(store,featureType); |
|
89 |
} |
|
90 |
DynClass dynClass = featureTypeDefinitionsManager.get(store,featureType); |
|
91 |
DynFormLocator.getDynFormManager().removeDefinition(dynClass.getName()); |
|
92 | 84 |
|
93 | 85 |
DefaultJFeaturesForm form = new DefaultJFeaturesForm(); |
94 |
form.bind(store, dynClass);
|
|
86 |
form.bind(store, featureType2DynClass(store, featureType));
|
|
95 | 87 |
return form; |
96 | 88 |
|
97 | 89 |
} catch (Exception ex) { |
... | ... | |
99 | 91 |
} |
100 | 92 |
} |
101 | 93 |
|
94 |
public DynClass featureType2DynClass(FeatureStore store, FeatureType type) { |
|
95 |
FeatureTypeDefinitionsManager featureTypeDefinitionsManager = DALLocator.getFeatureTypeDefinitionsManager(); |
|
96 |
if( featureTypeDefinitionsManager.contains(store,type) ) { |
|
97 |
// Force reload next call to get. |
|
98 |
featureTypeDefinitionsManager.remove(store,type); |
|
99 |
} |
|
100 |
DynClass dynClass = featureTypeDefinitionsManager.get(store,type); |
|
101 |
// Force reload next call to get. |
|
102 |
DynFormLocator.getDynFormManager().removeDefinition(dynClass.getName()); |
|
103 |
return dynClass; |
|
104 |
} |
|
105 |
|
|
102 | 106 |
@Override |
103 | 107 |
public JDBCConnectionPanel createJDBCConnectionPanel() { |
104 | 108 |
JDBCConnectionPanel x = new DefaultJDBCConnectionPanel(); |
... | ... | |
109 | 113 |
public JExpressionBuilder createQueryFilterExpresion(FeatureStore store) { |
110 | 114 |
DataManager dataManager = DALLocator.getDataManager(); |
111 | 115 |
ExpressionEvaluatorSwingManager swingManager = ExpressionEvaluatorSwingLocator.getManager(); |
116 |
FeatureSymbolTable featureSymbolTable = dataManager.createFeatureSymbolTable(); |
|
112 | 117 |
|
113 | 118 |
Feature sampleFeature = null; |
114 | 119 |
try { |
... | ... | |
120 | 125 |
} |
121 | 126 |
final JExpressionBuilder builder = swingManager.createJExpressionBuilder(); |
122 | 127 |
if( sampleFeature!=null ) { |
123 |
FeatureSymbolTable featureSymbolTable = dataManager.createFeatureSymbolTable(); |
|
124 | 128 |
featureSymbolTable.setFeature(sampleFeature); |
125 | 129 |
builder.setPreviewSymbolTable(featureSymbolTable.createParent()); |
126 | 130 |
} |
131 |
builder.addSymbolTable(featureSymbolTable); |
|
127 | 132 |
builder.addElement(new DefaultFeatureStoreElement(builder, store)); |
128 | 133 |
if( store.getProviderFactory().hasSQLSupport()==DataStoreProviderFactory.YES ) { |
129 | 134 |
builder.setSQLCompatible(true); |
... | ... | |
145 | 150 |
return form; |
146 | 151 |
} |
147 | 152 |
|
153 |
@Override |
|
148 | 154 |
public JFeatureTable createJFeatureTable(FeatureTableModel model) { |
149 | 155 |
return this.createJFeatureTable(model, true); |
150 | 156 |
} |
151 | 157 |
|
158 |
@Override |
|
152 | 159 |
public JFeatureTable createJFeatureTable(FeatureTableModel model, boolean isDoubleBuffered) { |
153 | 160 |
return new FeatureTablePanel(model, isDoubleBuffered); |
154 | 161 |
} |
155 | 162 |
|
163 |
@Override |
|
156 | 164 |
public FeatureTableModel createEmptyFeatureTableModel(DynStruct struct) { |
157 | 165 |
return new EmptyFeatureTableModel(struct); |
158 | 166 |
} |
159 | 167 |
|
168 |
@Override |
|
160 | 169 |
public FeatureTableModel createFeatureTableModel(FeatureStore featureStore, |
161 | 170 |
FeatureQuery featureQuery) { |
162 | 171 |
try { |
... | ... | |
170 | 179 |
} |
171 | 180 |
} |
172 | 181 |
|
182 |
@Override |
|
173 | 183 |
public FeatureTableModel createFeatureTableModel(FeaturePagingHelper featurePager) { |
174 | 184 |
return new DefaultFeatureTableModel(featurePager); |
175 | 185 |
} |
176 | 186 |
|
187 |
@Override |
|
177 | 188 |
public ProjectionPickerController createProjectionPickerController( |
178 | 189 |
JTextField txtProjection, |
179 | 190 |
JButton btnSelectProjection |
... | ... | |
182 | 193 |
return picker; |
183 | 194 |
} |
184 | 195 |
|
196 |
@Override |
|
185 | 197 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo) { |
186 | 198 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(combo, null); |
187 | 199 |
return controller; |
188 | 200 |
} |
189 | 201 |
|
202 |
@Override |
|
190 | 203 |
public AttributeDescriptorPickerController createAttributeDescriptorPickerController(JComboBox combo, Predicate<FeatureAttributeDescriptor> filter) { |
191 | 204 |
AttributeDescriptorPickerController controller = new DefaultAttributeDescriptorPickerController(combo, filter); |
192 | 205 |
return controller; |
193 | 206 |
} |
194 | 207 |
|
208 |
@Override |
|
195 | 209 |
public FeatureTypePanel createFeatureTypePanel() { |
196 | 210 |
FeatureTypePanel panel = new DefaultFeatureTypePanel(); |
197 | 211 |
return panel; |
198 | 212 |
} |
199 | 213 |
|
214 |
@Override |
|
200 | 215 |
public FeatureTypeAttributePanel createFeatureTypeAttributePanel() { |
201 | 216 |
FeatureTypeAttributePanel panel = new DefaultFeatureTypeAttributePanel(); |
202 | 217 |
return panel; |
203 | 218 |
} |
204 | 219 |
|
220 |
@Override |
|
205 | 221 |
public FeatureStoreElement createFeatureStoreElement(ExpressionBuilderConfig configPanel) { |
206 | 222 |
FeatureStoreElement e = new DefaultFeatureStoreElement(configPanel, null); |
207 | 223 |
return e; |
Also available in: Unified diff