Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / AdvancedSymbologyExtension.java @ 13513

History | View | Annotate | Download (7.74 KB)

1
/* 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: AdvancedSymbologyExtension.java 13513 2007-09-04 10:53:52Z caballero $
45
* $Log$
46
* Revision 1.9  2007-09-04 10:53:10  caballero
47
* show page
48
*
49
* Revision 1.8  2007/08/09 10:39:04  jaume
50
* first round of found bugs fixed
51
*
52
* Revision 1.7  2007/08/01 13:03:31  jaume
53
* plugable symbol editor
54
*
55
* Revision 1.6  2007/05/22 12:17:12  jaume
56
* *** empty log message ***
57
*
58
* Revision 1.5  2007/05/17 09:32:37  jaume
59
* *** empty log message ***
60
*
61
* Revision 1.4  2007/03/21 08:03:03  jaume
62
* refactored to use ISymbol instead of FSymbol
63
*
64
* Revision 1.3  2007/03/13 16:57:35  jaume
65
* Added MultiVariable legend
66
*
67
* Revision 1.2  2007/03/09 11:25:00  jaume
68
* Advanced symbology (start committing)
69
*
70
* Revision 1.1.2.4  2007/02/21 07:35:14  jaume
71
* *** empty log message ***
72
*
73
* Revision 1.1.2.3  2007/02/12 15:14:41  jaume
74
* refactored interval legend and added graduated symbol legend
75
*
76
* Revision 1.1.2.2  2007/02/01 17:47:12  jaume
77
* *** empty log message ***
78
*
79
* Revision 1.1.2.1  2007/02/01 12:12:41  jaume
80
* theme manager window and all its components are now dynamic
81
*
82
*
83
*/
84
package com.iver.cit.gvsig;
85

    
86
import com.iver.andami.PluginServices;
87
import com.iver.andami.plugins.Extension;
88
import com.iver.cit.gvsig.fmap.core.FShape;
89
import com.iver.cit.gvsig.fmap.core.symbols.MarkerLineSymbol;
90
import com.iver.cit.gvsig.fmap.rendering.styling.AttrInTableLabeling;
91
import com.iver.cit.gvsig.fmap.rendering.styling.DefaultLabelingMethod;
92
import com.iver.cit.gvsig.fmap.rendering.styling.FeatureDependentLabeled;
93
import com.iver.cit.gvsig.fmap.rendering.styling.GeneralLabelingStrategy;
94
import com.iver.cit.gvsig.fmap.rendering.styling.OnSelectionLabeled;
95
import com.iver.cit.gvsig.gui.styling.CharacterMarker;
96
import com.iver.cit.gvsig.gui.styling.LineFill;
97
import com.iver.cit.gvsig.gui.styling.MarkerFill;
98
import com.iver.cit.gvsig.gui.styling.MarkerLine;
99
import com.iver.cit.gvsig.gui.styling.PictureFill;
100
import com.iver.cit.gvsig.gui.styling.PictureLine;
101
import com.iver.cit.gvsig.gui.styling.PictureMarker;
102
import com.iver.cit.gvsig.gui.styling.SimpleFill;
103
import com.iver.cit.gvsig.gui.styling.SimpleLine;
104
import com.iver.cit.gvsig.gui.styling.SimpleMarker;
105
import com.iver.cit.gvsig.gui.styling.SimpleText;
106
import com.iver.cit.gvsig.gui.styling.SymbolEditor;
107
import com.iver.cit.gvsig.project.documents.view.legend.gui.Categories;
108
import com.iver.cit.gvsig.project.documents.view.legend.gui.DotDensity;
109
import com.iver.cit.gvsig.project.documents.view.legend.gui.Features;
110
import com.iver.cit.gvsig.project.documents.view.legend.gui.FilePage;
111
import com.iver.cit.gvsig.project.documents.view.legend.gui.General;
112
import com.iver.cit.gvsig.project.documents.view.legend.gui.GraduatedSymbols;
113
import com.iver.cit.gvsig.project.documents.view.legend.gui.LabelingManager;
114
import com.iver.cit.gvsig.project.documents.view.legend.gui.LegendManager;
115
import com.iver.cit.gvsig.project.documents.view.legend.gui.MultipleAttributes;
116
import com.iver.cit.gvsig.project.documents.view.legend.gui.ProportionalSymbols;
117
import com.iver.cit.gvsig.project.documents.view.legend.gui.Quantities;
118
import com.iver.cit.gvsig.project.documents.view.legend.gui.QuantityByCategory;
119
import com.iver.cit.gvsig.project.documents.view.legend.gui.SingleSymbol;
120
import com.iver.cit.gvsig.project.documents.view.legend.gui.SuitableVectorialLegend;
121
import com.iver.cit.gvsig.project.documents.view.legend.gui.ThemeManagerWindow;
122
import com.iver.cit.gvsig.project.documents.view.legend.gui.VectorialInterval;
123
import com.iver.cit.gvsig.project.documents.view.legend.gui.VectorialUniqueValue;
124
import com.iver.utiles.extensionPoints.ExtensionPoints;
125
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
126
/**
127
 * Extension for enable the symbology. It only installs the core symbology.
128
 * @author jaume dominguez faus - jaume.dominguez@iver.es
129
 *
130
 */
