svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.symbology / org.gvsig.symbology.lib / org.gvsig.symbology.lib.impl / src / main / java / org / gvsig / symbology / impl / SymbologyDefaultImplLibrary.java @ 40560
History | View | Annotate | Download (9.44 KB)
1 | 40560 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40560 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | *
|
||
6 | 40435 | jjdelcerro | * This program is free software; you can redistribute it and/or
|
7 | * modify it under the terms of the GNU General Public License
|
||
8 | 40560 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * of the License, or (at your option) any later version.
|
10 | 40560 | jjdelcerro | *
|
11 | 40435 | jjdelcerro | * 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 | 40560 | jjdelcerro | *
|
16 | 40435 | jjdelcerro | * 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 | 40560 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | 40435 | jjdelcerro | * MA 02110-1301, USA.
|
20 | 40560 | jjdelcerro | *
|
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | /*
|
||
25 | * AUTHORS (In addition to CIT):
|
||
26 | * 2009 {gvSIG} {{Task}}
|
||
27 | */
|
||
28 | package org.gvsig.symbology.impl; |
||
29 | |||
30 | import org.gvsig.symbology.SymbologyLibrary; |
||
31 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractClassifiedVectorLegend; |
||
32 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractIntervalLegend; |
||
33 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractLegend; |
||
34 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend; |
||
35 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.FInterval; |
||
36 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.SingleSymbolLegend; |
||
37 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.VectorialIntervalLegend; |
||
38 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.VectorialUniqueValueLegend; |
||
39 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy; |
||
40 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.DefaultLabelingMethod; |
||
41 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.LabelClass; |
||
42 | import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.ZoomConstraintsImpl; |
||
43 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.AbstractFillSymbol; |
||
44 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.MarkerFillSymbol; |
||
45 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.MultiLayerFillSymbol; |
||
46 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.PictureFillSymbol; |
||
47 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.SimpleFillSymbol; |
||
48 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol; |
||
49 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.MultiShapeSymbol; |
||
50 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.AbstractLineSymbol; |
||
51 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.MultiLayerLineSymbol; |
||
52 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.PictureLineSymbol; |
||
53 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.SimpleLineSymbol; |
||
54 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol; |
||
55 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.ArrowMarkerSymbol; |
||
56 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.MultiLayerMarkerSymbol; |
||
57 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.PictureMarkerSymbol; |
||
58 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.SimpleMarkerSymbol; |
||
59 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.AbstractStyle; |
||
60 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.ArrowDecoratorStyle; |
||
61 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.BackgroundFileStyle; |
||
62 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.DefaultMask; |
||
63 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.ImageStyle; |
||
64 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.RemoteFileStyle; |
||
65 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.SVGStyle; |
||
66 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.SimpleLineStyle; |
||
67 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.SimpleMarkerFillPropertiesStyle; |
||
68 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol; |
||
69 | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.warning.impl.WarningSymbol; |
||
70 | import org.gvsig.tools.library.AbstractLibrary; |
||
71 | import org.gvsig.tools.library.LibraryException; |
||
72 | import org.gvsig.tools.util.Caller; |
||
73 | import org.gvsig.tools.util.impl.DefaultCaller; |
||
74 | |||
75 | /**
|
||
76 | * Library for the Basic Symbology implementation.
|
||
77 | *
|
||
78 | * @author gvSIG team
|
||
79 | */
|
||
80 | public class SymbologyDefaultImplLibrary extends AbstractLibrary { |
||
81 | |||
82 | @Override
|
||
83 | public void doRegistration() { |
||
84 | registerAsImplementationOf(SymbologyLibrary.class); |
||
85 | } |
||
86 | |||
87 | protected void doInitialize() throws LibraryException { |
||
88 | Caller caller = new DefaultCaller();
|
||
89 | caller.add(new DefaultSymbologyManager.RegisterSymbologyManager());
|
||
90 | if (!caller.call()) {
|
||
91 | throw new LibraryException(SymbologyDefaultImplLibrary.class, |
||
92 | caller.getExceptions()); |
||
93 | } |
||
94 | } |
||
95 | |||
96 | protected void doPostInitialize() throws LibraryException { |
||
97 | Caller caller = new DefaultCaller();
|
||
98 | |||
99 | /*
|
||
100 | * Add registry of symbols
|
||
101 | */
|
||
102 | caller.add( new SimpleFillSymbol.RegisterSymbol() );
|
||
103 | caller.add( new MultiLayerFillSymbol.RegisterSymbol() );
|
||
104 | caller.add( new SimpleLineSymbol.RegisterSymbol() );
|
||
105 | caller.add( new MultiLayerLineSymbol.RegisterSymbol() );
|
||
106 | caller.add( new SimpleMarkerSymbol.RegisterSymbol() );
|
||
107 | caller.add( new MultiLayerMarkerSymbol.RegisterSymbol() );
|
||
108 | caller.add( new SimpleTextSymbol.RegisterSymbol() );
|
||
109 | caller.add( new MultiShapeSymbol.RegisterSymbol() );
|
||
110 | caller.add( new WarningSymbol.RegisterSymbol() );
|
||
111 | |||
112 | caller.add( new PictureFillSymbol.RegisterSymbol() );
|
||
113 | caller.add( new PictureLineSymbol.RegisterSymbol() );
|
||
114 | caller.add( new PictureMarkerSymbol.RegisterSymbol() );
|
||
115 | |||
116 | // caller.add( new MarkerFillSymbol.RegisterSymbol() );
|
||
117 | |||
118 | /*
|
||
119 | * Add registry of legends
|
||
120 | */
|
||
121 | caller.add( new VectorialUniqueValueLegend.RegisterLegend() );
|
||
122 | caller.add( new VectorialIntervalLegend.RegisterLegend() );
|
||
123 | caller.add( new SingleSymbolLegend.RegisterLegend() );
|
||
124 | |||
125 | /*
|
||
126 | * Add registry of persistent styles
|
||
127 | */
|
||
128 | caller.add( new AbstractStyle.RegisterPersistence() );
|
||
129 | caller.add( new ArrowDecoratorStyle.RegisterPersistence() );
|
||
130 | caller.add( new DefaultMask.RegisterPersistence() );
|
||
131 | caller.add( new SimpleLineStyle.RegisterPersistence() );
|
||
132 | |||
133 | caller.add( new BackgroundFileStyle.RegisterPersistence() );
|
||
134 | caller.add( new ImageStyle.RegisterPersistence() );
|
||
135 | caller.add( new RemoteFileStyle.RegisterPersistence() );
|
||
136 | caller.add( new SVGStyle.RegisterPersistence() );
|
||
137 | |||
138 | /*
|
||
139 | * Add registry of persistent symbols
|
||
140 | */
|
||
141 | caller.add( new AbstractSymbol.RegisterPersistence() );
|
||
142 | caller.add( new AbstractFillSymbol.RegisterPersistence() );
|
||
143 | caller.add( new SimpleFillSymbol.RegisterPersistence() );
|
||
144 | caller.add( new MultiLayerFillSymbol.RegisterPersistence() );
|
||
145 | caller.add( new AbstractLineSymbol.RegisterPersistence() );
|
||
146 | caller.add( new SimpleLineSymbol.RegisterPersistence() );
|
||
147 | caller.add( new MultiLayerLineSymbol.RegisterPersistence() );
|
||
148 | caller.add( new AbstractMarkerSymbol.RegisterPersistence() );
|
||
149 | caller.add( new SimpleMarkerSymbol.RegisterPersistence() );
|
||
150 | caller.add( new ArrowMarkerSymbol.RegisterPersistence() );
|
||
151 | caller.add( new MultiLayerMarkerSymbol.RegisterPersistence() );
|
||
152 | caller.add( new SimpleTextSymbol.RegisterPersistence() );
|
||
153 | caller.add( new MultiShapeSymbol.RegisterPersistence() );
|
||
154 | caller.add( new WarningSymbol.RegisterPersistence() );
|
||
155 | |||
156 | caller.add( new PictureFillSymbol.RegisterPersistence() );
|
||
157 | caller.add( new PictureLineSymbol.RegisterPersistence() );
|
||
158 | caller.add( new PictureMarkerSymbol.RegisterPersistence() );
|
||
159 | caller.add( new MarkerFillSymbol.RegisterPersistence() );
|
||
160 | caller.add( new SimpleMarkerFillPropertiesStyle.RegisterPersistence() );
|
||
161 | |||
162 | |||
163 | /*
|
||
164 | * Add registry of persistent legends
|
||
165 | */
|
||
166 | caller.add(new AbstractLegend.RegisterPersistence());
|
||
167 | caller.add(new AbstractVectorialLegend.RegisterPersistence());
|
||
168 | caller.add(new AbstractClassifiedVectorLegend.RegisterPersistence());
|
||
169 | caller.add(new FInterval.RegisterPersistence());
|
||
170 | caller.add(new AbstractIntervalLegend.RegisterPersistence());
|
||
171 | caller.add(new VectorialIntervalLegend.RegisterPersistence());
|
||
172 | caller.add(new VectorialUniqueValueLegend.RegisterPersistence());
|
||
173 | caller.add(new SingleSymbolLegend.RegisterPersistence());
|
||
174 | |||
175 | /*
|
||
176 | * Add registry of labeling classes
|
||
177 | */
|
||
178 | caller.add(new ZoomConstraintsImpl.RegisterPersistence());
|
||
179 | caller.add(new LabelClass.RegisterPersistence());
|
||
180 | caller.add(new DefaultLabelingMethod.RegisterPersistence());
|
||
181 | caller.add(new AttrInTableLabelingStrategy.RegisterPersistence());
|
||
182 | |||
183 | /*
|
||
184 | * Do register of all
|
||
185 | */
|
||
186 | if( !caller.call() ) {
|
||
187 | throw new LibraryException(SymbologyDefaultImplLibrary.class, caller.getExceptions()); |
||
188 | } |
||
189 | |||
190 | } |
||
191 | |||
192 | } |