Revision 40486
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.daltransform.app/org.gvsig.daltransform.app.eventtheme/src/main/resources-plugin/config.xml | ||
---|---|---|
4 | 4 |
<depends plugin-name="org.gvsig.app"/> |
5 | 5 |
<depends plugin-name="org.gvsig.daltransform.app.mainplugin"/> |
6 | 6 |
<resourceBundle name="text"/> |
7 |
|
|
7 | 8 |
<extensions> |
8 |
<extension class-name="org.gvsig.andami.LibraryExtension" active="false"/> |
|
9 |
</extensions> |
|
9 |
<extension class-name="org.gvsig.andami.LibraryExtension" active="false"/> |
|
10 |
|
|
11 |
<extension class-name="org.gvsig.app.eventtheme.AddEventThemeExtension" |
|
12 |
description="This extension lets the user create a new event theme based on an existing table." |
|
13 |
active="true"> |
|
14 |
|
|
15 |
<action |
|
16 |
name="view-event-theme-add" |
|
17 |
label="Anadir_capa_de_eventos" |
|
18 |
tooltip="Anadir_capa_de_eventos" |
|
19 |
position="650350000" |
|
20 |
action-command="view-event-theme-add" |
|
21 |
icon="view-event-theme-add" |
|
22 |
accelerator="" |
|
23 |
/> |
|
24 |
|
|
25 |
<menu |
|
26 |
name="view-event-theme-add" |
|
27 |
text="View/Anadir_capa_de_eventos" |
|
28 |
/> |
|
29 |
|
|
30 |
<tool-bar name="view" position="30015"> |
|
31 |
<action-tool name="view-event-theme-add"/> |
|
32 |
</tool-bar> |
|
33 |
|
|
34 |
</extension> |
|
35 |
</extensions> |
|
36 |
|
|
37 |
|
|
10 | 38 |
</plugin-config> |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.daltransform.app/org.gvsig.daltransform.app.eventtheme/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
10 | 10 |
events_geom_field=Nombre del campo que contiene la geometr?a |
11 | 11 |
events_feature_type_field=Tipo de feature |
12 | 12 |
_Extent_of_event_theme=Extensi?n de capa de eventos |
13 |
_Error_while_getting_extent=Error durante c?lculo de extensi?n |
|
13 |
_Error_while_getting_extent=Error durante c?lculo de extensi?n |
|
14 |
_Error_while_opening_wizard=Error al abrir el asistente |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.daltransform.app/org.gvsig.daltransform.app.eventtheme/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
10 | 10 |
events_geom_field=Geometry field name |
11 | 11 |
events_feature_type_field=Feature type |
12 | 12 |
_Extent_of_event_theme=Extent of event theme |
13 |
_Error_while_getting_extent=Error while getting extent |
|
13 |
_Error_while_getting_extent=Error while getting extent |
|
14 |
_Error_while_opening_wizard=Error while opening wizard |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.daltransform.app/org.gvsig.daltransform.app.eventtheme/src/main/java/org/gvsig/app/eventtheme/AddEventThemeExtension.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.app.eventtheme; |
|
23 |
|
|
24 |
import javax.swing.JOptionPane; |
|
25 |
|
|
26 |
import org.gvsig.andami.IconThemeHelper; |
|
27 |
import org.gvsig.andami.PluginServices; |
|
28 |
import org.gvsig.andami.plugins.Extension; |
|
29 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
30 |
import org.gvsig.app.ApplicationLocator; |
|
31 |
import org.gvsig.app.eventtheme.daltransform.EventThemeTransformGui; |
|
32 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
33 |
import org.gvsig.daltransform.DataTransformLocator; |
|
34 |
import org.gvsig.daltransform.swing.DataTransformWizard; |
|
35 |
import org.gvsig.i18n.Messages; |
|
36 |
|
|
37 |
/** |
|
38 |
* This extension opens the transformation wizard |
|
39 |
* with the "add event theme" option selected |
|
40 |
* |
|
41 |
* @author jldominguez |
|
42 |
* |
|
43 |
*/ |
|
44 |
public class AddEventThemeExtension extends Extension { |
|
45 |
|
|
46 |
public void initialize() { |
|
47 |
|
|
48 |
IconThemeHelper.registerIcon("action", "view-event-theme-add", this); |
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
public void execute(String comm) { |
|
53 |
|
|
54 |
if (comm.compareToIgnoreCase("view-event-theme-add") == 0) { |
|
55 |
|
|
56 |
try { |
|
57 |
DataTransformWizard dataTransformWizard = |
|
58 |
DataTransformLocator.getDataTransformManager().createWizard(); |
|
59 |
dataTransformWizard.setDataTransformGui(new EventThemeTransformGui()); |
|
60 |
PluginServices.getMDIManager().addWindow(dataTransformWizard.getWindow()); |
|
61 |
} catch (Exception e) { |
|
62 |
|
|
63 |
JOptionPane.showInternalMessageDialog( |
|
64 |
ApplicationLocator.getManager().getRootComponent(), |
|
65 |
Messages.getText("_Error_while_opening_wizard") |
|
66 |
+ ": \n\n" + e.getMessage(), |
|
67 |
Messages.getText("Anadir_capa_de_eventos"), |
|
68 |
JOptionPane.ERROR_MESSAGE); |
|
69 |
} |
|
70 |
|
|
71 |
} |
|
72 |
|
|
73 |
} |
|
74 |
|
|
75 |
public boolean isEnabled() { |
|
76 |
return true; |
|
77 |
} |
|
78 |
|
|
79 |
public boolean isVisible() { |
|
80 |
|
|
81 |
IWindow iw = ApplicationLocator.getManager().getActiveWindow(); |
|
82 |
return (iw instanceof IView); |
|
83 |
} |
|
84 |
|
|
85 |
} |
Also available in: Unified diff