131
public class AdvancedSymbologyExtension extends Extension {
132

    
133
        public void initialize() {
134
                // Install required features
135

    
136
                // modules for symbol editor
137
                SymbolEditor.addSymbolEditorPanel(SimpleFill.class, FShape.POLYGON);
138
                SymbolEditor.addSymbolEditorPanel(MarkerFill.class, FShape.POLYGON);
139
                SymbolEditor.addSymbolEditorPanel(PictureFill.class, FShape.POLYGON);
140
                SymbolEditor.addSymbolEditorPanel(LineFill.class, FShape.POLYGON);
141

    
142
                SymbolEditor.addSymbolEditorPanel(CharacterMarker.class, FShape.POINT);
143
                SymbolEditor.addSymbolEditorPanel(SimpleMarker.class, FShape.POINT);
144
                SymbolEditor.addSymbolEditorPanel(PictureMarker.class, FShape.POINT);
145

    
146
                SymbolEditor.addSymbolEditorPanel(SimpleLine.class, FShape.LINE);
147
                SymbolEditor.addSymbolEditorPanel(PictureLine.class, FShape.LINE);
148
                SymbolEditor.addSymbolEditorPanel(MarkerLine.class, FShape.LINE);
149

    
150
                SymbolEditor.addSymbolEditorPanel(SimpleText.class, FShape.TEXT);
151

    
152
                // pages
153
                ThemeManagerWindow.addPage(General.class);
154
                ThemeManagerWindow.addPage(LegendManager.class);
155
                ThemeManagerWindow.addPage(LabelingManager.class);
156
                ThemeManagerWindow.addPage(FilePage.class);
157

    
158

    
159
                // labeling strategies
160
                LabelingManager.addLabelingStrategy(
161
                                PluginServices.getText(this, "user_defined_labels"),
162
                                GeneralLabelingStrategy.class);
163
                LabelingManager.addLabelingStrategy(
164
                                PluginServices.getText(this, "label_attributes_defined_in_table"),
165
                                AttrInTableLabeling.class);
166

    
167

    
168
                // labeling methods in the labeling page
169
                LabelingManager.addLabelingMethod(
170
                                PluginServices.getText(this, "label_features_in_the_same_way")+".",
171
                                DefaultLabelingMethod.class);
172
                LabelingManager.addLabelingMethod(
173
                                PluginServices.getText(this, "define_classes_of_features_and_label_each_differently")+".",
174
                                FeatureDependentLabeled.class);
175
                LabelingManager.addLabelingMethod(
176
                                PluginServices.getText(this, "label_only_when_selected")+".",
177
                                OnSelectionLabeled.class);
178

    
179

    
180
                // legends available in the legend page
181
                LegendManager.addLegendPage(Quantities.class);
182
                LegendManager.addLegendPage(Features.class);
183
                LegendManager.addLegendPage(Categories.class);
184
                LegendManager.addLegendPage(MultipleAttributes.class);
185

    
186
                LegendManager.addLegendPage(SingleSymbol.class);
187
                LegendManager.addLegendPage(DotDensity.class);
188
                LegendManager.addLegendPage(GraduatedSymbols.class);
189
                LegendManager.addLegendPage(VectorialInterval.class);
190
                LegendManager.addLegendPage(VectorialUniqueValue.class);
191
                LegendManager.addLegendPage(QuantityByCategory.class);
192
                LegendManager.addLegendPage(ProportionalSymbols.class);
193
                ExtensionPoints extensionPoints = ExtensionPointsSingleton
194
                        .getInstance();
195
                extensionPoints.add("IsSuitable",SuitableVectorialLegend.class.getName(),SuitableVectorialLegend.class);
196
        }
197

    
198
        public void execute(String actionCommand) {
199

    
200
        }
201

    
202
        public boolean isEnabled() {
203
                return true; // or whatever
204
        }
205

    
206
        public boolean isVisible() {
207
                return true; // or whatever
208
        }
209

    
210
}