Revision 990

View differences:

org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<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">
4
	<modelVersion>4.0.0</modelVersion>
5
	<groupId>org.gvsig</groupId>
6
	<artifactId>org.gvsig.educa.portableview.app</artifactId>
7
	<packaging>pom</packaging>
8
	<name>org.gvsig.educa.portableview.app</name>
9
	<description>Educa.PortableView plugins</description>
10
	<parent>
11
            <groupId>org.gvsig</groupId>
12
            <artifactId>org.gvsig.educa.portableview</artifactId>
13
            <version>1.0.140</version> 
14
	</parent>
15
	<properties>
16
		<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-educa/pool</gvsig.package.info.poolURL>
17
	</properties>
18
	<dependencies>
19
		<dependency>
20
			<groupId>org.slf4j</groupId>
21
			<artifactId>slf4j-api</artifactId>
22
			<scope>compile</scope>
23
		</dependency>
24
	</dependencies>
25
	<modules>
26
		<module>org.gvsig.educa.portableview.app.viewer</module>
27
		<module>org.gvsig.educa.portableview.app.editor</module>
28
	</modules>
29
</project>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/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.app</artifactId>
6
		<version>1.0.140</version>
7
	</parent>
8
	<artifactId>org.gvsig.educa.portableview.app.editor</artifactId>
9
	<name>org.gvsig.educa.portableview.app.editor</name>
10

  
11
	<dependencies>
12
            <dependency>
13
                <groupId>org.gvsig</groupId>
14
                <artifactId> org.gvsig.educa.portableview.app.viewer </artifactId>
15
                <scope>compile</scope>
16
            </dependency>
17
            <dependency>
18
                <groupId>org.gvsig</groupId>
19
                <artifactId>org.gvsig.about.api</artifactId>
20
                <scope>compile</scope>
21
            </dependency>
22
	</dependencies>
23
	  	<properties>
24
		<gvsig.package.info.state>testing</gvsig.package.info.state>
25
        <gvsig.package.info.official>true</gvsig.package.info.official>
26
		<gvsig.package.info.dependencies>required: org.gvsig.app -ge 2.1.0</gvsig.package.info.dependencies>
27
        <gvsig.package.info.categories>Portable View</gvsig.package.info.categories>
28
        <gvsig.package.info.name>Portable View: editor</gvsig.package.info.name>
29
        <gvsig.package.info.description>Portable View document: Provides tools to create and generate packages of Portable View.</gvsig.package.info.description>
30
        <gvsig.package.info.owner>gvSIG Association</gvsig.package.info.owner>
31
        <gvsig.package.info.javaVM>j1_6</gvsig.package.info.javaVM>
32
        <gvsig.package.info.sourcesURL>${project.scm.url}</gvsig.package.info.sourcesURL>
33
		<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-educa/pool/</gvsig.package.info.poolURL>
34
    </properties>
