Revision 36036
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/toc/WFSProperties.java | ||
---|---|---|
36 | 36 |
import org.gvsig.app.panelGroup.loaders.PanelGroupLoaderFromExtensionPoint; |
37 | 37 |
import org.gvsig.app.project.documents.view.legend.gui.AbstractThemeManagerPage; |
38 | 38 |
import org.gvsig.fmap.dal.serverexplorer.wfs.WFSServerExplorer; |
39 |
import org.gvsig.fmap.dal.store.wfs.WFSStoreParameters; |
|
40 | 39 |
import org.gvsig.fmap.mapcontext.exceptions.CreateLayerException; |
41 | 40 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
42 | 41 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
... | ... | |
130 | 129 |
|
131 | 130 |
//Refresh the forms with the capabilities information |
132 | 131 |
panel.refreshCapabilitiesInfo(); |
133 |
|
|
134 |
WFSStoreParameters storeParameters = (WFSStoreParameters)((FLyrVect)layer).getDataStore().getParameters(); |
|
135 |
String featureType = storeParameters.getFeatureType(); |
|
136 |
panel.setSelectedFeature(selectedFeatureManager.getFeatureInfo(storeParameters.getFeatureNamespace(), |
|
137 |
storeParameters.getFeatureType()), |
|
138 |
(FLyrVect)layer); |
|
132 |
|
|
133 |
//Set the datastore |
|
134 |
panel.setDataStore(((FLyrVect)layer).getDataStore()); |
|
139 | 135 |
} catch (Exception e) { |
140 | 136 |
LOG.error("Error loading the layer", e); |
141 | 137 |
} |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSSelectFieldsPanel.java | ||
---|---|---|
3 | 3 |
import java.awt.Component; |
4 | 4 |
import java.beans.PropertyChangeEvent; |
5 | 5 |
import java.beans.PropertyChangeListener; |
6 |
import java.util.Vector; |
|
6 |
import java.util.ArrayList; |
|
7 |
import java.util.List; |
|
7 | 8 |
|
8 | 9 |
import javax.swing.JPanel; |
9 | 10 |
import javax.swing.JScrollPane; |
... | ... | |
227 | 228 |
* @see com.iver.cit.gvsig.gui.panels.AbstractWFSPanel#refresh(com.iver.cit.gvsig.fmap.layers.WFSLayerNode) |
228 | 229 |
*/ |
229 | 230 |
public void refresh(WFSSelectedFeature feature){ |
230 |
setFields(feature); |
|
231 |
setSelectedFields(feature); |
|
231 |
setFields(feature); |
|
232 | 232 |
} |
233 | 233 |
|
234 | 234 |
/** |
... | ... | |
251 | 251 |
* |
252 | 252 |
* @param feature node with the fields |
253 | 253 |
*/ |
254 |
public void setSelectedFields(WFSSelectedFeature feature){ |
|
255 |
Vector<Object> selectedFields = feature.getSelectedFields(); |
|
256 |
getFieldsTreeTable().setSelectedFields(selectedFields); |
|
254 |
public void setSelectedFields(String selectedFields){ |
|
255 |
String[] fields = selectedFields.split(","); |
|
256 |
List<Object> listFields = new ArrayList(); |
|
257 |
for (int i=0 ; i<fields.length ; i++){ |
|
258 |
listFields.add(fields[i]); |
|
259 |
} |
|
260 |
getFieldsTreeTable().setSelectedFields(listFields); |
|
257 | 261 |
} |
258 | 262 |
|
259 | 263 |
/** |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/fieldstree/FieldsTreeTable.java | ||
---|---|---|
1 | 1 |
package org.gvsig.wfs.gui.panels.fieldstree; |
2 | 2 |
|
3 | 3 |
import java.util.ArrayList; |
4 |
import java.util.List; |
|
4 | 5 |
import java.util.Vector; |
5 | 6 |
|
6 | 7 |
import javax.swing.JToolTip; |
... | ... | |
205 | 206 |
* Set the selected fields |
206 | 207 |
* @param selectedFields |
207 | 208 |
*/ |
208 |
public void setSelectedFields(Vector selectedFields) {
|
|
209 |
public void setSelectedFields(List selectedFields) {
|
|
209 | 210 |
TreeTableModelAdapter obj = (TreeTableModelAdapter)getModel(); |
210 | 211 |
JTree tree = (JTree)getTree(); |
211 | 212 |
|
... | ... | |
217 | 218 |
WFSFeatureField featureField = ((CheckBoxNode)obj.nodeForRow(i)).getFeatureField(); |
218 | 219 |
for (int j=0 ; j<selectedFields.size() ; j++){ |
219 | 220 |
//If the name is equals |
220 |
if (((WFSFeatureField)selectedFields.get(j)).getName().equals(featureField.getName())){ |
|
221 |
//If the type is equals |
|
222 |
if ((featureField.getDataType() != null) && |
|
223 |
(((WFSFeatureField)selectedFields.get(j)).getDataType() != null) && |
|
224 |
(((WFSFeatureField)selectedFields.get(j)).getDataType().equals(featureField.getDataType())) ){ |
|
225 |
((CheckBoxNode)obj.nodeForRow(i)).setSelected(true); |
|
226 |
} |
|
221 |
if ((selectedFields.get(j)).equals(featureField.getName())){ |
|
222 |
((CheckBoxNode)obj.nodeForRow(i)).setSelected(true); |
|
227 | 223 |
} |
228 | 224 |
} |
229 | 225 |
} |
230 |
} |
|
231 |
|
|
226 |
} |
|
232 | 227 |
} |
233 | 228 |
|
234 | 229 |
/** |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSAreaPanel.java | ||
---|---|---|
43 | 43 |
import org.gvsig.fmap.dal.serverexplorer.wfs.WFSServerExplorer; |
44 | 44 |
import org.gvsig.fmap.geom.Geometry; |
45 | 45 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
46 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
46 | 47 |
import org.gvsig.fmap.geom.GeometryLocator; |
47 | 48 |
import org.gvsig.fmap.geom.GeometryManager; |
48 | 49 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
49 | 50 |
import org.gvsig.fmap.geom.primitive.Envelope; |
50 |
import org.gvsig.fmap.geom.primitive.GeneralPathX;
|
|
51 |
import org.gvsig.fmap.geom.primitive.Surface;
|
|
51 | 52 |
import org.gvsig.fmap.mapcontext.ExtentHistory; |
52 | 53 |
import org.gvsig.fmap.mapcontext.MapContext; |
53 | 54 |
import org.gvsig.fmap.mapcontext.ViewPort; |
... | ... | |
863 | 864 |
return null; // Return null if there is no coordinate |
864 | 865 |
} |
865 | 866 |
else { |
866 |
if (getCoordinatesPanel().validVertexes()) { |
|
867 |
Rectangle2D r2d = getCoordinatesPanel().getExtent(); |
|
868 |
GeneralPathX generalPath = new GeneralPathX(); |
|
869 |
generalPath.moveTo(r2d.getMinX(), r2d.getMinY()); |
|
870 |
generalPath.lineTo(r2d.getMaxX(), r2d.getMinY()); |
|
871 |
generalPath.lineTo(r2d.getMaxX(), r2d.getMaxY()); |
|
872 |
generalPath.lineTo(r2d.getMinX(), r2d.getMaxY()); |
|
873 |
generalPath.lineTo(r2d.getMinX(), r2d.getMinY()); |
|
867 |
if (getCoordinatesPanel().validVertexes()) { |
|
874 | 868 |
try { |
875 |
return geometryManager.createSurface(generalPath, SUBTYPES.GEOM2D);
|
|
869 |
return getCoordinatesPanel().getSurface();
|
|
876 | 870 |
} catch (CreateGeometryException e) { |
877 | 871 |
logger.error("Creating the area", e); |
878 | 872 |
return null; |
... | ... | |
883 | 877 |
} |
884 | 878 |
} |
885 | 879 |
} |
880 |
|
|
881 |
public void setArea(Geometry area){ |
|
882 |
if ((area != null) && (area.getType() == TYPES.SURFACE)){ |
|
883 |
getCoordinatesPanel().setSurface((Surface)area); |
|
884 |
} |
|
885 |
} |
|
886 | 886 |
|
887 | 887 |
/** |
888 | 888 |
* Set parent's 'Applicable' button enable or disable according the value of the parameter |
... | ... | |
2620 | 2620 |
|
2621 | 2621 |
return new Rectangle2D.Double(v2x, v2y, (v1x - v2x), (v1y - v2y)); |
2622 | 2622 |
} |
2623 |
|
|
2624 |
public Surface getSurface() throws CreateGeometryException { |
|
2625 |
double v1x = getDoubleValueOfJTextFieldV1X(); |
|
2626 |
double v1y = getDoubleValueOfJTextFieldV1Y(); |
|
2627 |
double v2x = getDoubleValueOfJTextFieldV2X(); |
|
2628 |
double v2y = getDoubleValueOfJTextFieldV2Y(); |
|
2629 |
|
|
2630 |
Surface surface = (Surface)geometryManager.create(TYPES.SURFACE, SUBTYPES.GEOM2D); |
|
2631 |
surface.addMoveToVertex(geometryManager.createPoint(v1x, v1y, SUBTYPES.GEOM2D)); |
|
2632 |
surface.addVertex(geometryManager.createPoint(v1x, v2y, SUBTYPES.GEOM2D)); |
|
2633 |
surface.addVertex(geometryManager.createPoint(v2x, v2y, SUBTYPES.GEOM2D)); |
|
2634 |
surface.addVertex(geometryManager.createPoint(v2x, v1y, SUBTYPES.GEOM2D)); |
|
2635 |
surface.closePrimitive(); |
|
2636 |
|
|
2637 |
return surface; |
|
2638 |
} |
|
2639 |
|
|
2640 |
public void setSurface(Surface surface){ |
|
2641 |
getJTextFieldVertex1X().setText(String.valueOf(surface.getVertex(0).getX())); |
|
2642 |
getJTextFieldVertex1Y().setText(String.valueOf(surface.getVertex(0).getY())); |
|
2643 |
getJTextFieldVertex2X().setText(String.valueOf(surface.getVertex(2).getX())); |
|
2644 |
getJTextFieldVertex2Y().setText(String.valueOf(surface.getVertex(2).getY())); |
|
2645 |
} |
|
2623 | 2646 |
|
2624 | 2647 |
/** |
2625 | 2648 |
* Returns true if there is some coordinate text field with data; else returns false |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSParamsPanel.java | ||
---|---|---|
15 | 15 |
import org.gvsig.fmap.crs.CRSFactory; |
16 | 16 |
import org.gvsig.fmap.dal.DALLocator; |
17 | 17 |
import org.gvsig.fmap.dal.DataManager; |
18 |
import org.gvsig.fmap.dal.DataStore; |
|
18 | 19 |
import org.gvsig.fmap.dal.DataStoreParameters; |
19 | 20 |
import org.gvsig.fmap.dal.exception.DataException; |
20 | 21 |
import org.gvsig.fmap.dal.exception.InitializeException; |
... | ... | |
35 | 36 |
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel; |
36 | 37 |
import org.gvsig.gui.beans.panelGroup.panels.IPanel; |
37 | 38 |
import org.gvsig.gui.beans.panelGroup.tabbedPanel.TabbedPanel; |
38 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
|
39 | 39 |
import org.gvsig.tools.dynobject.DynObject; |
40 | 40 |
import org.gvsig.wfs.gui.panels.model.WFSSelectedFeature; |
41 | 41 |
import org.gvsig.wfs.gui.panels.model.WFSSelectedFeatureManager; |
... | ... | |
617 | 617 |
.createStoreParameters(WFSStoreProvider.NAME); |
618 | 618 |
refreshDataStoreParameters(parameters); |
619 | 619 |
return parameters; |
620 |
} |
|
620 |
}
|
|
621 | 621 |
|
622 |
public void refreshDataStoreParameters(WFSStoreParameters parameters){
|
|
622 |
private void refreshDataStoreParameters(WFSStoreParameters parameters){
|
|
623 | 623 |
WFSSelectedFeature selectedFeature = getSelectedFeature(); |
624 | 624 |
parameters.setUrl(serverExplorer.getUrl()); |
625 | 625 |
parameters.setVersion(serverExplorer.getVersion()); |
... | ... | |
635 | 635 |
parameters.setFilterByAreaOperation((int)AbstractFilter.GEOMETRY_INTERSECTS); |
636 | 636 |
parameters.setFilterByAreaAttribute(selectedFeature.getGeometryField().getName()); |
637 | 637 |
parameters.setFilterEncodingByAttribute(getFilterPanel().getQuery()); |
638 |
} |
|
638 |
} |
|
639 |
|
|
640 |
/** |
|
641 |
* Sets the forms from a |
|
642 |
*/ |
|
643 |
public void setDataStore(DataStore dataStore){ |
|
644 |
WFSStoreParameters storeParameters = |
|
645 |
(WFSStoreParameters)dataStore.getParameters(); |
|
646 |
WFSSelectedFeature selectedFeature = |
|
647 |
selectedFeatureManager.getFeatureInfo(storeParameters.getFeatureNamespace(), |
|
648 |
storeParameters.getFeatureType()); |
|
649 |
getFeaturesPanel().setSelectedFeature(selectedFeature); |
|
650 |
getFieldsPanel().setSelectedFields(storeParameters.getFields()); |
|
651 |
getOptionsPanel().setUserName(storeParameters.getUser()); |
|
652 |
getOptionsPanel().setPassword(storeParameters.getPassword()); |
|
653 |
getOptionsPanel().setBuffer(storeParameters.getMaxFeatures()); |
|
654 |
getOptionsPanel().setTimeOut(storeParameters.getTimeOut()); |
|
655 |
getAreaPanel().setArea(storeParameters.getFilterByAreaGeometry()); |
|
656 |
getOptionsPanel().setSRS(storeParameters.getFilterByAreaCrs()); |
|
657 |
getFilterPanel().setFilterExpressionIntoInterface(storeParameters.getFilterEncodingByAttribute()); |
|
658 |
|
|
659 |
//The filter panel needs to store to update the attributes list |
|
660 |
getFilterPanel().setDataStore(dataStore); |
|
661 |
} |
|
662 |
|
|
663 |
/** |
|
664 |
* Gets the node of the layer selected as a feature, with the selected fields and the filter defined. |
|
665 |
* |
|
666 |
* @return gets the node of the layer selected as a feature, with the selected fields and the filter defined |
|
667 |
*/ |
|
668 |
private WFSSelectedFeature getSelectedFeature(){ |
|
669 |
WFSSelectedFeature selectedFeature = getFeaturesPanel().getSelectedFeature(); |
|
670 |
selectedFeature.setSelectedFields(getFieldsPanel().getSelectedFields()); |
|
671 |
selectedFeature.setFilter(getFilterPanel().getQuery()); |
|
672 |
return selectedFeature; |
|
673 |
} |
|
639 | 674 |
|
640 | 675 |
/** |
641 | 676 |
* @see WFSWizard#doClickOnNextButton() |
... | ... | |
678 | 713 |
} |
679 | 714 |
|
680 | 715 |
/** |
681 |
* Gets the node of the layer selected as a feature, with the selected fields and the filter defined. |
|
682 |
* |
|
683 |
* @return gets the node of the layer selected as a feature, with the selected fields and the filter defined |
|
684 |
*/ |
|
685 |
private WFSSelectedFeature getSelectedFeature(){ |
|
686 |
WFSSelectedFeature selectedFeature = getFeaturesPanel().getSelectedFeature(); |
|
687 |
selectedFeature.setSelectedFields(getFieldsPanel().getSelectedFields()); |
|
688 |
selectedFeature.setFilter(getFilterPanel().getQuery()); |
|
689 |
return selectedFeature; |
|
690 |
} |
|
691 |
|
|
692 |
/** |
|
693 | 716 |
* @return the selected projection |
694 | 717 |
*/ |
695 | 718 |
public IProjection getSelectedFeatureProjection(){ |
... | ... | |
828 | 851 |
|
829 | 852 |
///// BEGIN: METHODS FOR INITIALIZE THIS PANEL AS A COMPONENT OF A PROPERTIES DIALOG ///// |
830 | 853 |
|
831 |
/** |
|
832 |
* Sets the selected feature. |
|
833 |
* |
|
834 |
* @param selectedFeature node of the selected feature |
|
835 |
*/ |
|
836 |
public void setSelectedFeature(WFSSelectedFeature selectedFeature){ |
|
837 |
getFeaturesPanel().setSelectedFeature(selectedFeature); |
|
838 |
getFieldsPanel().setSelectedFields(selectedFeature); |
|
839 |
getFilterPanel().refresh(selectedFeature); |
|
840 |
} |
|
841 |
|
|
842 |
public void setSelectedFeature(WFSSelectedFeature selectedFeature, FLyrVect layer){ |
|
843 |
setSelectedFeature(selectedFeature); |
|
844 |
getFilterPanel().setSelectedLayer(layer); |
|
845 |
} |
|
846 | 854 |
|
847 | 855 |
/** |
848 |
* Sets the status of the options and filter panels. |
|
849 |
* |
|
850 |
* @param status the status of the options and filter panels |
|
851 |
*/ |
|
852 |
public void setStatus(WFSStatus status) { |
|
853 |
getOptionsPanel().setStatus(status); |
|
854 |
getFilterPanel().setFilterExpressionIntoInterface(status.getFilterByAttribute()); |
|
855 |
} |
|
856 |
|
|
857 |
/** |
|
858 | 856 |
* @see WFSSelectFeaturePanel#setLayerName(String) |
859 | 857 |
*/ |
860 | 858 |
public void setLayerName(String name) { |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSFilterPanel.java | ||
---|---|---|
37 | 37 |
import org.gvsig.app.gui.filter.ExpressionDataSource; |
38 | 38 |
import org.gvsig.app.gui.filter.FilterException; |
39 | 39 |
import org.gvsig.app.sqlQueryValidation.SQLQueryValidation; |
40 |
import org.gvsig.fmap.dal.DataStore; |
|
40 | 41 |
import org.gvsig.fmap.dal.feature.Feature; |
41 | 42 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
42 | 43 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
43 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
44 | 44 |
import org.gvsig.gui.beans.Messages; |
45 | 45 |
import org.gvsig.gui.beans.filterPanel.filterQueryPanel.FilterQueryJPanel; |
46 | 46 |
import org.gvsig.gui.beans.panelGroup.IPanelGroup; |
... | ... | |
112 | 112 |
private FieldsTreeTableModel fieldsTreeTableModel; |
113 | 113 |
private boolean panelAsATabForWFSLayersLoad; |
114 | 114 |
private TreePath currentPath; |
115 |
private String featureName; |
|
116 | 115 |
private Map<String, Map<String, String>> allFieldsAndValuesKnownOfCurrentLayer; // This will have all values (not repeated) known of all fields (not repeated) |
117 | 116 |
|
118 |
private FLyrVect selectedLayer = null;
|
|
117 |
private DataStore dataStore = null;
|
|
119 | 118 |
|
120 | 119 |
///// GUI METHODS //// |
121 | 120 |
|
... | ... | |
126 | 125 |
*/ |
127 | 126 |
public WFSFilterPanel() { |
128 | 127 |
super(); |
129 |
currentPath = null; |
|
130 |
featureName = null; |
|
128 |
currentPath = null; |
|
131 | 129 |
allFieldsAndValuesKnownOfCurrentLayer = new HashMap<String, Map<String, String>>(); // Initial capacity = 0 |
132 | 130 |
|
133 | 131 |
// At beginning, the JList is disabled (and its set a particular color for user could knew it) |
... | ... | |
256 | 254 |
* @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent) |
257 | 255 |
*/ |
258 | 256 |
public void valueChanged(TreeSelectionEvent e) { |
259 |
if (selectedLayer != null){
|
|
257 |
if (dataStore != null){
|
|
260 | 258 |
currentPath = e.getPath(); |
261 | 259 |
fillValuesByPath(currentPath); |
262 | 260 |
} |
... | ... | |
356 | 354 |
} |
357 | 355 |
|
358 | 356 |
/** |
359 |
* Sets the value of the inner attribute: 'panelAsATabForWFSLayersLoad' |
|
360 |
* |
|
361 |
* @param b A boolean value |
|
362 |
*/ |
|
363 |
public void setWFSFilterPanelIsAsTabForWFSLayersLoad (boolean b) { |
|
364 |
// this.panelAsATabForWFSLayersLoad = b; |
|
365 |
// |
|
366 |
// if (this.panelAsATabForWFSLayersLoad == true) { |
|
367 |
// // At beginning, the JList is disabled (and its set a particular color for user could knew it) |
|
368 |
// super.getValuesJList().setEnabled(false); |
|
369 |
// super.getValuesJList().setBackground(new Color(220, 220, 220)); // a grey color |
|
370 |
// |
|
371 |
// this.allFieldsAndValuesKnownOfCurrentLayer.clear(); |
|
372 |
// getValidateFilterExpressionJCheckBox().setSelected(true); |
|
373 |
// } |
|
374 |
// else { |
|
375 |
// // Unselect the selected path in the tree (if there was any selected) |
|
376 |
// if (this.currentPath != null) { |
|
377 |
// this.currentPath = null; |
|
378 |
// this.getFieldsJTree().removeSelectionPath(this.getFieldsJTree().getSelectionPath()); |
|
379 |
// } |
|
380 |
// |
|
381 |
// // Resets data loaded |
|
382 |
// super.getValuesJList().setEnabled(true); |
|
383 |
// super.getValuesJList().setBackground(Color.WHITE); |
|
384 |
// |
|
385 |
// this.getFieldsJTree().removeAll(); |
|
386 |
// this.getValuesJList().removeAll(); |
|
387 |
// |
|
388 |
// // Updates data associated to view with the new layer data |
|
389 |
// this.setNewDataToTable(); |
|
390 |
// |
|
391 |
// // Reads that new data |
|
392 |
// DefaultExpression data = DataLoadingFromActiveView.getDefaultExpressionDataSource(); |
|
393 |
// |
|
394 |
// if (data != null) { |
|
395 |
// setModel(data); |
|
396 |
// } |
|
397 |
// |
|
398 |
// // Loads values known of fields |
|
399 |
// this.setValuesKnownOfFields(); |
|
400 |
// } |
|
401 |
} |
|
402 |
|
|
403 |
/** |
|
404 | 357 |
* Refresh all information about fields |
405 | 358 |
* |
406 | 359 |
* @param feature a feature with fields |
407 | 360 |
*/ |
408 | 361 |
public void refresh(WFSSelectedFeature feature) { |
409 |
featureName = feature.getTitle(); |
|
410 |
setFields(feature); |
|
411 |
setFilterExpressionIntoInterface(feature.getFilter()); |
|
362 |
setFields(feature); |
|
412 | 363 |
} |
413 | 364 |
|
414 |
///// END GUI METHODS ///// |
|
415 |
|
|
416 |
///// METHODS FOR THE FILTER QUERY ///// |
|
417 |
|
|
418 | 365 |
/** |
419 | 366 |
* Gets the query that will be send to the server |
420 | 367 |
* @return SQL query (just the where part) |
... | ... | |
434 | 381 |
return null; |
435 | 382 |
} |
436 | 383 |
// Codify expression (only if the validation has been successful) |
437 |
return this.codifyExpression(writtenQuery); // Ignores the spaces at beginning and end of the chain of characters
|
|
384 |
return formatResutl(writtenQuery); // Ignores the spaces at beginning and end of the chain of characters
|
|
438 | 385 |
} |
439 | 386 |
} |
440 | 387 |
|
... | ... | |
459 | 406 |
public void removeFilterExpression() { |
460 | 407 |
getTxtExpression().setText(""); |
461 | 408 |
} |
462 |
|
|
463 |
/** |
|
464 |
* Codifies the expression to ISO ISO-8859_1 and a format that the SQL parser could validate |
|
465 |
* |
|
466 |
* @param expression The expression to be codified |
|
467 |
* |
|
468 |
* @return The expression codified |
|
469 |
*/ |
|
470 |
private String codifyExpression(String expression) { |
|
471 |
String result = new String(""); |
|
472 |
|
|
473 |
// Encode each string of the query |
|
474 |
int index = 0; |
|
475 |
int lastIndex = 0; |
|
476 |
boolean endInnerLoop; |
|
477 |
|
|
478 |
// Encodes all inner strings to the equivalent codification in ISO-8859_1 with each ' symbol converted to '' |
|
479 |
while (index != -1) { |
|
480 |
index = expression.indexOf("'", index); |
|
481 |
|
|
482 |
// Add the parts of the chain of characters that not are string |
|
483 |
if (index == -1) { |
|
484 |
result += expression.substring(lastIndex, expression.length()); |
|
485 |
} |
|
486 |
else { |
|
487 |
result += expression.substring(lastIndex, index).replaceAll(" [ ]+", " "); |
|
488 |
} |
|
489 |
|
|
490 |
lastIndex = index; |
|
491 |
endInnerLoop = false; |
|
492 |
|
|
493 |
// Tries to find each first apostrophe of each string of the query |
|
494 |
if ((index > 0) && (expression.charAt(index - 1) == ' ')) { |
|
495 |
index++; |
|
496 |
|
|
497 |
// Ignore all inner apostrophes and try to find the last of the string |
|
498 |
while (!endInnerLoop) { |
|
499 |
index = expression.indexOf("'", index); |
|
500 |
index++; |
|
501 |
|
|
502 |
// If we haven't arrived to the finish of the string |
|
503 |
if (index != expression.length()) { |
|
504 |
if ((index == -1) || (expression.charAt(index) == ' ')) { |
|
505 |
result += translateString(expression.substring(lastIndex, index)); |
|
506 |
endInnerLoop = true; |
|
507 |
} |
|
508 |
} |
|
509 |
else { |
|
510 |
result += translateString(expression.substring(lastIndex, index)); |
|
511 |
endInnerLoop = true; |
|
512 |
index = -1; // Force to finish the external loop |
|
513 |
} |
|
514 |
} |
|
515 |
lastIndex = index; |
|
516 |
} |
|
517 |
} |
|
518 |
|
|
519 |
return formatResutl(result); |
|
520 |
} |
|
521 | 409 |
|
522 | 410 |
private String formatResutl(String query) { |
523 | 411 |
if ((query == null) || (query.equals(""))){ |
... | ... | |
735 | 623 |
return operatorNamesAndSymbols.contains(text); |
736 | 624 |
} |
737 | 625 |
|
738 |
///// END METHODS FOR THE FILTER QUERY ///// |
|
739 |
|
|
740 |
///// METHODS FOR TRANSLATE DATA IN FILTER SENTENCES ///// |
|
741 |
|
|
742 | 626 |
/** |
743 |
* Encodes an string to ISO 8859_1 with each ' symbol converted to '' |
|
744 |
* |
|
745 |
* @param text An string started and finished with simple apostrophes |
|
746 |
* |
|
747 |
* @return An string started and finished with simple apostrophes |
|
748 |
*/ |
|
749 |
private String translateString(String text) { |
|
750 |
// Encode to the string to ISO 8859_1 (the URL codification) |
|
751 |
|
|
752 |
// Ignore the first and last apostrophes |
|
753 |
if (text.length() > 2) { |
|
754 |
text = text.substring(1, text.length() -1); |
|
755 |
|
|
756 |
// Change ' (%27 code) to '' for the SQL parser (before send the query) |
|
757 |
text = text.replaceAll("\\%27", "\\'\\'"); |
|
758 |
} |
|
759 |
return "'" + text + "'"; |
|
760 |
} |
|
761 |
|
|
762 |
///// END METHODS FOR TRANSLATE DATA IN FILTER SENTENCES ///// |
|
763 |
|
|
764 |
///// METHODS FOR MANIPULATE 'fields' and 'values' ///// |
|
765 |
|
|
766 |
/** |
|
767 | 627 |
* Sets the model with the fields and values of the feature selected. |
768 | 628 |
* |
769 | 629 |
* @param eds data source with the model of the feature selected |
... | ... | |
807 | 667 |
} |
808 | 668 |
|
809 | 669 |
/** |
810 |
* If there is a field selected, show its new values |
|
811 |
*/ |
|
812 |
public void updateFieldValues() { |
|
813 |
// if (currentPath != null) { |
|
814 |
// DefaultExpression data = DataLoadingFromActiveView.getDefaultExpressionDataSource(); |
|
815 |
// |
|
816 |
// if (data != null) { |
|
817 |
// setModel(data); |
|
818 |
// fillValuesByPath(currentPath); |
|
819 |
// |
|
820 |
// // Updates all tables that their data is about the changed view |
|
821 |
// this.updateTablesThatHasNewData(); |
|
822 |
// |
|
823 |
// // Adjust JScrollPanes to the the beginning |
|
824 |
// getFieldsJScrollPane().getHorizontalScrollBar().setValue(-1); |
|
825 |
// getFieldsJScrollPane().getVerticalScrollBar().setValue(-1); |
|
826 |
// |
|
827 |
// // Adjust JScrollPanes to the the beginning |
|
828 |
// getValuesJScrollPane().getHorizontalScrollBar().setValue(-1); |
|
829 |
// getValuesJScrollPane().getVerticalScrollBar().setValue(-1); |
|
830 |
// |
|
831 |
// // Adjusts valuesJList to the default position |
|
832 |
// getValuesJList().setSelectedIndex(-1); // No item selected |
|
833 |
// } |
|
834 |
// } |
|
835 |
} |
|
836 |
|
|
837 |
/** |
|
838 | 670 |
* Adds the fields of the feature. |
839 | 671 |
* |
840 | 672 |
* @param feature A Layer node with fields information |
... | ... | |
892 | 724 |
} |
893 | 725 |
|
894 | 726 |
/** |
895 |
* This method load all values known of all fields known. |
|
896 |
* (It's used when a new layer is loaded). |
|
897 |
*/ |
|
898 |
private void setValuesKnownOfFields() { |
|
899 |
// Desde el modelo se deber?a acceder a los campos y sus valores cargados |
|
900 |
// try { |
|
901 |
// for (int i = 0; i < model.getFieldCount(); i++) { |
|
902 |
// String fieldName = model.getFieldName(i); |
|
903 |
// HashMap<String, String> fieldValues = (HashMap<String, String>) allFieldsAndValuesKnownOfCurrentLayer.get(fieldName); |
|
904 |
// |
|
905 |
// if (fieldValues != null) { |
|
906 |
// for (int j = 0; j < model.getRowCount(); j++) { |
|
907 |
// Value value = model.getFieldValue(j, i); |
|
908 |
// |
|
909 |
// if (value instanceof NullValue) |
|
910 |
// continue; |
|
911 |
// |
|
912 |
// Object obj = (Object)value; |
|
913 |
// |
|
914 |
// if (obj == null) |
|
915 |
// continue; |
|
916 |
// |
|
917 |
// fieldValues.put(obj.toString(), obj.toString()); |
|
918 |
// |
|
919 |
// } |
|
920 |
// } |
|
921 |
// } |
|
922 |
// } |
|
923 |
// catch (Exception e) { |
|
924 |
// NotificationManager.addError(e); |
|
925 |
// } |
|
926 |
} |
|
927 |
|
|
928 |
/** |
|
929 | 727 |
* Resets the data of fields and their values of the current layer feature, and removes the branches of <code>fieldsJTree</code>. |
930 | 728 |
*/ |
931 | 729 |
private void resetFieldsAndValuesData() { |
... | ... | |
960 | 758 |
return; |
961 | 759 |
} |
962 | 760 |
|
963 |
FeatureStore featureStore = (FeatureStore)selectedLayer.getDataStore();
|
|
761 |
FeatureStore featureStore = (FeatureStore)dataStore;
|
|
964 | 762 |
FeatureAttributeDescriptor featureAttributeDescriptor = featureStore.getDefaultFeatureType().getAttributeDescriptor(wfsFeatureField.getName()); |
965 | 763 |
|
966 | 764 |
if (featureAttributeDescriptor == null){ |
... | ... | |
984 | 782 |
} |
985 | 783 |
} |
986 | 784 |
|
987 |
this.getValuesJList().setEnabled(valuesListModel.getSize() > 0); |
|
785 |
this.getValuesJList().setEnabled(valuesListModel.getSize() > 0);
|
|
988 | 786 |
|
989 |
|
|
990 |
// // Find the selected field and try to obtein values related |
|
991 |
// for (int i = 0; i < model.getFieldCount(); i++) { |
|
992 |
// String name = model.getFieldName(i); |
|
993 |
// |
|
994 |
// // If we find the field (this means that are loaded its values and we can obtein them) |
|
995 |
// if (name.equals(element.getName())) { |
|
996 |
// for (int j = 0; j < model.getRowCount(); j++) { |
|
997 |
// Value value = model.getFieldValue(j, i); |
|
998 |
// |
|
999 |
// if (value instanceof NullValue) |
|
1000 |
// continue; |
|
1001 |
// |
|
1002 |
// if (!conjunto.contains(value)) { |
|
1003 |
// conjunto.add(value); |
|
1004 |
// } |
|
1005 |
// } |
|
1006 |
// |
|
1007 |
// break; |
|
1008 |
// } |
|
1009 |
// } |
|
1010 |
// } else { |
|
1011 |
// //create a vector with the parent names from the leaf until the root |
|
1012 |
// XMLElement parent = element.getParentElement(); |
|
1013 |
// Vector<String> parentNames = new Vector<String>(); |
|
1014 |
// parentNames.add(element.getName()); |
|
1015 |
// while (parent != null){ |
|
1016 |
// parentNames.add(parent.getName()); |
|
1017 |
// parent = parent.getParentElement(); |
|
1018 |
// } |
|
1019 |
// |
|
1020 |
// //The field name (in the gvSIG table) is the second field name |
|
1021 |
// String fieldName = parentNames.get(parentNames.size()-2); |
|
1022 |
// |
|
1023 |
// for (int i = 0; i < model.getFieldCount(); i++) { |
|
1024 |
// String name = model.getFieldName(i); |
|
1025 |
// |
|
1026 |
// // If we find the field (this means that are loaded its values and we can obtein them) |
|
1027 |
// if (name.equals(fieldName)) { |
|
1028 |
// for (int j = 0; j < model.getRowCount(); j++) { |
|
1029 |
// Value value = model.getFieldValue(j, i); |
|
1030 |
// |
|
1031 |
// if (value instanceof NullValue) |
|
1032 |
// continue; |
|
1033 |
// |
|
1034 |
// if (value instanceof ComplexValue){ |
|
1035 |
// for (int k=parentNames.size()-3 ; k >= 0 ; k--){ |
|
1036 |
// ComplexValue complex = (ComplexValue)value; |
|
1037 |
// Value childValue = (Value)complex.get(parentNames.get(k)); |
|
1038 |
// if (k == 0) { |
|
1039 |
// if (!conjunto.contains(childValue)) { |
|
1040 |
// conjunto.add(childValue); |
|
1041 |
// } |
|
1042 |
// } else { |
|
1043 |
// value = childValue; |
|
1044 |
// } |
|
1045 |
// } |
|
1046 |
// } |
|
1047 |
// } |
|
1048 |
// |
|
1049 |
// break; |
|
1050 |
// } |
|
1051 |
// } |
|
1052 |
// } |
|
1053 |
// break; |
|
1054 |
// case IXMLType.COMPLEX: |
|
1055 |
// break; |
|
1056 |
// default: |
|
1057 |
// // Do Nothing |
|
1058 |
// } |
|
1059 |
// |
|
1060 |
// // Add the values to the model of the graphic list |
|
1061 |
// Iterator<Object> it = conjunto.iterator(); |
|
1062 |
// Object[] objects = currentPath.getPath(); |
|
1063 |
// |
|
1064 |
// if (objects.length == 0) |
|
1065 |
// return; |
|
1066 |
// |
|
1067 |
// String selectedField = ((XMLElement)objects[objects.length-1]).getName(); // Gets the selected field |
|
1068 |
// |
|
1069 |
// if (selectedField != null) { // If there is a selected field |
|
1070 |
// Map<String, String> fieldValues = (HashMap<String, String>)allFieldsAndValuesKnownOfCurrentLayer.get(selectedField); // Gets values stored associated to this field |
|
1071 |
// JLabel currentValueLabel = null; |
|
1072 |
// |
|
1073 |
// // If the field doesn't exits -> create a new Map with its values |
|
1074 |
// if (fieldValues == null) { |
|
1075 |
// fieldValues = new HashMap<String, String>(); |
|
1076 |
// allFieldsAndValuesKnownOfCurrentLayer.put(selectedField, fieldValues); |
|
1077 |
// |
|
1078 |
// while (it.hasNext()) { |
|
1079 |
// // A label with text with yellow background color for values that are loaded in the layer |
|
1080 |
// currentValueLabel = new JLabelAsCellValueLoaded(); |
|
1081 |
// |
|
1082 |
// currentValueLabel.setText(it.next().toString()); |
|
1083 |
// |
|
1084 |
// if (currentValueLabel.getText().compareTo("") != 0) { |
|
1085 |
// fieldValues.put(currentValueLabel.getText(), currentValueLabel.getText()); |
|
1086 |
// |
|
1087 |
// // All values loaded in this loop must be at beginning of the list (and in a differenciated color) |
|
1088 |
// if ( ! valuesListModel.contains(currentValueLabel) ) |
|
1089 |
// valuesListModel.addElement(currentValueLabel); |
|
1090 |
// } |
|
1091 |
// } |
|
1092 |
// } |
|
1093 |
// else { // Else -> Adds the new ones, and changes element labels that have changed (before were loaded and now not, or before weren't loaded but now yes) |
|
1094 |
// |
|
1095 |
// // Changes element labels that have changed (before were loaded and now not, or before weren't loaded but now yes) |
|
1096 |
// ((DefaultListModelForJLabelAsCell)valuesListModel).setAllElementsToNotLoaded(); |
|
1097 |
// |
|
1098 |
// // For each current value associated to de current selected field -> if its loaded -> put it at beginning of the list and change to 'JLabelLoadedValue' |
|
1099 |
// while (it.hasNext()) { |
|
1100 |
// String text = it.next().toString(); |
|
1101 |
// int elementPosition = ((DefaultListModelForJLabelAsCell)valuesListModel).getIndexOfJLabelText(text); |
|
1102 |
// |
|
1103 |
// if (elementPosition == -1) // If it must be added |
|
1104 |
// valuesListModel.addElement(new JLabelAsCellValueLoaded(text)); |
|
1105 |
// else |
|
1106 |
// ((DefaultListModelForJLabelAsCell)valuesListModel).changeElementThatHasTextToJLabelLoadedValue(text); // Change to 'JLabelLoadedValue' |
|
1107 |
// } |
|
1108 |
// } |
|
1109 |
// |
|
1110 |
// // Load the rest of the values associated to the current selected field |
|
1111 |
// if (fieldValues != null) { |
|
1112 |
// // A label with text with yellow background color for values that are loaded in the layer |
|
1113 |
// currentValueLabel = new JLabelAsCellValueNotLoaded(); |
|
1114 |
// |
|
1115 |
// Set<String> values = fieldValues.keySet(); |
|
1116 |
// |
|
1117 |
// for (String name : values) { |
|
1118 |
// if ( ! ((DefaultListModelForJLabelAsCell)valuesListModel).containsJLabelText(name) ) |
|
1119 |
// valuesListModel.addElement(new JLabelAsCellValueNotLoaded(name)); |
|
1120 |
// } |
|
1121 |
// } |
|
1122 |
// } |
|
1123 |
|
|
1124 | 787 |
} catch (Exception e) { |
1125 | 788 |
NotificationManager.addError(e); |
1126 | 789 |
} |
1127 | 790 |
} |
1128 | 791 |
|
1129 |
///// END METHODS FOR MANIPULATE 'fields' and 'values' ///// |
|
1130 |
|
|
1131 |
///// METHOS FOR 'allFieldsAndValuesKnownOfCurrentLayer' ///// |
|
1132 |
|
|
1133 | 792 |
/** |
1134 | 793 |
* Sets all fields and values known about the current layer |
1135 | 794 |
* |
... | ... | |
1151 | 810 |
return allFieldsAndValuesKnownOfCurrentLayer; |
1152 | 811 |
} |
1153 | 812 |
|
1154 |
///// METHOS FOR 'allFieldsAndValuesKnownOfCurrentLayer' ///// |
|
1155 |
|
|
1156 |
///// UPDATE TABLES DATA ///// |
|
1157 |
|
|
1158 | 813 |
/** |
1159 |
* Updates all tables that their data is about the changed view |
|
1160 |
*/ |
|
1161 |
private void updateTablesThatHasNewData() { |
|
1162 |
// boolean oneTimeNewDataToTableAdded = false; |
|
1163 |
// |
|
1164 |
// IWindow[] activeNoModalWindows = PluginServices.getMDIManager().getAllWindows(); |
|
1165 |
// |
|
1166 |
// for (int i = 0; i < activeNoModalWindows.length; i++) { |
|
1167 |
// IWindow window = activeNoModalWindows[i]; |
|
1168 |
// if (window instanceof Table) { |
|
1169 |
// Table table = (Table) window; |
|
1170 |
// |
|
1171 |
// int pos1 = featureName.indexOf(':'); |
|
1172 |
// |
|
1173 |
// if ((pos1 >= 0) && (pos1 < featureName.length())) |
|
1174 |
// featureName = featureName.substring(pos1 +1, featureName.length()); |
|
1175 |
// |
|
1176 |
// String featureOfTable = table.getModel().getName(); |
|
1177 |
// int pos2 = featureOfTable.indexOf(':'); |
|
1178 |
// |
|
1179 |
// if ((pos2 >= 0) && (pos2 < featureName.length())) |
|
1180 |
// featureOfTable = featureOfTable.substring(pos2 +1, featureOfTable.length()); |
|
1181 |
// |
|
1182 |
// if (featureName.trim().compareTo(featureOfTable.trim()) == 0) { |
|
1183 |
// // Only add the new data associated to the table one time |
|
1184 |
// if (oneTimeNewDataToTableAdded == false) { |
|
1185 |
// setNewDataToTable(); |
|
1186 |
// oneTimeNewDataToTableAdded = true; |
|
1187 |
// } |
|
1188 |
// |
|
1189 |
// // Refresh the table with the new data |
|
1190 |
// table.invalidate(); |
|
1191 |
// table.refresh(); |
|
1192 |
// } |
|
1193 |
// } |
|
1194 |
// } |
|
1195 |
} |
|
1196 |
|
|
1197 |
/** |
|
1198 |
* This method is a modification of the "execute" method from the "ShowTable" class |
|
1199 |
* |
|
1200 |
* @see org.gvsig.app.extension.ShowTable#execute(String) |
|
1201 |
*/ |
|
1202 |
private void setNewDataToTable() { |
|
1203 |
// try { |
|
1204 |
// if (getPanelGroup().getReference() == null) |
|
1205 |
// return; |
|
1206 |
// |
|
1207 |
// FLayer activeLayer = (FLayer) getPanelGroup().getReference(); |
|
1208 |
// AlphanumericData co = (AlphanumericData) activeLayer; |
|
1209 |
// |
|
1210 |
// ProjectExtension ext = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
1211 |
// ProjectTable projectTable = ext.getProject().getTable(co); |
|
1212 |
// |
|
1213 |
// EditableAdapter ea = null; |
|
1214 |
// ReadableVectorial rv = ((FLyrVect)activeLayer).getSource(); |
|
1215 |
// |
|
1216 |
// if (rv instanceof VectorialEditableAdapter) { |
|
1217 |
// ea = (EditableAdapter)((FLyrVect)activeLayer).getSource(); |
|
1218 |
// } else { |
|
1219 |
// ea = new EditableAdapter(); |
|
1220 |
// SelectableDataSource sds = ((FLyrVect)activeLayer).getRecordset(); |
|
1221 |
// ea.setOriginalDataSource(sds); |
|
1222 |
// } |
|
1223 |
// |
|
1224 |
// if (projectTable == null) { |
|
1225 |
// projectTable = ProjectFactory.createTable(PluginServices.getText(this, "Tabla_de_Atributos") + ": " + activeLayer.getName(), ea); |
|
1226 |
// projectTable.setProjectDocumentFactory(new ProjectTableFactory()); |
|
1227 |
// projectTable.setAssociatedTable(co); |
|
1228 |
// ext.getProject().addDocument(projectTable); |
|
1229 |
// } |
|
1230 |
// |
|
1231 |
// projectTable.setModel(ea); |
|
1232 |
// } catch (ReadDriverException e) { |
|
1233 |
// NotificationManager.addError(PluginServices.getText(this,"No_se_pudo_obtener_la_tabla_de_la_capa"), e); |
|
1234 |
// } |
|
1235 |
} |
|
1236 |
|
|
1237 |
/** |
|
1238 | 814 |
* @param layer |
1239 | 815 |
*/ |
1240 |
public void setSelectedLayer(FLyrVect layer) {
|
|
1241 |
this.selectedLayer = layer;
|
|
816 |
public void setDataStore(DataStore dataStore) {
|
|
817 |
this.dataStore = dataStore;
|
|
1242 | 818 |
|
1243 |
} |
|
1244 |
|
|
1245 |
// /** OLD VERSION |
|
1246 |
// * This method is a modification of the "execute" method from the "ShowTable" class |
|
1247 |
// * |
|
1248 |
// * @see com.iver.cit.gvsig.ShowTable#execute(String) |
|
1249 |
// */ |
|
1250 |
// private void setNewDataToTable() { |
|
1251 |
// BaseView vista = (BaseView) PluginServices.getMDIManager().getActiveWindow(); |
|
1252 |
// FLayer[] actives = vista.getModel().getMapContext().getLayers().getActives(); |
|
1253 |
// |
|
1254 |
// try { |
|
1255 |
// for (int i = 0; i < actives.length; i++) { |
|
1256 |
// if (actives[i] instanceof AlphanumericData) { |
|
1257 |
// AlphanumericData co = (AlphanumericData) actives[i]; |
|
1258 |
// |
|
1259 |
// ProjectExtension ext = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
|
1260 |
// |
|
1261 |
// ProjectTable projectTable = ext.getProject().getTable(co); |
|
1262 |
// EditableAdapter ea=null; |
|
1263 |
// ReadableVectorial rv=((FLyrVect)actives[i]).getSource(); |
|
1264 |
// if (rv instanceof VectorialEditableAdapter){ |
|
1265 |
// ea = (EditableAdapter)((FLyrVect)actives[i]).getSource(); |
|
1266 |
// } else { |
|
1267 |
// ea = new EditableAdapter(); |
|
1268 |
// SelectableDataSource sds=((FLyrVect)actives[i]).getRecordset(); |
|
1269 |
// ea.setOriginalDataSource(sds); |
|
1270 |
// } |
|
1271 |
// |
|
1272 |
// if (projectTable == null) { |
|
1273 |
// projectTable = ProjectFactory.createTable(PluginServices.getText(this, "Tabla_de_Atributos") + ": " + actives[i].getName(), ea); |
|
1274 |
// projectTable.setProjectDocumentFactory(new ProjectTableFactory()); |
|
1275 |
// projectTable.setAssociatedTable(co); |
|
1276 |
// ext.getProject().addDocument(projectTable); |
|
1277 |
// } |
|
1278 |
// |
|
1279 |
// projectTable.setModel(ea); |
|
1280 |
// } |
|
1281 |
// } |
|
1282 |
// } catch (ReadDriverException e) { |
|
1283 |
// NotificationManager.addError(PluginServices.getText(this,"No_se_pudo_obtener_la_tabla_de_la_capa"), e); |
|
1284 |
// } |
|
1285 |
// } |
|
1286 |
|
|
1287 |
///// END UPDATE TABLES DATA ///// |
|
819 |
} |
|
1288 | 820 |
} |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSOptionsPanel.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import org.gvsig.andami.PluginServices; |
17 | 17 |
import org.gvsig.gui.beans.panelGroup.IPanelGroup; |
18 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
|
19 | 18 |
import org.gvsig.utils.StringUtilities; |
20 | 19 |
import org.gvsig.wfs.gui.panels.model.WFSSelectedFeature; |
21 | 20 |
|
... | ... | |
295 | 294 |
public String getUserName(){ |
296 | 295 |
return getUsernameText().getText(); |
297 | 296 |
} |
297 |
|
|
298 |
public void setUserName(String userName){ |
|
299 |
getUsernameText().setText(userName); |
|
300 |
} |
|
298 | 301 |
|
299 | 302 |
/** |
300 | 303 |
* Gets the password of the user. |
... | ... | |
304 | 307 |
public String getPassword(){ |
305 | 308 |
return getPasswordText().getText(); |
306 | 309 |
} |
310 |
|
|
311 |
public void setPassword(String password){ |
|
312 |
getPasswordText().setText(password); |
|
313 |
} |
|
307 | 314 |
|
308 | 315 |
/** |
309 | 316 |
* Gets the maximum number of values that can load. |
... | ... | |
319 | 326 |
return 10000; |
320 | 327 |
} |
321 | 328 |
} |
329 |
|
|
330 |
public void setBuffer(int buffer){ |
|
331 |
getBufferText().setText(String.valueOf(buffer)); |
|
332 |
} |
|
322 | 333 |
|
323 | 334 |
/** |
324 | 335 |
* Gets the timeout used during the loading process. |
... | ... | |
334 | 345 |
return 10000; |
335 | 346 |
} |
336 | 347 |
} |
348 |
|
|
349 |
public void setTimeOut(int timeOut){ |
|
350 |
getTimeOutText().setText(String.valueOf(timeOut)); |
|
351 |
} |
|
337 | 352 |
|
338 | 353 |
/** |
339 | 354 |
* Gets the reference system of the layer. |
... | ... | |
343 | 358 |
public String getSRS(){ |
344 | 359 |
return getSrsText().getText(); |
345 | 360 |
} |
361 |
|
|
362 |
public void setSRS(String srs){ |
|
363 |
getSrsText().setText(srs); |
|
364 |
} |
|
346 | 365 |
|
347 | 366 |
/** |
348 | 367 |
* This method initializes formatPanel |
... | ... | |
408 | 427 |
} |
409 | 428 |
|
410 | 429 |
/** |
411 |
* Updates the status of this panel. |
|
412 |
* |
|
413 |
* @param status status of the WFS graphical interface. |
|
414 |
*/ |
|
415 |
public void setStatus(WFSStatus status) { |
|
416 |
getBufferText().setText(String.valueOf(status.getMaxFeatures())); |
|
417 |
getTimeOutText().setText(String.valueOf(status.getTimeout())); |
|
418 |
getUsernameText().setText(status.getUserName()); |
|
419 |
getPasswordText().setText(status.getPassword()); |
|
420 |
} |
|
421 |
|
|
422 |
/** |
|
423 | 430 |
* This method initializes jLabelMiliSeconds |
424 | 431 |
* |
425 | 432 |
* @return javax.swing.JLabel |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSSelectFeaturePanel.java | ||
---|---|---|
265 | 265 |
|
266 | 266 |
if (((WFSParamsPanel)panelGroup).getFilterPanel() == null) |
267 | 267 |
return; |
268 |
|
|
269 |
((WFSParamsPanel)panelGroup).getFilterPanel().setWFSFilterPanelIsAsTabForWFSLayersLoad(true); |
|
270 |
|
|
268 |
|
|
271 | 269 |
refreshData(); |
272 | 270 |
} |
273 | 271 |
} |
Also available in: Unified diff