Revision 43891 branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/impl/DefaultMapContextManager.java
DefaultMapContextManager.java | ||
---|---|---|
39 | 39 |
import java.util.Map; |
40 | 40 |
import org.apache.commons.io.IOUtils; |
41 | 41 |
import org.apache.commons.lang3.StringUtils; |
42 |
import org.cresques.cts.ICoordTrans; |
|
42 | 43 |
|
43 | 44 |
import org.cresques.cts.IProjection; |
44 | 45 |
import org.gvsig.fmap.crs.CRSFactory; |
46 |
import org.gvsig.fmap.dal.DALLocator; |
|
47 |
import org.gvsig.fmap.dal.DataManager; |
|
45 | 48 |
import org.gvsig.fmap.dal.DataServerExplorer; |
46 | 49 |
import org.gvsig.fmap.dal.DataStore; |
47 | 50 |
import org.gvsig.fmap.dal.DataStoreParameters; |
51 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
|
48 | 52 |
import org.gvsig.fmap.dal.exception.DataException; |
49 | 53 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
50 | 54 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
57 | 61 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
58 | 62 |
import org.gvsig.fmap.mapcontext.MapContextRuntimeException; |
59 | 63 |
import org.gvsig.fmap.mapcontext.ViewPort; |
64 |
import org.gvsig.fmap.mapcontext.exceptions.CantRetrieveLayerByStoreException; |
|
60 | 65 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
61 | 66 |
import org.gvsig.fmap.mapcontext.layers.DefaultLayerInformationBuilder; |
62 | 67 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
63 |
import org.gvsig.fmap.mapcontext.layers.LayerFactory; |
|
64 | 68 |
import org.gvsig.fmap.mapcontext.layers.LayerInformationBuilder; |
69 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
|
65 | 70 |
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer; |
66 | 71 |
import org.gvsig.fmap.mapcontext.layers.vectorial.impl.DefaultGraphicLayer; |
67 | 72 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
... | ... | |
82 | 87 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
83 | 88 |
import org.gvsig.tools.ToolsLocator; |
84 | 89 |
import org.gvsig.tools.dispose.DisposeUtils; |
90 |
import org.gvsig.tools.dynobject.DynObject; |
|
85 | 91 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
86 | 92 |
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException; |
93 |
import org.gvsig.tools.folders.FoldersManager; |
|
87 | 94 |
import org.gvsig.tools.observer.Notification; |
88 | 95 |
import org.gvsig.tools.observer.ObservableHelper; |
89 | 96 |
import org.gvsig.tools.observer.Observer; |
... | ... | |
108 | 115 |
private final Map<String, Class<ILegendReader>> legendReaders = new LinkedHashMap<>(); |
109 | 116 |
|
110 | 117 |
private final Map<String, Map<Class<ILegend>,Class<ILegendWriter>>> legendWriters = new LinkedHashMap<>(); |
118 |
|
|
119 |
private final Map<Class<? extends DataStore>,Class<? extends FLayer>> layerClassFromStoreClass = new HashMap<>(); |
|
111 | 120 |
|
121 |
private final Map<String,String> iconLayers = new HashMap(); // (Map<String storeProviderName, String iconName>) |
|
122 |
|
|
112 | 123 |
private String defaultVectorLegend; |
113 | 124 |
|
114 |
private ObservableHelper observableHelper = new ObservableHelper(); |
|
125 |
private final ObservableHelper observableHelper = new ObservableHelper();
|
|
115 | 126 |
|
116 | 127 |
private File colorTableLibraryFolder = null; |
117 | 128 |
private String defaultRasterLegend; |
118 | 129 |
|
130 |
@Override |
|
119 | 131 |
public MapContext createMapContext() { |
120 | 132 |
MapContext mapcontext = new MapContext(new ViewPort()); |
121 | 133 |
return (MapContext) notifyObservers(CREATE_MAPCONTEXT, mapcontext).getValue(); |
122 | 134 |
} |
123 | 135 |
|
136 |
@Override |
|
124 | 137 |
public SymbolManager getSymbolManager() { |
125 | 138 |
return MapContextLocator.getSymbolManager(); |
126 | 139 |
} |
... | ... | |
129 | 142 |
return getSymbolManager().getSymbolPreferences(); |
130 | 143 |
} |
131 | 144 |
|
145 |
@Override |
|
132 | 146 |
public String getSymbolLibraryPath() { |
133 | 147 |
return getSymbolPreferences().getSymbolLibraryPath(); |
134 | 148 |
} |
135 | 149 |
|
150 |
@Override |
|
136 | 151 |
public void setSymbolLibraryPath(String symbolLibraryPath) { |
137 | 152 |
getSymbolPreferences().setSymbolLibraryPath(symbolLibraryPath); |
138 | 153 |
} |
139 | 154 |
|
155 |
@Override |
|
140 | 156 |
public void resetSymbolLibraryPath() { |
141 | 157 |
getSymbolPreferences().resetSymbolLibraryPath(); |
142 | 158 |
} |
143 | 159 |
|
160 |
@Override |
|
144 | 161 |
public Color getDefaultSymbolColor() { |
145 | 162 |
return getSymbolPreferences().getDefaultSymbolColor(); |
146 | 163 |
} |
147 | 164 |
|
165 |
@Override |
|
148 | 166 |
public Color getDefaultSymbolFillColor() { |
149 | 167 |
return getSymbolPreferences().getDefaultSymbolFillColor(); |
150 | 168 |
} |
151 | 169 |
|
170 |
@Override |
|
152 | 171 |
public Font getDefaultSymbolFont() { |
153 | 172 |
return getSymbolPreferences().getDefaultSymbolFont(); |
154 | 173 |
} |
... | ... | |
157 | 176 |
return getSymbolPreferences().getSymbolFileExtension(); |
158 | 177 |
} |
159 | 178 |
|
179 |
@Override |
|
160 | 180 |
public boolean isDefaultSymbolFillColorAleatory() { |
161 | 181 |
return getSymbolPreferences().isDefaultSymbolFillColorAleatory(); |
162 | 182 |
} |
163 | 183 |
|
184 |
@Override |
|
164 | 185 |
public void resetDefaultSymbolColor() { |
165 | 186 |
getSymbolPreferences().resetDefaultSymbolColor(); |
166 | 187 |
} |
167 | 188 |
|
189 |
@Override |
|
168 | 190 |
public void resetDefaultSymbolFillColor() { |
169 | 191 |
getSymbolPreferences().resetDefaultSymbolFillColor(); |
170 | 192 |
} |
171 | 193 |
|
194 |
@Override |
|
172 | 195 |
public void resetDefaultSymbolFillColorAleatory() { |
173 | 196 |
getSymbolPreferences().resetDefaultSymbolFillColorAleatory(); |
174 | 197 |
} |
175 | 198 |
|
199 |
@Override |
|
176 | 200 |
public void resetDefaultSymbolFont() { |
177 | 201 |
getSymbolPreferences().resetDefaultSymbolFont(); |
178 | 202 |
} |
179 | 203 |
|
204 |
@Override |
|
180 | 205 |
public void setDefaultSymbolColor(Color defaultSymbolColor) { |
181 | 206 |
getSymbolPreferences().setDefaultSymbolColor(defaultSymbolColor); |
182 | 207 |
} |
183 | 208 |
|
209 |
@Override |
|
184 | 210 |
public void setDefaultSymbolFillColor(Color defaultSymbolFillColor) { |
185 | 211 |
getSymbolPreferences().setDefaultSymbolFillColor(defaultSymbolFillColor); |
186 | 212 |
} |
187 | 213 |
|
214 |
@Override |
|
188 | 215 |
public void setDefaultSymbolFillColorAleatory( |
189 | 216 |
boolean defaultSymbolFillColorAleatory) { |
190 | 217 |
getSymbolPreferences().setDefaultSymbolFillColorAleatory( |
191 | 218 |
defaultSymbolFillColorAleatory); |
192 | 219 |
} |
193 | 220 |
|
221 |
@Override |
|
194 | 222 |
public void setDefaultSymbolFont(Font defaultSymbolFont) { |
195 | 223 |
getSymbolPreferences().setDefaultSymbolFont(defaultSymbolFont); |
196 | 224 |
} |
... | ... | |
199 | 227 |
getSymbolPreferences().setSymbolFileExtension(extension); |
200 | 228 |
} |
201 | 229 |
|
230 |
@Override |
|
202 | 231 |
public int getDefaultCartographicSupportMeasureUnit() { |
203 | 232 |
return getSymbolPreferences().getDefaultCartographicSupportMeasureUnit(); |
204 | 233 |
} |
205 | 234 |
|
235 |
@Override |
|
206 | 236 |
public void setDefaultCartographicSupportMeasureUnit( |
207 | 237 |
int defaultCartographicSupportMeasureUnit) { |
208 | 238 |
getSymbolPreferences().setDefaultCartographicSupportMeasureUnit( |
209 | 239 |
defaultCartographicSupportMeasureUnit); |
210 | 240 |
} |
211 | 241 |
|
242 |
@Override |
|
212 | 243 |
public int getDefaultCartographicSupportReferenceSystem() { |
213 | 244 |
return getSymbolPreferences().getDefaultCartographicSupportReferenceSystem(); |
214 | 245 |
} |
215 | 246 |
|
247 |
@Override |
|
216 | 248 |
public void setDefaultCartographicSupportReferenceSystem( |
217 | 249 |
int defaultCartographicSupportReferenceSystem) { |
218 | 250 |
getSymbolPreferences().setDefaultCartographicSupportReferenceSystem( |
219 | 251 |
defaultCartographicSupportReferenceSystem); |
220 | 252 |
} |
221 | 253 |
|
254 |
@Override |
|
222 | 255 |
public MapContextDrawer createMapContextDrawerInstance(Class drawerClazz) |
223 | 256 |
throws MapContextException { |
224 | 257 |
return createMapContextDrawerInstance(drawerClazz, "NONE"); |
225 | 258 |
} |
226 | 259 |
|
260 |
@Override |
|
227 | 261 |
public MapContextDrawer createDefaultMapContextDrawerInstance() |
228 | 262 |
throws MapContextException { |
229 | 263 |
|
... | ... | |
242 | 276 |
} |
243 | 277 |
} |
244 | 278 |
|
279 |
@Override |
|
245 | 280 |
public void setDefaultMapContextDrawer(Class drawerClazz) |
246 | 281 |
throws MapContextException { |
247 | 282 |
|
... | ... | |
250 | 285 |
notifyObservers(SET_MAPCONTEXT_DRAWER, drawerClazz); |
251 | 286 |
} |
252 | 287 |
|
288 |
@Override |
|
253 | 289 |
public void validateMapContextDrawer(Class drawerClazz) |
254 | 290 |
throws MapContextException { |
255 | 291 |
if (!MapContextDrawer.class.isAssignableFrom(drawerClazz)) { |
... | ... | |
510 | 546 |
throws Exception { |
511 | 547 |
|
512 | 548 |
Iterator kiter = clsToWtr.keySet().iterator(); |
513 |
Object oitem = null;
|
|
514 |
Class citem = null;
|
|
549 |
Object oitem; |
|
550 |
Class<ILegendWriter> citem;
|
|
515 | 551 |
while (kiter.hasNext()) { |
516 | 552 |
oitem = kiter.next(); |
517 | 553 |
if (oitem instanceof Class) { |
... | ... | |
520 | 556 |
/* |
521 | 557 |
* Found superclass/superinterface |
522 | 558 |
*/ |
523 |
citem = (Class) clsToWtr.get(oitem);
|
|
559 |
citem = clsToWtr.get(oitem); |
|
524 | 560 |
return (ILegendWriter) citem.newInstance(); |
525 | 561 |
} |
526 | 562 |
} |
... | ... | |
533 | 569 |
|
534 | 570 |
// ============================================================= |
535 | 571 |
|
572 |
@Override |
|
536 | 573 |
public IMultiLayerSymbol createMultiLayerSymbol(int shapeType) |
537 | 574 |
throws MapContextRuntimeException { |
538 | 575 |
IMultiLayerSymbol symbol = getSymbolManager().createMultiLayerSymbol(shapeType); |
539 | 576 |
return (IMultiLayerSymbol) notifyObservers(CREATE_SYMBOL, symbol).getValue(); |
540 | 577 |
} |
541 | 578 |
|
579 |
@Override |
|
542 | 580 |
public IMultiLayerSymbol createMultiLayerSymbol(String symbolName) |
543 | 581 |
throws MapContextRuntimeException { |
544 | 582 |
IMultiLayerSymbol symbol = getSymbolManager().createMultiLayerSymbol(symbolName); |
545 | 583 |
return (IMultiLayerSymbol) notifyObservers(CREATE_SYMBOL, symbol).getValue(); |
546 | 584 |
} |
547 | 585 |
|
586 |
@Override |
|
548 | 587 |
public ISymbol createSymbol(int shapeType, Color color) |
549 | 588 |
throws MapContextRuntimeException { |
550 | 589 |
ISymbol symbol = getSymbolManager().createSymbol(shapeType, color); |
551 | 590 |
return (ISymbol) notifyObservers(CREATE_SYMBOL, symbol).getValue(); |
552 | 591 |
} |
553 | 592 |
|
593 |
@Override |
|
554 | 594 |
public ISymbol createSymbol(int shapeType) |
555 | 595 |
throws MapContextRuntimeException { |
556 | 596 |
ISymbol symbol = getSymbolManager().createSymbol(shapeType); |
557 | 597 |
return (ISymbol) notifyObservers(CREATE_SYMBOL, symbol).getValue(); |
558 | 598 |
} |
559 | 599 |
|
600 |
@Override |
|
560 | 601 |
public ISymbol createSymbol(String symbolName, Color color) |
561 | 602 |
throws MapContextRuntimeException { |
562 | 603 |
ISymbol symbol = getSymbolManager().createSymbol(symbolName, color); |
563 | 604 |
return (ISymbol) notifyObservers(CREATE_SYMBOL, symbol).getValue(); |
564 | 605 |
} |
565 | 606 |
|
607 |
@Override |
|
566 | 608 |
public ISymbol createSymbol(String symbolName) |
567 | 609 |
throws MapContextRuntimeException { |
568 | 610 |
ISymbol symbol = getSymbolManager().createSymbol(symbolName); |
569 | 611 |
return (ISymbol) notifyObservers(CREATE_SYMBOL, symbol).getValue(); |
570 | 612 |
} |
571 | 613 |
|
614 |
@Override |
|
572 | 615 |
public IWarningSymbol getWarningSymbol(String message, String symbolDesc, |
573 | 616 |
int symbolDrawExceptionType) throws MapContextRuntimeException { |
574 | 617 |
return getSymbolManager().getWarningSymbol(message, symbolDesc, |
... | ... | |
586 | 629 |
return (ISymbol[]) notifyObservers(LOAD_SYMBOLS, symbols).getValue(); |
587 | 630 |
} |
588 | 631 |
|
632 |
@Override |
|
589 | 633 |
public void registerMultiLayerSymbol(String symbolName, Class symbolClass) |
590 | 634 |
throws MapContextRuntimeException { |
591 | 635 |
getSymbolManager().registerMultiLayerSymbol(symbolName, symbolClass); |
592 | 636 |
notifyObservers(REGISTER_MULTILAYER_SYMBOL, symbolName, symbolClass); |
593 | 637 |
} |
594 | 638 |
|
639 |
@Override |
|
595 | 640 |
public void registerMultiLayerSymbol(String symbolName, int[] shapeTypes, |
596 | 641 |
Class symbolClass) throws MapContextRuntimeException { |
597 | 642 |
getSymbolManager().registerMultiLayerSymbol(symbolName, shapeTypes, |
... | ... | |
599 | 644 |
notifyObservers(REGISTER_MULTILAYER_SYMBOL, symbolName, symbolClass, shapeTypes); |
600 | 645 |
} |
601 | 646 |
|
647 |
@Override |
|
602 | 648 |
public void registerSymbol(String symbolName, Class symbolClass) |
603 | 649 |
throws MapContextRuntimeException { |
604 | 650 |
getSymbolManager().registerSymbol(symbolName, symbolClass); |
605 | 651 |
notifyObservers(REGISTER_SYMBOL, symbolName, symbolClass); |
606 | 652 |
} |
607 | 653 |
|
654 |
@Override |
|
608 | 655 |
public void registerSymbol(String symbolName, int[] shapeTypes, |
609 | 656 |
Class symbolClass) throws MapContextException { |
610 | 657 |
getSymbolManager().registerSymbol(symbolName, shapeTypes, symbolClass); |
... | ... | |
621 | 668 |
getSymbolManager().saveSymbol(symbol, fileName, folder); |
622 | 669 |
} |
623 | 670 |
|
624 |
public FLayer createLayer(String layerName, DataStoreParameters parameters) |
|
671 |
@Override |
|
672 |
public boolean registerLayer( |
|
673 |
Class<? extends DataStore> dataStoreClass, |
|
674 |
Class<? extends FLayer> layerClass) |
|
675 |
{ |
|
676 |
this.layerClassFromStoreClass.put(dataStoreClass, layerClass); |
|
677 |
return true; |
|
678 |
} |
|
679 |
|
|
680 |
private Class<? extends FLayer> getLayerClassFromDataStoreClass( |
|
681 |
Class<? extends DataStore> dataStoreClass) { |
|
682 |
Class<? extends FLayer> layerClass = this.layerClassFromStoreClass.get(dataStoreClass); |
|
683 |
if( layerClass!=null ) { |
|
684 |
return layerClass; |
|
685 |
} |
|
686 |
for (Map.Entry<Class<? extends DataStore>, Class<? extends FLayer>> entry : layerClassFromStoreClass.entrySet()) { |
|
687 |
Class<? extends DataStore> currentDataStoreClass = entry.getKey(); |
|
688 |
layerClass = entry.getValue(); |
|
689 |
if( currentDataStoreClass.isAssignableFrom(dataStoreClass) ) { |
|
690 |
return layerClass; |
|
691 |
} |
|
692 |
} |
|
693 |
return null; |
|
694 |
} |
|
695 |
|
|
696 |
@Override |
|
697 |
public FLayer createLayer(String layerName, DataStoreParameters dataParameters) |
|
625 | 698 |
throws LoadLayerException { |
626 |
FLayer layer = LayerFactory.getInstance().createLayer(layerName, parameters); |
|
627 |
return (FLayer) notifyObservers(CREATE_LAYER, layer).getValue(); |
|
699 |
try { |
|
700 |
DataManager dataManager = DALLocator.getDataManager(); |
|
701 |
DataStore dataStore = dataManager.openStore( |
|
702 |
dataParameters.getDataStoreName(), |
|
703 |
dataParameters |
|
704 |
); |
|
705 |
return this.createLayer(layerName, dataStore, null); |
|
706 |
} catch (Exception e) { |
|
707 |
throw new LoadLayerException(layerName, e); |
|
708 |
} |
|
628 | 709 |
} |
629 | 710 |
|
630 | 711 |
@Override |
631 |
public FLayer createLayer(String layerName, DataStore store)
|
|
712 |
public FLayer createLayer(String layerName, DataStore dataStore)
|
|
632 | 713 |
throws LoadLayerException { |
633 |
FLayer layer = LayerFactory.getInstance().createLayer(layerName, store); |
|
634 |
return (FLayer) notifyObservers(CREATE_LAYER, layer).getValue(); |
|
714 |
return this.createLayer(layerName, dataStore, null); |
|
635 | 715 |
} |
636 | 716 |
|
717 |
|
|
637 | 718 |
@Override |
719 |
public FLayer createLayer(String layerName, CreateLayerParameters parameters) throws LoadLayerException { |
|
720 |
try { |
|
721 |
DataManager dataManager = DALLocator.getDataManager(); |
|
722 |
DataStoreParameters dataParameters = parameters.getDataParameters(); |
|
723 |
DataStore dataStore = dataManager.openStore( |
|
724 |
dataParameters.getDataStoreName(), |
|
725 |
dataParameters |
|
726 |
); |
|
727 |
return this.createLayer(layerName, dataStore, parameters); |
|
728 |
} catch (Exception e) { |
|
729 |
throw new LoadLayerException(layerName, e); |
|
730 |
} |
|
731 |
} |
|
732 |
|
|
733 |
@Override |
|
734 |
public FLayer createLayer(String layerName, DataStore dataStore, CreateLayerParameters parameters) throws LoadLayerException { |
|
735 |
try { |
|
736 |
boolean useCache = false; |
|
737 |
ICoordTrans coordTrans = null; |
|
738 |
IProjection projection = (IProjection) dataStore.getDynValue(FeatureStore.METADATA_CRS); |
|
739 |
|
|
740 |
if( parameters!=null ) { |
|
741 |
if( parameters.getDataParameters()!=dataStore.getParameters() ) { |
|
742 |
throw new IllegalArgumentException("The dataStore parameters are not the same of the store pased to create layer."); |
|
743 |
} |
|
744 |
useCache = parameters.useCache(); |
|
745 |
|
|
746 |
coordTrans = parameters.getCoordTrans(); |
|
747 |
// TODO: Aqui comprobacion de que si hay transformacion es adecuada |
|
748 |
// para la proyeccion del store. |
|
749 |
} |
|
750 |
|
|
751 |
if( useCache ) { |
|
752 |
DataStoreProviderFactory factory = dataStore.getProviderFactory(); |
|
753 |
if( factory.isTiledSupported() != DataStoreProviderFactory.NO ) { |
|
754 |
if( !factory.getClass().getSimpleName().equals("TileProviderFactory")) { |
|
755 |
DataManager dataManager = DALLocator.getDataManager(); |
|
756 |
DynObject tileParameters = dataManager.createStoreParameters("TileCache"); |
|
757 |
File cacheFolder; |
|
758 |
FoldersManager folderManager = ToolsLocator.getFoldersManager(); |
|
759 |
File applicationHome = folderManager.get("ApplicationHome"); |
|
760 |
if( applicationHome==null ) { |
|
761 |
cacheFolder = folderManager.getTemporaryFile("gvsig_rcache"); |
|
762 |
} else { |
|
763 |
cacheFolder = new File(applicationHome, "gvsig_rcache"); |
|
764 |
} |
|
765 |
if (tileParameters.getDynClass().getDynField("rootFolder") != null) { |
|
766 |
tileParameters.setDynValue("rootFolder", cacheFolder); |
|
767 |
} |
|
768 |
try { |
|
769 |
dataStore.useCache("TileCache", tileParameters); |
|
770 |
} catch (DataException e) { |
|
771 |
logger.warn("Can't cache the layer.", e); |
|
772 |
} |
|
773 |
} |
|
774 |
} |
|
775 |
} |
|
776 |
|
|
777 |
Class<? extends FLayer> layerClass = this.getLayerClassFromDataStoreClass(dataStore.getClass()); |
|
778 |
if (layerClass == null) { |
|
779 |
throw new CantRetrieveLayerByStoreException(layerName, dataStore.getName()); |
|
780 |
} |
|
781 |
FLayer layer; |
|
782 |
try { |
|
783 |
layer = (FLayer) layerClass.newInstance(); |
|
784 |
} catch (InstantiationException | IllegalAccessException e) { |
|
785 |
throw new LoadLayerException(layerName, e); |
|
786 |
} |
|
787 |
|
|
788 |
layer.setName(layerName); |
|
789 |
((SingleLayer) layer).setDataStore(dataStore); |
|
790 |
if (projection != null) { |
|
791 |
layer.setProjection(projection); |
|
792 |
if( coordTrans != null ) { |
|
793 |
layer.setCoordTrans(coordTrans); |
|
794 |
} |
|
795 |
} |
|
796 |
layer.load(); |
|
797 |
return (FLayer) notifyObservers(CREATE_LAYER, layer).getValue(); |
|
798 |
} catch (Exception e) { |
|
799 |
throw new LoadLayerException(layerName, e); |
|
800 |
} |
|
801 |
} |
|
802 |
|
|
803 |
|
|
804 |
@Override |
|
638 | 805 |
public ILegend getLegend(DataStore dataStore) { |
639 | 806 |
ILegend legend = null; |
640 | 807 |
|
... | ... | |
756 | 923 |
} |
757 | 924 |
Object value = method.invoke(instance, params); |
758 | 925 |
return value; |
759 |
} catch (NoSuchMethodException ex) { |
|
926 |
} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
|
|
760 | 927 |
return null; |
761 |
} catch (SecurityException ex) { |
|
762 |
return null; |
|
763 |
} catch (IllegalAccessException ex) { |
|
764 |
return null; |
|
765 |
} catch (IllegalArgumentException ex) { |
|
766 |
return null; |
|
767 |
} catch (InvocationTargetException ex) { |
|
768 |
return null; |
|
769 | 928 |
} |
770 | 929 |
} |
771 | 930 |
|
... | ... | |
788 | 947 |
} |
789 | 948 |
} |
790 | 949 |
|
791 |
private Map iconLayers = new HashMap(); // (Map<String storeProviderName, String iconName>) |
|
792 |
|
|
950 |
@Override |
|
793 | 951 |
public void registerIconLayer(String storeProviderName, String iconName) { |
794 | 952 |
if (storeProviderName == null || iconName == null) { |
795 | 953 |
logger.info("registerIconLayer, storeProviderName or iconName are null"); |
... | ... | |
830 | 988 |
/* (non-Javadoc) |
831 | 989 |
* @see org.gvsig.fmap.mapcontext.MapContextManager#getDefaultCRS() |
832 | 990 |
*/ |
991 |
@Override |
|
833 | 992 |
public IProjection getDefaultCRS() { |
834 | 993 |
IProjection crs = CRSFactory.getCRS("EPSG:4326"); |
835 | 994 |
return (IProjection) notifyObservers(GET_DEFAULT_CRS, crs).getValue(); |
... | ... | |
843 | 1002 |
return this.observableHelper.notifyObservers(this, LOAD_LAYER, layer); |
844 | 1003 |
} |
845 | 1004 |
|
1005 |
@Override |
|
846 | 1006 |
public void addObserver(Observer o) { |
847 | 1007 |
this.observableHelper.addObserver(o); |
848 | 1008 |
} |
849 | 1009 |
|
1010 |
@Override |
|
850 | 1011 |
public void deleteObserver(Observer o) { |
851 | 1012 |
this.observableHelper.deleteObserver(o); |
852 | 1013 |
} |
853 | 1014 |
|
1015 |
@Override |
|
854 | 1016 |
public void deleteObservers() { |
855 | 1017 |
this.observableHelper.deleteObservers(); |
856 | 1018 |
} |
... | ... | |
867 | 1029 |
return this.observableHelper.notifyObservers(this, type, value1, value2, value3); |
868 | 1030 |
} |
869 | 1031 |
|
1032 |
@Override |
|
870 | 1033 |
public File getColorTableLibraryFolder() { |
871 | 1034 |
if (this.colorTableLibraryFolder == null) { |
872 | 1035 |
// Provide a default value to the location for the color |
... | ... | |
881 | 1044 |
return this.colorTableLibraryFolder; |
882 | 1045 |
} |
883 | 1046 |
|
1047 |
@Override |
|
884 | 1048 |
public void setColorTableLibraryFolder(File colorTableLibraryFolder) { |
885 | 1049 |
this.colorTableLibraryFolder = colorTableLibraryFolder; |
886 | 1050 |
} |
Also available in: Unified diff