35

  
36
</project>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/buildNumber.properties
1
#Tue Apr 27 23:28:03 CEST 2021
2
buildNumber=150
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources-plugin/text_de.properties
1
#text_de.properties
2
create_from_view=Aus Ansicht erstellen
3
create_portable_view=Thematische Karte erstellen
4
export_to_view=Als Ansicht exportieren
5
folder_must_be_empty=Ordner muss leer sein
6
generate_package=Erzeuge Paket
7
generated_file=Erstellte Datei
8
generated_from_portable_view=Aus thematischer Karte erstellt
9
new_portable_view_from_a_view=Neue thematische Karte aus Ansicht
10
open_related_portable_view=Zugeh\u00F6rige Thematische Karte \u00F6ffnen
11
open_source_view=Quelldaten-Ansicht \u00F6ffnen
12
problems_creating_portable_view_from_a_view=Probleme beim Erstellen der Thematischen Karte aus der Ansicht
13
problems_exporting_portable_view_to_view=Problem beim Export der Thematischen Karte in die Ansicht
14
problems_generating_portable_view_package=Problem beim Erstellen eines Thematischen Kartenpakets
15
problems_regeneration_portable_view=Problem beim Wiederherstellen der thematischen Karte
16
problems_reloading_portable_view=Problem beim Laden der Thematischen Karte
17
regenerate_portable_view_from_a_view=Thematische Karte aus Ansicht wiederherstellen
18
Select_folder_to_extract_data=Zielverzeichnis zum Extrahieren von Daten ausw\u00E4hlen
19
Select_folder_to_store_package=Zielverzeichnis ausw\u00E4hlen
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources-plugin/text_it.properties
1
#text_it.properties
2
create_from_view=Crea dalla vista
3
create_portable_view=Crea mappa tematica
4
export_to_view=Esporta nella vista
5
folder_must_be_empty=La cartella deve essere vuota
6
generate_package=Crea pacchetto distribuibile
7
generated_file=File generato
8
generated_from_portable_view=Generato dalla mappa tematica\:\n* Id\: %1$s\n* Nome\: %2$s\n* Versione\: %3$d\n* Numero di compilazione\: %4$s
9
new_portable_view_from_a_view=Nuova mappa tematica da una vista
10
open_related_portable_view=Apri mappa tematica relativa
11
open_source_view=Apri la vista di origine
12
problems_creating_portable_view_from_a_view=Problemi nella creazione della mappa tematica dalla vista
13
problems_exporting_portable_view_to_view=Problemi nell'esportazione della mappa tematica dalla vista
14
problems_generating_portable_view_package=Problemi nella creazione del pacchetto della mappa tematica
15
problems_regeneration_portable_view=Problemi nella rigenerazione della mappa tematica
16
problems_reloading_portable_view=Problemi nel ricaricamento della mappa tematica
17
regenerate_portable_view_from_a_view=Rigenera la mappa tematica dalla vista
18
Select_folder_to_extract_data=Seleziona la cartella per l'esportazione
19
Select_folder_to_store_package=Seleziona la cartella di destinazione
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources-plugin/text.properties
1
#text.properties
2
create_from_view=Crear a partir de la vista
3
create_portable_view=Crear vista portable
4
export_to_view=Exportar a vista
5
folder_must_be_empty=El directorio debe estar vac\u00EDo
6
generate_package=Generar paquete distribuible
7
generated_file=Generado el fichero
8
generated_from_portable_view=Generado a partir de la vista portable\:\n* Id\: %1$s\n* Nombre\: %2$s\n* Versi\u00F3n\: %3$d\n* N\u00FAmero de compilaci\u00F3n\: %4$d\n\n
9
new_portable_view_from_a_view=Nueva vista portable desde vista
10
open_related_portable_view=Abrir la vista portable relacionada
11
open_source_view=Abrir la vista origen
12
problems_creating_portable_view_from_a_view=Problemas creando vista portable desde la vista
13
problems_exporting_portable_view_to_view=Problemas exportando vista portable a vista
14
problems_generating_portable_view_package=Problemas generando el paquete de la vista portable
15
problems_regeneration_portable_view=Problemas regenerando la vista portable
16
problems_reloading_portable_view=Problemas al recargar la vista portable
17
regenerate_portable_view_from_a_view=Regenerar vista portable desde vista
18
Select_folder_to_extract_data=Seleccione directorio para exportar
19
Select_folder_to_store_package=Seleccione directorio de destino
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources-plugin/text_en.properties
1
#text_en.properties
2
create_from_view=Create from View
3
create_portable_view=Create Portable View
4
export_to_view=Export to view
5
folder_must_be_empty=Folder must be empty
6
generate_package=Generate package
7
generated_file=Generated file
8
generated_from_portable_view=Generated from Portable View\:\n* Id\: %1$s\n* Name\: %2$s\n* Version\: %3$d\n* Build Number\: %4$s\n
9
new_portable_view_from_a_view=New Portable View from a view
10
open_related_portable_view=Open related Portable View
11
open_source_view=Open source view
12
problems_creating_portable_view_from_a_view=Problems creating Portable View from a view
13
problems_exporting_portable_view_to_view=Problem exporting Portable View to a View
14
problems_generating_portable_view_package=Problems generating Portable View package
15
problems_regeneration_portable_view=Problems regenerating Portable View
16
problems_reloading_portable_view=Problems reloading Portable View
17
regenerate_portable_view_from_a_view=Regenerate Portable View from view
18
Select_folder_to_extract_data=Select folder to export
19
Select_folder_to_store_package=Select target folder
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.educa.portableview.app.viewer" />
4
	<resourceBundle name="text"/>
5
	<libraries library-dir="lib"/>
6
	<extensions>
7
		<extension class-name="org.gvsig.educa.portableview.app.editor.PortableViewEditorExtension"
8
			description=""
9
			active="true"
10
			priority="1">
11
			<!--
12
			<menu text="tools/Get PortableView"
13
				position="11"
14
				action-command="PortableView"/>
15
				 -->
16
		</extension>
17
		<extension class-name="org.gvsig.educa.portableview.app.editor.NewPortableViewExtension"
18
			description=""
19
			active="true"
20
			priority="1">
21

  
22
			<action
23
		        name="portableview-create-from-view"
24
		        label="create_from_view"
25
		        position="0800100000"
26
		        action-command="portableview-create-from-view"
27
		        icon=""
28
		        tooltip=""
29
		        accelerator="" />
30

  
31
			<menu
32
				name="portableview-create-from-view"
33
			    text="Portable_View/create_from_view"/>
34
		</extension>
35
		<extension class-name="org.gvsig.educa.portableview.app.editor.ExportPortableViewToViewExtension"
36
			description=""
37
			active="true"
38
			priority="1">
39

  
40
			<action
41
		        name="portableview-export-to-view"
42
		        label="export_to_view"
43
		        position="0800200000"
44
		        action-command="portableview-export-to-view"
45
		        icon=""
46
		        tooltip=""
47
		        accelerator="" />
48

  
49
			<menu
50
				name="portableview-export-to-view"
51
			    text="Portable_View/export_to_view"/>
52
		</extension>
53
		<extension class-name="org.gvsig.educa.portableview.app.editor.OpenSourceViewExtension"
54
			description=""
55
			active="true"
56
			priority="1">
57
			<action
58
		        name="portableview-open-source-view"
59
		        label="open_source_view"
60
		        position="0800300000"
61
		        action-command="portableview-open-source-view"
62
		        icon=""
63
		        tooltip=""
64
		        accelerator="" />
65

  
66
			<menu
67
				name="portableview-open-source-view"
68
			    text="Portable_View/open_source_view"/>
69
		</extension>
70
		<extension class-name="org.gvsig.educa.portableview.app.editor.OpenRelatedPortableViewExtension"
71
			description=""
72
			active="true"
73
			priority="1">
74
			<action
75
		        name="portableview-open-related"
76
		        label="open_related_portable_view"
77
		        position="0800400000"
78
		        action-command="portableview-open-related"
79
		        icon=""
80
		        tooltip=""
81
		        accelerator="" />
82

  
83
			<menu
