Revision 14818
trunk/extensions/extWFS2/src/com/iver/cit/gvsig/wfs/WFSClientExtension.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.wfs; |
2 | 2 |
|
3 |
import com.iver.andami.PluginServices; |
|
3 | 4 |
import com.iver.andami.plugins.Extension; |
4 | 5 |
import com.iver.cit.gvsig.AddLayer; |
5 | 6 |
import com.iver.cit.gvsig.fmap.layers.FLyrWFS; |
... | ... | |
54 | 55 |
/* CVS MESSAGES: |
55 | 56 |
* |
56 | 57 |
* $Id$ |
57 |
* $Log$ |
|
58 |
* Revision 1.9 2007-09-04 10:53:52 caballero
|
|
58 |
* $Log: WFSClientExtension.java,v $
|
|
59 |
* Revision 1.9 2007/09/04 10:53:52 caballero
|
|
59 | 60 |
* show page |
60 | 61 |
* |
61 | 62 |
* Revision 1.8 2006/10/02 09:09:45 jorpiell |
... | ... | |
94 | 95 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
95 | 96 |
extensionPoints.add("CatalogLayers","OGC:WFS",FLyrWFS.class); |
96 | 97 |
extensionPoints.add("IsSuitable",SuitableWFSLegend.class.getName(),SuitableWFSLegend.class); |
98 |
initilizeIcons(); |
|
97 | 99 |
} |
98 | 100 |
|
99 | 101 |
public void execute(String actionCommand) { |
... | ... | |
111 | 113 |
return false; |
112 | 114 |
} |
113 | 115 |
|
116 |
void initilizeIcons(){ |
|
117 |
// FLyrWFS.java |
|
118 |
PluginServices.getIconTheme().register( |
|
119 |
"WFS-icolayer", |
|
120 |
this.getClass().getClassLoader().getResource("images/icoLayer.png") |
|
121 |
); |
|
122 |
|
|
123 |
// WFSAreaPanel.java |
|
124 |
PluginServices.getIconTheme().register( |
|
125 |
"edit-undo", |
|
126 |
this.getClass().getClassLoader().getResource("images/edit-undo.png") |
|
127 |
); |
|
128 |
|
|
129 |
// WFSAreaPanel.java |
|
130 |
PluginServices.getIconTheme().register( |
|
131 |
"WFS-move", |
|
132 |
this.getClass().getClassLoader().getResource("images/move.png") |
|
133 |
); |
|
134 |
|
|
135 |
// WFSAreaPanel.java |
|
136 |
PluginServices.getIconTheme().register( |
|
137 |
"WFS-scaling", |
|
138 |
this.getClass().getClassLoader().getResource("images/scaling.png") |
|
139 |
); |
|
140 |
|
|
141 |
// WFSAreaPanel.java |
|
142 |
PluginServices.getIconTheme().register( |
|
143 |
"view-pan", |
|
144 |
this.getClass().getClassLoader().getResource("images/Pan.png") |
|
145 |
); |
|
146 |
|
|
147 |
// WFSAreaPanel.java |
|
148 |
PluginServices.getIconTheme().register( |
|
149 |
"view-zoom-in", |
|
150 |
this.getClass().getClassLoader().getResource("images/ZoomIn.png") |
|
151 |
); |
|
152 |
|
|
153 |
// WFSAreaPanel.java |
|
154 |
PluginServices.getIconTheme().register( |
|
155 |
"view-zoom-out", |
|
156 |
this.getClass().getClassLoader().getResource("images/ZoomOut.png") |
|
157 |
); |
|
158 |
|
|
159 |
// WFSAreaPanel.java |
|
160 |
PluginServices.getIconTheme().register( |
|
161 |
"view-zoom-back", |
|
162 |
this.getClass().getClassLoader().getResource("images/ZoomPrevio.png") |
|
163 |
); |
|
164 |
|
|
165 |
// WFSAreaPanel.java |
|
166 |
PluginServices.getIconTheme().register( |
|
167 |
"view-zoom-map-contents", |
|
168 |
this.getClass().getClassLoader().getResource("images/MapContents.png") |
|
169 |
); |
|
170 |
|
|
171 |
// WFSAreaPanel.java |
|
172 |
PluginServices.getIconTheme().register( |
|
173 |
"view-zoom-mas", |
|
174 |
this.getClass().getClassLoader().getResource("images/zoommas.png") |
|
175 |
); |
|
176 |
|
|
177 |
// WFSAreaPanel.java |
|
178 |
PluginServices.getIconTheme().register( |
|
179 |
"view-zoom-menos", |
|
180 |
this.getClass().getClassLoader().getResource("images/zoommenos.png") |
|
181 |
); |
|
182 |
|
|
183 |
// WFSAreaPanel.java |
|
184 |
PluginServices.getIconTheme().register( |
|
185 |
"view-query-distance", |
|
186 |
this.getClass().getClassLoader().getResource("images/Distancia.png") |
|
187 |
); |
|
188 |
|
|
189 |
// WFSAreaPanel.java |
|
190 |
PluginServices.getIconTheme().register( |
|
191 |
"view-query-area", |
|
192 |
this.getClass().getClassLoader().getResource("images/Poligono16.png") |
|
193 |
); |
|
194 |
|
|
195 |
// WFSAreaPanel.java |
|
196 |
PluginServices.getIconTheme().register( |
|
197 |
"view-previsualize-area", |
|
198 |
this.getClass().getClassLoader().getResource("images/to_previsualize_area.png") |
|
199 |
); |
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
} |
|
114 | 204 |
} |
trunk/extensions/extWFS2/src/com/iver/cit/gvsig/fmap/layers/FLyrWFS.java | ||
---|---|---|
36 | 36 |
import com.iver.utiles.StringUtilities; |
37 | 37 |
import com.iver.utiles.XMLEntity; |
38 | 38 |
|
39 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
|
39 |
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
|
|
40 | 40 |
* |
41 | 41 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
42 | 42 |
* |
... | ... | |
58 | 58 |
* |
59 | 59 |
* Generalitat Valenciana |
60 | 60 |
* Conselleria d'Infraestructures i Transport |
61 |
* Av. Blasco Ib??ez, 50
|
|
61 |
* Av. Blasco Ib��ez, 50
|
|
62 | 62 |
* 46010 VALENCIA |
63 | 63 |
* SPAIN |
64 | 64 |
* |
... | ... | |
90 | 90 |
* Exceptions |
91 | 91 |
* |
92 | 92 |
* Revision 1.34 2007/03/05 13:46:28 ppiqueras |
93 |
* Mejorado el filtrado por ?rea.
|
|
93 |
* Mejorado el filtrado por �rea.
|
|
94 | 94 |
* |
95 | 95 |
* Revision 1.33 2007/03/01 13:10:59 ppiqueras |
96 | 96 |
* Corregido para que diferencie entre 3 tipos de filtrado: filtrado por sentencia, filtrado por bounding box y filtrado por ambos. |
... | ... | |
129 | 129 |
* Se guarda el filtro en el gvp |
130 | 130 |
* |
131 | 131 |
* Revision 1.20 2006/11/16 13:29:47 jorpiell |
132 |
* Se ha reescrito losl m?todo para guardar y recuperar gvps
|
|
132 |
* Se ha reescrito losl m�todo para guardar y recuperar gvps
|
|
133 | 133 |
* |
134 | 134 |
* Revision 1.19 2006/11/15 17:38:08 jorpiell |
135 | 135 |
* Ya se puede guardar una capa en WFS. |
... | ... | |
138 | 138 |
* Comprobado el caso en el que los atributos no tienen tipo |
139 | 139 |
* |
140 | 140 |
* Revision 1.17 2006/10/31 09:55:28 jorpiell |
141 |
* Se ha modificado el constructor del WFS desde cat?logo
|
|
141 |
* Se ha modificado el constructor del WFS desde cat�logo
|
|
142 | 142 |
* |
143 | 143 |
* Revision 1.16 2006/10/31 09:38:15 jorpiell |
144 |
* Se ha creado una factoria para crear la capa. De ese modo no se repite c?digo desde le panel de propiedades y desde el panel de la capa
|
|
144 |
* Se ha creado una factoria para crear la capa. De ese modo no se repite c�digo desde le panel de propiedades y desde el panel de la capa
|
|
145 | 145 |
* |
146 | 146 |
* Revision 1.15 2006/10/23 07:37:04 jorpiell |
147 | 147 |
* Ya funciona el filterEncoding |
148 | 148 |
* |
149 | 149 |
* Revision 1.14 2006/10/10 12:55:06 jorpiell |
150 |
* Se ha a?adido el soporte de features complejas
|
|
150 |
* Se ha a�adido el soporte de features complejas
|
|
151 | 151 |
* |
152 | 152 |
* Revision 1.13 2006/10/02 12:54:35 jorpiell |
153 |
* No se pod?a crear un mapa que tubiera la opci?n enlace vivo habilitada
|
|
153 |
* No se pod�a crear un mapa que tubiera la opci�n enlace vivo habilitada
|
|
154 | 154 |
* |
155 | 155 |
* Revision 1.12 2006/10/02 09:09:45 jorpiell |
156 | 156 |
* Cambios del 10 copiados al head |
... | ... | |
165 | 165 |
* El WFS no reproyectaba porque no se le asignaba a la capa un sistema de referencia. Ahora ya se hace. |
166 | 166 |
* |
167 | 167 |
* Revision 1.10 2006/09/05 15:41:52 jorpiell |
168 |
* A?adida la funcionalidad de cargar WFS desde el cat?logo
|
|
168 |
* A�adida la funcionalidad de cargar WFS desde el cat�logo
|
|
169 | 169 |
* |
170 | 170 |
* Revision 1.9 2006/07/05 12:05:41 jorpiell |
171 | 171 |
* Se ha modificado para que avise si se han recuperado las mismas features que marca el campo buffer |
172 | 172 |
* |
173 | 173 |
* Revision 1.8 2006/06/21 12:52:10 jorpiell |
174 |
* A?adido un icono para la capa WFS
|
|
174 |
* A�adido un icono para la capa WFS
|
|
175 | 175 |
* |
176 | 176 |
* Revision 1.7 2006/06/21 12:35:45 jorpiell |
177 |
* Se ha a?adido la ventana de propiedades. Esto implica a?adir listeners por todos los paneles. Adem?s no se muestra la geomatr?a en la lista de atributos y se muestran ?nicamnete los que se van a descargar
|
|
177 |
* Se ha a�adido la ventana de propiedades. Esto implica a�adir listeners por todos los paneles. Adem�s no se muestra la geomatr�a en la lista de atributos y se muestran �nicamnete los que se van a descargar
|
|
178 | 178 |
* |
179 | 179 |
* Revision 1.6 2006/06/15 11:17:06 jorpiell |
180 |
* Se ha encontrado la forma de comprobar cuando se prodicia un error de parseo al hacer un hasnext (en la feature). Se atrapa y se lanza la excepci?n hacia arriba
|
|
180 |
* Se ha encontrado la forma de comprobar cuando se prodicia un error de parseo al hacer un hasnext (en la feature). Se atrapa y se lanza la excepci�n hacia arriba
|
|
181 | 181 |
* |
182 | 182 |
* Revision 1.5 2006/06/14 07:57:19 jorpiell |
183 |
* Ya no se usa la estrategia ni se usa geotools para hacer el getFeature. Ahora se usa ?nicamente para el parseo de GML
|
|
183 |
* Ya no se usa la estrategia ni se usa geotools para hacer el getFeature. Ahora se usa �nicamente para el parseo de GML
|
|
184 | 184 |
* |
185 | 185 |
* Revision 1.4 2006/06/05 16:49:31 caballero |
186 | 186 |
* poder editar y exportar |
... | ... | |
189 | 189 |
* Se ha renombrado la clase WFSFields por WFSAttributes porque era algo confusa |
190 | 190 |
* |
191 | 191 |
* Revision 1.2 2006/05/23 13:21:59 jorpiell |
192 |
* Si hay alg?n problema en la carga se muestra un mensaje de error
|
|
192 |
* Si hay alg�n problema en la carga se muestra un mensaje de error
|
|
193 | 193 |
* |
194 | 194 |
* Revision 1.1 2006/05/19 12:54:11 jorpiell |
195 | 195 |
* Creada la capa WFS |
... | ... | |
199 | 199 |
/** |
200 | 200 |
* FMap's WFS Layer class. |
201 | 201 |
* |
202 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
|
202 |
* @author Jorge Piera Llodr� (piera_jor@gva.es)
|
|
203 | 203 |
*/ |
204 | 204 |
public class FLyrWFS extends FLyrVect{ |
205 | 205 |
private URL host = null; |
... | ... | |
594 | 594 |
} |
595 | 595 |
|
596 | 596 |
public ImageIcon getTocImageIcon() { |
597 |
return new ImageIcon(PluginServices.getPluginServices("com.iver.cit.gvsig.wfs2").getClassLoader().getResource("images/icoLayer.png"));
|
|
597 |
return PluginServices.getIconTheme().get("WFS-icolayer");
|
|
598 | 598 |
} |
599 | 599 |
|
600 | 600 |
/* |
... | ... | |
738 | 738 |
adapter.setDriver((VectorialDriver) wfsDriver); |
739 | 739 |
adapter.setProjection(getProjection()); |
740 | 740 |
setSource(adapter); |
741 |
driver.getLayerList();
|
|
742 |
WFSLayerNode layer = driver.getLayerInfo(getLayerName(),getNameSapce());
|
|
743 |
XMLElement[] atts = null;
|
|
741 |
driver.getLayerList(); |
|
742 |
WFSLayerNode layer = driver.getLayerInfo(getLayerName(),getNameSapce()); |
|
743 |
XMLElement[] atts = null; |
|
744 | 744 |
|
745 |
// The root element always exists
|
|
746 |
XMLElement rootElement = (XMLElement)layer.getFields().get(0);
|
|
745 |
// The root element always exists |
|
746 |
XMLElement rootElement = (XMLElement)layer.getFields().get(0); |
|
747 | 747 |
|
748 |
if (xml.contains("fields")) { |
|
749 |
String[] fields = xml.getStringProperty("fields").split("~##SEP1##~"); |
|
750 |
if ((fields.length == 1) && (fields[0].equals(""))){ |
|
751 |
fields = new String[0]; |
|
752 |
} |
|
753 |
//The root element always is a complex type |
|
754 |
Vector allFields = ((XMLComplexType)rootElement.getEntityType()).getAttributes(); |
|
755 |
//If the root node has been selected |
|
756 |
if (xml.contains("rootNode")){ |
|
757 |
if (xml.getBooleanProperty("rootNode")==true){ |
|
758 |
atts = new XMLElement[fields.length + 1]; |
|
759 |
atts[fields.length] = rootElement; |
|
760 |
}else{ |
|
761 |
atts = new XMLElement[fields.length]; |
|
762 |
} |
|
748 |
if (xml.contains("fields")) { |
|
749 |
String[] fields = xml.getStringProperty("fields").split("~##SEP1##~"); |
|
750 |
if ((fields.length == 1) && (fields[0].equals(""))){ |
|
751 |
fields = new String[0]; |
|
752 |
} |
|
753 |
//The root element always is a complex type |
|
754 |
Vector allFields = ((XMLComplexType)rootElement.getEntityType()).getAttributes(); |
|
755 |
//If the root node has been selected |
|
756 |
if (xml.contains("rootNode")){ |
|
757 |
if (xml.getBooleanProperty("rootNode")==true){ |
|
758 |
atts = new XMLElement[fields.length + 1]; |
|
759 |
atts[fields.length] = rootElement; |
|
763 | 760 |
}else{ |
764 | 761 |
atts = new XMLElement[fields.length]; |
765 | 762 |
} |
766 |
//Adding the other fields |
|
767 |
for (int i=0 ; i<fields.length ; i++){ |
|
768 |
for (int j=0 ; j<allFields.size() ; j++){ |
|
769 |
XMLElement field = (XMLElement)allFields.get(j); |
|
770 |
if (field != null){ |
|
771 |
XMLElement found = field.searchAttribute(fields[i]); |
|
772 |
if (found != null){ |
|
773 |
atts[i] = found; |
|
774 |
break; |
|
775 |
} |
|
763 |
}else{ |
|
764 |
atts = new XMLElement[fields.length]; |
|
765 |
} |
|
766 |
//Adding the other fields |
|
767 |
for (int i=0 ; i<fields.length ; i++){ |
|
768 |
for (int j=0 ; j<allFields.size() ; j++){ |
|
769 |
XMLElement field = (XMLElement)allFields.get(j); |
|
770 |
if (field != null){ |
|
771 |
XMLElement found = field.searchAttribute(fields[i]); |
|
772 |
if (found != null){ |
|
773 |
atts[i] = found; |
|
774 |
break; |
|
776 | 775 |
} |
777 | 776 |
} |
778 | 777 |
} |
779 |
}else{
|
|
780 |
if (xml.contains("rootNode")){
|
|
781 |
if (xml.getBooleanProperty("rootNode")==true){
|
|
782 |
atts = new XMLElement[1];
|
|
783 |
atts[0] = rootElement;
|
|
784 |
}
|
|
778 |
} |
|
779 |
}else{
|
|
780 |
if (xml.contains("rootNode")){
|
|
781 |
if (xml.getBooleanProperty("rootNode")==true){
|
|
782 |
atts = new XMLElement[1];
|
|
783 |
atts[0] = rootElement;
|
|
785 | 784 |
} |
786 | 785 |
} |
787 |
layer.setSelectedFields(atts); |
|
788 |
setWfsLayerNode(layer); |
|
789 |
setFields(atts); |
|
786 |
} |
|
787 |
layer.setSelectedFields(atts); |
|
788 |
setWfsLayerNode(layer); |
|
789 |
setFields(atts); |
|
790 | 790 |
load(); |
791 | 791 |
|
792 | 792 |
super.setXMLEntity(xml); |
... | ... | |
808 | 808 |
labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName")); |
809 | 809 |
this.setLabelingStrategy(labeling); |
810 | 810 |
this.setIsLabeled(true); |
811 |
}
|
|
811 |
}
|
|
812 | 812 |
/* end patch */ |
813 | 813 |
} catch (Exception e) { |
814 | 814 |
throw new XMLException(e); |
trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/panels/WFSAreaPanel.java | ||
---|---|---|
62 | 62 |
import com.iver.cit.gvsig.project.documents.view.toolListeners.ZoomOutListener; |
63 | 63 |
import com.iver.utiles.stringNumberUtilities.StringNumberUtilities; |
64 | 64 |
|
65 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
|
65 |
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
|
|
66 | 66 |
* |
67 | 67 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
68 | 68 |
* |
... | ... | |
84 | 84 |
* |
85 | 85 |
* Generalitat Valenciana |
86 | 86 |
* Conselleria d'Infraestructures i Transport |
87 |
* Av. Blasco Ib??ez, 50
|
|
87 |
* Av. Blasco Ib��ez, 50
|
|
88 | 88 |
* 46010 VALENCIA |
89 | 89 |
* SPAIN |
90 | 90 |
* |
... | ... | |
110 | 110 |
* Fixed changes to 3D extension |
111 | 111 |
* |
112 | 112 |
* Revision 1.28 2007/04/11 12:04:58 ppiqueras |
113 |
* Bug corregido: al pulsar "Aplicar" en el wizard de WFS, despu?s de haber seleccionado un ?rea distinta, se debe actualizar el ?rea visible del wizard con la de la vista activa.
|
|
113 |
* Bug corregido: al pulsar "Aplicar" en el wizard de WFS, despu�s de haber seleccionado un �rea distinta, se debe actualizar el �rea visible del wizard con la de la vista activa.
|
|
114 | 114 |
* |
115 | 115 |
* Revision 1.27 2007/03/15 13:32:44 ppiqueras |
116 |
* -Corregido bug de excepci?n que se lanzaba cuando se filtraba y no se pod?a cargar la capa.
|
|
116 |
* -Corregido bug de excepci�n que se lanzaba cuando se filtraba y no se pod�a cargar la capa.
|
|
117 | 117 |
* - Mejorada la interfaz |
118 | 118 |
* |
119 | 119 |
* Revision 1.26 2007/03/06 18:01:03 caballero |
120 | 120 |
* Exceptions |
121 | 121 |
* |
122 | 122 |
* Revision 1.25 2007/03/05 13:47:42 ppiqueras |
123 |
* Eliminadas l?neas que sobraban.
|
|
123 |
* Eliminadas l�neas que sobraban.
|
|
124 | 124 |
* |
125 | 125 |
* Revision 1.24 2007/03/01 13:13:58 ppiqueras |
126 |
* A?adido m?todo para que si no se ha modificado el ?rea que no se aplique filtro por ?rea. Y mejorado el m?todo getExtent() (obtenci?n del Rectangle2D que define el ?rea: si el usuario no ha seleccionado un ?rea distinta, devolver? null).
|
|
126 |
* A�adido m�todo para que si no se ha modificado el �rea que no se aplique filtro por �rea. Y mejorado el m�todo getExtent() (obtenci�n del Rectangle2D que define el �rea: si el usuario no ha seleccionado un �rea distinta, devolver� null).
|
|
127 | 127 |
* |
128 | 128 |
* Revision 1.23 2007/02/26 13:40:28 ppiqueras |
129 |
* - Eliminado bot?n zoom siguiente
|
|
130 |
* - En caso de que no haya vista cargada, que los botones de escalar y desplazar est?n deshabilitados
|
|
129 |
* - Eliminado bot�n zoom siguiente
|
|
130 |
* - En caso de que no haya vista cargada, que los botones de escalar y desplazar est�n deshabilitados
|
|
131 | 131 |
* |
132 | 132 |
* Revision 1.22 2007/02/26 12:58:09 ppiqueras |
133 | 133 |
* En caso de escribir una coordenada con formato incorrecto, avisa al usuario y restaura el valor anterior. |
134 | 134 |
* |
135 | 135 |
* Revision 1.21 2007/02/22 13:17:57 ppiqueras |
136 |
* Mejor documentado el c?digo.
|
|
136 |
* Mejor documentado el c�digo.
|
|
137 | 137 |
* |
138 | 138 |
* Revision 1.20 2007/02/22 12:23:32 ppiqueras |
139 | 139 |
* Varias mejoras: |
140 |
* - Aviso de error en caso de intentar cargar capa con ?rea mal indicada.
|
|
141 |
* - Obtenci?n del ?rea de las coordenadas.
|
|
142 |
* - Alg?n bug corregido.
|
|
140 |
* - Aviso de error en caso de intentar cargar capa con �rea mal indicada.
|
|
141 |
* - Obtenci�n del �rea de las coordenadas.
|
|
142 |
* - Alg�n bug corregido.
|
|
143 | 143 |
* |
144 | 144 |
* Revision 1.19 2007/02/20 13:13:26 ppiqueras |
145 |
* Se habilita el bot?n aplicar del panel padre en caso de alg?n cambio de coordendas, y mejora en la obtenci?n del ?rea del usuario.
|
|
145 |
* Se habilita el bot�n aplicar del panel padre en caso de alg�n cambio de coordendas, y mejora en la obtenci�n del �rea del usuario.
|
|
146 | 146 |
* |
147 | 147 |
* Revision 1.18 2007/02/20 11:31:11 ppiqueras |
148 | 148 |
* Eliminados comentarios que sobraban. |
149 | 149 |
* |
150 | 150 |
* Revision 1.17 2007/02/16 13:36:53 ppiqueras |
151 |
* Que el ?rea seleccionada en el panel WFSArea sea accesible una vez se va a aplicar.
|
|
151 |
* Que el �rea seleccionada en el panel WFSArea sea accesible una vez se va a aplicar.
|
|
152 | 152 |
* |
153 | 153 |
* Revision 1.16 2007/02/16 13:14:21 ppiqueras |
154 |
* Mejorada la selecci?n por coordenadas absolutas y corregido alg?n bug.
|
|
154 |
* Mejorada la selecci�n por coordenadas absolutas y corregido alg�n bug.
|
|
155 | 155 |
* |
156 | 156 |
* Revision 1.15 2007/02/15 11:36:57 ppiqueras |
157 |
* Mejorada la interfaz: nuevas herramientas, mejoradas las de coordenadas absolutas. Y corregido alg?n bug de interacci?n con otros paneles.
|
|
157 |
* Mejorada la interfaz: nuevas herramientas, mejoradas las de coordenadas absolutas. Y corregido alg�n bug de interacci�n con otros paneles.
|
|
158 | 158 |
* |
159 | 159 |
* Revision 1.14 2007/02/12 11:29:37 ppiqueras |
160 | 160 |
* Mejoras de la interfaz y uso de las herramientas |
... | ... | |
169 | 169 |
* Carga de la vista actual. |
170 | 170 |
* |
171 | 171 |
* Revision 1.10 2007/02/05 13:49:26 ppiqueras |
172 |
* Mejorada la interfaz y a?adidos componentes de tipo lista desplegable con iconos como ?tems.
|
|
172 |
* Mejorada la interfaz y a�adidos componentes de tipo lista desplegable con iconos como �tems.
|
|
173 | 173 |
* |
174 | 174 |
* Revision 1.9 2007/02/02 12:22:03 ppiqueras |
175 | 175 |
* Mejorada la interfaz. |
... | ... | |
196 | 196 |
* Actualizado el driver del WFS |
197 | 197 |
* |
198 | 198 |
* Revision 1.1 2006/10/10 12:55:06 jorpiell |
199 |
* Se ha a?adido el soporte de features complejas
|
|
199 |
* Se ha a�adido el soporte de features complejas
|
|
200 | 200 |
* |
201 | 201 |
* |
202 | 202 |
*/ |
... | ... | |
208 | 208 |
* - Indicating the coordinates of the top-left and down-right corners |
209 | 209 |
* - Selecting the area with some visual tool |
210 | 210 |
* |
211 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
|
|
212 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
|
211 |
* @author Pablo Piqueras Bartolom� (p_queras@hotmail.com)
|
|
212 |
* @author Jorge Piera Llodr� (piera_jor@gva.es)
|
|
213 | 213 |
*/ |
214 | 214 |
public class WFSAreaPanel extends JPanel { |
215 | 215 |
private final Rectangle DEFAULT_BOUNDS = new Rectangle(10, 5, 490, 380); |
... | ... | |
471 | 471 |
if (jButtonUndo == null) { |
472 | 472 |
jButtonUndo = new JButton(); |
473 | 473 |
jButtonUndo.setBounds(DEFAULT_UNDO_ICON_BUTTON_RECTANGLE); |
474 |
jButtonUndo.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/edit-undo.png")));
|
|
474 |
jButtonUndo.setIcon(PluginServices.getIconTheme().get("edit-undo"));
|
|
475 | 475 |
jButtonUndo.setToolTipText(PluginServices.getText(this, "previous_area")); |
476 | 476 |
jButtonUndo.addMouseListener(new MouseAdapter() { |
477 | 477 |
/* |
... | ... | |
512 | 512 |
if (jToggleButtonMove == null) { |
513 | 513 |
jToggleButtonMove = new JToggleButton(); |
514 | 514 |
jToggleButtonMove.setBounds(DEFAULT_MOVE_ICON_TOGGLE_BUTTON_RECTANGLE); |
515 |
jToggleButtonMove.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/move.png")));
|
|
515 |
jToggleButtonMove.setIcon(PluginServices.getIconTheme().get("WFS-move"));
|
|
516 | 516 |
jToggleButtonMove.setToolTipText(PluginServices.getText(this, "move") + ": " + PluginServices.getText(this, "area_move_explanation")); |
517 | 517 |
jToggleButtonMove.addItemListener(new ItemListener() { |
518 | 518 |
/* |
... | ... | |
539 | 539 |
if (jToggleButtonScaling == null) { |
540 | 540 |
jToggleButtonScaling = new JToggleButton(); |
541 | 541 |
jToggleButtonScaling.setBounds(DEFAULT_SCALING_ICON_TOGGLE_BUTTON_RECTANGLE); |
542 |
jToggleButtonScaling.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/scaling.png")));
|
|
542 |
jToggleButtonScaling.setIcon(PluginServices.getIconTheme().get("WFS-scaling"));
|
|
543 | 543 |
jToggleButtonScaling.setToolTipText(PluginServices.getText(this, "scaling") + ": " + PluginServices.getText(this, "area_scaling_explanation")); |
544 | 544 |
jToggleButtonScaling.addItemListener(new ItemListener() { |
545 | 545 |
/* |
... | ... | |
565 | 565 |
if (jButtonPan == null) { |
566 | 566 |
jButtonPan = new JButton(); |
567 | 567 |
jButtonPan.setBounds(DEFAULT_PAN_ICON_BUTTON_RECTANGLE); |
568 |
jButtonPan.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/Pan.png")));
|
|
568 |
jButtonPan.setIcon(PluginServices.getIconTheme().get("view-pan"));
|
|
569 | 569 |
jButtonPan.setToolTipText(PluginServices.getText(this, "Desplazamiento")); |
570 | 570 |
jButtonPan.addMouseListener(new MouseAdapter() { |
571 | 571 |
/* |
... | ... | |
589 | 589 |
if (jComboBoxZoomInAndOut == null) { |
590 | 590 |
jComboBoxZoomInAndOut = new JComboBoxWithImageIconItems(); |
591 | 591 |
jComboBoxZoomInAndOut.setBounds(DEFAULT_ZOOMINANDOUT_JCOMBOBOX_RECTANGLE); |
592 |
jComboBoxZoomInAndOut.addImageIconItem(new ImageIconItemInfo("images/ZoomIn.png", new ImageIcon(getClass().getClassLoader().getResource("images/ZoomIn.png")), PluginServices.getText(this, "Zoom_Mas"), ZOOM_IN_TOOL));
|
|
593 |
jComboBoxZoomInAndOut.addImageIconItem(new ImageIconItemInfo("images/ZoomOut.png", new ImageIcon(getClass().getClassLoader().getResource("images/ZoomOut.png")), PluginServices.getText(this, "Zoom_Menos"), ZOOM_OUT_TOOL));
|
|
592 |
jComboBoxZoomInAndOut.addImageIconItem(new ImageIconItemInfo("images/ZoomIn.png",PluginServices.getIconTheme().get("view-zoom-in"),PluginServices.getText(this, "Zoom_Mas"), ZOOM_IN_TOOL));
|
|
593 |
jComboBoxZoomInAndOut.addImageIconItem(new ImageIconItemInfo("images/ZoomOut.png",PluginServices.getIconTheme().get("view-zoom-out"), PluginServices.getText(this, "Zoom_Menos"), ZOOM_OUT_TOOL));
|
|
594 | 594 |
jComboBoxZoomInAndOut.addActionListener(new ActionListener() { |
595 | 595 |
/* |
596 | 596 |
* (non-Javadoc) |
... | ... | |
616 | 616 |
if (jButtonZoomPrevious == null) { |
617 | 617 |
jButtonZoomPrevious = new JButton(); |
618 | 618 |
jButtonZoomPrevious.setBounds(DEFAULT_ZOOMPREVIOUS_ICON_BUTTON_RECTANGLE); |
619 |
jButtonZoomPrevious.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/ZoomPrevio.png")));
|
|
619 |
jButtonZoomPrevious.setIcon(PluginServices.getIconTheme().get("view-zoom-back"));
|
|
620 | 620 |
jButtonZoomPrevious.setToolTipText(PluginServices.getText(this, "Zoom_Previo")); |
621 | 621 |
jButtonZoomPrevious.addMouseListener(new MouseAdapter() { |
622 | 622 |
/* |
... | ... | |
640 | 640 |
if (jButtonZoomComplete == null) { |
641 | 641 |
jButtonZoomComplete = new JButton(); |
642 | 642 |
jButtonZoomComplete.setBounds(DEFAULT_ZOOMCOMPLETE_ICON_BUTTON_RECTANGLE); |
643 |
jButtonZoomComplete.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/MapContents.png")));
|
|
643 |
jButtonZoomComplete.setIcon(PluginServices.getIconTheme().get("view-zoom-map-contents"));
|
|
644 | 644 |
jButtonZoomComplete.setToolTipText(PluginServices.getText(this, "Zoom_Completo")); |
645 | 645 |
jButtonZoomComplete.addMouseListener(new MouseAdapter() { |
646 | 646 |
/* |
... | ... | |
666 | 666 |
if (jComboBoxZoomInAndOutViewCentered == null) { |
667 | 667 |
jComboBoxZoomInAndOutViewCentered = new JComboBoxWithImageIconItems(); |
668 | 668 |
jComboBoxZoomInAndOutViewCentered.setBounds(DEFAULT_ZOOMINANDOUTVIEWCENTERED_JCOMBOBOX_RECTANGLE); |
669 |
jComboBoxZoomInAndOutViewCentered.addImageIconItem(new ImageIconItemInfo("images/zoommas.png", new ImageIcon(getClass().getClassLoader().getResource("images/zoommas.png")), PluginServices.getText(this, "Zoom_Acercar"), ZOOM_IN_VIEW_CENTERED_TOOL));
|
|
670 |
jComboBoxZoomInAndOutViewCentered.addImageIconItem(new ImageIconItemInfo("images/ZoomOut.png", new ImageIcon(getClass().getClassLoader().getResource("images/zoommenos.png")), PluginServices.getText(this, "Zoom_Alejar"), ZOOM_OUT_VIEW_CENTERED_TOOL));
|
|
669 |
jComboBoxZoomInAndOutViewCentered.addImageIconItem(new ImageIconItemInfo("images/zoommas.png",PluginServices.getIconTheme().get("view-zoom-mas"), PluginServices.getText(this, "Zoom_Acercar"), ZOOM_IN_VIEW_CENTERED_TOOL));
|
|
670 |
jComboBoxZoomInAndOutViewCentered.addImageIconItem(new ImageIconItemInfo("images/ZoomOut.png",PluginServices.getIconTheme().get("view-zoom-menos"), PluginServices.getText(this, "Zoom_Alejar"), ZOOM_OUT_VIEW_CENTERED_TOOL));
|
|
671 | 671 |
jComboBoxZoomInAndOutViewCentered.addActionListener(new ActionListener() { |
672 | 672 |
/* |
673 | 673 |
* (non-Javadoc) |
... | ... | |
698 | 698 |
if (jComboBoxOtherTools == null) { |
699 | 699 |
jComboBoxOtherTools = new JComboBoxWithImageIconItems(); |
700 | 700 |
jComboBoxOtherTools.setBounds(DEFAULT_OTHER_TOOLS_JCOMBOBOX_RECTANGLE); |
701 |
jComboBoxOtherTools.addImageIconItem(new ImageIconItemInfo("images/Distancia.png", new ImageIcon(getClass().getClassLoader().getResource("images/Distancia.png")), PluginServices.getText(this, "medir_distancias"), MEASURE_DISTANCES_TOOL));
|
|
702 |
jComboBoxOtherTools.addImageIconItem(new ImageIconItemInfo("images/Poligono16.png", new ImageIcon(getClass().getClassLoader().getResource("images/Poligono16.png")), PluginServices.getText(this, "medir_area"), MEASURE_AREA_TOOL));
|
|
701 |
jComboBoxOtherTools.addImageIconItem(new ImageIconItemInfo("images/Distancia.png",PluginServices.getIconTheme().get("view-query-distance"),PluginServices.getText(this, "medir_distancias"), MEASURE_DISTANCES_TOOL));
|
|
702 |
jComboBoxOtherTools.addImageIconItem(new ImageIconItemInfo("images/Poligono16.png",PluginServices.getIconTheme().get("view-query-area"), PluginServices.getText(this, "medir_area"), MEASURE_AREA_TOOL));
|
|
703 | 703 |
jComboBoxOtherTools.addActionListener(new ActionListener() { |
704 | 704 |
/* |
705 | 705 |
* (non-Javadoc) |
... | ... | |
804 | 804 |
public boolean hasUserDefinedAnArea() { |
805 | 805 |
return hasUserDefinedAnArea; |
806 | 806 |
} |
807 |
|
|
807 |
|
|
808 | 808 |
/** |
809 | 809 |
* Restores the inner attribute 'hasUserDefinedAnArea' to its default value (false) |
810 | 810 |
*/ |
811 | 811 |
public void setUserHasntDefineAnArea() { |
812 |
hasUserDefinedAnArea = false;
|
|
812 |
hasUserDefinedAnArea = false; |
|
813 | 813 |
} |
814 |
|
|
814 |
|
|
815 | 815 |
/** |
816 | 816 |
* Updates the current area information with the area of the active view |
817 | 817 |
*/ |
818 | 818 |
public void updateWFSArea() { |
819 | 819 |
this.getSelectableMapAreaPanel().disableAllMouseListeners(); |
820 |
|
|
820 |
|
|
821 | 821 |
// To prevent that events that take place (are produced) could be a nuisance to the load of the layers |
822 | 822 |
this.getSelectableMapAreaPanel().getMapContext().beginAtomicEvent(); |
823 | 823 |
|
824 | 824 |
try { |
825 | 825 |
MapContext mapContext = this.getSelectableMapAreaPanel().getMapContext(); |
826 |
|
|
826 |
|
|
827 | 827 |
// Removes all layers in the view area |
828 | 828 |
int numberOfLayers = mapContext.getLayers().getLayersCount(); |
829 | 829 |
int i; |
830 |
|
|
830 |
|
|
831 | 831 |
for (i = (numberOfLayers-1); i >= 0; i--) { |
832 | 832 |
mapContext.getLayers().removeLayer(i); |
833 | 833 |
} |
834 |
|
|
834 |
|
|
835 | 835 |
// Adds the extent of the viewport of the current active view |
836 | 836 |
BaseView view = (BaseView) PluginServices.getMDIManager().getActiveWindow(); |
837 | 837 |
ViewPort vP = view.getMapControl().getMapContext().getViewPort(); |
... | ... | |
840 | 840 |
Rectangle2D r2D = vP.getExtent(); |
841 | 841 |
|
842 | 842 |
if (r2D == null) { |
843 |
// End To prevent that events that take place(are produced) could be a nuisance to the load of the layers
|
|
843 |
// End To prevent that events that take place(are produced) could be a nuisance to the load of the layers |
|
844 | 844 |
this.getSelectableMapAreaPanel().getMapContext().endAtomicEvent(); |
845 |
|
|
845 |
|
|
846 | 846 |
// No tools enabled |
847 |
getJComboBoxToolSelection().setSelectedIndex(0);
|
|
847 |
getJComboBoxToolSelection().setSelectedIndex(0); |
|
848 | 848 |
|
849 | 849 |
return; |
850 | 850 |
} |
851 | 851 |
|
852 | 852 |
getCoordinatesPanel().updateCoordinates(r2D); |
853 | 853 |
mapContext.getViewPort().setExtent(r2D); |
854 |
|
|
855 |
// Adds the active layers of the current active view
|
|
854 |
|
|
855 |
// Adds the active layers of the current active view |
|
856 | 856 |
MapContext mC = view.getMapControl().getMapContext(); |
857 |
|
|
857 |
|
|
858 | 858 |
numberOfLayers = mC.getLayers().getLayersCount(); |
859 | 859 |
|
860 | 860 |
for (i = (numberOfLayers-1); i >= 0; i--) { |
... | ... | |
864 | 864 |
// If has to enable all listeners of all tools on the view area |
865 | 865 |
if (((ItemOperation)this.getJComboBoxToolSelection().getSelectedItem()).getOperation() == SELECTION_BY_AREA_OPERATION) |
866 | 866 |
this.getSelectableMapAreaPanel().enableAllMouseListeners(); |
867 |
|
|
868 |
// End To prevent that events that take place(are produced) could be a nuisance to the load of the layers
|
|
867 |
|
|
868 |
// End To prevent that events that take place(are produced) could be a nuisance to the load of the layers |
|
869 | 869 |
this.getSelectableMapAreaPanel().getMapContext().endAtomicEvent(); |
870 |
|
|
870 |
|
|
871 | 871 |
// Refresh the view |
872 | 872 |
this.getSelectableMapAreaPanel().getViewPort().refreshExtent(); |
873 | 873 |
} catch (Exception e) { |
874 | 874 |
e.printStackTrace(); |
875 | 875 |
|
876 |
// End To prevent that events that take place(are produced) could be a nuisance to the load of the layers
|
|
876 |
// End To prevent that events that take place(are produced) could be a nuisance to the load of the layers |
|
877 | 877 |
this.getSelectableMapAreaPanel().getMapContext().endAtomicEvent(); |
878 |
|
|
878 |
|
|
879 | 879 |
// No tools enabled |
880 | 880 |
getJComboBoxToolSelection().setSelectedIndex(0); |
881 | 881 |
return; |
882 | 882 |
} |
883 | 883 |
} |
884 |
|
|
884 |
|
|
885 | 885 |
/** |
886 | 886 |
* Represents an object that stores the necessary information for know each operation of the 'jComboBoxToolSelection' |
887 | 887 |
* |
888 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
|
|
888 |
* @author Pablo Piqueras Bartolom� (p_queras@hotmail.com)
|
|
889 | 889 |
*/ |
890 | 890 |
private class ItemOperation { |
891 | 891 |
String _name; |
... | ... | |
932 | 932 |
* This class is a panel width four fields for indicate the coordinates of two points: |
933 | 933 |
* One for the ritgh-up point and another for the left-down point of a rectangle area |
934 | 934 |
* |
935 |
* @author Pablo Piqueras Bartolom? (p_queras_pab@hotmail.com)
|
|
936 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
|
935 |
* @author Pablo Piqueras Bartolom� (p_queras_pab@hotmail.com)
|
|
936 |
* @author Jorge Piera Llodr� (piera_jor@gva.es)
|
|
937 | 937 |
*/ |
938 | 938 |
private class AreaCoordinatesPanel extends JPanel implements Serializable { |
939 | 939 |
private final Rectangle DEFAULT_JBUTTON_GO_TO_AREA_RECTANGLE = new Rectangle(412, 5, 62, 51); // @jve:decl-index=0: |
... | ... | |
1685 | 1685 |
jButtonPreviewArea.setToolTipText(PluginServices.getText(this, "to_previsualize")); |
1686 | 1686 |
jButtonPreviewArea.setVerticalTextPosition(AbstractButton.CENTER); |
1687 | 1687 |
jButtonPreviewArea.setHorizontalTextPosition(AbstractButton.CENTER); |
1688 |
jButtonPreviewArea.setIcon(new ImageIcon(getClass().getClassLoader().getResource("images/to_previsualize_area.png")));
|
|
1688 |
jButtonPreviewArea.setIcon(PluginServices.getIconTheme().get("view-previsualize-area"));
|
|
1689 | 1689 |
jButtonPreviewArea.addMouseListener(new MouseAdapter() { |
1690 | 1690 |
/* |
1691 | 1691 |
* (non-Javadoc) |
... | ... | |
2058 | 2058 |
getJTextFieldVertex2Y().setText(String.valueOf(extent.getMinY())); |
2059 | 2059 |
last_Coordinates[3] = getJTextFieldVertex2Y().getText(); |
2060 | 2060 |
previous_Coordinate_Value[3] = last_Coordinates[3]; |
2061 |
|
|
2061 |
|
|
2062 | 2062 |
resetCoordinatesFlags(); |
2063 | 2063 |
|
2064 | 2064 |
// Enable the 'Applicate' button |
... | ... | |
2203 | 2203 |
/** |
2204 | 2204 |
* This class is a MapControl JComponent that has visual information and allows user interact with some tools and view the results |
2205 | 2205 |
* |
2206 |
* @author Pablo Piqueras Bartolom? (p_queras_pab@hotmail.com)
|
|
2206 |
* @author Pablo Piqueras Bartolom� (p_queras_pab@hotmail.com)
|
|
2207 | 2207 |
*/ |
2208 | 2208 |
private class SelectableMapControlAreaPanel extends MapControl implements Serializable { |
2209 | 2209 |
private MouseListener[] mouseListeners; |
... | ... | |
2256 | 2256 |
* Refresh the active view |
2257 | 2257 |
*/ |
2258 | 2258 |
public void refreshWithTheActiveView() { |
2259 |
try {
|
|
2259 |
try { |
|
2260 | 2260 |
MapContext mp = ((BaseView) PluginServices.getMDIManager().getActiveWindow()).getMapControl().getMapContext(); |
2261 | 2261 |
this.setMapContext(mp.cloneFMap()); |
2262 | 2262 |
ViewPort vP = this.getViewPort(); |
... | ... | |
2313 | 2313 |
|
2314 | 2314 |
if (r2d != null) { |
2315 | 2315 |
getCoordinatesPanel().updateCoordinates(r2d); |
2316 |
|
|
2316 |
|
|
2317 | 2317 |
if (getJComboBoxToolSelection().getSelectedIndex() != 0) { |
2318 | 2318 |
hasUserDefinedAnArea = true; |
2319 | 2319 |
} |
... | ... | |
2429 | 2429 |
* - A boolean value -> if has been or not validated <br> |
2430 | 2430 |
* - An String -> a message about the invalid |
2431 | 2431 |
* |
2432 |
* @author Pablo Piqueras Bartolom? (p_queras_pab@hotmail.com)
|
|
2432 |
* @author Pablo Piqueras Bartolom� (p_queras_pab@hotmail.com)
|
|
2433 | 2433 |
*/ |
2434 | 2434 |
private class ValidationInfo { |
2435 | 2435 |
private boolean _valid; |
Also available in: Unified diff