Revision 9448
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop</artifactId> |
|
6 |
<version>2.0.444</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.topology</artifactId> |
|
9 |
<version>1.0.167</version> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>${project.artifactId}</name> |
|
12 |
|
|
13 |
<url>https://devel.gvsig.org/svn/gvsig-projects-pool/${project.artifactId}/trunk/${project.artifactId}</url> |
|
14 |
|
|
15 |
<distributionManagement> |
|
16 |
<site> |
|
17 |
<id>gvsig-repository</id> |
|
18 |
<url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url> |
|
19 |
</site> |
|
20 |
</distributionManagement> |
|
21 |
|
|
22 |
<scm> |
|
23 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.topology/tags/org.gvsig.topology-1.0.167</connection> |
|
24 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.topology/tags/org.gvsig.topology-1.0.167</developerConnection> |
|
25 |
<url>https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.topology/tags/org.gvsig.topology-1.0.167</url> |
|
26 |
</scm> |
|
27 |
|
|
28 |
<developers> |
|
29 |
<developer> |
|
30 |
<id>jjdelcerro</id> |
|
31 |
<name>Joaquin Jose del Cerro</name> |
|
32 |
<email>jjdelcerro@gvsig.com</email> |
|
33 |
<roles> |
|
34 |
<role>Architect</role> |
|
35 |
<role>Developer</role> |
|
36 |
</roles> |
|
37 |
</developer> |
|
38 |
</developers> |
|
39 |
|
|
40 |
<repositories> |
|
41 |
<repository> |
|
42 |
<id>gvsig-public-http-repository</id> |
|
43 |
<name>gvSIG maven public HTTP repository</name> |
|
44 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
45 |
<releases> |
|
46 |
<enabled>true</enabled> |
|
47 |
<updatePolicy>daily</updatePolicy> |
|
48 |
<checksumPolicy>warn</checksumPolicy> |
|
49 |
</releases> |
|
50 |
<snapshots> |
|
51 |
<enabled>true</enabled> |
|
52 |
<updatePolicy>daily</updatePolicy> |
|
53 |
<checksumPolicy>warn</checksumPolicy> |
|
54 |
</snapshots> |
|
55 |
</repository> |
|
56 |
</repositories> |
|
57 |
|
|
58 |
<build> |
|
59 |
<plugins> |
|
60 |
<plugin> |
|
61 |
<groupId>org.apache.maven.plugins</groupId> |
|
62 |
<artifactId>maven-release-plugin</artifactId> |
|
63 |
<configuration> |
|
64 |
<tagBase>https://devel.gvsig.org/svn/gvsig-projects-pool/${project.artifactId}/tags</tagBase> |
|
65 |
<goal>deploy</goal> |
|
66 |
</configuration> |
|
67 |
</plugin> |
|
68 |
</plugins> |
|
69 |
</build> |
|
70 |
|
|
71 |
|
|
72 |
<dependencyManagement> |
|
73 |
<dependencies> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.topology.app.mainplugin</artifactId> |
|
77 |
<version>1.0.167</version> |
|
78 |
</dependency> |
|
79 |
<dependency> |
|
80 |
<groupId>org.gvsig</groupId> |
|
81 |
<artifactId>org.gvsig.topology.lib.api</artifactId> |
|
82 |
<version>1.0.167</version> |
|
83 |
</dependency> |
|
84 |
<dependency> |
|
85 |
<groupId>org.gvsig</groupId> |
|
86 |
<artifactId>org.gvsig.topology.lib.impl</artifactId> |
|
87 |
<version>1.0.167</version> |
|
88 |
</dependency> |
|
89 |
<dependency> |
|
90 |
<groupId>org.gvsig</groupId> |
|
91 |
<artifactId>org.gvsig.topology.swing.api</artifactId> |
|
92 |
<version>1.0.167</version> |
|
93 |
</dependency> |
|
94 |
<dependency> |
|
95 |
<groupId>org.gvsig</groupId> |
|
96 |
<artifactId>org.gvsig.topology.swing.impl</artifactId> |
|
97 |
<version>1.0.167</version> |
|
98 |
</dependency> |
|
99 |
</dependencies> |
|
100 |
</dependencyManagement> |
|
101 |
|
|
102 |
<modules> |
|
103 |
<module>org.gvsig.topology.lib</module> |
|
104 |
<module>org.gvsig.topology.swing</module> |
|
105 |
<module>org.gvsig.topology.app</module> |
|
106 |
</modules> |
|
107 |
|
|
108 |
<properties> |
|
109 |
<encoding>UTF-8</encoding> |
|
110 |
</properties> |
|
111 |
|
|
112 |
</project> |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.topology</artifactId> |
|
6 |
<version>1.0.167</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.topology.app</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>${project.artifactId}</name> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.topology.app.mainplugin</module> |
|
13 |
</modules> |
|
14 |
</project> |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Tue Mar 19 12:33:07 CET 2024 |
|
2 |
buildNumber=174 |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2014 gvSIG |
|
3 |
Association. This program is free software; you can redistribute it and/or modify |
|
4 |
it under the terms of the GNU General Public License as published by the Free Software |
|
5 |
Foundation; either version 3 of the License, or (at your option) any later version. |
|
6 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
7 |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
8 |
PURPOSE. See the GNU General Public License for more details. You should have received |
|
9 |
a copy of the GNU General Public License along with this program; if not, write to |
|
10 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
11 |
USA. For any additional information, do not hesitate to contact us at info AT gvsig.com, |
|
12 |
or visit our website www.gvsig.com. --> |
|
13 |
<plugin-config> |
|
14 |
<depends plugin-name="org.gvsig.app.mainplugin" /> |
|
15 |
<depends plugin-name="org.gvsig.app.document.table.app.mainplugin" /> |
|
16 |
<resourceBundle name="text" /> |
|
17 |
<libraries library-dir="lib" /> |
|
18 |
<extensions> |
|
19 |
|
|
20 |
|
|
21 |
<extension class-name="org.gvsig.topology.app.mainplugin.TopologyExtension" |
|
22 |
description="" active="true" priority="1"> |
|
23 |
<action |
|
24 |
name="tools-topology-create-or-modify" |
|
25 |
label="_Show_create_or_edit_topology_plan" |
|
26 |
position="908300100" |
|
27 |
tooltip="_Show_create_or_edit_topology_plan" |
|
28 |
action-command="tools-topology-create-or-modify" |
|
29 |
icon="tools-topology-create-or-modify" |
|
30 |
accelerator="" |
|
31 |
/> |
|
32 |
<action |
|
33 |
name="tools-topology-execute" |
|
34 |
label="_Execute_topology_plan" |
|
35 |
position="908300200" |
|
36 |
tooltip="_Execute_topology_plan" |
|
37 |
action-command="tools-topology-execute" |
|
38 |
icon="tools-topology-execute" |
|
39 |
accelerator="" |
|
40 |
/> |
|
41 |
<action |
|
42 |
name="tools-topology-checklayer" |
|
43 |
label="_Validate_geometries" |
|
44 |
position="000657000000" |
|
45 |
tooltip="_Validate_geometries" |
|
46 |
action-command="tools-topology-checklayer" |
|
47 |
icon="tools-topology-checklayer" |
|
48 |
accelerator="" |
|
49 |
/> |
|
50 |
|
|
51 |
<menu text="tools/_Topology" |
|
52 |
position="908300000" |
|
53 |
is_separator="true"/> |
|
54 |
<menu text="tools/_Topology/_Create_or_edit_plan" |
|
55 |
name="tools-topology-create-or-modify"/> |
|
56 |
<menu text="tools/_Topology/_Execute_plan" |
|
57 |
name="tools-topology-execute"/> |
|
58 |
<menu text="Layer/_Validate_geometries" |
|
59 |
name="tools-topology-checklayer"/> |
|
60 |
|
|
61 |
|
|
62 |
<!-- |
|
63 |
<tool-bar name="topology" position="2000"> |
|
64 |
<action-tool name="tools-topology-create-or-modify"/> |
|
65 |
<action-tool name="tools-topology-execute"/> |
|
66 |
</tool-bar> |
|
67 |
--> |
|
68 |
</extension> |
|
69 |
|
|
70 |
|
|
71 |
</extensions> |
|
72 |
</plugin-config> |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1 |
#Translations for language [es] |
|
2 |
#Thu Nov 20 10:10:09 CET 2014 |
|
3 |
_Topology=Topologia |
|
4 |
_Create_or_edit_plan=Crear o modificar plan |
|
5 |
_Execute_plan=Ejecutar plan |
|
6 |
_Topology_plan_error_inspector=Inspector de errores del Plan de topologia |
|
7 |
_Topology_plan=Plan de topologia |
|
8 |
_Show=Mostrar |
|
9 |
_Show_errors=Mostrar errores |
|
10 |
_Show_exceptions=Mostrar excepciones |
|
11 |
_Show_only_in_visible_extent=Mostrar solo en el area visible |
|
12 |
_Show_form_when_modify_geometry=Mostrar formulario al modificar la geometria |
|
13 |
_Zoom=Zoom |
|
14 |
Center_geometry=Centrar geometria |
|
15 |
_Center_error=Centrar error |
|
16 |
_Actions=Acciones |
|
17 |
_Action=Acci\u00f3n |
|
18 |
_Update=Actualizar |
|
19 |
_Name=Nombre |
|
20 |
_Tolerance=Tolerancia |
|
21 |
_DataSets=Conjuntos de datos |
|
22 |
_Dataset1=Conjunto de datos1 |
|
23 |
_Dataset2=Conjunto de datos2 |
|
24 |
_Rules=Reglas |
|
25 |
_Remove_dataset=Eliminar conjunto de datos |
|
26 |
_Add_dataset=A\u00f1adir conjunto de datos |
|
27 |
_Remove_rule=Eliminar regla |
|
28 |
_Add_rule=A\u00f1adir regla |
|
29 |
_Edit_rule=Modificar regla |
|
30 |
_Contains_Point=Contiene punto |
|
31 |
_Primary_dataset=Conjunto de datos primario |
|
32 |
_Secondary_dataset=Conjunto de datos secundario |
|
33 |
_Rule=Regla |
|
34 |
_Add_new_rule=A\u00f1adir nueva regla |
|
35 |
_Exception=Excepcion |
|
36 |
_Errors=Errores |
|
37 |
_Parameters=Parametros |
|
38 |
_Accept=Aceptar |
|
39 |
_Execute=Ejecutar |
|
40 |
_Any_rule=Cualquier regla |
|
41 |
_Erase_error_marks=Eliminar marcas de errores |
|
42 |
_Select_a_dataset=Seleccione un conjunto de datos |
|
43 |
_The_polygon_overlay_with_other=El pol\u00edgono se superpone con otro |
|
44 |
_The_geometry_is_null=La geometr\u00eda es nula. |
|
45 |
_Point_is_not_contained_in_a_polygon=El punto no est\u00e1 contenido en un pol\u00edgono |
|
46 |
_The_polygon_does_not_contain_any_points=El pol\u00edgono no contiene ning\u00fan punto |
|
47 |
_The_length_of_the_line_is_less_than_the_specified_tolerance=La longitud de la l\u00ednea es menore que la tolerancia dada |
|
48 |
_Polygon_is_not_covered_by_any_other_polygon=El pol\u00edgono no est\u00e1 cubierto por ning\u00fan otro pol\u00edgono |
|
49 |
_Line_is_not_covered_by_boundary_of_any_polygon=La l\u00ednea no est\u00e1 cubierta por el l\u00edmite de ning\u00fan pol\u00edgono |
|
50 |
_Line_is_not_covered_by_boundary_of_the_polygon=La l\u00ednea no est\u00e1 cubierta por el l\u00edmite del pol\u00edgono |
|
51 |
_Line_crosses_too_many_polygons=La l\u00ednea cruza por demasiados pol\u00edgonos |
|
52 |
The_solution_cannot_be_automated_because_the_line_crosses_too_many_polygons=No se puede automatizar la soluci\u00f3n porque la l\u00ednea cruza por demasiados pol\u00edgonos |
|
53 |
_The_polygon_does_not_contain_any_polygons=El pol\u00edgono no contiene ning\u00fan pol\u00edgono |
|
54 |
_The_polygon_contains_more_than_a_point=El pol\u00edgono contiene m\u00e1s de un punto |
|
55 |
_Add_dataset=A\u00f1adir conjunto de datos |
|
56 |
_The_dataset_XnameX_is_neither_2D_nor_2DM_The_result_of_the_topological_checks_may_not_be_what_you_expect_Do_you_want_to_continue=El conjunto de datos "{0}" no es 2D ni 2DM. El resultado de las comprobaciones topol\u00f3gicas puede no ser el esperado.\n\u00bfDesea continuar? |
|
57 |
_Add_non_2D_topology_dataset=A\u00f1adir conjunto de datos no 2D a topolog\u00eda |
|
58 |
_Accept_exceptions=Aceptar excepciones |
|
59 |
_Copy_topology_Plan_to_clipboard=Copiar el plan de topologia al portapapeles |
|
60 |
_Customizable=Personalizable |
|
61 |
_Check_code=C\u00f3digo de verificaci\u00f3n |
|
62 |
_Action_code=C\u00f3digo de la acci\u00f3n |
|
63 |
_Save_topology_plan=Guardar plan de topolog\u00eda |
|
64 |
_Select_topology_plan_file=Seleccionar archivo de plan de topolog\u00eda |
|
65 |
_Cant_save_topology_plan=No se puede guardar el plan de topolog\u00eda |
|
66 |
_Load_topology_plan=Cargar plan de topolog\u00eda |
|
67 |
_Cant_load_topology_plan=No se puede cargar el plan de topolog\u00eda |
|
68 |
_Modify_rule=Modificar regla |
|
69 |
_Check_expression=Expressi\u00f3n de verificaci\u00f3n |
|
70 |
_Verification_expression_If_false_the_rule_fails=Expresi\u00f3n de verificaci\u00f3n. Si devuelve false la regla falla. |
|
71 |
_Error_message=Mensaje de error. |
|
72 |
_Message_to_show_if_check_fail=Mensaje a mostrar cuando la regla falla. |
|
73 |
_The_verification_expression_was_not_met=No se ha cumplido la expresi\u00f3n de verificaci\u00f3n. |
|
74 |
_Name_of_the_rule=Nombre de la regla |
|
75 |
|
|
76 |
_Validate_geometries=Validar geometr\u00edas |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1 |
#Translations for language [en] |
|
2 |
#Thu Nov 20 10:10:15 CET 2014 |
|
3 |
_Topology=Topology |
|
4 |
_Create_or_edit_plan=Create or edit plan |
|
5 |
_Execute_plan=Execute plan |
|
6 |
_Topology_plan_error_inspector=Topology plan error inspector |
|
7 |
_Topology_plan=Topology plan |
|
8 |
_Show=Show |
|
9 |
_Show_errors=Show errors |
|
10 |
_Show_exceptions=Show exceptions |
|
11 |
_Show_only_in_visible_extent=Show only in visible extent |
|
12 |
_Show_form_when_modify_geometry=Show form when modify geometry |
|
13 |
_Zoom=Zoom |
|
14 |
_Center_geometry=Center geometry |
|
15 |
_Center_error=Center error |
|
16 |
_Actions=Actions |
|
17 |
_Action=Action |
|
18 |
_Update=Update |
|
19 |
_Name=Name |
|
20 |
_Tolerance=Tolerance |
|
21 |
_DataSets=Datasets |
|
22 |
_Dataset1=Dataset1 |
|
23 |
_Dataset2=Dataset2 |
|
24 |
_Rules=Rules |
|
25 |
_Remove_dataset=Remove dataset |
|
26 |
_Add_dataset=Add dataset |
|
27 |
_Remove_rule=Remove rule |
|
28 |
_Add_rule=Add rule |
|
29 |
_Edit_rule=Edit rule |
|
30 |
_Primary_dataset=Primary dataset |
|
31 |
_Secondary_dataset=Secondary dataset |
|
32 |
_Rule=Rule |
|
33 |
_Add_new_rule=Add new rule |
|
34 |
_Exception=Exception |
|
35 |
_Errors=Errors |
|
36 |
_Parameters=Parameters |
|
37 |
_Accept=Accept |
|
38 |
_Execute=Execute |
|
39 |
_Any_rule=Any rule |
|
40 |
_Erase_error_marks=Erase error marks |
|
41 |
_Select_a_dataset=Select a dataset |
|
42 |
_The_polygon_overlay_with_other=The polygon overlay with other. |
|
43 |
_The_geometry_is_null=The geometry is null. |
|
44 |
_Point_is_not_contained_in_a_polygon=Point is not contained in a polygon |
|
45 |
_The_polygon_does_not_contain_any_points=The polygon does not contain any points |
|
46 |
_The_length_of_the_line_is_less_than_the_specified_tolerance=The length of the line is less than the specified tolerance |
|
47 |
_Polygon_is_not_covered_by_any_other_polygon=The polygon is not covered by any other polygon |
|
48 |
_Line_is_not_covered_by_boundary_of_any_polygon=Line is not covered by boundary of any polygon |
|
49 |
_Line_is_not_covered_by_boundary_of_the_polygon=Line is not covered by boundary of thes polygon |
|
50 |
_Line_crosses_too_many_polygons=Line crosses too many polygons |
|
51 |
The_solution_cannot_be_automated_because_the_line_crosses_too_many_polygons=The solution cannot be automated because the line crosses too many polygons |
|
52 |
_The_polygon_does_not_contain_any_polygons=The polygon does not contain any polygons |
|
53 |
_The_polygon_contains_more_than_a_point=The polygon contains more than a point |
|
54 |
_Add_dataset=Add dataset |
|
55 |
_The_dataset_XnameX_is_neither_2D_nor_2DM_The_result_of_the_topological_checks_may_not_be_what_you_expect_Do_you_want_to_continue=The dataset "{0}" is neither 2D nor 2DM. The result of the topological checks may not be what you expect.\nDo you want to continue? |
|
56 |
_Add_non_2D_topology_dataset=Add non 2D topology dataset |
|
57 |
_Accept_exceptions=Accept exceptions |
|
58 |
_Copy_topology_Plan_to_clipboard=Copy topology plan to clipboard |
|
59 |
_Customizable=Customizable |
|
60 |
_Check_code=Check code |
|
61 |
_Action_code=Action code |
|
62 |
_Save_topology_plan=Save topology plan |
|
63 |
_Select_topology_plan_file=Select topology plan file |
|
64 |
_Cant_save_topology_plan=Can't save topology plan |
|
65 |
_Load_topology_plan=Load topology plan |
|
66 |
_Cant_load_topology_plan=Can't load topology plan |
|
67 |
_Modify_rule=Modify rule |
|
68 |
_Check_expression=Check expression |
|
69 |
_Verification_expression_If_false_the_rule_fails=Verification expression. If false the rule fails. |
|
70 |
_Error_message=Error message |
|
71 |
_Message_to_show_if_check_fail=Message to show if check fail. |
|
72 |
_The_verification_expression_was_not_met=The verification expression was not met. |
|
73 |
_Name_of_the_rule=Name of the rule |
|
74 |
|
|
75 |
_Validate_geometries=Validate geometries |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
|
|
51 |
<dependencySets> |
|
52 |
<dependencySet> |
|
53 |
<useProjectArtifact>false</useProjectArtifact> |
|
54 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
55 |
<outputDirectory>lib</outputDirectory> |
|
56 |
<includes> |
|
57 |
<include>org.gvsig:org.gvsig.topology.lib.api</include> |
|
58 |
<include>org.gvsig:org.gvsig.topology.lib.impl</include> |
|
59 |
<include>org.gvsig:org.gvsig.topology.swing.api</include> |
|
60 |
<include>org.gvsig:org.gvsig.topology.swing.impl</include> |
|
61 |
</includes> |
|
62 |
</dependencySet> |
|
63 |
</dependencySets> |
|
64 |
|
|
65 |
</assembly> |
|
66 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/src/main/java/org/gvsig/topology/app/mainplugin/DataSetsTreeModel.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.topology.app.mainplugin; |
|
25 |
|
|
26 |
import java.util.Map; |
|
27 |
import javax.swing.ImageIcon; |
|
28 |
import javax.swing.event.TreeModelListener; |
|
29 |
import javax.swing.tree.TreeModel; |
|
30 |
import javax.swing.tree.TreePath; |
|
31 |
import org.gvsig.andami.IconThemeHelper; |
|
32 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
33 |
import org.gvsig.fmap.dal.DALLocator; |
|
34 |
import org.gvsig.fmap.dal.DataManager; |
|
35 |
import org.gvsig.fmap.dal.DataStore; |
|
36 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
37 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
38 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
|
39 |
import org.gvsig.fmap.mapcontrol.CompoundLayersTreeModel; |
|
40 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
|
41 |
import org.gvsig.tools.swing.api.ListElement; |
|
42 |
import org.gvsig.topology.lib.api.TopologyDataSet; |
|
43 |
import org.gvsig.topology.lib.api.TopologyLocator; |
|
44 |
import org.gvsig.topology.swing.api.TopologySwingServices; |
|
45 |
|
|
46 |
/** |
|
47 |
* |
|
48 |
* @author jjdelcerro |
|
49 |
*/ |
|
50 |
public class DataSetsTreeModel implements TreeModel { |
|
51 |
|
|
52 |
private final ViewDocument view; |
|
53 |
private final CompoundLayersTreeModel deletaged; |
|
54 |
private final TopologySwingServices services; |
|
55 |
private final ListElement<Object> root; |
|
56 |
|
|
57 |
public DataSetsTreeModel(TopologySwingServices services, ViewDocument view) { |
|
58 |
this.services = services; |
|
59 |
CompoundLayersTreeModel model = (CompoundLayersTreeModel) MapControlLocator.getMapControlManager().createCompoundLayersTreeModel(); |
|
60 |
this.view = view; |
|
61 |
if( view!=null ) { |
|
62 |
model.addLayers(view.getMapContext().getLayers()); |
|
63 |
} |
|
64 |
this.deletaged = model; |
|
65 |
this.root = new ListElement<>("Project", this.deletaged.getRoot()); |
|
66 |
|
|
67 |
} |
|
68 |
|
|
69 |
private Object getNode(Object value) { |
|
70 |
if( value instanceof ListElement ) { |
|
71 |
return ((ListElement) value).getValue(); |
|
72 |
} |
|
73 |
return value; |
|
74 |
} |
|
75 |
|
|
76 |
@Override |
|
77 |
public Object getRoot() { |
|
78 |
return this.root; |
|
79 |
} |
|
80 |
|
|
81 |
@Override |
|
82 |
public Object getChild(Object parent, int index) { |
|
83 |
parent = this.getNode(parent); |
|
84 |
Object x = this.deletaged.getChild(parent, index); |
|
85 |
if( x instanceof SingleLayer ) { |
|
86 |
SingleLayer layer = (SingleLayer)x; |
|
87 |
DataStore store = layer.getDataStore(); |
|
88 |
x = TopologyLocator.getTopologyManager().createDataSet( |
|
89 |
layer.getName(), |
|
90 |
store |
|
91 |
); |
|
92 |
} |
|
93 |
return x; |
|
94 |
} |
|
95 |
|
|
96 |
@Override |
|
97 |
public int getChildCount(Object parent) { |
|
98 |
parent = this.getNode(parent); |
|
99 |
return this.deletaged.getChildCount(parent); |
|
100 |
} |
|
101 |
|
|
102 |
@Override |
|
103 |
public boolean isLeaf(Object node) { |
|
104 |
node = this.getNode(node); |
|
105 |
return this.deletaged.isLeaf(node); |
|
106 |
} |
|
107 |
|
|
108 |
@Override |
|
109 |
public void valueForPathChanged(TreePath path, Object newValue) { |
|
110 |
this.deletaged.valueForPathChanged(path, newValue); |
|
111 |
} |
|
112 |
|
|
113 |
@Override |
|
114 |
public int getIndexOfChild(Object parent, Object child) { |
|
115 |
parent = this.getNode(parent); |
|
116 |
return this.deletaged.getIndexOfChild(parent, child); |
|
117 |
} |
|
118 |
|
|
119 |
@Override |
|
120 |
public void addTreeModelListener(TreeModelListener l) { |
|
121 |
this.deletaged.addTreeModelListener(l); |
|
122 |
} |
|
123 |
|
|
124 |
@Override |
|
125 |
public void removeTreeModelListener(TreeModelListener l) { |
|
126 |
this.deletaged.removeTreeModelListener(l); |
|
127 |
} |
|
128 |
|
|
129 |
public ImageIcon getTreeIcon(Object item) { |
|
130 |
if( this.getRoot()==item ) { |
|
131 |
return IconThemeHelper.getImageIcon("topology-tree-project"); |
|
132 |
} |
|
133 |
if (item instanceof ListElement) { |
|
134 |
item = ((ListElement) item).getValue(); |
|
135 |
} |
|
136 |
if( this.view!=null && this.view.getMapContext().getLayers()==item ) { |
|
137 |
return IconThemeHelper.getImageIcon("document-view-tree-icon"); |
|
138 |
} |
|
139 |
if (item instanceof TopologyDataSet) { |
|
140 |
DataStore store = ((TopologyDataSet)item).getStore(); |
|
141 |
String iconName = MapContextLocator.getMapContextManager().getIconLayer(store); |
|
142 |
return IconThemeHelper.getImageIcon(iconName); |
|
143 |
} |
|
144 |
if (item instanceof FLayer) { |
|
145 |
String iconName = ((FLayer) item).getTocImageIcon(); |
|
146 |
return IconThemeHelper.getImageIcon(iconName); |
|
147 |
} |
|
148 |
return IconThemeHelper.getImageIcon("topology-tree-folder"); |
|
149 |
} |
|
150 |
|
|
151 |
} |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/src/main/java/org/gvsig/topology/app/mainplugin/TopologyExtension.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.topology.app.mainplugin; |
|
25 |
|
|
26 |
import java.awt.event.ActionEvent; |
|
27 |
import java.io.File; |
|
28 |
import java.io.IOException; |
|
29 |
import java.nio.charset.StandardCharsets; |
|
30 |
import javax.swing.AbstractAction; |
|
31 |
import static javax.swing.Action.ACTION_COMMAND_KEY; |
|
32 |
import static javax.swing.Action.NAME; |
|
33 |
import javax.swing.JFileChooser; |
|
34 |
import javax.swing.JOptionPane; |
|
35 |
import javax.swing.filechooser.FileFilter; |
|
36 |
import org.apache.commons.io.FileUtils; |
|
37 |
import org.apache.commons.io.FilenameUtils; |
|
38 |
import org.apache.commons.lang.StringUtils; |
|
39 |
import org.gvsig.andami.IconThemeHelper; |
|
40 |
import org.gvsig.andami.plugins.Extension; |
|
41 |
import org.gvsig.app.ApplicationLocator; |
|
42 |
import org.gvsig.app.ApplicationManager; |
|
43 |
import org.gvsig.app.project.Project; |
|
44 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
45 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
46 |
import org.gvsig.configurableactions.ConfigurableActionsMamager; |
|
47 |
import org.gvsig.filedialogchooser.FileDialogChooser; |
|
48 |
import org.gvsig.filedialogchooser.FileDialogChooserManager; |
|
49 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
50 |
import org.gvsig.fmap.mapcontext.layers.vectorial.VectorLayer; |
|
51 |
import org.gvsig.json.Json; |
|
52 |
import org.gvsig.tools.ToolsLocator; |
|
53 |
import org.gvsig.tools.i18n.I18nManager; |
|
54 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
55 |
import org.gvsig.tools.swing.api.ToolsSwingUtils; |
|
56 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
57 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
58 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
59 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
60 |
import org.gvsig.tools.util.ToolsUtilLocator; |
|
61 |
import org.gvsig.topology.lib.api.TopologyLocator; |
|
62 |
import org.gvsig.topology.lib.api.TopologyManager; |
|
63 |
import org.gvsig.topology.lib.api.TopologyPlan; |
|
64 |
import org.gvsig.topology.swing.api.JTopologyPlanProperties; |
|
65 |
import org.gvsig.topology.swing.api.JTopologyReport; |
|
66 |
import org.gvsig.topology.swing.api.TopologySwingLocator; |
|
67 |
import org.gvsig.topology.swing.api.TopologySwingManager; |
|
68 |
|
|
69 |
/** |
|
70 |
* |
|
71 |
* @author gvSIG Team |
|
72 |
*/ |
|
73 |
@SuppressWarnings("UseSpecificCatch") |
|
74 |
public class TopologyExtension extends Extension { |
|
75 |
|
|
76 |
public static final String TOPOLOGYPLAN_FILE_EXTENSION = "gvtoplan"; |
|
77 |
|
|
78 |
@Override |
|
79 |
public void initialize() { |
|
80 |
|
|
81 |
} |
|
82 |
|
|
83 |
@Override |
|
84 |
public void postInitialize() { |
|
85 |
AppTopologyServices services = new AppTopologyServices(); |
|
86 |
|
|
87 |
TopologyManager manager = TopologyLocator.getTopologyManager(); |
|
88 |
manager.setDefaultServices(services); |
|
89 |
|
|
90 |
TopologySwingManager swingManager = TopologySwingLocator.getTopologySwingManager(); |
|
91 |
swingManager.setDefaultServices(services); |
|
92 |
|
|
93 |
IconThemeHelper.registerIcon("topology", "topology-plan", "document-view-tree-icon", this); |
|
94 |
IconThemeHelper.registerIcon("topology", "topology-plan", "topology-tree-folder", this); |
|
95 |
IconThemeHelper.registerIcon("topology", "topology-plan", "topology-tree-project", this); |
|
96 |
IconThemeHelper.registerIcon("action", "tools-topology-checklayer", this); |
|
97 |
|
|
98 |
ConfigurableActionsMamager cfgActionsManager = ToolsUtilLocator.getConfigurableActionsMamager(); |
|
99 |
cfgActionsManager.addConfigurableAction(JTopologyPlanProperties.CONFIGURABLE_PANEL_ID, new SaveTopologyPlan()); |
|
100 |
cfgActionsManager.addConfigurableAction(JTopologyPlanProperties.CONFIGURABLE_PANEL_ID, new LoadTopologyPlan()); |
|
101 |
} |
|
102 |
|
|
103 |
|
|
104 |
@Override |
|
105 |
public void execute(String action) { |
|
106 |
if( StringUtils.equalsIgnoreCase("tools-topology-create-or-modify", action) ) { |
|
107 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
108 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
109 |
|
|
110 |
TopologyManager manager = TopologyLocator.getTopologyManager(); |
|
111 |
TopologySwingManager swingManager = TopologySwingLocator.getTopologySwingManager(); |
|
112 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
113 |
|
|
114 |
final JTopologyPlanProperties panel = swingManager.createJTopologyPlan(); |
|
115 |
|
|
116 |
TopologyPlan plan = getCurrentTopologyPlan(); |
|
117 |
if( plan == null ) { |
|
118 |
plan = manager.createTopologyPlan(); |
|
119 |
} |
|
120 |
panel.put(plan); |
|
121 |
|
|
122 |
final Dialog dlg = winManager.createDialog( |
|
123 |
panel.asJComponent(), |
|
124 |
i18n.getTranslation("_Topology_plan"), |
|
125 |
null, |
|
126 |
WindowManager_v2.BUTTONS_APPLY_OK_CANCEL |
|
127 |
); |
|
128 |
dlg.setButtonLabel(WindowManager_v2.BUTTON_APPLY, i18n.getTranslation("_Execute")); |
|
129 |
dlg.addActionListener((ActionEvent e) -> { |
|
130 |
TopologyPlan plan1; |
|
131 |
switch(dlg.getAction()) { |
|
132 |
case WindowManager_v2.BUTTON_OK: |
|
133 |
plan1 = panel.fetch(null); |
|
134 |
setCurrentTopologyPlan(plan1); |
|
135 |
break; |
|
136 |
case WindowManager_v2.BUTTON_APPLY: |
|
137 |
plan1 = panel.fetch(null); |
|
138 |
setCurrentTopologyPlan(plan1); |
|
139 |
JTopologyReport jreport = swingManager.createJTopologyReport(plan1); |
|
140 |
jreport.put(plan1); |
|
141 |
winManager.showWindow( |
|
142 |
jreport.asJComponent(), |
|
143 |
i18n.getTranslation("_Topology_plan_error_inspector") + " ("+plan1.getName()+")", |
|
144 |
WindowManager.MODE.TOOL |
|
145 |
); |
|
146 |
Thread th = new Thread(() -> { |
|
147 |
plan1.execute(); |
|
148 |
}, "TopologyPlan-"+ plan1.getName()); |
|
149 |
th.start(); |
|
150 |
break; |
|
151 |
} |
|
152 |
}); |
|
153 |
dlg.show(WindowManager.MODE.WINDOW); |
|
154 |
|
|
155 |
} else if( StringUtils.equalsIgnoreCase("tools-topology-execute", action) ) { |
|
156 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
157 |
final TopologySwingManager swingManager = TopologySwingLocator.getTopologySwingManager(); |
|
158 |
final WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
159 |
|
|
160 |
|
|
161 |
final TopologyPlan plan = getCurrentTopologyPlan(); |
|
162 |
if( plan == null ) { |
|
163 |
// TODO: Mensaje de crear plan |
|
164 |
return; |
|
165 |
} |
|
166 |
JTopologyReport panel = swingManager.createJTopologyReport(plan); |
|
167 |
panel.put(plan); |
|
168 |
winManager.showWindow( |
|
169 |
panel.asJComponent(), |
|
170 |
ToolsSwingUtils.makeTitle("_Topology_plan_error_inspector", plan.getName(), null), |
|
171 |
WindowManager.MODE.TOOL |
|
172 |
); |
|
173 |
|
|
174 |
Thread th = new Thread(() -> { |
|
175 |
plan.execute(); |
|
176 |
}, "TopologyPlan-"+ plan.getName()); |
|
177 |
th.start(); |
|
178 |
|
|
179 |
} else if( StringUtils.equalsIgnoreCase("tools-topology-checklayer", action) ) { |
|
180 |
checkCurrentLayer(); |
|
181 |
} |
|
182 |
} |
|
183 |
|
|
184 |
|
|
185 |
private static String getCurrentTopologyPlanAsJson() { |
|
186 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
187 |
// final ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
188 |
// if( view==null ) { |
|
189 |
// return null; |
|
190 |
// } |
|
191 |
// String jsonPlan = (String) view.getProperty("TopologyPlan"); |
|
192 |
Project project = application.getCurrentProject(); |
|
193 |
String jsonPlan = (String) project.getProperty("TopologyPlan"); |
|
194 |
return jsonPlan; |
|
195 |
} |
|
196 |
|
|
197 |
private static boolean setCurrentTopologyPlan(String jsonPlan) { |
|
198 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
199 |
// final ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
200 |
// if( view==null ) { |
|
201 |
// return false; |
|
202 |
// } |
|
203 |
// view.setProperty("TopologyPlan", jsonPlan); |
|
204 |
Project project = application.getCurrentProject(); |
|
205 |
project.setProperty("TopologyPlan", jsonPlan); |
|
206 |
return true; |
|
207 |
} |
|
208 |
|
|
209 |
public static TopologyPlan getCurrentTopologyPlan() { |
|
210 |
String jsonPlan_s = getCurrentTopologyPlanAsJson(); |
|
211 |
if( StringUtils.isBlank(jsonPlan_s) ) { |
|
212 |
return null; |
|
213 |
} |
|
214 |
try { |
|
215 |
TopologyManager manager = TopologyLocator.getTopologyManager(); |
|
216 |
TopologyPlan plan = manager.createTopologyPlan(); |
|
217 |
plan.fromJson(Json.createObject(jsonPlan_s)); |
|
218 |
return plan; |
|
219 |
} catch (Exception ex) { |
|
220 |
throw new RuntimeException("Can't retrieve topology plan from json.",ex); |
|
221 |
} |
|
222 |
} |
|
223 |
|
|
224 |
public static boolean setCurrentTopologyPlan(TopologyPlan plan) { |
|
225 |
return setCurrentTopologyPlan(plan.toJson().toString()); |
|
226 |
} |
|
227 |
|
|
228 |
@Override |
|
229 |
public boolean isEnabled() { |
|
230 |
// ApplicationManager application = ApplicationLocator.getManager(); |
|
231 |
// Document view = application.getActiveDocument(ViewManager.TYPENAME); |
|
232 |
// return view!=null; |
|
233 |
return true; |
|
234 |
} |
|
235 |
|
|
236 |
@Override |
|
237 |
public boolean isVisible() { |
|
238 |
return true; |
|
239 |
} |
|
240 |
|
|
241 |
private static class SaveTopologyPlan extends AbstractAction { |
|
242 |
|
|
243 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
244 |
public SaveTopologyPlan() { |
|
245 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
246 |
|
|
247 |
this.putValue(NAME, i18n.getTranslation("_Save_topology_plan")); |
|
248 |
this.putValue(ACTION_COMMAND_KEY, "SaveTopologyPLanToFile"); |
|
249 |
} |
|
250 |
|
|
251 |
@Override |
|
252 |
public void actionPerformed(ActionEvent e) { |
|
253 |
final I18nManager i18n = ToolsLocator.getI18nManager(); |
|
254 |
|
|
255 |
JTopologyPlanProperties panel = (JTopologyPlanProperties) e.getSource(); |
|
256 |
TopologyPlan plan = panel.fetch(null); |
|
257 |
|
|
258 |
// _Select_topology_plan_file |
|
259 |
// Select topology plan file |
|
260 |
// Seleccionar archivo de plan de topologÃa |
|
261 |
|
|
262 |
FileDialogChooserManager fileDislogs = ToolsUtilLocator.getFileDialogChooserManager(); |
|
263 |
FileDialogChooser dialog = fileDislogs.create("TopologyPlan"); |
|
264 |
dialog.setCurrentDirectory(null); |
|
265 |
dialog.setDialogTitle(i18n.getTranslation("_Select_topology_plan_file")); |
|
266 |
dialog.setMultiSelectionEnabled(false); |
|
267 |
dialog.addChoosableFileFilter(new FileFilter() { |
|
268 |
@Override |
|
269 |
public boolean accept(File f) { |
|
270 |
return f.getName().endsWith(","+TOPOLOGYPLAN_FILE_EXTENSION); |
|
271 |
} |
|
272 |
|
|
273 |
@Override |
|
274 |
public String getDescription() { |
|
275 |
final I18nManager i18n = ToolsLocator.getI18nManager(); |
|
276 |
return i18n.getTranslation("_Topology_plan"); |
|
277 |
} |
|
278 |
}); |
|
279 |
int n = dialog.showSaveDialog(panel.asJComponent()); |
|
280 |
if( n == JFileChooser.APPROVE_OPTION ) { |
|
281 |
File file = dialog.getSelectedFile(); |
|
282 |
if( FilenameUtils.indexOfExtension(file.getName())<0 ) { |
|
283 |
file = new File(file.getAbsolutePath()+"."+TOPOLOGYPLAN_FILE_EXTENSION); |
|
284 |
} |
|
285 |
try { |
|
286 |
String fcontents = plan.toJson().toString(); |
|
287 |
FileUtils.write(file, fcontents, StandardCharsets.UTF_8); |
|
288 |
} catch (IOException ex) { |
|
289 |
logger.warn("Can't save topology plan",ex); |
|
290 |
ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
291 |
dialogs.messageDialog( |
|
292 |
i18n.getTranslation("_Cant_save_topology_plan"), |
|
293 |
i18n.getTranslation("_Topology_plan"), |
|
294 |
JOptionPane.WARNING_MESSAGE |
|
295 |
); |
|
296 |
} |
|
297 |
} |
|
298 |
} |
|
299 |
} |
|
300 |
|
|
301 |
private static class LoadTopologyPlan extends AbstractAction { |
|
302 |
|
|
303 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
304 |
public LoadTopologyPlan() { |
|
305 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
306 |
|
|
307 |
this.putValue(NAME, i18n.getTranslation("_Load_topology_plan")); |
|
308 |
this.putValue(ACTION_COMMAND_KEY, "LoadTopologyPLanFromFile"); |
|
309 |
} |
|
310 |
|
|
311 |
@Override |
|
312 |
public void actionPerformed(ActionEvent e) { |
|
313 |
final I18nManager i18n = ToolsLocator.getI18nManager(); |
|
314 |
|
|
315 |
JTopologyPlanProperties panel = (JTopologyPlanProperties) e.getSource(); |
|
316 |
|
|
317 |
FileDialogChooserManager fileDislogs = ToolsUtilLocator.getFileDialogChooserManager(); |
|
318 |
FileDialogChooser dialog = fileDislogs.create("TopologyPlan"); |
|
319 |
dialog.setCurrentDirectory(null); |
|
320 |
dialog.setDialogTitle(i18n.getTranslation("_Select_topology_plan_file")); |
|
321 |
dialog.setMultiSelectionEnabled(false); |
|
322 |
dialog.addChoosableFileFilter(new FileFilter() { |
|
323 |
@Override |
|
324 |
public boolean accept(File f) { |
|
325 |
if( f.isDirectory() ) { |
|
326 |
return true; |
|
327 |
} |
|
328 |
return FilenameUtils.isExtension(f.getName(), TOPOLOGYPLAN_FILE_EXTENSION); |
|
329 |
} |
|
330 |
|
|
331 |
@Override |
|
332 |
public String getDescription() { |
|
333 |
return "Topology plan ("+TOPOLOGYPLAN_FILE_EXTENSION+")"; |
|
334 |
} |
|
335 |
}); |
|
336 |
int n = dialog.showOpenDialog(panel.asJComponent()); |
|
337 |
if( n == JFileChooser.APPROVE_OPTION ) { |
|
338 |
File file = dialog.getSelectedFile(); |
|
339 |
try { |
|
340 |
String fcontents = FileUtils.readFileToString(file, StandardCharsets.UTF_8); |
|
341 |
TopologyManager manager = TopologyLocator.getTopologyManager(); |
|
342 |
TopologyPlan plan = manager.createTopologyPlan(); |
|
343 |
plan.fromJson(Json.createObject(fcontents)); |
|
344 |
panel.put(plan); |
|
345 |
} catch (IOException ex) { |
|
346 |
logger.warn("Can't load topology plan",ex); |
|
347 |
ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
348 |
dialogs.messageDialog( |
|
349 |
i18n.getTranslation("_Cant_load_topology_plan"), |
|
350 |
i18n.getTranslation("_Topology_plan"), |
|
351 |
JOptionPane.WARNING_MESSAGE |
|
352 |
); |
|
353 |
} |
|
354 |
} |
|
355 |
} |
|
356 |
} |
|
357 |
|
|
358 |
private void checkCurrentLayer() { |
|
359 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
|
360 |
|
|
361 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
362 |
if( viewdoc == null ) { |
|
363 |
application.messageDialog( |
|
364 |
"There must be an active layer in the active View.", |
|
365 |
"Check geometries", |
|
366 |
JOptionPane.WARNING_MESSAGE |
|
367 |
); |
|
368 |
} |
|
369 |
FLayer[] activeLayers = viewdoc.getMapContext().getLayers().getActives(); |
|
370 |
if( activeLayers==null || activeLayers.length!=1 || !(activeLayers[0] instanceof VectorLayer) ) { |
|
371 |
application.messageDialog( |
|
372 |
"There must be an active vector layer in the active View.", |
|
373 |
"Check geometries", |
|
374 |
JOptionPane.WARNING_MESSAGE |
|
375 |
); |
|
376 |
return; |
|
377 |
} |
|
378 |
VectorLayer layer = (VectorLayer) activeLayers[0]; |
|
379 |
|
|
380 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
381 |
TopologyManager manager = TopologyLocator.getTopologyManager(); |
|
382 |
TopologySwingManager swingManager = TopologySwingLocator.getTopologySwingManager(); |
|
383 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
384 |
|
|
385 |
AppTopologyServices services = new AppTopologyServices(); |
|
386 |
manager.setDefaultServices(services); |
|
387 |
swingManager.setDefaultServices(services); |
|
388 |
|
|
389 |
TopologyPlan plan = manager.createTopologyPlan(); |
|
390 |
plan.setName(i18n.getTranslation("_Validate_geometries")); |
|
391 |
plan.addDataSet(layer.getName(), layer.getFeatureStore()); |
|
392 |
plan.addRule(TopologyManager.RULE_GEOMETRYISVALID_ID, layer.getName(), null, 0); |
|
393 |
plan.addRule(TopologyManager.RULE_GEOMETRYMUSTNOTBENULL_ID, layer.getName(), null, 0); |
|
394 |
|
|
395 |
JTopologyReport panel = swingManager.createJTopologyReport(plan); |
|
396 |
panel.put(plan); |
|
397 |
winManager.showWindow( |
|
398 |
panel.asJComponent(), |
|
399 |
ToolsSwingUtils.makeTitle("_Topology_plan_error_inspector", plan.getName(), layer.getName()), |
|
400 |
WindowManager.MODE.TOOL |
|
401 |
); |
|
402 |
|
|
403 |
Thread th = new Thread(() -> { |
|
404 |
plan.execute(); |
|
405 |
}, "TopologyPlan-"+ plan.getName()); |
|
406 |
th.start(); |
|
407 |
} |
|
408 |
} |
org.gvsig.topology/tags/org.gvsig.topology-1.0.167/org.gvsig.topology.app/org.gvsig.topology.app.mainplugin/src/main/java/org/gvsig/topology/app/mainplugin/AppTopologyServices.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.topology.app.mainplugin; |
|
25 |
|
|
26 |
import java.io.File; |
|
27 |
import java.util.ArrayList; |
|
28 |
import java.util.Collections; |
|
29 |
import java.util.HashMap; |
|
30 |
import java.util.Iterator; |
|
31 |
import java.util.List; |
|
32 |
import java.util.Map; |
|
33 |
import java.util.function.Predicate; |
|
34 |
import javax.swing.DefaultListModel; |
|
35 |
import javax.swing.ImageIcon; |
|
36 |
import javax.swing.ListModel; |
|
37 |
import javax.swing.tree.TreeModel; |
|
38 |
import org.apache.commons.lang.StringUtils; |
|
39 |
import org.apache.commons.lang3.mutable.Mutable; |
|
40 |
import org.apache.commons.lang3.mutable.MutableObject; |
|
41 |
import org.gvsig.andami.PluginsLocator; |
|
42 |
import org.gvsig.app.ApplicationLocator; |
|
43 |
import org.gvsig.app.ApplicationManager; |
|
44 |
import org.gvsig.app.project.Project; |
|
45 |
import org.gvsig.app.project.documents.Document; |
|
46 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
47 |
import org.gvsig.app.project.documents.table.TableManager; |
|
48 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
|
49 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
50 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
51 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
52 |
import org.gvsig.fmap.dal.EditingNotification; |
|
53 |
import org.gvsig.fmap.dal.EditingNotificationManager; |
|
54 |
import org.gvsig.fmap.dal.exception.DataException; |
|
55 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
56 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
57 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
58 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
|
59 |
import org.gvsig.fmap.geom.Geometry; |
|
60 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
|
61 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
|
62 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
|
63 |
import org.gvsig.fmap.geom.primitive.Curve; |
|
64 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
65 |
import org.gvsig.fmap.geom.primitive.Point; |
|
66 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
67 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
68 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
69 |
import org.gvsig.fmap.mapcontext.ViewPort; |
|
70 |
import org.gvsig.fmap.mapcontext.events.ColorEvent; |
|
71 |
import org.gvsig.fmap.mapcontext.events.ExtentEvent; |
|
72 |
import org.gvsig.fmap.mapcontext.events.ProjectionEvent; |
|
73 |
import org.gvsig.fmap.mapcontext.events.listeners.ViewPortListener; |
|
74 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
75 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
76 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
77 |
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer; |
|
78 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
79 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol_v2; |
|
80 |
import org.gvsig.fmap.mapcontrol.swing.dynobject.DynObjectEditor; |
|
81 |
import org.gvsig.tools.dynobject.DynObject; |
|
82 |
import org.gvsig.tools.observer.Observable; |
|
83 |
import org.gvsig.tools.observer.Observer; |
|
84 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
85 |
import org.gvsig.topology.lib.api.TopologyDataSet; |
|
86 |
import org.gvsig.topology.lib.api.TopologyLocator; |
|
87 |
import org.gvsig.topology.lib.api.TopologyManager; |
|
88 |
import org.gvsig.topology.swing.api.TopologySwingServices; |
|
89 |
import org.slf4j.Logger; |
|
90 |
import org.slf4j.LoggerFactory; |
|
91 |
|
|
92 |
/** |
|
93 |
* |
|
94 |
* @author jjdelcerro |
|
95 |
*/ |
|
96 |
@SuppressWarnings("UseSpecificCatch") |
|
97 |
public class AppTopologyServices implements TopologySwingServices { |
|
98 |
|
|
99 |
private static final Logger LOGGER = LoggerFactory.getLogger(AppTopologyServices.class); |
|
100 |
|
|
101 |
private class WorkingAreaViewPortListener implements ViewPortListener { |
|
102 |
|
|
103 |
private final WorkingAreaChangedListener workingAreaChangedListener; |
|
104 |
private final ViewPort viewPort; |
|
105 |
|
|
106 |
public WorkingAreaViewPortListener(ViewPort viewPort, WorkingAreaChangedListener workingAreaChangedListener) { |
|
107 |
this.workingAreaChangedListener = workingAreaChangedListener; |
|
108 |
this.viewPort = viewPort; |
|
109 |
} |
|
110 |
|
|
111 |
public ViewPort getViewPort() { |
|
112 |
return this.viewPort; |
|
113 |
} |
|
114 |
|
|
115 |
@Override |
|
116 |
public void extentChanged(ExtentEvent e) { |
|
117 |
this.workingAreaChangedListener.workingAreaChanged(e.getNewExtent()); |
|
118 |
} |
|
119 |
|
|
120 |
@Override |
|
121 |
public void backColorChanged(ColorEvent e) { |
|
122 |
} |
|
123 |
|
|
124 |
@Override |
|
125 |
public void projectionChanged(ProjectionEvent e) { |
|
126 |
} |
|
127 |
} |
|
128 |
|
|
129 |
private class EditingNotificationObserver implements Observer { |
|
130 |
|
|
131 |
public EditingNotificationObserver() { |
|
132 |
|
|
133 |
} |
|
134 |
|
|
135 |
@Override |
|
136 |
public void update(Observable o, Object notification) { |
|
137 |
EditingNotification n = (EditingNotification) notification; |
|
138 |
if (n.isCancelable() && n.getFeature() != null) { |
|
139 |
try { |
|
140 |
DynObject data = n.getFeature().getAsDynObject(); |
|
141 |
DynObjectEditor editor = new DynObjectEditor(data); |
|
142 |
editor.setTitle("Topology - " + n.getFeature().getType().getName()); |
|
143 |
editor.editObject(true); |
|
144 |
if (editor.isCanceled()) { |
|
145 |
n.cancel(); |
|
146 |
} else { |
|
147 |
editor.getData(data); |
|
148 |
} |
|
149 |
} catch (Exception ex) { |
|
150 |
LOGGER.warn("Problems showing the feature in a form.", ex); |
|
151 |
} |
|
152 |
} |
|
153 |
} |
|
154 |
} |
|
155 |
|
|
156 |
private final Map<WorkingAreaChangedListener, WorkingAreaViewPortListener> workingAreaListener; |
|
157 |
private ISymbol errorPolygonSymbol = null; |
|
158 |
private ISymbol errorPointSymbol = null; |
|
159 |
private ISymbol errorLineSymbol = null; |
|
160 |
private EditingNotificationObserver editingNotificationObserver = null; |
|
161 |
|
|
162 |
public AppTopologyServices() { |
|
163 |
this.workingAreaListener = new HashMap<>(); |
|
164 |
} |
|
165 |
|
|
166 |
@Override |
|
167 |
public TreeModel getDataSetTreeModel() { |
|
168 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
169 |
ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
170 |
return new DataSetsTreeModel(this, view); |
|
171 |
} |
|
172 |
|
|
173 |
@Override |
|
174 |
public ListModel getTablesListModel() { |
|
175 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
176 |
Project project = application.getCurrentProject(); |
|
177 |
TopologyManager manager = TopologyLocator.getTopologyManager(); |
|
178 |
|
|
179 |
DefaultListModel<TopologyDataSet> model = new DefaultListModel<>(); |
|
180 |
|
|
181 |
List<Document> docs = project.getDocuments(TableManager.TYPENAME); |
|
182 |
for (Document doc : docs) { |
|
183 |
TableDocument table=(TableDocument) doc; |
|
184 |
TopologyDataSet dataset = manager.createDataSet(table.getName(), table.getFeatureStore()); |
|
185 |
model.addElement(dataset); |
|
186 |
} |
|
187 |
return model; |
|
188 |
} |
|
189 |
|
|
190 |
|
|
191 |
|
|
192 |
@Override |
|
193 |
public FeatureStore getFeatureStore(final TopologyDataSet dataSet) { |
|
194 |
final Mutable<FeatureStore> store = new MutableObject<>(); |
|
195 |
store.setValue(null); |
|
196 |
|
|
197 |
|
|
198 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
199 |
Project project = application.getCurrentProject(); |
|
200 |
|
|
201 |
List<Document> views = new ArrayList<>(); |
|
202 |
views.add(project.getActiveDocument(ViewManager.TYPENAME)); |
|
203 |
// views.addAll(project.getDocuments(ViewManager.TYPENAME)); |
|
204 |
|
|
205 |
for (Document view : views) { |
|
206 |
if (view == null) { |
|
207 |
continue; |
|
208 |
} |
|
209 |
FLayers layers = ((ViewDocument) view).getMapContext().getLayers(); |
|
210 |
try { |
|
211 |
layers.accept((Object o) -> { |
|
212 |
if (o instanceof FLyrVect) { |
|
213 |
FLyrVect layer = (FLyrVect) o; |
|
214 |
if (dataSet.isThisStore(layer.getFeatureStore())) { |
|
215 |
store.setValue(layer.getFeatureStore()); |
|
216 |
throw new VisitCanceledException(); |
|
217 |
} |
|
218 |
} |
|
219 |
}); |
|
220 |
} catch (VisitCanceledException ex) { |
|
221 |
break; |
|
222 |
} catch (Exception ex) { |
|
223 |
throw new RuntimeException(ex); |
|
224 |
} |
|
225 |
} |
|
226 |
if (store.getValue()==null){ |
|
227 |
for (Document document : project.getDocuments(TableManager.TYPENAME)) { |
|
228 |
TableDocument table= (TableDocument) document; |
|
229 |
if (dataSet.isThisStore(table.getFeatureStore())) { |
|
230 |
store.setValue(table.getFeatureStore()); |
|
231 |
break; |
|
232 |
} |
|
233 |
} |
|
234 |
} |
|
235 |
return store.getValue(); |
|
236 |
} |
|
237 |
|
|
238 |
@Override |
|
239 |
public void zoomTo(Envelope envelope) { |
|
240 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
241 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
242 |
if (viewdoc == null) { |
|
243 |
return; |
|
244 |
} |
|
245 |
ViewPort viewPort = viewdoc.getMapContext().getViewPort(); |
|
246 |
viewPort.setEnvelope(envelope); |
|
247 |
} |
|
248 |
|
|
249 |
@Override |
|
250 |
public void refreshView() { |
|
251 |
try { |
|
252 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
253 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
254 |
if (viewdoc == null) { |
|
255 |
return; |
|
256 |
} |
|
257 |
viewdoc.getMapContext().invalidate(); |
|
258 |
} catch (Exception ex) { |
|
259 |
LOGGER.warn("Cant refresh view", ex); |
|
260 |
} |
|
261 |
} |
|
262 |
|
|
263 |
@Override |
|
264 |
public void centerTo(Point point) { |
|
265 |
try { |
|
266 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
267 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
268 |
if (viewdoc == null) { |
|
269 |
return; |
|
270 |
} |
|
271 |
ViewPort viewPort = viewdoc.getMapContext().getViewPort(); |
|
272 |
Envelope envelope = (Envelope) viewPort.getEnvelope().clone(); |
|
273 |
envelope.centerTo(point); |
|
274 |
viewPort.setEnvelope(envelope); |
|
275 |
} catch (Exception ex) { |
|
276 |
LOGGER.warn("Cant center view", ex); |
|
277 |
} |
|
278 |
} |
|
279 |
|
|
280 |
@Override |
|
281 |
public Envelope getWorkingArea() { |
|
282 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
283 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
284 |
if (viewdoc == null) { |
|
285 |
return null; |
|
286 |
} |
|
287 |
ViewPort viewPort = viewdoc.getMapContext().getViewPort(); |
|
288 |
return viewPort.getEnvelope(); |
|
289 |
} |
|
290 |
|
|
291 |
@Override |
|
292 |
public void addWorkingAreaChangedListener(WorkingAreaChangedListener listener) { |
|
293 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
294 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
295 |
if (viewdoc == null) { |
|
296 |
return; |
|
297 |
} |
|
298 |
ViewPort viewPort = viewdoc.getMapContext().getViewPort(); |
|
299 |
WorkingAreaViewPortListener viewPortListener = this.workingAreaListener.get(listener); |
|
300 |
if (viewPortListener == null) { |
|
301 |
viewPortListener = new WorkingAreaViewPortListener(viewPort, listener); |
|
302 |
this.workingAreaListener.put(listener, viewPortListener); |
|
303 |
} else { |
|
304 |
if (viewPort != viewPortListener.getViewPort()) { |
|
305 |
viewPortListener.getViewPort().removeViewPortListener(viewPortListener); |
|
306 |
viewPortListener = new WorkingAreaViewPortListener(viewPort, listener); |
|
307 |
this.workingAreaListener.put(listener, viewPortListener); |
|
308 |
} |
|
309 |
} |
|
310 |
viewPortListener.getViewPort().addViewPortListener(viewPortListener); |
|
311 |
} |
|
312 |
|
|
313 |
@Override |
|
314 |
public void removeWorkingAreaChangedListener(WorkingAreaChangedListener listener) { |
|
315 |
WorkingAreaViewPortListener viewPortListener = this.workingAreaListener.get(listener); |
|
316 |
if (viewPortListener == null) { |
|
317 |
return; |
|
318 |
} |
|
319 |
viewPortListener.getViewPort().removeViewPortListener(viewPortListener); |
|
320 |
} |
|
321 |
|
|
322 |
@Override |
|
323 |
public void addError(Geometry geom) { |
|
324 |
if (this.errorPointSymbol == null) { |
|
325 |
try { |
|
326 |
File pluginfolder = PluginsLocator.getManager().getPlugin(this).getPluginDirectory(); |
|
327 |
File folder = new File(pluginfolder, "symbols"); |
|
328 |
ISymbol[] symbols = MapContextLocator.getSymbolManager().loadSymbols(folder); |
|
329 |
for (ISymbol symbol : symbols) { |
|
330 |
if (symbol instanceof ISymbol_v2) { |
|
331 |
String symbolid = ((ISymbol_v2) symbol).getID(); |
|
332 |
switch(symbolid) { |
|
333 |
case "topology-error-polygon": |
|
334 |
this.errorPolygonSymbol = symbol; |
|
335 |
break; |
|
336 |
case "topology-error-line": |
|
337 |
this.errorLineSymbol = symbol; |
|
338 |
break; |
|
339 |
case "topology-error-point": |
|
340 |
this.errorPointSymbol = symbol; |
|
341 |
break; |
|
342 |
} |
|
343 |
} |
|
344 |
} |
|
345 |
} catch (Exception ex) { |
|
346 |
} |
|
347 |
} |
|
348 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
349 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
350 |
if(viewdoc != null){ |
|
351 |
MapContext mapContext = viewdoc.getMapContext(); |
|
352 |
GraphicLayer gl = mapContext.getGraphicsLayer(); |
|
353 |
gl.removeGraphics("topology-errors"); |
|
354 |
if ( geom!=null ) { |
|
355 |
ISymbol symbol = null; |
|
356 |
if( geom instanceof Point || geom instanceof MultiPoint) { |
|
357 |
symbol = this.errorPointSymbol; |
|
358 |
} else if( geom instanceof Curve || geom instanceof MultiCurve ) { |
|
359 |
symbol = this.errorLineSymbol; |
|
360 |
} else if( geom instanceof Surface || geom instanceof MultiSurface ) { |
|
361 |
symbol = this.errorPolygonSymbol; |
|
362 |
} |
|
363 |
if (symbol != null) { |
|
364 |
int symbolid = gl.getSymbolId(symbol); |
|
365 |
if (symbolid < 0) { |
|
366 |
gl.addSymbol(symbol); |
|
367 |
symbolid = gl.getSymbolId(symbol); |
|
368 |
} |
|
369 |
gl.addGraphic("topology-errors", geom, symbolid); |
|
370 |
} |
|
371 |
} |
|
372 |
mapContext.invalidate(); |
|
373 |
} |
|
374 |
} |
|
375 |
|
|
376 |
@Override |
|
377 |
public void setShowFormWhenEdit(boolean showFormWhenEdit) { |
|
378 |
if (this.editingNotificationObserver == null) { |
|
379 |
this.editingNotificationObserver = new EditingNotificationObserver(); |
|
380 |
} |
|
381 |
EditingNotificationManager editingNotificationManager = DALSwingLocator.getEditingNotificationManager(); |
|
382 |
if (showFormWhenEdit) { |
|
383 |
editingNotificationManager.addObserver(this.editingNotificationObserver); |
|
384 |
} else { |
|
385 |
editingNotificationManager.deleteObserver(this.editingNotificationObserver); |
|
386 |
} |
|
387 |
} |
|
388 |
|
|
389 |
@Override |
|
390 |
public ImageIcon getTreeIcon(TreeModel model, Object item) { |
|
391 |
return ((DataSetsTreeModel)model).getTreeIcon(item); |
|
392 |
} |
|
393 |
|
|
394 |
@Override |
|
395 |
public void selectFeature(FeatureStore store, FeatureReference ref) { |
|
396 |
try { |
|
397 |
FeatureStore targetLayerStore = getStoreOfActiveView(store); |
|
398 |
if (targetLayerStore != null) { |
|
399 |
FeatureSelection targetSelection = targetLayerStore.getFeatureSelection(); |
|
400 |
targetSelection.deselectAll(); |
|
401 |
FeatureReference targetReference = targetLayerStore.getFeatureReference(ref.getCode()); |
|
402 |
targetSelection.select(targetReference); |
|
403 |
} |
|
404 |
FeatureStore targetTableStore = getStoreOfActiveTable(store); |
Also available in: Unified diff