84
				name="portableview-open-related"
85
			    text="Portable_View/open_related_portable_view"/>
86
		</extension>
87
		<extension class-name="org.gvsig.educa.portableview.app.editor.GeneratePackagePortableViewExtension"
88
			description=""
89
			active="true"
90
			priority="1">
91
			<action
92
		        name="portableview-generate-package"
93
		        label="generate_package"
94
		        position="0800500000"
95
		        action-command="portableview-generate-package"
96
		        icon=""
97
		        tooltip=""
98
		        accelerator="" />
99

  
100
			<menu
101
				name="portableview-generate-package"
102
			    text="Portable_View/generate_package"/>
103
		</extension>
104
		<extension class-name="org.gvsig.educa.portableview.app.editor.RegeneratePortableViewExtension"
105
			description=""
106
			active="true"
107
			priority="1">
108
			<action
109
		        name="portableview-regenerate-from-view"
110
		        label="regenerate_portable_view_from_a_view"
111
		        position="0800600000"
112
		        action-command="portableview-regenerate-from-view"
113
		        icon=""
114
		        tooltip=""
115
		        accelerator="" />
116

  
117
			<menu
118
				name="portableview-regenerate-from-view"
119
			    text="Portable_View/regenerate_portable_view_from_a_view"/>
120
		</extension>
121
	</extensions>
122
</plugin-config>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources-plugin/text_pt_BR.properties
1
#text_pt_br.properties
2
create_from_view=Criar a partir da vista
3
create_portable_view=Criar mapa tem\u00E1tico
4
export_to_view=Exportar para a vista
5
folder_must_be_empty=O diret\u00F3rio deve estar vazio
6
generate_package=Gerar pacote
7
generated_file=Arquivo gerado
8
generated_from_portable_view=Gerado a partir de mapa tem\u00E1tico
9
new_portable_view_from_a_view=Novo mapa tem\u00E1tico a partir de uma vista
10
open_related_portable_view=Abrir mapa tem\u00E1tico relacionado
11
open_source_view=Abrir a vista de origem
12
problems_creating_portable_view_from_a_view=Problemas ao criar mapa tem\u00E1tico a partir de uma vista
13
problems_exporting_portable_view_to_view=Problemas ao exportar mapa tem\u00E1tico para uma vista
14
problems_generating_portable_view_package=Problemas ao gerar pacote de mapa tem\u00E1tico
15
problems_regeneration_portable_view=Problemas ao recuperar mapa tem\u00E1tico
16
problems_reloading_portable_view=Problemas ao recarregar  mapa tem\u00E1tico
17
regenerate_portable_view_from_a_view=Recuperar mapa tem\u00E1tico a partir de uma vista
18
Select_folder_to_extract_data=Selecionar diret\u00F3rio para exportar dados
19
Select_folder_to_store_package=Selecionar diret\u00F3rio para armazenar pacote
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources-plugin/text_ru.properties
1
#text_ru.properties
2
create_from_view=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0438\u0437 \u0412\u0438\u0434\u0430
3
create_portable_view=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u043A\u0430\u0440\u0442\u0443
4
export_to_view=\u042D\u043A\u0441\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u0412\u0438\u0434
5
folder_must_be_empty=\u041F\u0430\u043F\u043A\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u0431\u044B\u0442\u044C \u043F\u0443\u0441\u0442\u043E\u0439
6
generate_package=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0430\u043A\u0435\u0442
7
generated_file=\u0421\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0439 \u0444\u0430\u0439\u043B
8
generated_from_portable_view=* \u0412\u0435\u0440\u0441\u0438\u044F\: %3$d\n* \u041D\u043E\u043C\u0435\u0440 \u0441\u0431\u043E\u0440\u043A\u0438\: %4$s
9
new_portable_view_from_a_view=\u041D\u043E\u0432\u0430\u044F \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u043A\u0430\u0440\u0442\u0430 \u0438\u0437 \u0412\u0438\u0434\u0430
10
open_related_portable_view=\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0432\u044F\u0437\u0430\u043D\u043D\u0443\u044E \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u043A\u0430\u0440\u0442\u0443
11
open_source_view=\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0412\u0438\u0434
12
problems_creating_portable_view_from_a_view=\u041E\u0448\u0438\u0431\u043A\u0438 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B \u0438\u0437 \u0412\u0438\u0434\u0430
13
problems_exporting_portable_view_to_view=\u041E\u0448\u0438\u0431\u043A\u0438 \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B \u0432 \u0412\u0438\u0434
14
problems_generating_portable_view_package=\u041E\u0448\u0438\u0431\u043A\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u043F\u0430\u043A\u0435\u0442\u0430 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B
15
problems_regeneration_portable_view=\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0433\u043E \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B
16
problems_reloading_portable_view=\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B
17
regenerate_portable_view_from_a_view=\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u0422\u0435\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B \u0438\u0437 \u0412\u0438\u0434\u0430
18
Select_folder_to_extract_data=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0430\u043F\u043A\u0443 \u0434\u043B\u044F \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430
19
Select_folder_to_store_package=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0430\u043F\u043A\u0443
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.educa.portableview.app.editor.PortableViewEditorLibrary
2
org.gvsig.educa.portableview.app.editor.impl.PortableViewEditorDefaultImplLibrary
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
	<id>gvsig-plugin-package</id>
3
	<formats>
4
		<format>zip</format>
5
	</formats>
6
	<baseDirectory>${project.artifactId}</baseDirectory>
7
	<includeBaseDirectory>true</includeBaseDirectory>
8
	<files>
