root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / AdvancedSymbologyExtension.java @ 13967
History | View | Annotate | Download (8.12 KB)
1 | 10679 | jaume | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | |||
42 | /* CVS MESSAGES:
|
||
43 | *
|
||
44 | * $Id$
|
||
45 | * $Log$
|
||
46 | 13855 | jaume | * Revision 1.12 2007-09-19 15:34:59 jaume
|
47 | * removed unnecessary imports
|
||
48 | *
|
||
49 | * Revision 1.11 2007/09/17 09:11:28 jaume
|
||
50 | 13726 | jaume | * order of the elements inverted
|
51 | *
|
||
52 | * Revision 1.10 2007/09/13 11:37:09 jvidal
|
||
53 | 13668 | jvidal | * *** empty log message ***
|
54 | *
|
||
55 | * Revision 1.9 2007/09/04 10:53:10 caballero
|
||
56 | 13513 | caballero | * show page
|
57 | *
|
||
58 | * Revision 1.8 2007/08/09 10:39:04 jaume
|
||
59 | 12994 | jaume | * first round of found bugs fixed
|
60 | *
|
||
61 | * Revision 1.7 2007/08/01 13:03:31 jaume
|
||
62 | 12869 | jaume | * plugable symbol editor
|
63 | *
|
||
64 | * Revision 1.6 2007/05/22 12:17:12 jaume
|
||
65 | 11704 | jaume | * *** empty log message ***
|
66 | *
|
||
67 | 11747 | jaume | * Revision 1.5 2007/05/17 09:32:37 jaume
|
68 | * *** empty log message ***
|
||
69 | *
|
||
70 | 11704 | jaume | * Revision 1.4 2007/03/21 08:03:03 jaume
|
71 | 10825 | jaume | * refactored to use ISymbol instead of FSymbol
|
72 | *
|
||
73 | * Revision 1.3 2007/03/13 16:57:35 jaume
|
||
74 | 10737 | jaume | * Added MultiVariable legend
|
75 | *
|
||
76 | * Revision 1.2 2007/03/09 11:25:00 jaume
|
||
77 | 10679 | jaume | * Advanced symbology (start committing)
|
78 | *
|
||
79 | * Revision 1.1.2.4 2007/02/21 07:35:14 jaume
|
||
80 | * *** empty log message ***
|
||
81 | *
|
||
82 | * Revision 1.1.2.3 2007/02/12 15:14:41 jaume
|
||
83 | * refactored interval legend and added graduated symbol legend
|
||
84 | *
|
||
85 | * Revision 1.1.2.2 2007/02/01 17:47:12 jaume
|
||
86 | * *** empty log message ***
|
||
87 | *
|
||
88 | * Revision 1.1.2.1 2007/02/01 12:12:41 jaume
|
||
89 | * theme manager window and all its components are now dynamic
|
||
90 | *
|
||
91 | *
|
||
92 | */
|
||
93 | package com.iver.cit.gvsig; |
||
94 | |||
95 | import com.iver.andami.PluginServices; |
||
96 | import com.iver.andami.plugins.Extension; |
||
97 | 12869 | jaume | import com.iver.cit.gvsig.fmap.core.FShape; |
98 | 11747 | jaume | import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling; |
99 | 10825 | jaume | import com.iver.cit.gvsig.fmap.rendering.styling.DefaultLabelingMethod; |
100 | 10679 | jaume | import com.iver.cit.gvsig.fmap.rendering.styling.FeatureDependentLabeled; |
101 | 11747 | jaume | import com.iver.cit.gvsig.fmap.rendering.styling.GeneralLabelingStrategy; |
102 | 10679 | jaume | import com.iver.cit.gvsig.fmap.rendering.styling.OnSelectionLabeled; |
103 | 12869 | jaume | import com.iver.cit.gvsig.gui.styling.CharacterMarker; |
104 | 13668 | jvidal | import com.iver.cit.gvsig.gui.styling.GradientFill; |
105 | 12869 | jaume | import com.iver.cit.gvsig.gui.styling.LineFill; |
106 | import com.iver.cit.gvsig.gui.styling.MarkerFill; |
||
107 | 12994 | jaume | import com.iver.cit.gvsig.gui.styling.MarkerLine; |
108 | 12869 | jaume | import com.iver.cit.gvsig.gui.styling.PictureFill; |
109 | import com.iver.cit.gvsig.gui.styling.PictureLine; |
||
110 | import com.iver.cit.gvsig.gui.styling.PictureMarker; |
||
111 | import com.iver.cit.gvsig.gui.styling.SimpleFill; |
||
112 | import com.iver.cit.gvsig.gui.styling.SimpleLine; |
||
113 | import com.iver.cit.gvsig.gui.styling.SimpleMarker; |
||
114 | import com.iver.cit.gvsig.gui.styling.SimpleText; |
||
115 | import com.iver.cit.gvsig.gui.styling.SymbolEditor; |
||
116 | 10679 | jaume | import com.iver.cit.gvsig.project.documents.view.legend.gui.Categories; |
117 | import com.iver.cit.gvsig.project.documents.view.legend.gui.DotDensity; |
||
118 | import com.iver.cit.gvsig.project.documents.view.legend.gui.Features; |
||
119 | import com.iver.cit.gvsig.project.documents.view.legend.gui.FilePage; |
||
120 | import com.iver.cit.gvsig.project.documents.view.legend.gui.General; |
||
121 | import com.iver.cit.gvsig.project.documents.view.legend.gui.GraduatedSymbols; |
||
122 | import com.iver.cit.gvsig.project.documents.view.legend.gui.LabelingManager; |
||
123 | import com.iver.cit.gvsig.project.documents.view.legend.gui.LegendManager; |
||
124 | 10737 | jaume | import com.iver.cit.gvsig.project.documents.view.legend.gui.MultipleAttributes; |
125 | 11704 | jaume | import com.iver.cit.gvsig.project.documents.view.legend.gui.ProportionalSymbols; |
126 | 10679 | jaume | import com.iver.cit.gvsig.project.documents.view.legend.gui.Quantities; |
127 | 10737 | jaume | import com.iver.cit.gvsig.project.documents.view.legend.gui.QuantityByCategory; |
128 | 10679 | jaume | import com.iver.cit.gvsig.project.documents.view.legend.gui.SingleSymbol; |
129 | 13513 | caballero | import com.iver.cit.gvsig.project.documents.view.legend.gui.SuitableVectorialLegend; |
130 | 10679 | jaume | import com.iver.cit.gvsig.project.documents.view.legend.gui.ThemeManagerWindow; |
131 | import com.iver.cit.gvsig.project.documents.view.legend.gui.VectorialInterval; |
||
132 | import com.iver.cit.gvsig.project.documents.view.legend.gui.VectorialUniqueValue; |
||
133 | 13513 | caballero | import com.iver.utiles.extensionPoints.ExtensionPoints; |
134 | import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
||
135 | 10679 | jaume | /**
|
136 | * Extension for enable the symbology. It only installs the core symbology.
|
||
137 | * @author jaume dominguez faus - jaume.dominguez@iver.es
|
||
138 | *
|
||
139 | */
|
||
140 | public class AdvancedSymbologyExtension extends Extension { |
||
141 | |||
142 | public void initialize() { |
||
143 | // Install required features
|
||
144 | |||
145 | 12869 | jaume | // modules for symbol editor
|
146 | SymbolEditor.addSymbolEditorPanel(SimpleFill.class, FShape.POLYGON); |
||
147 | SymbolEditor.addSymbolEditorPanel(MarkerFill.class, FShape.POLYGON); |
||
148 | SymbolEditor.addSymbolEditorPanel(PictureFill.class, FShape.POLYGON); |
||
149 | SymbolEditor.addSymbolEditorPanel(LineFill.class, FShape.POLYGON); |
||
150 | 13668 | jvidal | SymbolEditor.addSymbolEditorPanel(GradientFill.class, FShape.POLYGON); |
151 | 13513 | caballero | |
152 | 12869 | jaume | SymbolEditor.addSymbolEditorPanel(CharacterMarker.class, FShape.POINT); |
153 | SymbolEditor.addSymbolEditorPanel(SimpleMarker.class, FShape.POINT); |
||
154 | SymbolEditor.addSymbolEditorPanel(PictureMarker.class, FShape.POINT); |
||
155 | 13513 | caballero | |
156 | 12869 | jaume | SymbolEditor.addSymbolEditorPanel(SimpleLine.class, FShape.LINE); |
157 | SymbolEditor.addSymbolEditorPanel(PictureLine.class, FShape.LINE); |
||
158 | 12994 | jaume | SymbolEditor.addSymbolEditorPanel(MarkerLine.class, FShape.LINE); |
159 | 13513 | caballero | |
160 | 12869 | jaume | SymbolEditor.addSymbolEditorPanel(SimpleText.class, FShape.TEXT); |
161 | 13513 | caballero | |
162 | 10679 | jaume | // pages
|
163 | ThemeManagerWindow.addPage(General.class); |
||
164 | ThemeManagerWindow.addPage(LegendManager.class); |
||
165 | ThemeManagerWindow.addPage(LabelingManager.class); |
||
166 | ThemeManagerWindow.addPage(FilePage.class); |
||
167 | |||
168 | |||
169 | 13726 | jaume | // labeling strategies (inverse order to the wanted to be shown)
|
170 | 11747 | jaume | LabelingManager.addLabelingStrategy( |
171 | 13726 | jaume | PluginServices.getText(this, "label_attributes_defined_in_table"), |
172 | AttrInTableLabeling.class); |
||
173 | LabelingManager.addLabelingStrategy( |
||
174 | 11747 | jaume | PluginServices.getText(this, "user_defined_labels"), |
175 | GeneralLabelingStrategy.class); |
||
176 | 13726 | jaume | |
177 | 11747 | jaume | |
178 | 10679 | jaume | // labeling methods in the labeling page
|
179 | 13726 | jaume | // (inverse order to the wanted to be shown)
|
180 | 10679 | jaume | LabelingManager.addLabelingMethod( |
181 | 13726 | jaume | PluginServices.getText(this, "label_only_when_selected")+".", |
182 | OnSelectionLabeled.class); |
||
183 | 10679 | jaume | LabelingManager.addLabelingMethod( |
184 | PluginServices.getText(this, "define_classes_of_features_and_label_each_differently")+".", |
||
185 | FeatureDependentLabeled.class); |
||
186 | LabelingManager.addLabelingMethod( |
||
187 | 13726 | jaume | PluginServices.getText(this, "label_features_in_the_same_way")+".", |
188 | DefaultLabelingMethod.class); |
||
189 | 10679 | jaume | |
190 | 11747 | jaume | |
191 | 10679 | jaume | // legends available in the legend page
|
192 | LegendManager.addLegendPage(Quantities.class); |
||
193 | LegendManager.addLegendPage(Features.class); |
||
194 | LegendManager.addLegendPage(Categories.class); |
||
195 | 10737 | jaume | LegendManager.addLegendPage(MultipleAttributes.class); |
196 | 10679 | jaume | |
197 | LegendManager.addLegendPage(SingleSymbol.class); |
||
198 | LegendManager.addLegendPage(DotDensity.class); |
||
199 | LegendManager.addLegendPage(GraduatedSymbols.class); |
||
200 | LegendManager.addLegendPage(VectorialInterval.class); |
||
201 | LegendManager.addLegendPage(VectorialUniqueValue.class); |
||
202 | 10737 | jaume | LegendManager.addLegendPage(QuantityByCategory.class); |
203 | 11704 | jaume | LegendManager.addLegendPage(ProportionalSymbols.class); |
204 | 13513 | caballero | ExtensionPoints extensionPoints = ExtensionPointsSingleton |
205 | .getInstance(); |
||
206 | extensionPoints.add("IsSuitable",SuitableVectorialLegend.class.getName(),SuitableVectorialLegend.class);
|
||
207 | 10679 | jaume | } |
208 | |||
209 | 11704 | jaume | public void execute(String actionCommand) { |
210 | 10679 | jaume | |
211 | 11704 | jaume | } |
212 | |||
213 | 10679 | jaume | public boolean isEnabled() { |
214 | return true; // or whatever |
||
215 | } |
||
216 | |||
217 | public boolean isVisible() { |
||
218 | 11704 | jaume | return true; // or whatever |
219 | 10679 | jaume | } |
220 | |||
221 | 13726 | jaume | } |