Revision 613
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/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.educa.portableview</artifactId> |
|
6 |
<version>1.0.65</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.educa.portableview.swing</artifactId> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>org.gvsig.educa.portableview.swing</name> |
|
12 |
|
|
13 |
<modules> |
|
14 |
<module>org.gvsig.educa.portableview.swing.api</module> |
|
15 |
<module>org.gvsig.educa.portableview.swing.impl</module> |
|
16 |
</modules> |
|
17 |
</project> |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n/text_pt_BR.properties | ||
---|---|---|
1 |
#text_pt_BR.properties |
|
2 |
accept=Aceitar |
|
3 |
add=Adicionar |
|
4 |
add_layer_group=Adicionar grupo de camadas |
|
5 |
add_layers=Adicionar camadas |
|
6 |
are_you_sure_to_remove_selected_layers=Deseja realmente remover as camadas selecionadas? |
|
7 |
cancel=Cancelar |
|
8 |
clean_messages=Apagar mensagens |
|
9 |
current_values_are_not_valid=Valores inv\u00E1lidos |
|
10 |
default=Default |
|
11 |
edit_source_properties=Editar propriedades da fonte de dados |
|
12 |
explorer=Explorador de fonte de dados |
|
13 |
explorer_parameters=Explorador de par\u00E2metros |
|
14 |
explorer_parameters_not_valid=Explorador de par\u00E2metros inv\u00E1lido |
|
15 |
get_layer_group_name=Forne\u00E7a um nome para o grupo de camadas |
|
16 |
layer_name=Nome da camada |
|
17 |
layer_properties=Propriedades da camada |
|
18 |
layer_show_in_toc=Camada vis\u00EDvel no TOC |
|
19 |
layer_visible=Camada vis\u00EDvel |
|
20 |
list_data_explorer=Listar fontes de dados |
|
21 |
list_sources=Listar fontes |
|
22 |
new=Novo |
|
23 |
no_layers_added=Nenhuma camada adicionada |
|
24 |
no_layers_to_add=Nenhuma camada a adicionar |
|
25 |
open_portable_view=Abrir mapa tem\u00E1tico |
|
26 |
parameters=Par\u00E2metros |
|
27 |
problem_adding_group=Problema ao adicionar grupo |
|
28 |
problems_opening_explorer=Problemas ao abrir o explorador |
|
29 |
remove_layers=Remover camadas |
|
30 |
select_layer_show_properties=Selecione uma camada para mostrar suas propriedades |
|
31 |
select_layers_to_remove=Selecione as camadas a remover |
|
32 |
select_only_one_layer=Selecione apenas uma camada |
|
33 |
source_parameters=Par\u00E2metros da fonte |
|
34 |
portable_view_compilation_editor=Editor de compila\u00E7\u00E3o de mapa tem\u00E1tico |
|
35 |
portable_view_description=Descri\u00E7\u00E3o do mapa tem\u00E1tico |
|
36 |
portable_view_id=Identificador do mapa tem\u00E1tico |
|
37 |
portable_view_information=Informa\u00E7\u00E3o do mapa tem\u00E1tico |
|
38 |
portable_view_layers=Camadas do mapa tem\u00E1tico |
|
39 |
portable_view_name=Nome do mapa tem\u00E1tico |
|
40 |
portable_view_validation=Valida\u00E7\u00E3o do mapa tem\u00E1tico |
|
41 |
portable_view_version=Vers\u00E3o do mapa tem\u00E1tico |
|
42 |
updateing_compilation_info=Atualizadno dados da compila\u00E7\u00E3o |
|
43 |
validate=Validar |
|
44 |
version=Vers\u00E3o |
|
45 |
version_must_be_a_integer=Vers\u00E3o deve ser n\u00FAmero inteiro |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n/text_ru.properties | ||
---|---|---|
1 |
#text_ru.properties |
|
2 |
accept=\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C |
|
3 |
add=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C |
|
4 |
add_layer_group=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0433\u0440\u0443\u043F\u043F\u0443 \u0441\u043B\u043E\u0435\u0432 |
|
5 |
add_layers=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u043B\u043E\u0438 |
|
6 |
are_you_sure_to_remove_selected_layers=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u043B\u043E\u0438? |
|
7 |
cancel=\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C |
|
8 |
clean_messages=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F |
|
9 |
current_values_are_not_valid=\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0442\u0435\u043A\u0443\u0449\u0435\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 |
|
10 |
default=\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E |
|
11 |
edit_source_properties=\u0418\u0437\u043C\u0435\u043D\u0438\u0442 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445 |
|
12 |
explorer=\u041C\u0435\u043D\u0435\u0434\u0436\u0435\u0440 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432 \u0434\u0430\u043D\u043D\u044B\u0445 |
|
13 |
explorer_parameters=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B |
|
14 |
explorer_parameters_not_valid=\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B |
|
15 |
get_layer_group_name=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043C\u044F \u0433\u0440\u0443\u043F\u043F\u044B \u0441\u043B\u043E\u0435\u0432 |
|
16 |
layer_name=\u0418\u043C\u044F |
|
17 |
layer_properties=\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0441\u043B\u043E\u044F |
|
18 |
layer_show_in_toc=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0422\u041E\u0421 |
|
19 |
layer_visible=\u0412\u0438\u0434\u0438\u043C\u044B\u0439 |
|
20 |
list_data_explorer=\u0421\u043F\u0438\u0441\u043E\u043A \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432 \u0434\u0430\u043D\u043D\u044B\u0445 |
|
21 |
list_sources=\u0421\u043F\u0438\u0441\u043E\u043A \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432 |
|
22 |
new=\u041D\u043E\u0432\u044B\u0439 |
|
23 |
no_layers_added=\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0441\u043B\u043E\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442 |
|
24 |
no_layers_to_add=\u041D\u0435\u0442 \u0441\u043B\u043E\u0435\u0432 \u0434\u043B\u044F \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F |
|
25 |
open_portable_view=\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u043A\u0430\u0440\u0442\u0443 |
|
26 |
parameters=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B |
|
27 |
problem_adding_group=\u041F\u0440\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0438 \u0433\u0440\u0443\u043F\u043F\u044B \u0441\u043B\u043E\u0435\u0432 \u043F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 |
|
28 |
problems_opening_explorer=\u041F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0430 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432 \u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 |
|
29 |
remove_layers=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u043B\u043E\u0438 |
|
30 |
select_layer_show_properties=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u043B\u043E\u0439, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0435\u0433\u043E \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430 |
|
31 |
select_layers_to_remove=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u043B\u043E\u0438 \u0434\u043B\u044F \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F |
|
32 |
select_only_one_layer=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0441\u043B\u043E\u0439 |
|
33 |
source_parameters=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430 |
|
34 |
portable_view_compilation_editor=\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u0438 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B |
|
35 |
portable_view_description=\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 |
|
36 |
portable_view_id=\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 |
|
37 |
portable_view_information=\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F |
|
38 |
portable_view_layers=\u0421\u043B\u043E\u0438 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B |
|
39 |
portable_view_name=\u0418\u043C\u044F |
|
40 |
portable_view_validation=\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B |
|
41 |
portable_view_version=\u0412\u0435\u0440\u0441\u0438\u044F |
|
42 |
updateing_compilation_info=\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438 \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u0438 |
|
43 |
validate=\u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C |
|
44 |
version=\u0412\u0435\u0440\u0441\u0438\u044F |
|
45 |
version_must_be_a_integer=\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0446\u0435\u043B\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n/text_es.properties | ||
---|---|---|
1 |
#text_es.properties |
|
2 |
accept=Aceptar |
|
3 |
add=A\u00F1adir |
|
4 |
add_layer_group=A\u00F1adir agrupaci\u00F3n de capas |
|
5 |
add_layers=A\u00F1adir capas |
|
6 |
are_you_sure_to_remove_selected_layers=\u00BFEst\u00E1 seguro de eliminar las capas seleccionadas? |
|
7 |
cancel=Cancelar |
|
8 |
clean_messages=Limpiar mensajes |
|
9 |
current_values_are_not_valid=Los valores actuales no son v\u00E1lidos |
|
10 |
default=Por defecto |
|
11 |
edit_source_properties=Editar propiedades de la fuente de datos |
|
12 |
explorer=Explorador de fuentes de datos |
|
13 |
explorer_parameters=Par\u00E1metros del explorador |
|
14 |
explorer_parameters_not_valid=Par\u00E1metro del explorador no v\u00E1lidos |
|
15 |
get_layer_group_name=Introduzca el nombre para la agrupaci\u00F3n |
|
16 |
layer_name=Nombre |
|
17 |
layer_properties=Propiedades de capa |
|
18 |
layer_show_in_toc=Se muestra en el TOC |
|
19 |
layer_visible=Visible |
|
20 |
list_data_explorer=Listar fuentes de datos |
|
21 |
list_sources=Listar fuentes |
|
22 |
new=nuevo |
|
23 |
no_layers_added=No se han a\u00F1adido capas |
|
24 |
no_layers_to_add=No hay capas para a\u00F1adir |
|
25 |
open_portable_view=Abrir Vista Portable |
|
26 |
parameters=Par\u00E1metros |
|
27 |
problem_adding_group=Se ha encontrado un problema a\u00F1adiendo la agrupaci\u00F3n |
|
28 |
problems_opening_explorer=Se han encontrado problemas abriendo el explorador |
|
29 |
remove_layers=Eliminar capas |
|
30 |
select_layer_show_properties=Seleccione una capa para mostrar sus propiedades |
|
31 |
select_layers_to_remove=Seleccione las capas a eliminar |
|
32 |
select_only_one_layer=Seleccione una \u00FAnica capa |
|
33 |
source_parameters=Par\u00E1metros de la fuente |
|
34 |
portable_view_compilation_editor=Editor de compilaci\u00F3n de la vista portable |
|
35 |
portable_view_description=Descripci\u00F3n |
|
36 |
portable_view_id=Identificador |
|
37 |
portable_view_information=Informaci\u00F3n de la vista portable |
|
38 |
portable_view_layers=Capas de la vista portable |
|
39 |
portable_view_name=Nombre |
|
40 |
portable_view_validation=Validaci\u00F3n de la vista portable |
|
41 |
portable_view_version=Versi\u00F3n |
|
42 |
updateing_compilation_info=Actualizando datos de la compilaci\u00F3n |
|
43 |
validate=Validar |
|
44 |
version=Versi\u00F3n |
|
45 |
version_must_be_a_integer=Versi\u00F3n debe ser un entero |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n/text_de.properties | ||
---|---|---|
1 |
#text_de.properties |
|
2 |
accept=Akzeptieren |
|
3 |
add=Hinzuf\u00FCgen |
|
4 |
add_layer_group=Layergruppe hinzuf\u00FCgen |
|
5 |
add_layers=Layer hinzuf\u00FCgen |
|
6 |
are_you_sure_to_remove_selected_layers=M\u00F6chten Sie die ausgew\u00E4hlten Layer wirklich l\u00F6schen? |
|
7 |
cancel=Abbrechen |
|
8 |
clean_messages=Benachrichtigungen l\u00F6schen |
|
9 |
current_values_are_not_valid=Aktuelle Werte sind nicht g\u00FCltig |
|
10 |
default=Standard |
|
11 |
edit_source_properties=Quelldaten-Eigenschaften bearbeiten |
|
12 |
explorer=Explorer |
|
13 |
explorer_parameters=Explorer Parameter |
|
14 |
explorer_parameters_not_valid=Explorer Parameter ung\u00FCltig |
|
15 |
get_layer_group_name=Layergruppenname eingeben |
|
16 |
layer_name=Name |
|
17 |
layer_properties=Layer Eigenschaften |
|
18 |
layer_show_in_toc=Layer in TOC anzeigen |
|
19 |
layer_visible=Sichtbar |
|
20 |
list_data_explorer=Datenquellen anzeigen |
|
21 |
list_sources=Quellen anzeigen |
|
22 |
new=Neu |
|
23 |
no_layers_added=Keine Layer hinzugef\u00FCgt |
|
24 |
no_layers_to_add=Keine Layer zum hinzuf\u00FCgen vorhanden |
|
25 |
open_portable_view=Thematische Karte \u00F6ffnen |
|
26 |
parameters=Parameter |
|
27 |
problem_adding_group=Problem beim Hinzuf\u00FCgen der Layergruppe |
|
28 |
problems_opening_explorer=Problem beim \u00D6ffnen des Explorer |
|
29 |
remove_layers=Layer entfernen |
|
30 |
select_layer_show_properties=Layer Ausw\u00E4hlen um seine Eigenschaften anzuzeigen |
|
31 |
select_layers_to_remove=Layer zum Entfernen ausw\u00E4hlen |
|
32 |
select_only_one_layer=Nur einen Layer ausw\u00E4hlen |
|
33 |
source_parameters=Quellparameter |
|
34 |
portable_view_compilation_editor=Editor zum Kompilieren Thematischer Karten |
|
35 |
portable_view_description=Beschreibung |
|
36 |
portable_view_id=ID |
|
37 |
portable_view_information=Information |
|
38 |
portable_view_layers=Layer der Thematischen Karte |
|
39 |
portable_view_name=Name |
|
40 |
portable_view_validation=Validierung der Thematischen Karte |
|
41 |
portable_view_version=Version |
|
42 |
updateing_compilation_info=Kompilierungsinformationen aktualisieren |
|
43 |
validate=Validieren |
|
44 |
version=Version |
|
45 |
version_must_be_a_integer=Version muss eine Ganzzahl sein |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n/text_it.properties | ||
---|---|---|
1 |
#text_it.properties |
|
2 |
accept=Accetta |
|
3 |
add=Aggiungi |
|
4 |
add_layer_group=Aggiungi gruppo di layer |
|
5 |
add_layers=Aggiungi layer |
|
6 |
are_you_sure_to_remove_selected_layers=Sei sicuro di voler rimuovere i layer selezionati? |
|
7 |
cancel=Cancella |
|
8 |
clean_messages=Cancella messaggi |
|
9 |
current_values_are_not_valid=I valori attuali non sono validi |
|
10 |
default=Predefinito |
|
11 |
edit_source_properties=Edita le propriet\u00E0 della fonte di dati |
|
12 |
explorer=Esploratore di fonte di dati |
|
13 |
explorer_parameters=Parametri dell'esploratore |
|
14 |
explorer_parameters_not_valid=Parametri dell'esploratore non validi |
|
15 |
get_layer_group_name=Introdurre il nome del gruppo di layer |
|
16 |
layer_name=Nome |
|
17 |
layer_properties=Propriet\u00E0 del layer |
|
18 |
layer_show_in_toc=Mostra nella TOC |
|
19 |
layer_visible=Visibile |
|
20 |
list_data_explorer=Elenca fonti di dati |
|
21 |
list_sources=Elenca fonti di dati |
|
22 |
new=Nuovo |
|
23 |
no_layers_added=Nessun layer \u00E8 stato aggiunto |
|
24 |
no_layers_to_add=Nessun layer da aggiungere |
|
25 |
open_portable_view=Apri mappa tematica |
|
26 |
parameters=Parametri |
|
27 |
problem_adding_group=Problema nell'aggiunta del gruppo di layer |
|
28 |
problems_opening_explorer=Problema nell'apertura dell'esploratore |
|
29 |
remove_layers=Rimuovi layer |
|
30 |
select_layer_show_properties=Seleziona layer per mostrare le sue propriet\u00E0 |
|
31 |
select_layers_to_remove=Seleziona layer da rimuovere |
|
32 |
select_only_one_layer=Seleziona un unico layer |
|
33 |
source_parameters=Parametri della fonte di dati |
|
34 |
portable_view_compilation_editor=Editor di compilazione di mappa tematica |
|
35 |
portable_view_description=Descrizione |
|
36 |
portable_view_id=Identificatore |
|
37 |
portable_view_information=Informazioni |
|
38 |
portable_view_layers=Layer della mappa tematica |
|
39 |
portable_view_name=Nome |
|
40 |
portable_view_validation=Validazione della mappa tematica |
|
41 |
portable_view_version=Versione |
|
42 |
updateing_compilation_info=Aggiornamento delle informazioni di compilazione |
|
43 |
validate=Valida |
|
44 |
version=Versione |
|
45 |
version_must_be_a_integer=La versione deve essere un intero |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n/text.properties | ||
---|---|---|
1 |
#text.properties |
|
2 |
accept=Aceptar |
|
3 |
add=A\u00F1adir |
|
4 |
add_layer_group=A\u00F1adir agrupaci\u00F3n de capas |
|
5 |
add_layers=A\u00F1adir capas |
|
6 |
are_you_sure_to_remove_selected_layers=\u00BFEst\u00E1 seguro de eliminar las capas seleccionadas? |
|
7 |
cancel=Cancelar |
|
8 |
clean_messages=Limpiar mensajes |
|
9 |
current_values_are_not_valid=Los valores actuales no son v\u00E1lidos |
|
10 |
default=Por defecto |
|
11 |
edit_source_properties=Editar propiedades de la fuente de datos |
|
12 |
explorer=Explorador de fuentes de datos |
|
13 |
explorer_parameters=Par\u00E1metros del explorador |
|
14 |
explorer_parameters_not_valid=Par\u00E1metro del explorador no v\u00E1lidos |
|
15 |
get_layer_group_name=Introduzca el nombre para la agrupaci\u00F3n |
|
16 |
layer_name=Nombre |
|
17 |
layer_properties=Propiedades de capa |
|
18 |
layer_show_in_toc=Se muestra en el TOC |
|
19 |
layer_visible=Visible |
|
20 |
list_data_explorer=Listar fuentes de datos |
|
21 |
list_sources=Listar fuentes |
|
22 |
new=nuevo |
|
23 |
no_layers_added=No se han a\u00F1adido capas |
|
24 |
no_layers_to_add=No hay capas para a\u00F1adir |
|
25 |
open_portable_view=Abrir Vista Portable |
|
26 |
parameters=Par\u00E1metros |
|
27 |
problem_adding_group=Se ha encontrado un problema a\u00F1adiendo la agrupaci\u00F3n |
|
28 |
problems_opening_explorer=Se han encontrado problemas abriendo el explorador |
|
29 |
remove_layers=Eliminar capas |
|
30 |
select_layer_show_properties=Seleccione una capa para mostrar sus propiedades |
|
31 |
select_layers_to_remove=Seleccione las capas a eliminar |
|
32 |
select_only_one_layer=Seleccione una \u00FAnica capa |
|
33 |
source_parameters=Par\u00E1metros de la fuente |
|
34 |
portable_view_compilation_editor=Editor de compilaci\u00F3n de la vista portable |
|
35 |
portable_view_description=Descripci\u00F3n |
|
36 |
portable_view_id=Identificador |
|
37 |
portable_view_information=Informaci\u00F3n de la vista portable |
|
38 |
portable_view_layers=Capas de la vista portable |
|
39 |
portable_view_name=Nombre |
|
40 |
portable_view_validation=Validaci\u00F3n de la vista portable |
|
41 |
portable_view_version=Versi\u00F3n |
|
42 |
updateing_compilation_info=Actualizando datos de la compilaci\u00F3n |
|
43 |
validate=Validar |
|
44 |
version=Versi\u00F3n |
|
45 |
version_must_be_a_integer=Versi\u00F3n debe ser un entero |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/org/gvsig/educa/portableview/swing/impl/i18n/text_en.properties | ||
---|---|---|
1 |
#text_en.properties |
|
2 |
accept=Accept |
|
3 |
add=Add |
|
4 |
add_layer_group=Add layer group |
|
5 |
add_layers=Add layers |
|
6 |
are_you_sure_to_remove_selected_layers=Are you sure to remove selected layers? |
|
7 |
cancel=Cancel |
|
8 |
clean_messages=Clean messages |
|
9 |
current_values_are_not_valid=Current values are not valid\n |
|
10 |
default=Default |
|
11 |
edit_source_properties=Edit source properties |
|
12 |
explorer=Sources Explorer |
|
13 |
explorer_parameters=Explorer parameters |
|
14 |
explorer_parameters_not_valid=Explorer parameters are not valid |
|
15 |
get_layer_group_name=Input layer group name |
|
16 |
layer_name=Name |
|
17 |
layer_properties=Layer properties |
|
18 |
layer_show_in_toc=Show in TOC |
|
19 |
layer_visible=Visible |
|
20 |
list_data_explorer=List sources |
|
21 |
list_sources=List sources |
|
22 |
new=New |
|
23 |
no_layers_added=None layer has been added |
|
24 |
no_layers_to_add=No layers to add |
|
25 |
open_portable_view=Open Portable View |
|
26 |
parameters=Parameters |
|
27 |
problem_adding_group=Problems found adding layer group |
|
28 |
problems_opening_explorer=Problems found opening explorer |
|
29 |
remove_layers=Remove layers |
|
30 |
select_layer_show_properties=Select a layer to show its properties |
|
31 |
select_layers_to_remove=Select the layers to remove |
|
32 |
select_only_one_layer=Select just one layer |
|
33 |
source_parameters=Source parameters |
|
34 |
portable_view_compilation_editor=Portable View Compilation Editor |
|
35 |
portable_view_description=Description |
|
36 |
portable_view_id=Identifier |
|
37 |
portable_view_information=Information |
|
38 |
portable_view_layers=Portable View Layers |
|
39 |
portable_view_name=Name |
|
40 |
portable_view_validation=Portable View Validation |
|
41 |
portable_view_version=Version |
|
42 |
updateing_compilation_info=Updating compilation information |
|
43 |
validate=Validate |
|
44 |
version=Version |
|
45 |
version_must_be_a_integer=Version must be an integer |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.educa.portableview.swing.impl.PortableViewSwingDefaultImplLibrary |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/java/org/gvsig/educa/portableview/swing/impl/viewer/DefaultPortableViewViewer.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.educa.portableview.swing.impl.viewer; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.awt.Dimension; |
|
26 |
import java.io.IOException; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import javax.swing.JComponent; |
|
30 |
import javax.swing.JPanel; |
|
31 |
import javax.swing.JSplitPane; |
|
32 |
|
|
33 |
import org.apache.commons.lang3.StringUtils; |
|
34 |
|
|
35 |
import org.gvsig.educa.portableview.PortableViewRuntimeException; |
|
36 |
import org.gvsig.educa.portableview.map.CantLoadContextException; |
|
37 |
import org.gvsig.educa.portableview.map.InvalidPortableViewFormatException; |
|
38 |
import org.gvsig.educa.portableview.map.PortableView; |
|
39 |
import org.gvsig.educa.portableview.swing.PortableViewSwingLocator; |
|
40 |
import org.gvsig.educa.portableview.swing.PortableViewSwingManager; |
|
41 |
import org.gvsig.educa.portableview.swing.viewer.MapControlToolRegistrant; |
|
42 |
import org.gvsig.educa.portableview.swing.viewer.PortableViewToc; |
|
43 |
import org.gvsig.educa.portableview.swing.viewer.PortableViewViewer; |
|
44 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
45 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
46 |
import org.gvsig.fmap.mapcontext.layers.LayerEvent; |
|
47 |
import org.gvsig.fmap.mapcontext.layers.LayerListener; |
|
48 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
49 |
import org.gvsig.fmap.mapcontrol.MapControlCreationException; |
|
50 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
|
51 |
import org.gvsig.tools.ToolsLocator; |
|
52 |
import org.gvsig.tools.dispose.DisposableManager; |
|
53 |
|
|
54 |
/** |
|
55 |
* |
|
56 |
* Implementation of {@link PortableViewViewer} |
|
57 |
* |
|
58 |
* @author gvSIG Team |
|
59 |
* @version $Id$ |
|
60 |
* |
|
61 |
*/ |
|
62 |
public class DefaultPortableViewViewer extends JPanel implements |
|
63 |
PortableViewViewer { |
|
64 |
|
|
65 |
/** |
|
66 |
* |
|
67 |
*/ |
|
68 |
private static final long serialVersionUID = -8405474764132950973L; |
|
69 |
|
|
70 |
private final DisposableManager disposableManager; |
|
71 |
|
|
72 |
private final PortableView portableView; |
|
73 |
private final PortableViewToc toc; |
|
74 |
|
|
75 |
private MapControl mapControl; |
|
76 |
|
|
77 |
private final PortableViewSwingManager swingManager; |
|
78 |
|
|
79 |
private final JSplitPane splitPane; |
|
80 |
|
|
81 |
public DefaultPortableViewViewer(PortableView portableView) |
|
82 |
throws InvalidPortableViewFormatException, CantLoadContextException, |
|
83 |
IOException { |
|
84 |
super(); |
|
85 |
swingManager = PortableViewSwingLocator.getSwingManager(); |
|
86 |
disposableManager = ToolsLocator.getDisposableManager(); |
|
87 |
|
|
88 |
disposableManager.bind(this); |
|
89 |
|
|
90 |
this.portableView = portableView; |
|
91 |
|
|
92 |
if (portableView == null) { |
|
93 |
throw new IllegalArgumentException(); |
|
94 |
} |
|
95 |
|
|
96 |
if (!portableView.isOpen()) { |
|
97 |
portableView.open(); |
|
98 |
} |
|
99 |
|
|
100 |
toc = PortableViewSwingLocator.getSwingManager().newToc(); |
|
101 |
|
|
102 |
toc.attachTo(this); |
|
103 |
|
|
104 |
try { |
|
105 |
this.mapControl = |
|
106 |
MapControlLocator.getMapControlManager() |
|
107 |
.createJMapControlPanel(null); |
|
108 |
} catch (MapControlCreationException e) { |
|
109 |
// FIMXE exception |
|
110 |
throw new PortableViewRuntimeException( |
|
111 |
"Problem creating MapControl for viewer", e); |
|
112 |
} |
|
113 |
// Hide grid (avoid problem of Global grid configuration) |
|
114 |
mapControl.setGridVisibility(false); |
|
115 |
|
|
116 |
MapContext mapContext = portableView.getMapContext(); |
|
117 |
mapControl.setMapContext(mapContext); |
|
118 |
mapContext.getLayers().addLayerListener(new LayerListener() { |
|
119 |
|
|
120 |
public void visibilityChanged(LayerEvent e) { |
|
121 |
// Nothing to do |
|
122 |
mapControl.rePaintDirtyLayers(); |
|
123 |
} |
|
124 |
|
|
125 |
public void nameChanged(LayerEvent e) { |
|
126 |
// Nothing to do |
|
127 |
} |
|
128 |
|
|
129 |
public void editionChanged(LayerEvent e) { |
|
130 |
// Nothing to do |
|
131 |
} |
|
132 |
|
|
133 |
public void drawValueChanged(LayerEvent e) { |
|
134 |
// XXX removed this redraw to avoid problem in raster layers |
|
135 |
// which always changed "drawValue" in every draw process |
|
136 |
// (so drawing never ends ) |
|
137 |
|
|
138 |
// mapControl.rePaintDirtyLayers(); |
|
139 |
} |
|
140 |
|
|
141 |
public void activationChanged(LayerEvent e) { |
|
142 |
// Nothing to do |
|
143 |
} |
|
144 |
}); |
|
145 |
|
|
146 |
loadMapTools(mapControl); |
|
147 |
|
|
148 |
setLayout(new BorderLayout(10, 10)); |
|
149 |
|
|
150 |
mapControl.setMinimumSize(new Dimension(300, 300)); |
|
151 |
|
|
152 |
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false); |
|
153 |
splitPane.setLeftComponent(toc.getSwingComponent()); |
|
154 |
splitPane.setResizeWeight(0); |
|
155 |
splitPane.setRightComponent(mapControl); |
|
156 |
splitPane.setOneTouchExpandable(true); |
|
157 |
|
|
158 |
add(splitPane, BorderLayout.CENTER); |
|
159 |
} |
|
160 |
|
|
161 |
protected void loadMapTools(MapControl theMapControl) { |
|
162 |
// Register tools |
|
163 |
List<MapControlToolRegistrant> registrants = |
|
164 |
swingManager.getMapControlRegistrantList(); |
|
165 |
for (MapControlToolRegistrant registrant : registrants) { |
|
166 |
registrant.registerTools(theMapControl); |
|
167 |
} |
|
168 |
if (StringUtils.isBlank(theMapControl.getCurrentTool())) { |
|
169 |
if (!theMapControl.getNamesMapTools().isEmpty()) { |
|
170 |
theMapControl.setTool((String) theMapControl.getNamesMapTools() |
|
171 |
.keySet().iterator().next()); |
|
172 |
} |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
176 |
/** {@inheridDoc} */ |
|
177 |
public JComponent getSwingComponent() { |
|
178 |
return this; |
|
179 |
} |
|
180 |
|
|
181 |
/** {@inheridDoc} */ |
|
182 |
public PortableView getPortableView() { |
|
183 |
return portableView; |
|
184 |
} |
|
185 |
|
|
186 |
/** {@inheridDoc} */ |
|
187 |
public void zoomAll() { |
|
188 |
try { |
|
189 |
mapControl.getViewPort().setEnvelope( |
|
190 |
mapControl.getMapContext().getFullEnvelope()); |
|
191 |
} catch (ReadException e) { |
|
192 |
mapControl.setEnabled(false); |
|
193 |
throw new PortableViewRuntimeException("Problem in zoom all", e); |
|
194 |
} |
|
195 |
} |
|
196 |
|
|
197 |
/** {@inheridDoc} */ |
|
198 |
public void setTool(String toolId) { |
|
199 |
mapControl.setTool(toolId); |
|
200 |
} |
|
201 |
|
|
202 |
/** {@inheridDoc} */ |
|
203 |
public MapControl getMapControl() { |
|
204 |
return mapControl; |
|
205 |
} |
|
206 |
|
|
207 |
/** {@inheridDoc} */ |
|
208 |
public PortableViewToc getTOC() { |
|
209 |
return toc; |
|
210 |
} |
|
211 |
|
|
212 |
/** {@inheridDoc} */ |
|
213 |
public String getCurrentToolId() { |
|
214 |
return mapControl.getCurrentTool(); |
|
215 |
} |
|
216 |
|
|
217 |
/** {@inheridDoc} */ |
|
218 |
public void dispose() { |
|
219 |
disposableManager.release(this); |
|
220 |
mapControl = null; |
|
221 |
} |
|
222 |
|
|
223 |
public boolean isTocVisible() { |
|
224 |
return splitPane.getDividerLocation() > 5; |
|
225 |
} |
|
226 |
|
|
227 |
public void setTocVisible(boolean visible) { |
|
228 |
if (isTocVisible() == visible) { |
|
229 |
return; |
|
230 |
} |
|
231 |
if (visible) { |
|
232 |
splitPane.resetToPreferredSizes(); |
|
233 |
} else { |
|
234 |
splitPane.setDividerLocation(0); |
|
235 |
} |
|
236 |
|
|
237 |
} |
|
238 |
} |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/java/org/gvsig/educa/portableview/swing/impl/viewer/TocTreeNode.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.educa.portableview.swing.impl.viewer; |
|
23 |
|
|
24 |
import java.awt.Image; |
|
25 |
|
|
26 |
import javax.swing.ImageIcon; |
|
27 |
import javax.swing.tree.DefaultMutableTreeNode; |
|
28 |
|
|
29 |
import org.gvsig.educa.portableview.swing.impl.editor.layers.DefaultPortableViewLayersEditor; |
|
30 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
31 |
import org.gvsig.fmap.mapcontext.layers.operations.IHasImageLegend; |
|
32 |
import org.gvsig.fmap.mapcontext.layers.operations.LayerCollection; |
|
33 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
|
34 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
35 |
|
|
36 |
/** |
|
37 |
* Node representation of a layer in JTree of |
|
38 |
* {@link DefaultPortableViewLayersEditor} |
|
39 |
* |
|
40 |
* @author gvSIG Team |
|
41 |
* @version $Id$ |
|
42 |
* |
|
43 |
*/ |
|
44 |
public class TocTreeNode extends DefaultMutableTreeNode { |
|
45 |
|
|
46 |
/** |
|
47 |
* |
|
48 |
*/ |
|
49 |
private static final long serialVersionUID = -5660745136587795464L; |
|
50 |
|
|
51 |
/** |
|
52 |
* Nodes type |
|
53 |
* |
|
54 |
* @author gvSIG Team |
|
55 |
* @version $Id$ |
|
56 |
* |
|
57 |
*/ |
|
58 |
public enum TYPE { |
|
59 |
LAYER_COLLECTION, LAYER_WITHOUT_LEGEND, LAYER_WITH_LEGEND, LAYER_WITH_IMAGE_LEGEND, LEGEND, IMAGE_LEGEND |
|
60 |
}; |
|
61 |
|
|
62 |
private final FLayer layer; |
|
63 |
private final FLayer sourceLayer; |
|
64 |
private final Image image; |
|
65 |
private final TYPE type; |
|
66 |
private final ISymbol symbol; |
|
67 |
private final String symbolDescription; |
|
68 |
|
|
69 |
/** |
|
70 |
* Constructor for a {@link LayerCollection} node |
|
71 |
* |
|
72 |
* @param layer |
|
73 |
*/ |
|
74 |
public TocTreeNode(LayerCollection layer) { |
|
75 |
super(layer); |
|
76 |
this.layer = (FLayer) layer; |
|
77 |
this.symbol = null; |
|
78 |
this.symbolDescription = null; |
|
79 |
this.sourceLayer = null; |
|
80 |
this.image = null; |
|
81 |
type = TYPE.LAYER_COLLECTION; |
|
82 |
} |
|
83 |
|
|
84 |
/** |
|
85 |
* Constructor for a {@link SingleLayer} node |
|
86 |
* |
|
87 |
* @param layer |
|
88 |
* @param hasLegend |
|
89 |
* whatever layer has legend defined or not |
|
90 |
*/ |
|
91 |
public TocTreeNode(SingleLayer layer, boolean hasLegend) { |
|
92 |
super(layer); |
|
93 |
this.layer = layer; |
|
94 |
this.symbol = null; |
|
95 |
this.symbolDescription = null; |
|
96 |
this.sourceLayer = null; |
|
97 |
this.image = null; |
|
98 |
if (hasLegend) { |
|
99 |
type = TYPE.LAYER_WITH_LEGEND; |
|
100 |
} else { |
|
101 |
type = TYPE.LAYER_WITHOUT_LEGEND; |
|
102 |
} |
|
103 |
} |
|
104 |
|
|
105 |
/** |
|
106 |
* Constructor for a {@link SingleLayer} node without legend defined |
|
107 |
* |
|
108 |
* @param layer |
|
109 |
*/ |
|
110 |
public TocTreeNode(SingleLayer layer) { |
|
111 |
this(layer, false); |
|
112 |
} |
|
113 |
|
|
114 |
/** |
|
115 |
* Constructor for a {@link SingleLayer} which has a image legend ( |
|
116 |
* implements {@link IHasImageLegend} ) |
|
117 |
* |
|
118 |
* @param layer |
|
119 |
* @param image |
|
120 |
*/ |
|
121 |
public TocTreeNode(SingleLayer layer, Image image) { |
|
122 |
super(layer); |
|
123 |
this.layer = layer; |
|
124 |
this.symbol = null; |
|
125 |
this.symbolDescription = null; |
|
126 |
this.sourceLayer = null; |
|
127 |
this.image = null; |
|
128 |
if (image != null) { |
|
129 |
type = TYPE.LAYER_WITH_IMAGE_LEGEND; |
|
130 |
} else { |
|
131 |
type = TYPE.LAYER_WITHOUT_LEGEND; |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
135 |
/** |
|
136 |
* Constructor for a {@link ISymbol} node |
|
137 |
* |
|
138 |
* @param symbol |
|
139 |
* @param description |
|
140 |
* @param sourceLayer |
|
141 |
*/ |
|
142 |
public TocTreeNode(ISymbol symbol, String description, FLayer sourceLayer) { |
|
143 |
super(symbol); |
|
144 |
this.layer = null; |
|
145 |
this.symbol = symbol; |
|
146 |
this.symbolDescription = description; |
|
147 |
this.sourceLayer = sourceLayer; |
|
148 |
this.image = null; |
|
149 |
type = TYPE.LEGEND; |
|
150 |
} |
|
151 |
|
|
152 |
/** |
|
153 |
* Constructor for the image from a {@link IHasImageLegend} layer |
|
154 |
* |
|
155 |
* @param image |
|
156 |
* @param sourceLayer |
|
157 |
*/ |
|
158 |
public TocTreeNode(Image image, FLayer sourceLayer) { |
|
159 |
super(new ImageIcon(image)); |
|
160 |
this.layer = null; |
|
161 |
this.symbol = null; |
|
162 |
this.symbolDescription = null; |
|
163 |
this.sourceLayer = sourceLayer; |
|
164 |
this.image = image; |
|
165 |
type = TYPE.LEGEND; |
|
166 |
|
|
167 |
} |
|
168 |
|
|
169 |
/** |
|
170 |
* Is a node which represent a legend or a part of it |
|
171 |
* |
|
172 |
* @return |
|
173 |
*/ |
|
174 |
public boolean isLegend() { |
|
175 |
return type == TYPE.LEGEND || type == TYPE.IMAGE_LEGEND; |
|
176 |
} |
|
177 |
|
|
178 |
/** |
|
179 |
* Gets the node type |
|
180 |
* |
|
181 |
* @return |
|
182 |
*/ |
|
183 |
public TYPE getType() { |
|
184 |
return type; |
|
185 |
} |
|
186 |
|
|
187 |
/** |
|
188 |
* Gets the layer related to this node |
|
189 |
* |
|
190 |
* @return layer or null |
|
191 |
*/ |
|
192 |
public FLayer getLayer() { |
|
193 |
return layer; |
|
194 |
} |
|
195 |
|
|
196 |
/** |
|
197 |
* Gets the layer related to legend represented by this node |
|
198 |
* |
|
199 |
* @return the sourceLayer |
|
200 |
*/ |
|
201 |
public FLayer getSourceLayer() { |
|
202 |
return sourceLayer; |
|
203 |
} |
|
204 |
|
|
205 |
/** |
|
206 |
* Gets the legend image which represents this node |
|
207 |
* |
|
208 |
* @return the image |
|
209 |
*/ |
|
210 |
public Image getImage() { |
|
211 |
return image; |
|
212 |
} |
|
213 |
|
|
214 |
/** |
|
215 |
* Gets the legend image which represents this node |
|
216 |
* |
|
217 |
* @return the image |
|
218 |
*/ |
|
219 |
public ImageIcon getImageIcon() { |
|
220 |
if (image == null) { |
|
221 |
return null; |
|
222 |
} |
|
223 |
return (ImageIcon) getUserObject(); |
|
224 |
} |
|
225 |
|
|
226 |
/** |
|
227 |
* Gets the legend symbol which represents this node |
|
228 |
* |
|
229 |
* @return the symbol or null |
|
230 |
*/ |
|
231 |
public ISymbol getSymbol() { |
|
232 |
return symbol; |
|
233 |
} |
|
234 |
|
|
235 |
/** |
|
236 |
* Gets description of the legend symbol which represents this node |
|
237 |
* |
|
238 |
* @return the symbolDescription or null |
|
239 |
*/ |
|
240 |
public String getSymbolDescription() { |
|
241 |
return symbolDescription; |
|
242 |
} |
|
243 |
|
|
244 |
@Override |
|
245 |
public boolean isLeaf() { |
|
246 |
return getChildCount() == 0; |
|
247 |
} |
|
248 |
|
|
249 |
/** |
|
250 |
* Informs if this node represents a {@link FLayer} |
|
251 |
* |
|
252 |
* @return |
|
253 |
*/ |
|
254 |
public boolean isLayer() { |
|
255 |
return layer != null; |
|
256 |
} |
|
257 |
} |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/java/org/gvsig/educa/portableview/swing/impl/viewer/TocTreeCellRenderer.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.educa.portableview.swing.impl.viewer; |
|
23 |
|
|
24 |
import java.awt.Component; |
|
25 |
import java.awt.FlowLayout; |
|
26 |
import java.awt.Font; |
|
27 |
import java.awt.Graphics2D; |
|
28 |
import java.awt.Rectangle; |
|
29 |
import java.awt.geom.AffineTransform; |
|
30 |
import java.awt.image.BufferedImage; |
|
31 |
|
|
32 |
import javax.swing.Icon; |
|
33 |
import javax.swing.ImageIcon; |
|
34 |
import javax.swing.JCheckBox; |
|
35 |
import javax.swing.JPanel; |
|
36 |
import javax.swing.JTree; |
|
37 |
import javax.swing.UIManager; |
|
38 |
import javax.swing.tree.DefaultTreeCellRenderer; |
|
39 |
import javax.swing.tree.TreeCellRenderer; |
|
40 |
|
|
41 |
import org.gvsig.educa.portableview.swing.impl.editor.layers.DefaultPortableViewLayersEditor; |
|
42 |
import org.gvsig.educa.portableview.swing.PortableViewSwingLocator; |
|
43 |
import org.gvsig.educa.portableview.swing.PortableViewSwingManager; |
|
44 |
import org.gvsig.educa.portableview.swing.viewer.PortableViewToc; |
|
45 |
import org.gvsig.educa.portableview.swing.viewer.PortableViewTocImageProvider; |
|
46 |
import org.gvsig.fmap.geom.Geometry; |
|
47 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
48 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
49 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
50 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException; |
|
51 |
import org.gvsig.andami.IconThemeHelper; |
|
52 |
/** |
|
53 |
* <p> |
|
54 |
* Tree cell renderer for {@link DefaultPortableViewLayersEditor} JTree |
|
55 |
* </p> |
|
56 |
* <p> |
|
57 |
* Nodes are render depending its type: |
|
58 |
* <ul> |
|
59 |
* <li><i>Layers</i>: shows icon from |
|
60 |
* {@link PortableViewTocImageProvider#getImageIconForLayer(FLayer)} (if any) and |
|
61 |
* it's name</li> |
|
62 |
* <li><i>Symbol</i>: shows a preview from |
|
63 |
* {@link PortableViewTocImageProvider#getSymbolPreview(ISymbol, FLayer)} or one |
|
64 |
* generated by default, and the symbol description</li> |
|
65 |
* </ul> |
|
66 |
* </p> |
|
67 |
* |
|
68 |
* @author gvSIG Team |
|
69 |
* @version $Id$ |
|
70 |
* @see PortableViewToc |
|
71 |
* @see PortableViewToc#setImageProvider(PortableViewTocImageProvider) |
|
72 |
* @see DefaultPortableViewToc |
|
73 |
* @see PortableViewTocImageProvider |
|
74 |
*/ |
|
75 |
public class TocTreeCellRenderer extends JPanel implements TreeCellRenderer { |
|
76 |
|
|
77 |
/** |
|
78 |
* |
|
79 |
*/ |
|
80 |
private static final long serialVersionUID = 2372319888923346385L; |
|
81 |
|
|
82 |
private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory |
|
83 |
.getLogger(TocTreeCellRenderer.class); |
|
84 |
|
|
85 |
private final DefaultTreeCellRenderer label; |
|
86 |
private final JCheckBox check; |
|
87 |
|
|
88 |
private PortableViewTocImageProvider imageProvider; |
|
89 |
|
|
90 |
private final PortableViewSwingManager swingManager; |
|
91 |
|
|
92 |
private final Font standarFont; |
|
93 |
|
|
94 |
private final Font alternateFont; |
|
95 |
|
|
96 |
/** |
|
97 |
* |
|
98 |
*/ |
|
99 |
public TocTreeCellRenderer() { |
|
100 |
super(); |
|
101 |
swingManager = PortableViewSwingLocator.getSwingManager(); |
|
102 |
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
|
103 |
this.setOpaque(false); |
|
104 |
check = new JCheckBox(); |
|
105 |
check.setOpaque(false); |
|
106 |
label = new DefaultTreeCellRenderer(); |
|
107 |
Font font = label.getFont(); |
|
108 |
if (font == null) { |
|
109 |
font = UIManager.getFont("Label.font"); |
|
110 |
} |
|
111 |
standarFont = font; |
|
112 |
alternateFont = standarFont.deriveFont(Font.ITALIC); |
|
113 |
add(check); |
|
114 |
add(label); |
|
115 |
} |
|
116 |
|
|
117 |
public Component getTreeCellRendererComponent(JTree tree, Object value, |
|
118 |
boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { |
|
119 |
|
|
120 |
label.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, |
|
121 |
row, hasFocus); |
|
122 |
|
|
123 |
if (!(value instanceof TocTreeNode)) { |
|
124 |
return this; |
|
125 |
} |
|
126 |
|
|
127 |
// Gets node |
|
128 |
TocTreeNode node = (TocTreeNode) value; |
|
129 |
|
|
130 |
// Format variables |
|
131 |
boolean enabled = true; |
|
132 |
Icon image = null; |
|
133 |
boolean showCheck = false; |
|
134 |
boolean checked = false; |
|
135 |
String text = null; |
|
136 |
Font font = standarFont; |
|
137 |
|
|
138 |
// Select node type and configure it |
|
139 |
switch (node.getType()) { |
|
140 |
case LAYER_COLLECTION: |
|
141 |
image = getImageForLayer(node.getLayer()); |
|
142 |
if (image == null && leaf) { |
|
143 |
image = label.getDefaultClosedIcon(); |
|
144 |
} |
|
145 |
showCheck = true; |
|
146 |
text = node.getLayer().getName(); |
|
147 |
checked = node.getLayer().isVisible(); |
|
148 |
enabled = node.getLayer().isAvailable(); |
|
149 |
break; |
|
150 |
|
|
151 |
case LAYER_WITH_LEGEND: |
|
152 |
case LAYER_WITHOUT_LEGEND: |
|
153 |
image = getImageForLayer(node.getLayer()); |
|
154 |
if (image == null) { |
|
155 |
image = label.getDefaultLeafIcon(); |
|
156 |
} |
|
157 |
showCheck = true; |
|
158 |
text = node.getLayer().getName(); |
|
159 |
checked = node.getLayer().isVisible(); |
|
160 |
// enabled = node.getLayer().isAvailable(); |
|
161 |
break; |
|
162 |
|
|
163 |
case LEGEND: |
|
164 |
image = getSymbolPreview(node.getSymbol(), node.getSourceLayer()); |
|
165 |
text = node.getSymbolDescription(); |
|
166 |
if (text == null) { |
|
167 |
text = |
|
168 |
"{".concat(swingManager.getTranslation("default")).concat( |
|
169 |
"}"); |
|
170 |
font = alternateFont; |
|
171 |
} |
|
172 |
break; |
|
173 |
|
|
174 |
case IMAGE_LEGEND: |
|
175 |
image = node.getImageIcon(); |
|
176 |
break; |
|
177 |
|
|
178 |
} |
|
179 |
|
|
180 |
// update enabled |
|
181 |
setEnabled(enabled); |
|
182 |
|
|
183 |
// Change image icon if any |
|
184 |
if (image != null) { |
|
185 |
if (label.isEnabled()) { |
|
186 |
label.setIcon(image); |
|
187 |
} else { |
|
188 |
label.setDisabledIcon(image); |
|
189 |
} |
|
190 |
} |
|
191 |
|
|
192 |
// Show or hide check box |
|
193 |
if (check.isVisible() != showCheck) { |
|
194 |
check.setVisible(showCheck); |
|
195 |
} |
|
196 |
if (showCheck) { |
|
197 |
// Update check box value |
|
198 |
check.setSelected(checked); |
|
199 |
} |
|
200 |
if (text != null) { |
|
201 |
label.setText(text); |
|
202 |
} else { |
|
203 |
label.setText(""); |
|
204 |
} |
|
205 |
label.setFont(font); |
|
206 |
|
|
207 |
doLayout(); |
|
208 |
return this; |
|
209 |
} |
|
210 |
|
|
211 |
/** |
|
212 |
* Generates a symbol preview |
|
213 |
* <p> |
|
214 |
* Ported from |
|
215 |
* <code>org.gvsig.app.project.documents.view.toc.TocItemLeaf.getIcon()</code> |
|
216 |
* </p> |
|
217 |
* <p> |
|
218 |
* <b>TODO review this code</b> |
|
219 |
* </p> |
|
220 |
* |
|
221 |
* @param symbol |
|
222 |
* @return |
|
223 |
*/ |
|
224 |
private ImageIcon getDefaultSymbolPreview(ISymbol symbol) { |
|
225 |
BufferedImage img = null; |
|
226 |
Graphics2D g2 = null; |
|
227 |
Rectangle r = null; |
|
228 |
|
|
229 |
switch (symbol.getSymbolType()) { |
|
230 |
case Geometry.TYPES.POINT: |
|
231 |
case Geometry.TYPES.CURVE: |
|
232 |
case Geometry.TYPES.SURFACE: |
|
233 |
case Geometry.TYPES.MULTICURVE: |
|
234 |
case Geometry.TYPES.MULTISURFACE: |
|
235 |
case Geometry.TYPES.MULTIPOINT: |
|
236 |
img = |
|
237 |
new BufferedImage(check.getWidth(), check.getHeight(), |
|
238 |
BufferedImage.TYPE_INT_ARGB); |
|
239 |
g2 = img.createGraphics(); |
|
240 |
r = new Rectangle(label.getHeight(), label.getHeight()); |
|
241 |
|
|
242 |
// // TODO: CAMBIAR PARA QUE NO DEPENDA DE FSYMBOL |
|
243 |
// if (symbol instanceof FSymbol) |
|
244 |
// FGraphicUtilities.DrawSymbol(g2, |
|
245 |
// AffineTransform.getScaleInstance(0.8,0.8), r, (FSymbol) symbol); |
|
246 |
// // Por ahora, los que no sean FSymbol no se renderizan en el TOC. |
|
247 |
break; |
|
248 |
case Geometry.TYPES.GEOMETRY: |
|
249 |
img = |
|
250 |
new BufferedImage(3 * check.getHeight(), check.getHeight(), |
|
251 |
BufferedImage.TYPE_INT_ARGB); |
|
252 |
g2 = img.createGraphics(); |
|
253 |
r = new Rectangle(3 * check.getHeight(), check.getHeight()); |
|
254 |
// if (symbol instanceof FSymbol) |
|
255 |
// FGraphicUtilities.DrawSymbol(g2, |
|
256 |
// AffineTransform.getScaleInstance(0.8,0.8), r, (FSymbol) symbol); |
|
257 |
break; |
|
258 |
|
|
259 |
} |
|
260 |
|
|
261 |
if (g2 == null) { |
|
262 |
return null;// TODO tipo de shape no soportado. |
|
263 |
} |
|
264 |
try { |
|
265 |
symbol.drawInsideRectangle(g2, |
|
266 |
AffineTransform.getScaleInstance(1, 1), r, null); |
|
267 |
} catch (SymbolDrawingException e) { |
|
268 |
if (e.getType() == SymbolDrawingException.UNSUPPORTED_SET_OF_SETTINGS) { |
|
269 |
try { |
|
270 |
MapContextLocator |
|
271 |
.getSymbolManager() |
|
272 |
.getWarningSymbol( |
|
273 |
SymbolDrawingException.STR_UNSUPPORTED_SET_OF_SETTINGS, |
|
274 |
symbol.getDescription(), |
|
275 |
SymbolDrawingException.UNSUPPORTED_SET_OF_SETTINGS) |
|
276 |
.drawInsideRectangle(g2, g2.getTransform(), |
|
277 |
r.getBounds(), null); |
|
278 |
} catch (SymbolDrawingException e1) { |
|
279 |
// IMPOSSIBLE TO REACH THIS |
|
280 |
} |
|
281 |
} else { |
|
282 |
LOG.warn("Unsupported symbol type: {}", symbol.getSymbolType()); |
|
283 |
return null; |
|
284 |
} |
|
285 |
} |
|
286 |
return new ImageIcon(img); |
|
287 |
} |
|
288 |
|
|
289 |
/** |
|
290 |
* <p> |
|
291 |
* Informs if coordinate is on check box location |
|
292 |
* </p> |
|
293 |
* <p> |
|
294 |
* Used to detect click on visibility layer check |
|
295 |
* </p> |
|
296 |
* |
|
297 |
* @param x |
|
298 |
* @param y |
|
299 |
* @return |
|
300 |
*/ |
|
301 |
public boolean isOnCheck(int x, int y) { |
|
302 |
if (!check.isVisible()) { |
|
303 |
return false; |
|
304 |
} |
|
305 |
return check.contains(x, y); |
|
306 |
} |
|
307 |
|
|
308 |
/** |
|
309 |
* <p> |
|
310 |
* Sets image provider for tree elements. |
|
311 |
* </p> |
|
312 |
* It is set by |
|
313 |
* {@link DefaultPortableViewToc#setImageProvider(PortableViewTocImageProvider)} |
|
314 |
* or in its initialization |
|
315 |
* |
|
316 |
* @param imageProvider |
|
317 |
*/ |
|
318 |
public void setImageProvider(PortableViewTocImageProvider imageProvider) { |
|
319 |
this.imageProvider = imageProvider; |
|
320 |
} |
|
321 |
|
|
322 |
/** |
|
323 |
* Returns the image to use for a layer tree element |
|
324 |
* |
|
325 |
* @param layer |
|
326 |
* @return image or null if there is not defined |
|
327 |
*/ |
|
328 |
private ImageIcon getImageForLayer(FLayer layer) { |
|
329 |
ImageIcon icon = null; |
|
330 |
if(!layer.isAvailable()){ |
|
331 |
icon = IconThemeHelper.getImageIcon("layer-icon-unavailable"); |
|
332 |
}else if (imageProvider != null) { |
|
333 |
icon = imageProvider.getImageIconForLayer(layer); |
|
334 |
} |
|
335 |
return icon; |
|
336 |
} |
|
337 |
|
|
338 |
/** |
|
339 |
* Returns the symbol preview image |
|
340 |
* |
|
341 |
* @param symbol |
|
342 |
* @param sourceLayer |
|
343 |
* @return |
|
344 |
*/ |
|
345 |
private ImageIcon getSymbolPreview(ISymbol symbol, FLayer sourceLayer) { |
|
346 |
ImageIcon icon = null; |
|
347 |
if (imageProvider != null) { |
|
348 |
icon = imageProvider.getSymbolPreview(symbol, sourceLayer); |
|
349 |
} |
|
350 |
if (icon == null) { |
|
351 |
icon = getDefaultSymbolPreview(symbol); |
|
352 |
} |
|
353 |
return icon; |
|
354 |
} |
|
355 |
|
|
356 |
@Override |
|
357 |
public void setEnabled(boolean enabled) { |
|
358 |
super.setEnabled(enabled); |
|
359 |
label.setEnabled(enabled); |
|
360 |
check.setEnabled(enabled); |
|
361 |
} |
|
362 |
} |
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.65/org.gvsig.educa.portableview.swing/org.gvsig.educa.portableview.swing.impl/src/main/java/org/gvsig/educa/portableview/swing/impl/viewer/DefaultPortableViewToc.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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 |
*/ |
|
22 |
package org.gvsig.educa.portableview.swing.impl.viewer; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.awt.Dimension; |
|
26 |
import java.awt.Image; |
|
27 |
import java.awt.Rectangle; |
|
28 |
import java.awt.event.MouseEvent; |
|
29 |
import java.awt.event.MouseListener; |
|
30 |
import java.util.ArrayList; |
|
31 |
import java.util.Arrays; |
|
32 |
import java.util.List; |
|
33 |
|
|
34 |
import javax.swing.JComponent; |
|
35 |
import javax.swing.JPanel; |
|
36 |
import javax.swing.JScrollPane; |
|
37 |
import javax.swing.JTree; |
|
38 |
import javax.swing.SwingUtilities; |
|
39 |
import javax.swing.event.TreeSelectionEvent; |
|
40 |
import javax.swing.event.TreeSelectionListener; |
|
41 |
import javax.swing.tree.DefaultMutableTreeNode; |
|
42 |
import javax.swing.tree.DefaultTreeModel; |
|
43 |
import javax.swing.tree.TreePath; |
|
44 |
import javax.swing.tree.TreeSelectionModel; |
|
45 |
|
|
46 |
import org.gvsig.andami.IconThemeHelper; |
|
47 |
import org.gvsig.educa.portableview.swing.impl.viewer.TocTreeNode.TYPE; |
|
48 |
import org.gvsig.educa.portableview.swing.PortableViewSwingLocator; |
|
49 |
import org.gvsig.educa.portableview.swing.PortableViewSwingManager; |
|
50 |
import org.gvsig.educa.portableview.swing.viewer.PortableViewToc; |
|
51 |
import org.gvsig.educa.portableview.swing.viewer.PortableViewTocImageProvider; |
|
52 |
import org.gvsig.educa.portableview.swing.viewer.PortableViewViewer; |
|
53 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
54 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
55 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
56 |
import org.gvsig.fmap.mapcontext.layers.LayerEvent; |
|
57 |
import org.gvsig.fmap.mapcontext.layers.LayerListener; |
|
58 |
import org.gvsig.fmap.mapcontext.layers.operations.Classifiable; |
|
59 |
import org.gvsig.fmap.mapcontext.layers.operations.IHasImageLegend; |
|
60 |
import org.gvsig.fmap.mapcontext.layers.operations.LayerCollection; |
|
61 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
|
62 |
import org.gvsig.fmap.mapcontext.rendering.legend.IClassifiedLegend; |
|
63 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
|
64 |
import org.gvsig.fmap.mapcontext.rendering.legend.ISingleSymbolLegend; |
|
65 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
66 |
import org.gvsig.fmap.swing.toc.TOCFactory; |
|
67 |
import org.gvsig.fmap.swing.toc.event.ActiveLayerChangeEventListener; |
|
68 |
import org.gvsig.fmap.swing.toc.event.LayerActionEventListener; |
|
69 |
import org.gvsig.fmap.swing.toc.event.LegendActionEventListener; |
|
70 |
import org.gvsig.tools.dynobject.DynObject; |
|
71 |
import org.gvsig.tools.service.Manager; |
|
72 |
|
|
73 |
/** |
|
74 |
* <p> |
|
75 |
* Default implementation of {@link PortableViewToc} |
|
76 |
* </p> |
|
77 |
* |
|
78 |
* @author gvSIG Team |
|
79 |
* @version $Id$ |
|
80 |
* |
|
81 |
*/ |
|
82 |
public class DefaultPortableViewToc extends JPanel implements PortableViewToc, |
|
83 |
LayerListener, TreeSelectionListener { |
|
84 |
|
|
85 |
/** |
|
86 |
* |
|
87 |
*/ |
|
88 |
private static final long serialVersionUID = 3761640139439674486L; |
|
89 |
|
|
90 |
@SuppressWarnings("unused") |
|
91 |
private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory |
|
92 |
.getLogger(DefaultPortableViewToc.class); |
|
93 |
|
|
94 |
private static final FLayer[] EMPTY_SELECTION = new FLayer[0]; |
|
95 |
|
|
96 |
private PortableViewViewer viewer; |
|
97 |
|
|
98 |
private boolean initialized; |
|
99 |
|
|
100 |
private JTree tree; |
|
101 |
|
|
102 |
private FLayers rootLayer; |
|
103 |
|
|
104 |
private TocTreeNode rootNode; |
|
105 |
|
|
106 |
private DefaultTreeModel treeModel; |
|
107 |
|
|
108 |
private PortableViewTocImageProvider imageProvider; |
|
109 |
|
|
110 |
private TocTreeCellRenderer cellRenderer; |
|
111 |
|
|
112 |
private boolean internalSelectionChanging; |
|
113 |
|
|
114 |
private final PortableViewSwingManager swingManager; |
|
115 |
|
|
116 |
public DefaultPortableViewToc() { |
|
117 |
swingManager = PortableViewSwingLocator.getSwingManager(); |
|
118 |
initialized = false; |
|
119 |
imageProvider = swingManager.getDefaultTocImageProvider(); |
|
120 |
} |
|
121 |
|
|
122 |
public void setImageProvider(PortableViewTocImageProvider imageProvider) { |
|
123 |
this.imageProvider = imageProvider; |
|
124 |
|
|
125 |
if (cellRenderer != null) { |
|
126 |
cellRenderer.setImageProvider(imageProvider); |
|
127 |
} |
|
128 |
} |
|
129 |
|
|
130 |
/** |
|
131 |
* Load tree model from mapContext |
|
132 |
*/ |
|
133 |
private void loadTreeModel() { |
|
134 |
rootLayer = getMapContext().getLayers(); |
|
135 |
// rootNode = new LayerTreeNode(rootLayer); |
|
136 |
// rootLayer.addLayerCollectionListener(this); |
|
137 |
loadLayerNode(rootLayer, null); |
|
138 |
treeModel = new DefaultTreeModel(rootNode); |
|
139 |
tree.setModel(treeModel); |
|
140 |
tree.invalidate(); |
|
141 |
tree.getSelectionModel().addTreeSelectionListener(this); |
|
142 |
} |
|
143 |
|
|
144 |
/** |
|
145 |
* Load a layer Node |
|
146 |
* |
|
147 |
* @param layer |
|
148 |
* @param parent |
|
149 |
*/ |
|
150 |
private void loadLayerNode(FLayer layer, TocTreeNode parent) { |
|
151 |
layer.addLayerListener(this); |
|
152 |
TocTreeNode node; |
|
153 |
if (layer instanceof LayerCollection) { |
|
154 |
LayerCollection collection = (LayerCollection) layer; |
|
155 |
node = new TocTreeNode((LayerCollection) layer); |
|
156 |
// collection.addLayerCollectionListener(this); |
|
157 |
for (int i = collection.getLayersCount(); i > 0; i--) { |
|
158 |
loadLayerNode(collection.getLayer(i - 1), node); |
|
159 |
} |
|
160 |
if (parent == null) { |
|
161 |
rootNode = node; |
|
162 |
} else { |
|
163 |
parent.add(node); |
|
164 |
} |
|
165 |
|
|
166 |
} else { |
|
167 |
loadSingleLayerNode((SingleLayer) layer, parent); |
|
168 |
} |
|
169 |
|
|
170 |
} |
|
171 |
|
|
172 |
private void loadSingleLayerNode(SingleLayer layer, TocTreeNode parent) { |
|
173 |
TocTreeNode node; |
|
174 |
if (layer instanceof Classifiable) { |
|
175 |
Classifiable classifLayer = (Classifiable) layer; |
|
176 |
if (classifLayer.getLegend() != null) { |
|
177 |
loadLayerWithLegendNode(layer, classifLayer.getLegend(), parent); |
|
178 |
return; |
|
179 |
} |
|
180 |
} |
|
181 |
if (layer instanceof IHasImageLegend) { |
|
182 |
if (layer.isAvailable()) { |
|
183 |
Image imgLegend = ((IHasImageLegend) layer).getImageLegend(); |
|
184 |
loadLayerWithImageLegendNode(layer, imgLegend, parent); |
|
185 |
}else { |
|
186 |
loadLayerWithImageLegendNode(layer, null, parent); |
|
187 |
} |
|
188 |
return; |
|
189 |
} |
|
190 |
node = new TocTreeNode(layer); |
|
191 |
parent.add(node); |
|
192 |
} |
|
193 |
|
|
194 |
/** |
|
195 |
* @param layer |
|
196 |
* @param imgLegend |
|
197 |
* @param parent |
|
198 |
*/ |
|
199 |
private void loadLayerWithImageLegendNode(SingleLayer layer, |
|
200 |
Image imgLegend, TocTreeNode parent) { |
|
201 |
TocTreeNode node; |
|
202 |
if (imgLegend == null) { |
|
203 |
node = new TocTreeNode(layer); |
|
204 |
} else { |
|
205 |
node = new TocTreeNode(layer, imgLegend); |
|
206 |
TocTreeNode legendNode = new TocTreeNode(imgLegend, layer); |
|
207 |
node.add(legendNode); |
|
208 |
} |
|
209 |
parent.add(node); |
|
210 |
} |
|
211 |
|
|
212 |
/** |
|
213 |
* @param layer |
|
214 |
* @param legend |
|
215 |
* @param parent |
|
216 |
*/ |
|
217 |
private void loadLayerWithLegendNode(SingleLayer layer, ILegend legend, |
|
218 |
TocTreeNode parent) { |
|
219 |
TocTreeNode node; |
|
220 |
ISymbol defSymbol = legend.getDefaultSymbol(); |
|
221 |
if (legend instanceof IClassifiedLegend) { |
|
222 |
node = new TocTreeNode(layer, true); |
|
223 |
IClassifiedLegend cl = (IClassifiedLegend) legend; |
|
224 |
String[] descriptions = cl.getDescriptions(); |
|
225 |
ISymbol[] symbols = cl.getSymbols(); |
|
226 |
|
|
227 |
TocTreeNode symNode; |
|
228 |
for (int j = 0; j < descriptions.length; j++) { |
|
229 |
symNode = new TocTreeNode(symbols[j], descriptions[j], layer); |
|
230 |
node.add(symNode); |
|
231 |
} |
|
232 |
} else if (legend instanceof ISingleSymbolLegend && defSymbol != null) { |
|
233 |
node = new TocTreeNode(layer, true); |
|
234 |
|
Also available in: Unified diff