9
		<file>
10
			<source>target/${project.artifactId}-${project.version}.jar</source>
11
			<outputDirectory>lib</outputDirectory>
12
		</file>
13
		<file>
14
			<source>target/package.info</source>
15
		</file>
16
	</files>
17

  
18
	<fileSets>
19
		<fileSet>
20
			<directory>src/main/resources-plugin</directory>
21
			<outputDirectory>.</outputDirectory>
22
		</fileSet>
23
	</fileSets>
24

  
25
	<dependencySets>
26
		<dependencySet>
27
			<useProjectArtifact>false</useProjectArtifact>
28
			<useTransitiveDependencies>false</useTransitiveDependencies>
29
			<outputDirectory>lib</outputDirectory>
30
			<includes>
31
				<include>org.gvsig:org.gvsig.educa.portableview.app.editor</include>
32
			</includes>
33
		</dependencySet>
34
	</dependencySets>
35

  
36
</assembly>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/OpenRelatedPortableViewExtension.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.app.editor;
23

  
24
import org.gvsig.andami.PluginServices;
25
import org.gvsig.andami.ui.mdiManager.IWindow;
26
import org.gvsig.app.project.documents.view.gui.IView;
27

  
28
/**
29
 * Andami extension which opens related portable view of a view
30
 * 
31
 * @author gvSIG Team
32
 * @version $Id$
33
 * 
34
 */
