Revision 3673
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Sat Jun 06 19:36:11 CEST 2020 |
|
2 |
buildNumber=48 |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 gvSIG |
|
2 |
Association. This program is free software; you can redistribute it and/or modify |
|
3 |
it under the terms of the GNU General Public License as published by the Free Software |
|
4 |
Foundation; either version 3 of the License, or (at your option) any later version. |
|
5 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
6 |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
7 |
PURPOSE. See the GNU General Public License for more details. You should have received |
|
8 |
a copy of the GNU General Public License along with this program; if not, write to |
|
9 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
10 |
USA. For any additional information, do not hesitate to contact us at info AT gvsig.com, |
|
11 |
or visit our website www.gvsig.com. --> |
|
12 |
<assembly> |
|
13 |
<id>gvsig-plugin-package</id> |
|
14 |
<formats> |
|
15 |
<format>zip</format> |
|
16 |
</formats> |
|
17 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
18 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
19 |
<files> |
|
20 |
<file> |
|
21 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
22 |
<outputDirectory>lib</outputDirectory> |
|
23 |
</file> |
|
24 |
<file> |
|
25 |
<source>target/package.info</source> |
|
26 |
</file> |
|
27 |
</files> |
|
28 |
|
|
29 |
<fileSets> |
|
30 |
<fileSet> |
|
31 |
<directory>src/main/resources-plugin</directory> |
|
32 |
<outputDirectory>.</outputDirectory> |
|
33 |
</fileSet> |
|
34 |
</fileSets> |
|
35 |
|
|
36 |
|
|
37 |
<dependencySets> |
|
38 |
<dependencySet> |
|
39 |
<useProjectArtifact>false</useProjectArtifact> |
|
40 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
41 |
<outputDirectory>lib</outputDirectory> |
|
42 |
<includes> |
|
43 |
<include>org.gvsig:org.gvsig.legend.aggregate.lib.api</include> |
|
44 |
<include>org.gvsig:org.gvsig.legend.aggregate.lib.impl</include> |
|
45 |
<include>org.gvsig:org.gvsig.legend.aggregate.swing.api</include> |
|
46 |
<include>org.gvsig:org.gvsig.legend.aggregate.swing.impl</include> |
|
47 |
<include>org.jfree:jcommon</include> |
|
48 |
</includes> |
|
49 |
</dependencySet> |
|
50 |
</dependencySets> |
|
51 |
|
|
52 |
</assembly> |
|
53 |
|
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/java/org/gvsig/legend/aggregate/app/AggregateLegendTextExtension.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.legend.aggregate.app; |
|
3 |
|
|
4 |
import org.gvsig.andami.IconThemeHelper; |
|
5 |
import org.gvsig.andami.plugins.Extension; |
|
6 |
|
|
7 |
|
|
8 |
public class AggregateLegendTextExtension extends Extension { |
|
9 |
|
|
10 |
@Override |
|
11 |
public void initialize() { |
|
12 |
IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-aggregated", this); |
|
13 |
} |
|
14 |
|
|
15 |
@Override |
|
16 |
public void execute(String string) { |
|
17 |
} |
|
18 |
|
|
19 |
@Override |
|
20 |
public boolean isEnabled() { |
|
21 |
return true; |
|
22 |
} |
|
23 |
|
|
24 |
@Override |
|
25 |
public boolean isVisible() { |
|
26 |
return true; |
|
27 |
} |
|
28 |
|
|
29 |
} |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.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-2013 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 |
<resourceBundle name="text" /> |
|
16 |
<libraries library-dir="lib" /> |
|
17 |
<extensions> |
|
18 |
<extension class-name="org.gvsig.legend.aggregate.app.AggregateLegendTextExtension" |
|
19 |
description="" active="true" priority="1"> |
|
20 |
|
|
21 |
<action |
|
22 |
name="aggregatelegend-set" |
|
23 |
label="_Set_aggregated_legend" |
|
24 |
tooltip="_Set_aggregated_legend" |
|
25 |
position="900700100" |
|
26 |
action-command="aggregatelegend-set" |
|
27 |
accelerator="" |
|
28 |
/> |
|
29 |
|
|
30 |
</extension> |
|
31 |
|
|
32 |
</extensions> |
|
33 |
</plugin-config> |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/resources-plugin/plugin-persistence.def | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of plugin persistence org.gvsig.aggregatelegend.app.mainplugin |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
<class name="org.gvsig.legend.aggregate.app.mainplugin"> |
|
9 |
<extends> |
|
10 |
</extends> |
|
11 |
<description>Persistence of the legend of aggregate texts</description> |
|
12 |
<fields> |
|
13 |
</fields> |
|
14 |
</class> |
|
15 |
</classes> |
|
16 |
</definitions> |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1 |
_Aggregate_legend_description=Leyenda de agrupaci\u00f3n de marcadores |
|
2 |
_Aggregate_legend=Agrupaci\u00f3n de marcadores |
|
3 |
_Use_basic_cluster_mark=Usar estilo b\u00e1sico para la agrupaci\u00f3n de marcadores |
|
4 |
_Use_styled_cluster_mark=Usar un estilo avanzado para la agrupaci\u00f3n de marcadores |
|
5 |
_Symbol_size=Tama\u00f1o de simbolo |
|
6 |
_Outline_color=Color del contorno |
|
7 |
_Fill_color=Color de relleno |
|
8 |
_Text_color=Color de texto |
|
9 |
_Text_font=Fuente del texto |
|
10 |
_Show_bounds=Mostrar l\u00edmites |
|
11 |
_Style=Estilo |
|
12 |
_Operation=Operaci\u00f3n |
|
13 |
_Attribute=Atributo |
|
14 |
_Aditional_value=Valor adicional |
|
15 |
Alpha=Alpha |
|
16 |
Average=Media |
|
17 |
_Calculate_the_average_of_the_selected_attribute_for_the_grouped_features=Calcula la media del atributo seleccionado para las features agrupadas |
|
18 |
Count=Cuenta |
|
19 |
_Count_of_grouped_features=Cuenta de las features agrupadas |
|
20 |
Maximum=M\u00e1ximo |
|
21 |
_Calculate_the_maximum_of_the_selected_attribute_for_the_grouped_features=Calcula el maximo del atributo seleccionado para las features agrupadas |
|
22 |
Minimun=Minimo |
|
23 |
_Calculate_the_minimun_of_the_selected_attribute_for_the_grouped_features=Calcula el minimo del atributo seleccionado para las features agrupadas |
|
24 |
_Select_style=Seleccion de estilo |
|
25 |
Sum=Suma |
|
26 |
_Calculate_the_sum_of_the_selected_attribute_for_the_grouped_features=Calcula la suma del atributo seleccionado para las features agrupadas |
|
27 |
_Select_font=Seleccione fuente |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1 |
_Aggregate_legend_description=Marker clustering legend |
|
2 |
_Aggregate_legend=Marker clustering |
|
3 |
_Use_basic_cluster_mark=Use basic style cluster mark |
|
4 |
_Use_styled_cluster_mark=Use advanced style cluster mark |
|
5 |
_Symbol_size=Symbol size |
|
6 |
_Outline_color=Outline color |
|
7 |
_Fill_color=Fill color |
|
8 |
_Text_color=Text color |
|
9 |
_Text_font=Text font |
|
10 |
_Show_bounds=Show bounds |
|
11 |
_Style=Style |
|
12 |
_Operation=Operation |
|
13 |
_Attribute=Attribute |
|
14 |
_Aditional_value=Aditional value |
|
15 |
Alpha=Alpha |
|
16 |
Average=Average |
|
17 |
_Calculate_the_average_of_the_selected_attribute_for_the_grouped_features=Calculate the average of the selected attribute for the grouped features |
|
18 |
Count=Count |
|
19 |
_Count_of_grouped_features=Count of grouped features |
|
20 |
Maximum=Maximum |
|
21 |
_Calculate_the_maximum_of_the_selected_attribute_for_the_grouped_features=Calculate the maximum of the selected attribute for the grouped features |
|
22 |
Minimun=Minimun |
|
23 |
_Calculate_the_minimun_of_the_selected_attribute_for_the_grouped_features=Calculate the minimun of the selected attribute for the grouped features |
|
24 |
_Select_style=Select style |
|
25 |
_Calculate_the_sum_of_the_selected_attribute_for_the_grouped_features=Calculate the sum of the selected attribute for the grouped features |
|
26 |
Sum=Sum |
|
27 |
_Select_font=Select font |
|
0 | 28 |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/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.legend.aggregate.app</artifactId> |
|
6 |
<version>1.0.46</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.legend.aggregate.app.mainplugin</artifactId> |
|
10 |
<version>1.0.46</version> |
|
11 |
<name>org.gvsig.legend.aggregate.app.mainplugin</name> |
|
12 |
|
|
13 |
<properties> |
|
14 |
<!-- Package info property values --> |
|
15 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
16 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.4.0-A</gvsig.package.info.dependencies> |
|
17 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
18 |
<gvsig.package.info.name>Vector legend: Aggregate text symbols</gvsig.package.info.name> |
|
19 |
<gvsig.package.info.description>Legend for aggregate text symbols that are near.</gvsig.package.info.description> |
|
20 |
<gvsig.package.info.categories>View,Vector,Symbology</gvsig.package.info.categories> |
|
21 |
<gvsig.package.info.javaVM>j1_7</gvsig.package.info.javaVM> |
|
22 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-base-legends/pool</gvsig.package.info.poolURL> |
|
23 |
</properties> |
|
24 |
|
|
25 |
<dependencies> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.andami</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
<dependency> |
|
32 |
<groupId>org.gvsig</groupId> |
|
33 |
<artifactId>org.gvsig.legend.aggregate.swing.api</artifactId> |
|
34 |
<scope>compile</scope> |
|
35 |
</dependency> |
|
36 |
<dependency> |
|
37 |
<groupId>org.gvsig</groupId> |
|
38 |
<artifactId>org.gvsig.legend.aggregate.lib.api</artifactId> |
|
39 |
<scope>compile</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.legend.aggregate.lib.impl</artifactId> |
|
44 |
<scope>runtime</scope> |
|
45 |
</dependency> |
|
46 |
<dependency> |
|
47 |
<groupId>org.gvsig</groupId> |
|
48 |
<artifactId>org.gvsig.legend.aggregate.swing.impl</artifactId> |
|
49 |
<scope>runtime</scope> |
|
50 |
</dependency> |
|
51 |
<dependency> |
|
52 |
<groupId>org.gvsig</groupId> |
|
53 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
54 |
<scope>compile</scope> |
|
55 |
</dependency> |
|
56 |
<dependency> |
|
57 |
<groupId>org.jfree</groupId> |
|
58 |
<artifactId>jcommon</artifactId> |
|
59 |
<scope>runtime</scope> |
|
60 |
</dependency> |
|
61 |
</dependencies> |
|
62 |
</project> |
|
0 | 63 |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.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.legend.aggregate</artifactId> |
|
6 |
<version>1.0.46</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.legend.aggregate.app</artifactId> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>org.gvsig.legend.aggregate.app</name> |
|
12 |
|
|
13 |
<modules> |
|
14 |
<module>org.gvsig.legend.aggregate.app.mainplugin</module> |
|
15 |
</modules> |
|
16 |
|
|
17 |
</project> |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/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 |
<groupId>org.gvsig</groupId> |
|
4 |
<artifactId>org.gvsig.legend.aggregate</artifactId> |
|
5 |
<version>1.0.46</version> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<description>Legend for aggregate text symbols that are near.</description> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.desktop</artifactId> |
|
12 |
<version>2.0.283</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<url>https://devel.gvsig.org/sites/org.gvsig.legend.aggregate/${project.version}</url> |
|
16 |
<scm> |
|
17 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46</connection> |
|
18 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46</developerConnection> |
|
19 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-base-legends/repository/show/org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46</url> |
|
20 |
</scm> |
|
21 |
<repositories> |
|
22 |
<repository> |
|
23 |
<id>gvsig-public-http-repository</id> |
|
24 |
<name>gvSIG maven public HTTP repository</name> |
|
25 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
26 |
<releases> |
|
27 |
<enabled>true</enabled> |
|
28 |
<updatePolicy>daily</updatePolicy> |
|
29 |
<checksumPolicy>warn</checksumPolicy> |
|
30 |
</releases> |
|
31 |
<snapshots> |
|
32 |
<enabled>true</enabled> |
|
33 |
<updatePolicy>daily</updatePolicy> |
|
34 |
<checksumPolicy>warn</checksumPolicy> |
|
35 |
</snapshots> |
|
36 |
</repository> |
|
37 |
</repositories> |
|
38 |
|
|
39 |
<distributionManagement> |
|
40 |
<site> |
|
41 |
<id>gvsig-repository</id> |
|
42 |
<url>dav:https://devel.gvsig.org/download/projects/gvsig-base-legends/pool/${project.artifactId}/${project.version}</url> |
|
43 |
</site> |
|
44 |
</distributionManagement> |
|
45 |
|
|
46 |
<build> |
|
47 |
<plugins> |
|
48 |
<plugin> |
|
49 |
<groupId>org.apache.maven.plugins</groupId> |
|
50 |
<artifactId>maven-release-plugin</artifactId> |
|
51 |
<configuration> |
|
52 |
<tagBase>https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.aggregate/tags</tagBase> |
|
53 |
</configuration> |
|
54 |
</plugin> |
|
55 |
</plugins> |
|
56 |
</build> |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
<dependencyManagement> |
|
61 |
<dependencies> |
|
62 |
<dependency> |
|
63 |
<groupId>org.gvsig</groupId> |
|
64 |
<artifactId>org.gvsig.legend.aggregate.lib.api</artifactId> |
|
65 |
<version>1.0.46</version> |
|
66 |
</dependency> |
|
67 |
<dependency> |
|
68 |
<groupId>org.gvsig</groupId> |
|
69 |
<artifactId>org.gvsig.legend.aggregate.lib.impl</artifactId> |
|
70 |
<version>1.0.46</version> |
|
71 |
</dependency> |
|
72 |
<dependency> |
|
73 |
<groupId>org.gvsig</groupId> |
|
74 |
<artifactId>org.gvsig.legend.aggregate.swing.api</artifactId> |
|
75 |
<version>1.0.46</version> |
|
76 |
</dependency> |
|
77 |
<dependency> |
|
78 |
<groupId>org.gvsig</groupId> |
|
79 |
<artifactId>org.gvsig.legend.aggregate.swing.impl</artifactId> |
|
80 |
<version>1.0.46</version> |
|
81 |
</dependency> |
|
82 |
<dependency> |
|
83 |
<groupId>org.gvsig</groupId> |
|
84 |
<artifactId>org.gvsig.legend.aggregate.app.mainplugin</artifactId> |
|
85 |
<version>1.0.46</version> |
|
86 |
</dependency> |
|
87 |
<dependency> |
|
88 |
<groupId>org.jfree</groupId> |
|
89 |
<artifactId>jcommon</artifactId> |
|
90 |
<version>1.0.24</version> |
|
91 |
</dependency> |
|
92 |
|
|
93 |
</dependencies> |
|
94 |
</dependencyManagement> |
|
95 |
<modules> |
|
96 |
<module>org.gvsig.legend.aggregate.lib</module> |
|
97 |
<module>org.gvsig.legend.aggregate.swing</module> |
|
98 |
<module>org.gvsig.legend.aggregate.app</module> |
|
99 |
</modules> |
|
100 |
</project> |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.legend.aggregate.lib.api.AggregateLegendLibrary |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/spi/AbstractOperation.java | ||
---|---|---|
1 |
package org.gvsig.legend.aggregate.lib.spi; |
|
2 |
|
|
3 |
import org.gvsig.legend.aggregate.lib.api.Operation; |
|
4 |
import org.gvsig.tools.ToolsLocator; |
|
5 |
import org.gvsig.tools.i18n.I18nManager; |
|
6 |
|
|
7 |
|
|
8 |
public abstract class AbstractOperation implements Operation { |
|
9 |
private final String name; |
|
10 |
private final String description; |
|
11 |
private String attrName; |
|
12 |
private String aditionalValue; |
|
13 |
|
|
14 |
protected AbstractOperation(String name, String description) { |
|
15 |
this.name = name; |
|
16 |
this.description = description; |
|
17 |
reset(); |
|
18 |
} |
|
19 |
|
|
20 |
@Override |
|
21 |
public String getName() { |
|
22 |
return this.name; |
|
23 |
} |
|
24 |
|
|
25 |
@Override |
|
26 |
public String getDescription() { |
|
27 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
28 |
return i18n.getTranslation(this.description); |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
public boolean isAttributeRequiered() { |
|
33 |
return false; |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public boolean isAditionalValueRequiered() { |
|
38 |
return false; |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
public String getAttributeName() { |
|
43 |
return attrName; |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public void setAttributeName(String attributeName) { |
|
48 |
this.attrName = attributeName; |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public String getAditionalValue() { |
|
53 |
return aditionalValue; |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public void setAditionalValue(String aditionalValue) { |
|
58 |
this.aditionalValue = aditionalValue; |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public String format() { |
|
63 |
return String.valueOf(getValue()); |
|
64 |
} |
|
65 |
|
|
66 |
@Override |
|
67 |
public String toString() { |
|
68 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
69 |
return i18n.getTranslation(this.getName()); |
|
70 |
} |
|
71 |
|
|
72 |
@Override |
|
73 |
public Operation clone() { |
|
74 |
try { |
|
75 |
return (Operation) super.clone(); |
|
76 |
} catch (CloneNotSupportedException ex) { |
|
77 |
return null; |
|
78 |
} |
|
79 |
} |
|
80 |
} |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/AggregateLegendManager.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2015 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 3 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.legend.aggregate.lib.api; |
|
24 |
|
|
25 |
import java.util.Collection; |
|
26 |
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle; |
|
27 |
|
|
28 |
|
|
29 |
public interface AggregateLegendManager { |
|
30 |
|
|
31 |
/** |
|
32 |
* Creates an aggregate legend |
|
33 |
* |
|
34 |
* @return the aggregate legend |
|
35 |
*/ |
|
36 |
public AggregateLegend createAggregateLegend(); |
|
37 |
|
|
38 |
public Class<? extends AggregateLegend> getLegendClass(); |
|
39 |
|
|
40 |
public ILabelStyle getDefaultLabelStyle(); |
|
41 |
|
|
42 |
public void setDefaultLabelStyle(ILabelStyle defaultLabelStyle); |
|
43 |
|
|
44 |
public Operation getDefaultOperation(); |
|
45 |
|
|
46 |
void addOperation(Operation operation); |
|
47 |
|
|
48 |
public Collection<Operation> getOperations(); |
|
49 |
|
|
50 |
public Operation createOperation(String name); |
|
51 |
} |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/Operation.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.legend.aggregate.lib.api; |
|
3 |
|
|
4 |
import org.gvsig.fmap.dal.feature.Feature; |
|
5 |
|
|
6 |
|
|
7 |
public interface Operation extends org.gvsig.tools.lang.Cloneable { |
|
8 |
|
|
9 |
public String getName(); |
|
10 |
|
|
11 |
public String getDescription(); |
|
12 |
|
|
13 |
public boolean isAttributeRequiered(); |
|
14 |
|
|
15 |
public boolean isAditionalValueRequiered(); |
|
16 |
|
|
17 |
public void reset(); |
|
18 |
|
|
19 |
public void perform(Feature feature); |
|
20 |
|
|
21 |
public Object getValue(); |
|
22 |
|
|
23 |
public String format(); |
|
24 |
|
|
25 |
public String getAttributeName(); |
|
26 |
|
|
27 |
public void setAttributeName(String attributeName); |
|
28 |
|
|
29 |
public String getAditionalValue(); |
|
30 |
|
|
31 |
public void setAditionalValue(String constant); |
|
32 |
|
|
33 |
@Override |
|
34 |
public Operation clone(); |
|
35 |
|
|
36 |
|
|
37 |
} |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/AggregateLegend.java | ||
---|---|---|
1 |
package org.gvsig.legend.aggregate.lib.api; |
|
2 |
|
|
3 |
import java.awt.Color; |
|
4 |
import java.awt.Font; |
|
5 |
import org.gvsig.fmap.mapcontext.rendering.legend.ISingleSymbolLegend; |
|
6 |
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend; |
|
7 |
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle; |
|
8 |
|
|
9 |
public interface AggregateLegend extends IVectorLegend, ISingleSymbolLegend { |
|
10 |
|
|
11 |
public int getSymbolSize(); |
|
12 |
public void setSymbolSize(int simbolSize); |
|
13 |
|
|
14 |
public ILabelStyle getLabelStyle(); |
|
15 |
public void setLabelStyle(ILabelStyle labelStyle); |
|
16 |
|
|
17 |
Color getFillColor(); |
|
18 |
|
|
19 |
void setFillColor(Color fillColor); |
|
20 |
|
|
21 |
Color getTextColor(); |
|
22 |
|
|
23 |
void setTextColor(Color textColor); |
|
24 |
|
|
25 |
Font getFont(); |
|
26 |
|
|
27 |
void setFont(Font font); |
|
28 |
|
|
29 |
Operation getOperation(); |
|
30 |
|
|
31 |
void setOperation(Operation operation); |
|
32 |
|
|
33 |
Color getOutlineColor(); |
|
34 |
|
|
35 |
void setOutlineColor(Color outlineColor); |
|
36 |
|
|
37 |
boolean isShowBounds(); |
|
38 |
|
|
39 |
void setShowBounds(boolean showBounds); |
|
40 |
|
|
41 |
boolean isUseStyle(); |
|
42 |
|
|
43 |
void setUseStyle(boolean useStyle); |
|
44 |
|
|
45 |
} |
|
46 |
|
|
47 |
|
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/AggregateLegendLocator.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2015 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.legend.aggregate.lib.api; |
|
24 |
|
|
25 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
26 |
import org.gvsig.tools.locator.AbstractLocator; |
|
27 |
import org.gvsig.tools.locator.Locator; |
|
28 |
import org.gvsig.tools.locator.LocatorException; |
|
29 |
|
|
30 |
|
|
31 |
public class AggregateLegendLocator extends AbstractLocator { |
|
32 |
|
|
33 |
/** |
|
34 |
* AggregateLegend locator name |
|
35 |
*/ |
|
36 |
private static final String LOCATOR_NAME = "AggregateLegendLocator"; |
|
37 |
|
|
38 |
/** |
|
39 |
* AggregateLegend manager name |
|
40 |
*/ |
|
41 |
public static final String MANAGER_NAME = "AggregateLegendManager"; |
|
42 |
|
|
43 |
/** |
|
44 |
* AggregateLegend manager description |
|
45 |
*/ |
|
46 |
private static final String MANAGER_DESCRIPTION = |
|
47 |
"AggregateLegend Manager of gvSIG"; |
|
48 |
|
|
49 |
|
|
50 |
/** |
|
51 |
* Unique instance |
|
52 |
*/ |
|
53 |
private static final AggregateLegendLocator instance = new AggregateLegendLocator(); |
|
54 |
|
|
55 |
@Override |
|
56 |
public String getLocatorName() { |
|
57 |
return LOCATOR_NAME; |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Registers the Class implementing the AggregateLegendManager interface. |
|
62 |
* |
|
63 |
* @param clazz |
|
64 |
* implementing the AggregateLegendManager interface |
|
65 |
*/ |
|
66 |
public static void registerAggregateLegendManager(Class clazz){ |
|
67 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Registers the default Class implementing the AggregateLegendManager interface |
|
72 |
* |
|
73 |
* @param clazz |
|
74 |
* implementing the AggregateLegendManager interface |
|
75 |
*/ |
|
76 |
public static void registerDefaultAggregateLegendManager(Class clazz){ |
|
77 |
getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Return a reference to AggregateLegendManager. |
|
82 |
* |
|
83 |
* @return a reference to AggregateLegendManager |
|
84 |
* @throws LocatorException |
|
85 |
* if there is no access to the class or the class |
|
86 |
* cannot be instantiated |
|
87 |
* @see Locator#get(String) |
|
88 |
*/ |
|
89 |
public static AggregateLegendManager getAggregateLegendManager() throws LocatorException { |
|
90 |
return (AggregateLegendManager) getInstance().get(MANAGER_NAME); |
|
91 |
} |
|
92 |
|
|
93 |
/** |
|
94 |
* @return |
|
95 |
*/ |
|
96 |
public static Locator getInstance() { |
|
97 |
return instance; |
|
98 |
} |
|
99 |
|
|
100 |
} |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/AggregateLegendLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2015 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.legend.aggregate.lib.api; |
|
24 |
|
|
25 |
import org.gvsig.tools.library.AbstractLibrary; |
|
26 |
import org.gvsig.tools.library.LibraryException; |
|
27 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
28 |
|
|
29 |
|
|
30 |
/** |
|
31 |
* @author fdiaz |
|
32 |
* |
|
33 |
*/ |
|
34 |
public class AggregateLegendLibrary extends AbstractLibrary { |
|
35 |
|
|
36 |
/* (non-Javadoc) |
|
37 |
* @see org.gvsig.tools.library.AbstractLibrary#doInitialize() |
|
38 |
*/ |
|
39 |
@Override |
|
40 |
protected void doInitialize() throws LibraryException { |
|
41 |
registerAsAPI(AggregateLegendLibrary.class); |
|
42 |
} |
|
43 |
|
|
44 |
/* (non-Javadoc) |
|
45 |
* @see org.gvsig.tools.library.AbstractLibrary#doPostInitialize() |
|
46 |
*/ |
|
47 |
@Override |
|
48 |
protected void doPostInitialize() throws LibraryException { |
|
49 |
// Validate there is any implementation registered. |
|
50 |
AggregateLegendManager manager = AggregateLegendLocator.getAggregateLegendManager(); |
|
51 |
if (manager == null) { |
|
52 |
throw new ReferenceNotRegisteredException( |
|
53 |
AggregateLegendLocator.MANAGER_NAME, AggregateLegendLocator.getInstance()); |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
} |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/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 |
<groupId>org.gvsig</groupId> |
|
4 |
<artifactId>org.gvsig.legend.aggregate.lib.api</artifactId> |
|
5 |
<name>org.gvsig.legend.aggregate.lib.api</name> |
|
6 |
<parent> |
|
7 |
<groupId>org.gvsig</groupId> |
|
8 |
<artifactId>org.gvsig.legend.aggregate.lib</artifactId> |
|
9 |
<version>1.0.46</version> |
|
10 |
</parent> |
|
11 |
|
|
12 |
<build> |
|
13 |
<plugins> |
|
14 |
<plugin> |
|
15 |
<groupId>org.apache.maven.plugins</groupId> |
|
16 |
<artifactId>maven-jar-plugin</artifactId> |
|
17 |
<configuration> |
|
18 |
</configuration> |
|
19 |
<executions> |
|
20 |
<!-- Generates a jar file only with the test classes --> |
|
21 |
<execution> |
|
22 |
<goals> |
|
23 |
<goal>test-jar</goal> |
|
24 |
</goals> |
|
25 |
</execution> |
|
26 |
</executions> |
|
27 |
</plugin> |
|
28 |
</plugins> |
|
29 |
</build> |
|
30 |
|
|
31 |
<dependencies> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
35 |
<scope>compile</scope> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
40 |
<scope>compile</scope> |
|
41 |
</dependency> |
|
42 |
</dependencies> |
|
43 |
</project> |
|
0 | 44 |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/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.legend.aggregate</artifactId> |
|
6 |
<version>1.0.46</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.legend.aggregate.lib</artifactId> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.legend.aggregate.lib.api</module> |
|
13 |
<module>org.gvsig.legend.aggregate.lib.impl</module> |
|
14 |
</modules> |
|
15 |
</project> |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/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 |
<artifactId>org.gvsig.legend.aggregate.lib.impl</artifactId> |
|
4 |
<name>org.gvsig.legend.aggregate.lib.impl</name> |
|
5 |
<parent> |
|
6 |
<groupId>org.gvsig</groupId> |
|
7 |
<artifactId>org.gvsig.legend.aggregate.lib</artifactId> |
|
8 |
<version>1.0.46</version> |
|
9 |
</parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<dependencies> |
|
12 |
<dependency> |
|
13 |
<groupId>org.gvsig</groupId> |
|
14 |
<artifactId>org.gvsig.legend.aggregate.lib.api</artifactId> |
|
15 |
<scope>compile</scope> |
|
16 |
</dependency> |
|
17 |
<dependency> |
|
18 |
<groupId>org.gvsig</groupId> |
|
19 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
20 |
<scope>compile</scope> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>org.gvsig</groupId> |
|
24 |
<artifactId>org.gvsig.symbology.lib.impl</artifactId> |
|
25 |
<scope>compile</scope> |
|
26 |
</dependency> |
|
27 |
</dependencies> |
|
28 |
</project> |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.legend.aggregate.lib.impl.AggregateLegendLibraryImpl |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/resources/org/gvsig/legend/aggregate/lib/impl/DefaultAggregateLegend.persistence.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="DefaultAggregateLegend"> |
|
6 |
<extends> |
|
7 |
<class>VectorialLegend</class> |
|
8 |
</extends> |
|
9 |
<fields> |
|
10 |
<field name="symbolSize" type="integer" defaultValue="30"> |
|
11 |
<description></description> |
|
12 |
</field> |
|
13 |
<field name="fillColor" type="object" classOfValue="java.awt.Color"> |
|
14 |
<description></description> |
|
15 |
</field> |
|
16 |
<field name="outlineColor" type="object" classOfValue="java.awt.Color"> |
|
17 |
<description></description> |
|
18 |
</field> |
|
19 |
<field name="textColor" type="object" classOfValue="java.awt.Color"> |
|
20 |
<description></description> |
|
21 |
</field> |
|
22 |
<field name="showBounds" type="boolean" defaultValue="false"> |
|
23 |
<description></description> |
|
24 |
</field> |
|
25 |
<field name="font" type="object" classOfValue="java.awt.Font"> |
|
26 |
<description></description> |
|
27 |
</field> |
|
28 |
<field name="labelStyle" type="object" classOfValue="org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle"> |
|
29 |
<description></description> |
|
30 |
</field> |
|
31 |
<field name="useStyle" type="boolean" defaultValue="false"> |
|
32 |
<description></description> |
|
33 |
</field> |
|
34 |
<field name="operation" type="object" classOfValue="org.gvsig.legend.aggregate.lib.api.Operation"> |
|
35 |
<description></description> |
|
36 |
</field> |
|
37 |
</fields> |
|
38 |
</class> |
|
39 |
|
|
40 |
</classes> |
|
41 |
</definitions> |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/DefaultAggregateLegend.java | ||
---|---|---|
1 |
package org.gvsig.legend.aggregate.lib.impl; |
|
2 |
|
|
3 |
import java.awt.Color; |
|
4 |
import java.awt.Dimension; |
|
5 |
import java.awt.Font; |
|
6 |
import java.awt.FontMetrics; |
|
7 |
import java.awt.Graphics2D; |
|
8 |
import java.awt.Rectangle; |
|
9 |
import java.awt.geom.AffineTransform; |
|
10 |
import java.awt.geom.Ellipse2D; |
|
11 |
import java.awt.geom.Rectangle2D; |
|
12 |
import java.awt.image.BufferedImage; |
|
13 |
import java.util.ArrayList; |
|
14 |
import java.util.List; |
|
15 |
import java.util.Map; |
|
16 |
import javax.swing.UIManager; |
|
17 |
|
|
18 |
import org.cresques.cts.ICoordTrans; |
|
19 |
import org.slf4j.Logger; |
|
20 |
import org.slf4j.LoggerFactory; |
|
21 |
|
|
22 |
import org.gvsig.fmap.dal.exception.DataException; |
|
23 |
import org.gvsig.fmap.dal.feature.Feature; |
|
24 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
25 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
26 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
27 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
28 |
import org.gvsig.fmap.geom.Geometry; |
|
29 |
import org.gvsig.fmap.geom.primitive.Point; |
|
30 |
import org.gvsig.fmap.mapcontext.MapContextException; |
|
31 |
import org.gvsig.fmap.mapcontext.ViewPort; |
|
32 |
import org.gvsig.fmap.mapcontext.rendering.legend.LegendException; |
|
33 |
import org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent; |
|
34 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
35 |
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle; |
|
36 |
import org.gvsig.legend.aggregate.lib.api.AggregateLegend; |
|
37 |
import org.gvsig.legend.aggregate.lib.api.AggregateLegendLocator; |
|
38 |
import org.gvsig.legend.aggregate.lib.api.Operation; |
|
39 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend; |
|
40 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.DefaultFeatureDrawnNotification; |
|
41 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.SimpleFillSymbol; |
|
42 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.SimpleLineSymbol; |
|
43 |
import org.gvsig.tools.exception.BaseException; |
|
44 |
import org.gvsig.tools.logger.FilteredLogger; |
|
45 |
import org.gvsig.tools.persistence.PersistentState; |
|
46 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
47 |
import org.gvsig.tools.task.Cancellable; |
|
48 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
49 |
import org.gvsig.tools.visitor.Visitor; |
|
50 |
|
|
51 |
public class DefaultAggregateLegend extends AbstractVectorialLegend implements AggregateLegend { |
|
52 |
|
|
53 |
private static class Group { |
|
54 |
|
|
55 |
// private final Point pointGeo; |
|
56 |
// private final Rectangle2D rectangle; |
|
57 |
private Operation op; |
|
58 |
private final Point pointPixels; |
|
59 |
private final Ellipse2D circle; |
|
60 |
|
|
61 |
public Group(Point pointGeo, Point pointPixels, double size, Operation op) { |
|
62 |
this.op = op; |
|
63 |
this.op.reset(); |
|
64 |
// this.pointGeo = pointGeo; |
|
65 |
this.pointPixels = pointPixels; |
|
66 |
double d2 = size * 2; |
|
67 |
// this.rectangle = new Rectangle2D.Double(pointPixels.getX() - distance, pointPixels.getY() - distance, d2, d2); |
|
68 |
this.circle = new Ellipse2D.Double(pointPixels.getX() - size, pointPixels.getY() - size, d2, d2); |
|
69 |
} |
|
70 |
|
|
71 |
public boolean contains(Point pointPixels) { |
|
72 |
// return this.rectangle.contains(pointPixels.getX(), pointPixels.getY()); |
|
73 |
return this.circle.contains(pointPixels.getX(), pointPixels.getY()); |
|
74 |
} |
|
75 |
|
|
76 |
public void add(Feature feature) { |
|
77 |
op.perform(feature); |
|
78 |
} |
|
79 |
|
|
80 |
public Operation getOperation() { |
|
81 |
return this.op; |
|
82 |
} |
|
83 |
} |
|
84 |
|
|
85 |
private static final Logger LOG = LoggerFactory.getLogger(DefaultAggregateLegend.class); |
|
86 |
|
|
87 |
private List<Group> groups; |
|
88 |
|
|
89 |
private int symbolSize; // Pixels |
|
90 |
private Color fillColor; |
|
91 |
private Color outlineColor; |
|
92 |
private Color textColor; |
|
93 |
private boolean showBounds; |
|
94 |
private Font font; |
|
95 |
|
|
96 |
private boolean useStyle; |
|
97 |
private ILabelStyle labelStyle; |
|
98 |
|
|
99 |
private Operation operation; |
|
100 |
|
|
101 |
private SimpleFillSymbol defaultSymbol; |
|
102 |
|
|
103 |
public DefaultAggregateLegend() { |
|
104 |
this.groups = null; |
|
105 |
|
|
106 |
this.useStyle = false; |
|
107 |
this.symbolSize = 30; |
|
108 |
this.fillColor = new Color(0xd0ffcccc, true); // Un rojo |
|
109 |
this.outlineColor = new Color(0xff5f60de, true); // un azul |
|
110 |
this.textColor = new Color(0xff000000, true); // negro |
|
111 |
this.showBounds = false; |
|
112 |
this.labelStyle = null; |
|
113 |
this.font = UIManager.getFont("Label.font"); |
|
114 |
this.operation = AggregateLegendLocator.getAggregateLegendManager().getDefaultOperation().clone(); |
|
115 |
this.defaultSymbol = new SimpleFillSymbol(); |
|
116 |
this.defaultSymbol.setOutline(new SimpleLineSymbol()); |
|
117 |
this.defaultSymbol.getOutline().setLineColor(this.outlineColor); |
|
118 |
this.defaultSymbol.setFillColor(this.fillColor); |
|
119 |
|
|
120 |
} |
|
121 |
|
|
122 |
@Override |
|
123 |
protected String[] getRequiredFeatureAttributeNames(FeatureStore featureStore) throws DataException { |
|
124 |
if( this.operation.isAttributeRequiered() && this.operation.getAttributeName()!=null ) { |
|
125 |
return new String[]{ |
|
126 |
this.operation.getAttributeName(), |
|
127 |
featureStore.getDefaultFeatureType().getDefaultGeometryAttributeName() |
|
128 |
}; |
|
129 |
} |
|
130 |
return new String[]{ |
|
131 |
featureStore.getDefaultFeatureType().getDefaultGeometryAttributeName() |
|
132 |
}; |
|
133 |
} |
|
134 |
|
|
135 |
@Override |
|
136 |
public ISymbol getDefaultSymbol() { |
|
137 |
return this.defaultSymbol; |
|
138 |
} |
|
139 |
|
|
140 |
@Override |
|
141 |
public void setDefaultSymbol(ISymbol is) { |
|
142 |
} |
|
143 |
|
|
144 |
@Override |
|
145 |
public ISymbol getSymbolByFeature(Feature ftr) throws MapContextException { |
|
146 |
return this.getDefaultSymbol(); |
|
147 |
} |
|
148 |
|
|
149 |
@Override |
|
150 |
public int getShapeType() { |
|
151 |
return Geometry.TYPES.GEOMETRY; |
|
152 |
} |
|
153 |
|
|
154 |
@Override |
|
155 |
public void setShapeType(int i) { |
|
156 |
} |
|
157 |
|
|
158 |
@Override |
|
159 |
public boolean isUseDefaultSymbol() { |
|
160 |
return true; |
|
161 |
} |
|
162 |
|
|
163 |
@Override |
|
164 |
public void useDefaultSymbol(boolean bln) { |
|
165 |
} |
|
166 |
|
|
167 |
@Override |
|
168 |
public boolean isSuitableForShapeType(int shapeType) { |
|
169 |
return true; |
|
170 |
} |
|
171 |
|
|
172 |
@Override |
|
173 |
protected void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, Map queryParameters, ICoordTrans coordTrans, FeatureStore featureStore, FeatureQuery featureQuery, double dpi) throws LegendException { |
|
174 |
super.draw(image, g, viewPort, cancel, scale, queryParameters, coordTrans, featureStore, featureQuery, dpi); |
|
175 |
this.drawGroups(image, g, cancel, viewPort.getAffineTransform()); |
|
176 |
} |
|
177 |
|
|
178 |
@Override |
|
179 |
protected void drawFeatures( |
|
180 |
BufferedImage image, |
|
181 |
Graphics2D g, |
|
182 |
final ViewPort viewPort, |
|
183 |
final Cancellable cancel, |
|
184 |
final ICoordTrans coordTrans, |
|
185 |
double dpi, |
|
186 |
DefaultFeatureDrawnNotification drawnNotification, |
|
187 |
FeatureSet featureSet, |
|
188 |
FeatureSelection selection |
|
189 |
) throws BaseException { |
|
190 |
this.groups = new ArrayList<>(); |
|
191 |
featureSet.accept(new Visitor() { |
|
192 |
@Override |
|
193 |
public void visit(Object o) throws VisitCanceledException, BaseException { |
|
194 |
if( cancel.isCanceled() ) { |
|
195 |
throw new VisitCanceledException(); |
|
196 |
} |
|
197 |
Feature feature = (Feature) o; |
|
198 |
Geometry geom = feature.getDefaultGeometry(); |
|
199 |
if( geom != null ) { |
|
200 |
Point pointGeo = geom.centroid(); |
|
201 |
if( coordTrans != null ) { |
|
202 |
pointGeo.reProject(coordTrans); |
|
203 |
} |
|
204 |
Point pointPixels = (Point) pointGeo.cloneGeometry(); |
|
205 |
pointPixels.transform(viewPort.getAffineTransform()); |
|
206 |
boolean inGroup = false; |
|
207 |
for( Group group : groups ) { |
|
208 |
if( group.contains(pointPixels) ) { |
|
209 |
group.add(feature); |
|
210 |
inGroup = true; |
|
211 |
break; |
|
212 |
} |
|
213 |
} |
|
214 |
if( !inGroup ) { |
|
215 |
Group group = new Group(pointGeo, pointPixels, getSymbolSize(), getOperation().clone()); |
|
216 |
group.add(feature); |
|
217 |
groups.add(group); |
|
218 |
} |
|
219 |
} |
|
220 |
} |
|
221 |
}); |
|
222 |
} |
|
223 |
|
|
224 |
private void drawGroups(BufferedImage image, Graphics2D g, Cancellable cancel, AffineTransform affineTransform) { |
|
225 |
FilteredLogger logger = new FilteredLogger(LOG, "", 10); |
|
226 |
AffineTransform identity = new AffineTransform(); |
|
227 |
|
|
228 |
g.setFont(this.font); |
|
229 |
FontMetrics fm = g.getFontMetrics(); |
|
230 |
int fontAscent = fm.getAscent(); |
|
231 |
int fontAscentAddDescentDiv2 = ((fm.getAscent() + fm.getDescent())) / 2; |
|
232 |
|
|
233 |
for( Group group : groups ) { |
|
234 |
if( cancel.isCanceled() ) { |
|
235 |
return; |
|
236 |
} |
|
237 |
try { |
|
238 |
int x = (int) group.pointPixels.getX(); |
|
239 |
int y = (int) group.pointPixels.getY(); |
|
240 |
String txt = group.getOperation().format(); |
|
241 |
if( this.useStyle && this.labelStyle != null ) { |
|
242 |
Dimension size = this.labelStyle.getSize(); |
|
243 |
this.labelStyle.setTextFields(new String[]{txt}); |
|
244 |
g.setTransform(identity); |
|
245 |
g.translate(x-size.getWidth()/2, y-size.getHeight()/2); |
|
246 |
Rectangle rect = new Rectangle( |
|
247 |
0, |
|
248 |
0, |
|
249 |
(int)size.getWidth(), |
|
250 |
(int)size.getHeight()); |
|
251 |
this.labelStyle.drawInsideRectangle(g, rect); |
|
252 |
Rectangle2D[] bounds = this.labelStyle.getTextBounds(); |
|
253 |
if(bounds.length>0){ |
|
254 |
Rectangle2D bound = bounds[0]; |
|
255 |
Rectangle2D expandedBound = new Rectangle2D.Double( |
|
256 |
bound.getMinX()*size.getWidth(), |
|
257 |
bound.getMinY()*size.getHeight(), |
|
258 |
bound.getWidth()*size.getWidth(), |
|
259 |
bound.getHeight()*size.getHeight()); |
|
260 |
drawCenteredString(txt, expandedBound, g); |
|
261 |
} |
|
262 |
g.translate(-(x-size.getWidth()/2), -(y-size.getHeight()/2)); |
|
263 |
} else { |
|
264 |
int r = symbolSize/2; |
|
265 |
g.setColor(this.fillColor); |
|
266 |
g.fillOval( x-r, y-r, 2*r, 2*r); |
|
267 |
g.setColor(this.outlineColor); |
|
268 |
g.drawOval( x-r, y-r, 2*r, 2*r); |
|
269 |
if( this.showBounds ) { |
|
270 |
g.drawRect( x-r, y-r, 2*r, 2*r); |
|
271 |
} |
|
272 |
g.setColor(this.textColor); |
|
273 |
int txtX = x - (fm.stringWidth(txt) / 2); |
|
274 |
int txtY = fontAscent + y - fontAscentAddDescentDiv2; //((fm.getAscent() + fm.getDescent())) / 2; |
|
275 |
g.drawString(txt, txtX, txtY); |
|
276 |
} |
|
277 |
} catch (Exception ex) { |
|
278 |
logger.warn("Can't draw group",ex); |
|
279 |
} |
|
280 |
} |
|
281 |
} |
|
282 |
|
|
283 |
private void drawCenteredString(String s, Rectangle2D rect, Graphics2D g) { |
|
284 |
|
|
285 |
double x = rect.getMinX(); |
|
286 |
double y = rect.getMinY(); |
|
287 |
double w = rect.getWidth(); |
|
288 |
double h = rect.getHeight(); |
|
289 |
|
|
290 |
FontMetrics fm = g.getFontMetrics(); |
|
291 |
int auxX = (int)(x+((w - fm.stringWidth(s)) / 2)); |
|
292 |
int auxY = (int)(y+((fm.getAscent() + (h - (fm.getAscent() + fm.getDescent())) / 2))); |
|
293 |
g.setColor(Color.BLACK); |
|
294 |
g.drawString(s, auxX, auxY); |
|
295 |
} |
|
296 |
|
|
297 |
@Override |
|
298 |
public ILabelStyle getLabelStyle() { |
|
299 |
return this.labelStyle; |
|
300 |
} |
|
301 |
|
|
302 |
@Override |
|
303 |
public void setLabelStyle(ILabelStyle labelStyle) { |
|
304 |
this.labelStyle = labelStyle; |
|
305 |
} |
|
306 |
|
|
307 |
@Override |
|
308 |
public int getSymbolSize() { |
|
309 |
return this.symbolSize; |
|
310 |
} |
|
311 |
|
|
312 |
@Override |
|
313 |
public void setSymbolSize(int simbolSize) { |
|
314 |
boolean changed = (this.symbolSize == simbolSize); |
|
315 |
this.symbolSize = simbolSize; |
|
316 |
if( changed ) { |
|
317 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
318 |
} |
|
319 |
} |
|
320 |
|
|
321 |
@Override |
|
322 |
public Operation getOperation() { |
|
323 |
return this.operation; |
|
324 |
} |
|
325 |
|
|
326 |
@Override |
|
327 |
public void setOperation(Operation operation) { |
|
328 |
boolean changed = (this.operation.getName().equalsIgnoreCase(operation.getName())); |
|
329 |
this.operation = operation; |
|
330 |
if( changed ) { |
|
331 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
332 |
} |
|
333 |
} |
|
334 |
|
|
335 |
@Override |
|
336 |
public Color getFillColor() { |
|
337 |
return fillColor; |
|
338 |
} |
|
339 |
|
|
340 |
@Override |
|
341 |
public void setFillColor(Color fillColor) { |
|
342 |
boolean changed = (this.fillColor.equals(fillColor)); |
|
343 |
this.fillColor = fillColor; |
|
344 |
this.defaultSymbol.setFillColor(this.fillColor); |
|
345 |
if( changed ) { |
|
346 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
347 |
} |
|
348 |
} |
|
349 |
|
|
350 |
@Override |
|
351 |
public Color getOutlineColor() { |
|
352 |
return outlineColor; |
|
353 |
} |
|
354 |
|
|
355 |
@Override |
|
356 |
public void setOutlineColor(Color outlineColor) { |
|
357 |
boolean changed = (this.outlineColor.equals(outlineColor)); |
|
358 |
this.outlineColor = outlineColor; |
|
359 |
this.defaultSymbol.getOutline().setLineColor(this.outlineColor); |
|
360 |
if( changed ) { |
|
361 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
362 |
} |
|
363 |
} |
|
364 |
|
|
365 |
@Override |
|
366 |
public boolean isShowBounds() { |
|
367 |
return showBounds; |
|
368 |
} |
|
369 |
|
|
370 |
@Override |
|
371 |
public void setShowBounds(boolean showBounds) { |
|
372 |
boolean changed = (this.showBounds == showBounds); |
|
373 |
this.showBounds = showBounds; |
|
374 |
if( changed ) { |
|
375 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
376 |
} |
|
377 |
} |
|
378 |
|
|
379 |
@Override |
|
380 |
public Font getFont() { |
|
381 |
return font; |
|
382 |
} |
|
383 |
|
|
384 |
@Override |
|
385 |
public void setFont(Font font) { |
|
386 |
this.font = font; |
|
387 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
388 |
} |
|
389 |
|
|
390 |
@Override |
|
391 |
public boolean isUseStyle() { |
|
392 |
return useStyle; |
|
393 |
} |
|
394 |
|
|
395 |
@Override |
|
396 |
public void setUseStyle(boolean useStyle) { |
|
397 |
boolean changed = (this.useStyle == useStyle); |
|
398 |
this.useStyle = useStyle; |
|
399 |
if( changed ) { |
|
400 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
401 |
} |
|
402 |
} |
|
403 |
|
|
404 |
@Override |
|
405 |
public Color getTextColor() { |
|
406 |
return this.textColor; |
|
407 |
} |
|
408 |
|
|
409 |
@Override |
|
410 |
public void setTextColor(Color textColor) { |
|
411 |
boolean changed = (this.textColor.equals(textColor)); |
|
412 |
this.textColor = textColor; |
|
413 |
if( changed ) { |
|
414 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null)); |
|
415 |
} |
|
416 |
} |
|
417 |
|
|
418 |
@Override |
|
419 |
public void loadFromState(PersistentState state) throws PersistenceException { |
|
420 |
super.loadFromState(state); |
|
421 |
this.symbolSize = state.getInt("symbolSize"); |
|
422 |
this.fillColor = (Color) state.get("fillColor"); |
|
423 |
this.outlineColor = (Color) state.get("outlineColor"); |
|
424 |
this.textColor = (Color) state.get("textColor"); |
|
425 |
this.showBounds = state.getBoolean("showBounds"); |
|
426 |
this.font = (Font) state.get("font"); |
|
427 |
this.useStyle = state.getBoolean("useStyle"); |
|
428 |
this.labelStyle = (ILabelStyle) state.get("labelStyle"); |
|
429 |
this.operation = (Operation) state.get("operation"); |
|
430 |
} |
|
431 |
|
|
432 |
@Override |
|
433 |
public void saveToState(PersistentState state) throws PersistenceException { |
|
434 |
super.saveToState(state); |
|
435 |
state.set("symbolSize", symbolSize); |
|
436 |
state.set("fillColor", fillColor); |
|
437 |
state.set("outlineColor", outlineColor); |
|
438 |
state.set("textColor", textColor); |
|
439 |
state.set("showBounds", showBounds); |
|
440 |
state.set("font", font); |
|
441 |
state.set("useStyle", useStyle); |
|
442 |
state.set("labelStyle", labelStyle); |
|
443 |
state.set("operation", operation); |
|
444 |
} |
|
445 |
} |
org.gvsig.legend.aggregate/tags/org.gvsig.legend.aggregate-1.0.46/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/AggregateLegendLibraryImpl.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright ? 2007-2015 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 2 |
|
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 |
|
|
25 |
package org.gvsig.legend.aggregate.lib.impl; |
|
26 |
|
|
27 |
import org.gvsig.fmap.mapcontext.MapContextLibrary; |
|
28 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
Also available in: Unified diff