root / org.gvsig.educa.thematicmap.app / trunk / org.gvsig.educa.thematicmap.app / org.gvsig.educa.thematicmap.app.editor / src / main / java / org / gvsig / educa / thematicmap / app / editor / ThematicMapEditorExtension.java @ 146
History | View | Annotate | Download (4.46 KB)
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.thematicmap.app.editor; |
23 |
|
24 |
import org.gvsig.about.AboutManager; |
25 |
import org.gvsig.about.AboutParticipant; |
26 |
import org.gvsig.andami.plugins.Extension; |
27 |
import org.gvsig.app.ApplicationLocator; |
28 |
import org.gvsig.app.ApplicationManager; |
29 |
import org.gvsig.app.project.ProjectManager; |
30 |
import org.gvsig.app.project.documents.view.ViewManager; |
31 |
import org.gvsig.educa.thematicmap.app.editor.document.GeneratePackageOfThematicMapAction; |
32 |
import org.gvsig.educa.thematicmap.app.editor.document.OpenRelatedThematicMapAction; |
33 |
import org.gvsig.educa.thematicmap.app.editor.document.OpenSourceViewAction; |
34 |
import org.gvsig.educa.thematicmap.app.editor.document.RegenerateThematicMapFromViewAction; |
35 |
import org.gvsig.educa.thematicmap.app.editor.document.ThematicMapToViewAction; |
36 |
import org.gvsig.educa.thematicmap.app.editor.document.ViewToThematicMapAction; |
37 |
import org.gvsig.educa.thematicmap.app.viewer.ThematicMapDocumentManager; |
38 |
import org.gvsig.educa.thematicmap.app.viewer.ThematicMapExtension; |
39 |
|
40 |
/**
|
41 |
* Andami extension which initializes the document actions related to
|
42 |
* ThematicMap creation, editing and share.
|
43 |
*
|
44 |
* @author gvSIG Team
|
45 |
* @version $Id$
|
46 |
*/
|
47 |
public class ThematicMapEditorExtension extends Extension { |
48 |
|
49 |
public void initialize() { |
50 |
// Do nothing
|
51 |
} |
52 |
|
53 |
@Override
|
54 |
public void postInitialize() { |
55 |
|
56 |
super.postInitialize();
|
57 |
|
58 |
// Register Document action
|
59 |
ProjectManager projectManager = ProjectManager.getInstance(); |
60 |
|
61 |
// Actions for ThematicMapDocuments:
|
62 |
|
63 |
// Create from view
|
64 |
projectManager.registerDocumentAction( |
65 |
ThematicMapDocumentManager.TYPENAME, new ThematicMapToViewAction());
|
66 |
// Open Related document
|
67 |
projectManager.registerDocumentAction( |
68 |
ThematicMapDocumentManager.TYPENAME, new OpenSourceViewAction());
|
69 |
// Regenerate from the view
|
70 |
projectManager.registerDocumentAction( |
71 |
ThematicMapDocumentManager.TYPENAME, |
72 |
new RegenerateThematicMapFromViewAction());
|
73 |
// Export to a view
|
74 |
projectManager.registerDocumentAction( |
75 |
ThematicMapDocumentManager.TYPENAME, |
76 |
new GeneratePackageOfThematicMapAction());
|
77 |
|
78 |
// Actions for ViewDocuments:
|
79 |
|
80 |
// Create a Thematic Map
|
81 |
projectManager.registerDocumentAction(ViewManager.TYPENAME, |
82 |
new ViewToThematicMapAction());
|
83 |
// Open Related document
|
84 |
projectManager.registerDocumentAction(ViewManager.TYPENAME, |
85 |
new OpenRelatedThematicMapAction());
|
86 |
// Update the Thematic Map contents
|
87 |
projectManager.registerDocumentAction(ViewManager.TYPENAME, |
88 |
new RegenerateThematicMapFromViewAction());
|
89 |
|
90 |
registerAbout(); |
91 |
|
92 |
} |
93 |
|
94 |
/**
|
95 |
*
|
96 |
*/
|
97 |
private void registerAbout() { |
98 |
// Register the about panel
|
99 |
ApplicationManager application = ApplicationLocator.getManager(); |
100 |
|
101 |
AboutManager about = application.getAbout(); |
102 |
|
103 |
about.addDeveloper("DISID", ThematicMapExtension.class.getClassLoader()
|
104 |
.getResource("disid.html"), 1); |
105 |
|
106 |
AboutParticipant participant = about.getDeveloper("DISID");
|
107 |
participant.addContribution("ThematicMapEditorExtension",
|
108 |
"Provides tools to create and generate packages of Thematic Maps",
|
109 |
2011, 11, 1, 2012, 2, 29); |
110 |
|
111 |
// TODO add more developers and participant
|
112 |
} |
113 |
|
114 |
/** {@inheridDoc} */
|
115 |
public boolean isEnabled() { |
116 |
return true; |
117 |
} |
118 |
|
119 |
/** {@inheridDoc} */
|
120 |
public boolean isVisible() { |
121 |
return true; |
122 |
} |
123 |
|
124 |
/** {@inheridDoc} */
|
125 |
public void execute(String actionCommand) { |
126 |
|
127 |
} |
128 |
} |