35
public class OpenRelatedPortableViewExtension extends
36
    OpenRelatedDocumentExtension {
37

  
38
    @Override
39
    public boolean isVisible() {
40
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
41
        return window instanceof IView && super.isVisible();
42
    }
43
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/CompilationListener.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.app.editor;
23

  
24
import org.gvsig.educa.portableview.compilation.PortableViewCompilation;
25
import org.gvsig.educa.portableview.compilation.PortableViewCompilerStatus;
26

  
27
/**
28
 * Portable View Document compilation listener
29
 * 
30
 * @author gvSIG Team
31
 * @version $Id$
32
 * 
33
 */
34
public interface CompilationListener {
35

  
36
    /**
37
     * Call when process is success
38
     * 
39
     * @param status
40
     */
41
    void finished(PortableViewCompilerStatus status);
42

  
43
    /**
44
     * Call when process is canceled in the compilation step
45
     * 
46
     * @param status
47
     */
48
    void canceledCompilation(PortableViewCompilerStatus status);
49

  
50
    /**
51
     * Call when user cancel the editor
52
     * 
53
     * @param compilation
54
     */
55
    void canceledEditing(PortableViewCompilation compilation);
56

  
57
    /**
58
     * Call when compilation process is not sucess
59
     * 
60
     * @param status
61
     */
62
    void fail(PortableViewCompilerStatus status);
63

  
64
    /**
65
     * Call when an exception is throw
66
     * 
67
     * @param message
68
     * @param exception
69
     */
70
    void exception(String message, Throwable exception);
71
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/PortableViewEditorManager.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.app.editor;
23

  
24
import java.io.File;
25
import java.io.IOException;
26

  
27
import org.gvsig.app.project.documents.view.ViewDocument;
28
import org.gvsig.educa.portableview.PortableViewException;
29
import org.gvsig.educa.portableview.PortableViewManager;
30
import org.gvsig.educa.portableview.app.viewer.PortableViewDocument;
31
import org.gvsig.educa.portableview.app.viewer.PortableViewDocumentManager;
32
import org.gvsig.educa.portableview.compilation.PortableViewCompilation;
33
import org.gvsig.educa.portableview.map.CantLoadContextException;
34
import org.gvsig.educa.portableview.map.InvalidPortableViewFormatException;
35
import org.gvsig.educa.portableview.map.PortableView;
36
import org.gvsig.educa.portableview.swing.PortableViewSwingManager;
37
import org.gvsig.tools.persistence.exception.PersistenceException;
38

  
39
/**
40
 * <p>
41
 * Manager which make easy the creation, editing and share PortableView
42
 * </p>
43
 * <p>
44
 * This uses all services of {@link PortableViewManager} and
45
 * {@link PortableViewSwingManager} in a high level way.
46
 * </p>
47
 *
48
 * <p>
49
 * This manager provides the most important services which provides this add-on
50
 * </p>
51
 *
52
 * @author gvSIG Team
53
 * @version $Id$
54
 *
55
 */
56
public interface PortableViewEditorManager {
57

  
58
    /**
59
     * Returns {@link PortableViewDocumentManager} instance
60
     *
61
     * @return
62
     */
63
    PortableViewDocumentManager getDocManager();
64

  
65
    /**
66
     * Compile a {@link PortableViewCompilation} and deploy it in current install
67
     * folder ( {@link PortableViewManager#getInstallationMapFolder()} )
68
     *
69
     * @param compilation
70
     *            to compile
71
     *
72
     * @param listener
73
     *            of the process
74
     */
75
    void compileInInstallFolder(PortableViewCompilation compilation,
76
        CompilationListener listener);
77

  
78
    /**
79
     * <p>
80
     * Create a new {@link PortableView} from a view contents and open it as a
81
     * {@link PortableViewDocument}
82
     * </p>
83
     * <p>
84
     * {@link PortableViewDocument} will be linked to source view so it can be
85
     * regenerated.
86
     * </p>
87
     *
88
     * @param view
89
     * @param listener
90
     * @param openWindow
91
     */
92
    void createPortableViewFromView(ViewDocument view,
93
        CompilationListener listener, boolean openWindow);
94

  
95
    /**
96
     * Gets the {@link PortableViewDocument} linked to a {@link ViewDocument}
97
     *
98
     * @param view
99
     * @return the document or null if not found
100
     */
101
    PortableViewDocument getPortableViewDocumentByView(ViewDocument view);
102

  
103
    /**
104
     * Generate a gvSIG add-ons installer package from a
105
     * {@link PortableViewDocument}
106
     *
107
     * @param portableView
108
     *            to packing
109
     * @param targetFolder
110
     *            to store result file
111
     * @return
112
     * @throws IOException
113
     * @throws PortableViewException
114
     */
115
    File generatePackage(PortableViewDocument portableView, File targetFolder)
116
        throws PortableViewException, IOException;
117

  
118
    /**
119
     * <p>
120
     * Generate a gvSIG add-ons installer package from a
121
     * {@link PortableViewDocument}
122
     * </p>
123
     * <p>
124
     * User will be prompted for folder to store result file
125
     * </p>
126
     *
127
     * @param portableView
128
     * @return
129
     * @throws IOException
130
     * @throws PortableViewException
131
     */
132
    File generatePackage(PortableViewDocument portableView)
133
        throws PortableViewException, IOException;
134

  
135
    /**
136
     * Export the contents of a Portable View into a folder and create a
137
     * {@link ViewDocument} in project with it's layers
138
     * <p>
139
     * User will be prompted for extract folder
140
     * </p>
141
     * <p>
142
     * If Portable view document has no related view link the new one to it
143
     * </p>
144
     *
145
     * @param map
146
     * @param openViewWindow
147
     * @return
148
     * @throws IOException
149
     * @throws InvalidPortableViewFormatException
150
     * @throws PersistenceException
151
     */
152
    ViewDocument exportPortableViewToView(PortableViewDocument map,
153
        boolean openViewWindow) throws IOException,
154
        InvalidPortableViewFormatException, PersistenceException;
155

  
156
    /**
157
     * Export the contents of a Portable View into a folder and create a
158
     * {@link ViewDocument} in project with it's layers
159
     * <p>
160
     * If Portable view document has no related view link the new one to it
161
     * </p>
162
     *
163
     * @param map
164
     * @param exportFolder
165
     *            <b>Warning:</b> this folder must be empty
166
     * @return
167
     * @throws IOException
168
     * @throws InvalidPortableViewFormatException
169
     * @throws PersistenceException
170
     */
171
    ViewDocument exportPortableViewToView(PortableViewDocument map,
172
        File exportFolder, boolean openViewWindow) throws IOException,
173
        InvalidPortableViewFormatException, PersistenceException;
174

  
175
    /**
176
     * <p>
177
     * Regenerates the Portable View from current state of source View
178
     * </p>
179
     * <p>
180
     * Portable View document must be linked to a view, otherwise this method do
181
     * nothing.
182
     * </p>
183
     *
184
     * @param map
185
     * @param listener
186
     * @param openWindow
187
     * @throws IOException
188
     * @throws CantLoadContextException
189
     * @throws InvalidPortableViewFormatException
190
     */
191
    void regeneratePortableView(PortableViewDocument map,
192
        CompilationListener listener, boolean openWindow)
193
        throws InvalidPortableViewFormatException, CantLoadContextException,
194
        IOException;
195

  
196
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/GeneratePackagePortableViewExtension.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.app.editor;
23

  
24
import java.io.File;
25

  
26
import javax.swing.SwingUtilities;
27

  
28
import org.gvsig.andami.PluginServices;
29
import org.gvsig.andami.messages.NotificationManager;
30
import org.gvsig.andami.plugins.Extension;
31
import org.gvsig.andami.ui.mdiManager.IWindow;
32
import org.gvsig.educa.portableview.app.viewer.PortableViewDocument;
33
import org.gvsig.educa.portableview.app.viewer.ui.PortableViewDocumentViewer;
34
import org.gvsig.educa.portableview.swing.PortableViewSwingLocator;
35
import org.gvsig.educa.portableview.swing.PortableViewSwingManager;
36
import org.gvsig.educa.portableview.swing.PortableViewWindowManager.MESSAGE_DIALOG_TYPE;
37

  
38
/**
39
 * Andami extension to create a gvSIG package of a Portable View.
40
 *
41
 * @author gvSIG Team
42
 * @version $Id$
43
 */
44
public class GeneratePackagePortableViewExtension extends Extension {
45

  
46
    private PortableViewEditorManager editorManager;
47
    private PortableViewSwingManager swingManager;
48

  
49
    public void initialize() {
50
        // Do nothing
51
    }
52

  
53
    @Override
54
    public void postInitialize() {
55
        editorManager = PortableViewEditorLocator.getManager();
56
        swingManager = PortableViewSwingLocator.getSwingManager();
57
    }
58

  
59
    public void execute(String actionCommand) {
60
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
61
        if (!(window instanceof PortableViewDocumentViewer)) {
62
            return;
63
        }
64
        final PortableViewDocument tmDocument =
65
            ((PortableViewDocumentViewer) window).getPortableViewDocument();
66

  
67
        SwingUtilities.invokeLater(new Runnable() {
68

  
69
            public void run() {
70
                try {
71
                    File file = editorManager.generatePackage(tmDocument);
72
                    if (file != null) {
73
                        swingManager.getWindowManager().showMessageDialog(
74
                            swingManager.getTranslation("generate_package"),
75
                            swingManager.getTranslation("generated_file")
76
                                .concat(":").concat(file.getAbsolutePath()),
77
                            MESSAGE_DIALOG_TYPE.INFO);
78
                    }
79
                } catch (Exception ex) {
80
                    NotificationManager.addError(
81
                        swingManager
82
                            .getTranslation("problems_exporting_portable_view_to_view"),
83
                        ex);
84
                }
85

  
86
            }
87
        });
88
    }
89

  
90
    public boolean isEnabled() {
91
        return true;
92
    }
93

  
94
    public boolean isVisible() {
95
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
96
        return window instanceof PortableViewDocumentViewer;
97
    }
98
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/PortableViewEditorExtension.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.app.editor;
23

  
24
import java.util.ArrayList;
25
import java.util.List;
26

  
27
import org.gvsig.about.AboutManager;
28
import org.gvsig.about.AboutParticipant;
29
import org.gvsig.andami.plugins.Extension;
30
import org.gvsig.app.ApplicationLocator;
31
import org.gvsig.app.ApplicationManager;
32
import org.gvsig.app.project.ProjectManager;
33
import org.gvsig.app.project.documents.view.ViewManager;
34
import org.gvsig.educa.portableview.app.editor.document.GeneratePackageOfPortableViewAction;
35
import org.gvsig.educa.portableview.app.editor.document.OpenRelatedPortableViewAction;
36
import org.gvsig.educa.portableview.app.editor.document.OpenSourceViewAction;
37
import org.gvsig.educa.portableview.app.editor.document.RegeneratePortableViewFromViewAction;
38
import org.gvsig.educa.portableview.app.editor.document.PortableViewToViewAction;
39
import org.gvsig.educa.portableview.app.editor.document.ViewToPortableViewAction;
40
import org.gvsig.educa.portableview.app.viewer.PortableViewDocumentManager;
41
import org.gvsig.educa.portableview.app.viewer.PortableViewExtension;
42

  
43
/**
44
 * Andami extension which initializes the document actions related to
45
 * PortableView creation, editing and share.
46
 *
47
 * @author gvSIG Team
48
 * @version $Id$
49
 */
50
public class PortableViewEditorExtension extends Extension {
51

  
52
    public void initialize() {
53
        // Do nothing
54
    }
55

  
56
    @Override
57
    public void postInitialize() {
58

  
59
        super.postInitialize();
60

  
61
        // Register Document action
62
        ProjectManager projectManager = ProjectManager.getInstance();
63

  
64
        // Actions for PortableViewDocuments:
65

  
66
        // Create from view
67
        projectManager.registerDocumentAction(
68
            PortableViewDocumentManager.TYPENAME, new PortableViewToViewAction());
69
        // Open Related document
70
        projectManager.registerDocumentAction(
71
            PortableViewDocumentManager.TYPENAME, new OpenSourceViewAction());
72
        // Regenerate from the view
73
        projectManager.registerDocumentAction(
74
            PortableViewDocumentManager.TYPENAME,
75
            new RegeneratePortableViewFromViewAction());
76
        // Export to a view
77
        projectManager.registerDocumentAction(
78
            PortableViewDocumentManager.TYPENAME,
79
            new GeneratePackageOfPortableViewAction());
80

  
81
        // Actions for ViewDocuments:
82

  
83
        // Create a Portable View
84
        projectManager.registerDocumentAction(ViewManager.TYPENAME,
85
            new ViewToPortableViewAction());
86
        // Open Related document
87
        projectManager.registerDocumentAction(ViewManager.TYPENAME,
88
            new OpenRelatedPortableViewAction());
89
        // Update the Portable View contents
90
        projectManager.registerDocumentAction(ViewManager.TYPENAME,
91
            new RegeneratePortableViewFromViewAction());
92

  
93
        registerAbout();
94

  
95
    }
96

  
97
    /**
98
    *
99
    */
100
    private void registerAbout() {
101
        // Register the about panel
102
        ApplicationManager application = ApplicationLocator.getManager();
103

  
104
        AboutManager about = application.getAbout();
105

  
106
        List<AboutParticipant> participants = new ArrayList<AboutParticipant>();
107

  
108
        participants.add(about.addDeveloper("DISID", PortableViewExtension.class
109
            .getClassLoader().getResource("about/disid.html"), 1));
110

  
111
        participants.add(about.addDeveloper(
112
            "UdelaR.uy",
113
            PortableViewExtension.class.getClassLoader().getResource(
114
                "about/universidad.edu.uy.html"), 1));
115

  
116
        participants.add(about.addSponsor(
117
            "MTOP.gub.uy",
118
            PortableViewExtension.class.getClassLoader().getResource(
119
                "about/MTOP.html"), 1));
120

  
121
        for (AboutParticipant participant : participants) {
122
            participant
123
                .addContribution(
124
                    "PortableViewEditorExtension",
125
                    "Provides tools to create and generate packages of Portable View",
126
                    2011, 11, 1, 2012, 2, 29);
127
        }
128

  
129
    }
130

  
131
    /** {@inheridDoc} */
132
    public boolean isEnabled() {
133
        return true;
134
    }
135

  
136
    /** {@inheridDoc} */
137
    public boolean isVisible() {
138
        return true;
139
    }
140

  
141
    /** {@inheridDoc} */
142
    public void execute(String actionCommand) {
143

  
144
    }
145
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/NewPortableViewExtension.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.app.editor;
23

  
24
import javax.swing.SwingUtilities;
25

  
26
import org.gvsig.andami.PluginServices;
27
import org.gvsig.andami.messages.NotificationManager;
28
import org.gvsig.andami.plugins.Extension;
29
import org.gvsig.andami.ui.mdiManager.IWindow;
30
import org.gvsig.app.project.documents.view.ViewDocument;
31
import org.gvsig.app.project.documents.view.gui.IView;
32
import org.gvsig.educa.portableview.swing.PortableViewSwingLocator;
33
import org.gvsig.educa.portableview.swing.PortableViewSwingManager;
34

  
35
/**
36
 * Andami extension to create a Portable view from a View.
37
 *
38
 * @author gvSIG Team
39
 * @version $Id$
40
 */
41
public class NewPortableViewExtension extends Extension {
42

  
43
    private PortableViewEditorManager editorManager;
44
    private PortableViewSwingManager swingManager;
45

  
46
    public void initialize() {
47
        // Do nothing
48
    }
49

  
50
    @Override
51
    public void postInitialize() {
52
        editorManager = PortableViewEditorLocator.getManager();
53
        swingManager = PortableViewSwingLocator.getSwingManager();
54
    }
55

  
56
    public void execute(String actionCommand) {
57
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
58
        if (!(window instanceof IView)) {
59
            return;
60
        }
61
        IView view = (IView) window;
62

  
63
        final ViewDocument viewDocument = (ViewDocument) view.getDocument();
64

  
65
        SwingUtilities.invokeLater(new Runnable() {
66

  
67
            public void run() {
68
                try {
69
                    editorManager.createPortableViewFromView(viewDocument, null,
70
                        true);
71
                } catch (Exception ex) {
72
                    NotificationManager.addError(
73
                        swingManager
74
                            .getTranslation("problems_creating_portable_view_from_a_view"),
75
                        ex);
76
                }
77

  
78
            }
79
        });
80
    }
81

  
82
    public boolean isEnabled() {
83
        return true;
84
    }
85

  
86
    public boolean isVisible() {
87
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
88
        return window instanceof IView;
89
    }
90
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/OpenSourceViewExtension.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.app.editor;
23

  
24
import org.gvsig.andami.PluginServices;
25
import org.gvsig.andami.ui.mdiManager.IWindow;
26
import org.gvsig.educa.portableview.app.viewer.ui.PortableViewDocumentViewer;
27

  
28
/**
29
 * Andami extension which opens source view of a portable view
30
 *
31
 * @author gvSIG Team
32
 * @version $Id$
33
 *
34
 */
35
public class OpenSourceViewExtension extends OpenRelatedDocumentExtension {
36

  
37
    @Override
38
    public boolean isVisible() {
39
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
40
        return window instanceof PortableViewDocumentViewer && super.isVisible();
41
    }
42
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/OpenRelatedDocumentExtension.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.app.editor;
23

  
24
import javax.swing.SwingUtilities;
25

  
26
import org.gvsig.andami.PluginServices;
27
import org.gvsig.andami.plugins.Extension;
28
import org.gvsig.andami.ui.mdiManager.IWindow;
29
import org.gvsig.app.project.documents.Document;
30
import org.gvsig.app.project.documents.view.gui.IView;
31
import org.gvsig.educa.portableview.app.viewer.ui.PortableViewDocumentViewer;
32

  
33
/**
34
 * Abstract Andami extension which opens a the related document: source view of
35
 * a portable view or related portable view of a view
36
 *
37
 * @author gvSIG Team
38
 * @version $Id$
39
 */
40
public abstract class OpenRelatedDocumentExtension extends Extension {
41

  
42
    private PortableViewEditorManager editorManager;
43

  
44
    public void initialize() {
45
        // Do nothing
46
    }
47

  
48
    @Override
49
    public void postInitialize() {
50
        editorManager = PortableViewEditorLocator.getManager();
51
    }
52

  
53
    public void execute(String actionCommand) {
54
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
55
        final Document docToShow = getRelatedDocument(window);
56
        if (docToShow == null) {
57
            return;
58
        }
59

  
60
        SwingUtilities.invokeLater(new Runnable() {
61

  
62
            public void run() {
63
                PluginServices.getMDIManager().addWindow(
64
                    docToShow.getFactory().getMainWindow(docToShow));
65
            }
66
        });
67

  
68
    }
69

  
70
    public boolean isEnabled() {
71
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
72
        return getRelatedDocument(window) != null;
73
    }
74

  
75
    /**
76
     * <p>
77
     * Returns related document to window
78
     * </p>
79
     * <p>
80
     * if window is a view return the Portable View. if it's a Portable view
81
     * returns a view.
82
     * </p>
83
     *
84
     * @param window
85
     * @return
86
     */
87
    private Document getRelatedDocument(IWindow window) {
88
        if (editorManager == null) {
89
            // initialization process not finished yet
90
            return null;
91
        }
92
        if (window instanceof IView) {
93
            return editorManager.getPortableViewDocumentByView(((IView) window)
94
                .getViewDocument());
95
        } else
96
            if (window instanceof PortableViewDocumentViewer) {
97
                return ((PortableViewDocumentViewer) window)
98
                    .getPortableViewDocument().getSourceView();
99

  
100
            }
101
        return null;
102

  
103
    }
104

  
105
    public boolean isVisible() {
106
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
107
        return window instanceof IView
108
            || window instanceof PortableViewDocumentViewer;
109
    }
110
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/PortableViewEditorLocator.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.app.editor;
23

  
24
import org.gvsig.educa.portableview.map.PortableView;
25
import org.gvsig.tools.locator.BaseLocator;
26
import org.gvsig.tools.locator.Locator;
27
import org.gvsig.tools.locator.LocatorException;
28

  
29
/**
30
 * Locator which provide access to the services to create, modify and share
31
 * {@link PortableView}
32
 *
33
 * @author gvSIG team
34
 * @version $Id$
35
 */
36
public class PortableViewEditorLocator extends BaseLocator {
37

  
38
    /**
39
     * PortableView manager name.
40
     */
41
    public static final String MANAGER_NAME = "PortableViewEditor.manager";
42

  
43
    /**
44
     * PortableView manager description.
45
     */
46
    public static final String MANAGER_DESCRIPTION =
47
        "PortableView Editor Manager";
48

  
49
    private static final String LOCATOR_NAME = "PortableViewEditor.locator";
50

  
51
    /**
52
     * Unique instance.
53
     */
54
    private static final PortableViewEditorLocator INSTANCE =
55
        new PortableViewEditorLocator();
56

  
57
    /**
58
     * Return the singleton instance.
59
     *
60
     * @return the singleton instance
61
     */
62
    public static PortableViewEditorLocator getInstance() {
63
        return INSTANCE;
64
    }
65

  
66
    /**
67
     * Return the Locator's name.
68
     *
69
     * @return a String with the Locator's name
70
     */
71
    @Override
72
    public final String getLocatorName() {
73
        return LOCATOR_NAME;
74
    }
75

  
76
    /**
77
     * Return a reference to the PortableViewEditorManager.
78
     *
79
     * @return a reference to the PortableViewEditorManager
80
     * @throws LocatorException
81
     *             if there is no access to the class or the class cannot be
82
     *             instantiated
83
     * @see Locator#get(String)
84
     */
85
    public static PortableViewEditorManager getManager() throws LocatorException {
86
        return (PortableViewEditorManager) getInstance().get(MANAGER_NAME);
87
    }
88

  
89
    /**
90
     * Registers the Class implementing the PortableViewEditorManager interface.
91
     *
92
     * @param clazz
93
     *            implementing the PortableViewManager interface
94
     */
95
    public static void registerManager(
96
        Class<? extends PortableViewEditorManager> clazz) {
97
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
98
    }
99

  
100
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/document/OpenSourceViewAction.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.app.editor.document;
23

  
24
import java.util.List;
25

  
26
import javax.swing.SwingUtilities;
27

  
28
import org.gvsig.andami.PluginServices;
29
import org.gvsig.andami.ui.mdiManager.IWindow;
30
import org.gvsig.app.project.ProjectManager;
31
import org.gvsig.app.project.documents.AbstractDocumentAction;
32
import org.gvsig.app.project.documents.Document;
33
import org.gvsig.app.project.documents.view.ViewDocument;
34
import org.gvsig.educa.portableview.app.viewer.PortableViewDocument;
35

  
36
/**
37
 * <p>
38
 * Document action which opens the source View of a Portable View
39
 * </p>
40
 *
41
 * <p>
42
 * This action can be set on PortableViewDocuments or ViewDocuments
43
 * </p>
44
 *
45
 * @author gvSIG Team
46
 * @version $Id$
47
 *
48
 */
49
public class OpenSourceViewAction extends AbstractDocumentAction {
50

  
51
    /**
52
     *
53
     */
54
    public OpenSourceViewAction() {
55
        super("OpenSourceViewExtension");
56
        this.order = 0;
57
        this.title = PluginServices.getText(this, "open_source_view");
58
        this.group =
59
            ProjectManager.getInstance().addDocumentActionGroup(
60
                "PortableViewActions", "Portable View actions", null, 0);
61
    }
62

  
63
    /** {@inheridDoc} */
64
    public boolean isVisible(Document document, List<Document> documents) {
65
        if (document != null || documents.size() != 1) {
66
            return false;
67
        }
68
        return true;
69
    }
70

  
71
    /** {@inheridDoc} */
72
    public boolean isAvailable(Document document, List<Document> documents) {
73
        Document doc = null;
74
        if (document != null) {
75
            doc = document;
76
        } else {
77
            if (documents != null && !documents.isEmpty()) {
78
                doc = documents.get(0);
79
            }
80
        }
81
        if (doc == null) {
82
            return false;
83
        }
84
        if (doc instanceof PortableViewDocument) {
85
            return ((PortableViewDocument) doc).getSourceView() != null;
86

  
87
        }
88

  
89
        return false;
90
    }
91

  
92
    /** {@inheridDoc} */
93
    public void execute(Document document, List<Document> documents) {
94
        Document doc;
95
        final IWindow window;
96
        if (document != null) {
97
            doc = document;
98
        } else {
99
            if (documents.size() != 1) {
100
                return;
101
            }
102
            doc = documents.get(0);
103
        }
104

  
105
        PortableViewDocument tmDocument;
106
        if (doc instanceof PortableViewDocument) {
107
            tmDocument = ((PortableViewDocument) doc);
108
            ViewDocument view = tmDocument.getSourceView();
109
            if (view == null) {
110
                return;
111
            }
112
            window = view.getFactory().getMainWindow(view);
113

  
114
        } else {
115
            return;
116
        }
117

  
118
        SwingUtilities.invokeLater(new Runnable() {
119

  
120
            public void run() {
121
                PluginServices.getMDIManager().addWindow(window);
122

  
123
            }
124
        });
125
    }
126

  
127
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.140/org.gvsig.educa.portableview.app/org.gvsig.educa.portableview.app.editor/src/main/java/org/gvsig/educa/portableview/app/editor/document/GeneratePackageOfPortableViewAction.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
 */
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff