Package org.gvsig.fmap.mapcontext.impl
Class DefaultMapContextManager
java.lang.Object
org.gvsig.fmap.mapcontext.impl.DefaultMapContextManager
- All Implemented Interfaces:
MapContextManager,org.gvsig.tools.observer.Observable
Default implementation of the
MapContextManager.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gvsig.fmap.mapcontext.MapContextManager
MapContextManager.CreateLayerParameters -
Field Summary
Fields inherited from interface org.gvsig.fmap.mapcontext.MapContextManager
CREATE_GRAPHICS_LAYER, CREATE_LAYER, CREATE_LEGEND, CREATE_LEGEND_READER, CREATE_MAPCONTEXT, CREATE_MAPCONTEXT_DRAWER, CREATE_SYMBOL, GET_DEFAULT_CRS, LOAD_LAYER, LOAD_MAPCONTEXT, LOAD_SYMBOLS, REGISTER_ICON_LAYER, REGISTER_LEGEND, REGISTER_LEGEND_READER, REGISTER_LEGEND_WRITER, REGISTER_MULTILAYER_SYMBOL, REGISTER_SYMBOL, SET_MAPCONTEXT_DRAWER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(org.gvsig.tools.observer.Observer o) Creates a new instance of the defaultMapContextDrawerimplementation.createDefaultRasterLegend(List<org.gvsig.fmap.dal.raster.BandDescriptor> bands) createDefaultVectorLegend(int shapeType) createGraphicsLayer(org.gvsig.crs.projection.lib.Projection projection) Create a layer to be used as theGraphicLayer.createLayer(String layerName, org.gvsig.fmap.dal.DataStore dataStore) Create a layer from aDataStore.createLayer(String layerName, org.gvsig.fmap.dal.DataStoreParameters dataParameters) Create a new layer from the data parameters passed as parameter.createLayer(String layerName, org.gvsig.fmap.dal.DataStore dataStore, MapContextManager.CreateLayerParameters parameters) createLayer(String layerName, MapContextManager.CreateLayerParameters parameters) createLegend(String legendName) createLegendReader(String format) Creates a legend reader for the given format ("sld", "gvsleg", etc are extracted from the MIME long string)createLegendWriter(Class legendClass, String format) Creates a legend writer for the specified legend classcreateMapContextDrawerInstance(Class drawerClazz) Creates a new instance of the providedMapContextDrawerimplementation.createMultiLayerSymbol(int shapeType) createMultiLayerSymbol(String symbolName) createSymbol(int shapeType) createSymbol(int shapeType, Color color) createSymbol(String symbolName) createSymbol(String symbolName, Color color) voiddeleteObserver(org.gvsig.tools.observer.Observer o) voidintintorg.gvsig.crs.projection.lib.ProjectionReturns the default CRS.getIcon(int geometryType, boolean withSelection) getIconLayer(String providerName) getIconLayer(org.gvsig.fmap.dal.DataStore store) getLabelingStrategy(org.gvsig.fmap.dal.DataStore dataStore) It returns the labeling strategy associated with aDataStore.getLegend(org.gvsig.fmap.dal.DataStore dataStore) It returns the legend associated with aDataStore.Format is a MIME type string.Format is a MIME type string.Returns the currentSymbolManager.getWarningSymbol(String message, String symbolDesc, int symbolDrawExceptionType) booleanISymbol[]loadSymbols(File folder) ISymbol[]loadSymbols(File folder, FileFilter filter) org.gvsig.tools.observer.NotificationnotifyLoadLayer(FLayer layer) org.gvsig.tools.observer.NotificationnotifyLoadMapContext(MapContext mapContext) protected org.gvsig.tools.observer.NotificationnotifyObservers(String type, Object value) protected org.gvsig.tools.observer.NotificationnotifyObservers(String type, Object value1, Object value2) protected org.gvsig.tools.observer.NotificationnotifyObservers(String type, Object value1, Object value2, Object value3) voidregisterIconLayer(String storeProviderName, String iconName) booleanregisterLayer(Class theClass, Class<? extends FLayer> layerClass) booleanregisterLayer(org.gvsig.tools.util.Factory<FLayer> factory) Register a factory to create new layers based on the parameters of the store and the store itself.voidregisterLegend(String legendName, Class legendClass) voidregisterLegendReader(String format, Class readerClass) Registers legend reader.voidregisterLegendWriter(Class legendClass, String format, Class writerClass) Registers legend writer.voidregisterMultiLayerSymbol(String symbolName, int[] shapeTypes, Class symbolClass) voidregisterMultiLayerSymbol(String symbolName, Class symbolClass) voidregisterSymbol(String symbolName, int[] shapeTypes, Class symbolClass) voidregisterSymbol(String symbolName, Class symbolClass) voidvoidvoidvoidvoidvoidsaveSymbol(ISymbol symbol, String fileName, File folder) voidsaveSymbol(ISymbol symbol, String fileName, File folder, boolean overwrite) voidsetColorTableLibraryFolder(File colorTableLibraryFolder) voidsetDefaultCartographicSupportMeasureUnit(int defaultCartographicSupportMeasureUnit) voidsetDefaultCartographicSupportReferenceSystem(int defaultCartographicSupportReferenceSystem) voidsetDefaultMapContextDrawer(Class drawerClazz) Sets the class to use as the default implementation for theMapContextDrawer.voidsetDefaultRasterLegend(String defaultRasterLegend) voidsetDefaultSymbolColor(Color defaultSymbolColor) voidsetDefaultSymbolFillColor(Color defaultSymbolFillColor) voidsetDefaultSymbolFillColorAleatory(boolean defaultSymbolFillColorAleatory) voidsetDefaultSymbolFont(Font defaultSymbolFont) voidsetDefaultVectorLegend(String defaultVectorLegend) voidsetSymbolFileExtension(String extension) voidsetSymbolLibraryPath(String symbolLibraryPath) voidvalidateMapContextDrawer(Class drawerClazz)
-
Constructor Details
-
DefaultMapContextManager
public DefaultMapContextManager()
-
-
Method Details
-
createMapContext
- Specified by:
createMapContextin interfaceMapContextManager
-
getSymbolManager
Description copied from interface:MapContextManagerReturns the currentSymbolManager.- Specified by:
getSymbolManagerin interfaceMapContextManager- Returns:
- the
SymbolManager
-
getSymbolLibraryPath
- Specified by:
getSymbolLibraryPathin interfaceMapContextManager- Returns:
- @Deprecated to be removed in gvSIG 2.0
-
setSymbolLibraryPath
- Specified by:
setSymbolLibraryPathin interfaceMapContextManager- Parameters:
symbolLibraryPath-
-
resetSymbolLibraryPath
public void resetSymbolLibraryPath()- Specified by:
resetSymbolLibraryPathin interfaceMapContextManager
-
getDefaultSymbolColor
- Specified by:
getDefaultSymbolColorin interfaceMapContextManager- Returns:
- @Deprecated to be removed in gvSIG 2.0
-
getDefaultSymbolFillColor
- Specified by:
getDefaultSymbolFillColorin interfaceMapContextManager- Returns:
- @Deprecated to be removed in gvSIG 2.0
-
getDefaultSymbolFont
- Specified by:
getDefaultSymbolFontin interfaceMapContextManager- Returns:
- @Deprecated to be removed in gvSIG 2.0
-
getSymbolFileExtension
-
isDefaultSymbolFillColorAleatory
public boolean isDefaultSymbolFillColorAleatory()- Specified by:
isDefaultSymbolFillColorAleatoryin interfaceMapContextManager- Returns:
- @Deprecated to be removed in gvSIG 2.0
-
resetDefaultSymbolColor
public void resetDefaultSymbolColor()- Specified by:
resetDefaultSymbolColorin interfaceMapContextManager
-
resetDefaultSymbolFillColor
public void resetDefaultSymbolFillColor()- Specified by:
resetDefaultSymbolFillColorin interfaceMapContextManager
-
resetDefaultSymbolFillColorAleatory
public void resetDefaultSymbolFillColorAleatory()- Specified by:
resetDefaultSymbolFillColorAleatoryin interfaceMapContextManager
-
resetDefaultSymbolFont
public void resetDefaultSymbolFont()- Specified by:
resetDefaultSymbolFontin interfaceMapContextManager
-
setDefaultSymbolColor
- Specified by:
setDefaultSymbolColorin interfaceMapContextManager- Parameters:
defaultSymbolColor-
-
setDefaultSymbolFillColor
- Specified by:
setDefaultSymbolFillColorin interfaceMapContextManager- Parameters:
defaultSymbolFillColor-
-
setDefaultSymbolFillColorAleatory
public void setDefaultSymbolFillColorAleatory(boolean defaultSymbolFillColorAleatory) - Specified by:
setDefaultSymbolFillColorAleatoryin interfaceMapContextManager- Parameters:
defaultSymbolFillColorAleatory-
-
setDefaultSymbolFont
- Specified by:
setDefaultSymbolFontin interfaceMapContextManager- Parameters:
defaultSymbolFont-
-
setSymbolFileExtension
-
getDefaultCartographicSupportMeasureUnit
public int getDefaultCartographicSupportMeasureUnit()- Specified by:
getDefaultCartographicSupportMeasureUnitin interfaceMapContextManager- Returns:
- @Deprecated to be removed in gvSIG 2.0
-
setDefaultCartographicSupportMeasureUnit
public void setDefaultCartographicSupportMeasureUnit(int defaultCartographicSupportMeasureUnit) - Specified by:
setDefaultCartographicSupportMeasureUnitin interfaceMapContextManager- Parameters:
defaultCartographicSupportMeasureUnit-
-
getDefaultCartographicSupportReferenceSystem
public int getDefaultCartographicSupportReferenceSystem()- Specified by:
getDefaultCartographicSupportReferenceSystemin interfaceMapContextManager- Returns:
- @Deprecated to be removed in gvSIG 2.0
-
setDefaultCartographicSupportReferenceSystem
public void setDefaultCartographicSupportReferenceSystem(int defaultCartographicSupportReferenceSystem) - Specified by:
setDefaultCartographicSupportReferenceSystemin interfaceMapContextManager- Parameters:
defaultCartographicSupportReferenceSystem-
-
createMapContextDrawerInstance
public MapContextDrawer createMapContextDrawerInstance(Class drawerClazz) throws MapContextException Description copied from interface:MapContextManagerCreates a new instance of the providedMapContextDrawerimplementation.- Specified by:
createMapContextDrawerInstancein interfaceMapContextManager- Parameters:
drawerClazz- theMapContextDrawerimplementation class- Returns:
- the new
MapContextDrawerinstance - Throws:
MapContextException- if there is an error creating the new object instance
-
createDefaultMapContextDrawerInstance
Description copied from interface:MapContextManagerCreates a new instance of the defaultMapContextDrawerimplementation.- Specified by:
createDefaultMapContextDrawerInstancein interfaceMapContextManager- Returns:
- the new
MapContextDrawerinstance - Throws:
MapContextException- if there is an error creating the new object instance
-
setDefaultMapContextDrawer
Description copied from interface:MapContextManagerSets the class to use as the default implementation for theMapContextDrawer.- Specified by:
setDefaultMapContextDrawerin interfaceMapContextManager- Parameters:
drawerClazz- theMapContextDrawerclass to use- Throws:
MapContextException- if there is any error setting the class
-
validateMapContextDrawer
- Specified by:
validateMapContextDrawerin interfaceMapContextManager- Throws:
MapContextException
-
createGraphicsLayer
Description copied from interface:MapContextManagerCreate a layer to be used as theGraphicLayer.- Specified by:
createGraphicsLayerin interfaceMapContextManager- Parameters:
projection- used in the layer.- Returns:
- the new
GraphicLayer.
-
getDefaultVectorLegend
- Specified by:
getDefaultVectorLegendin interfaceMapContextManager
-
setDefaultVectorLegend
- Specified by:
setDefaultVectorLegendin interfaceMapContextManager
-
getDefaultRasterLegend
- Specified by:
getDefaultRasterLegendin interfaceMapContextManager
-
setDefaultRasterLegend
- Specified by:
setDefaultRasterLegendin interfaceMapContextManager
-
registerLegend
- Specified by:
registerLegendin interfaceMapContextManager- Throws:
MapContextRuntimeException
-
createLegend
- Specified by:
createLegendin interfaceMapContextManager- Throws:
MapContextRuntimeException
-
createDefaultVectorLegend
- Specified by:
createDefaultVectorLegendin interfaceMapContextManager- Throws:
MapContextRuntimeException
-
createDefaultRasterLegend
public RasterLegend createDefaultRasterLegend(List<org.gvsig.fmap.dal.raster.BandDescriptor> bands) throws MapContextRuntimeException - Specified by:
createDefaultRasterLegendin interfaceMapContextManager- Throws:
MapContextRuntimeException
-
getLegendReadingFormats
Description copied from interface:MapContextManagerFormat is a MIME type string. Examples: "application/zip; subtype=gvsleg", "text/xml; subtype=sld/1.0.0", "text/xml; subtype=sld/1.1.0",- Specified by:
getLegendReadingFormatsin interfaceMapContextManager- Returns:
- A list of Strings with the available formats for reading legends
-
getLegendWritingFormats
Description copied from interface:MapContextManagerFormat is a MIME type string. Examples: "application/zip; subtype=gvsleg", "text/xml; subtype=sld/1.0.0", "text/xml; subtype=sld/1.1.0",- Specified by:
getLegendWritingFormatsin interfaceMapContextManager- Returns:
- A list of Strings with the available formats for writing legends
-
registerLegendReader
public void registerLegendReader(String format, Class readerClass) throws MapContextRuntimeException Description copied from interface:MapContextManagerRegisters legend reader. Format is a MIME type string. Examples: "application/zip; subtype=gvsleg", "text/xml; subtype=sld/1.0.0", "text/xml; subtype=sld/1.1.0",- Specified by:
registerLegendReaderin interfaceMapContextManager- Parameters:
format-readerClass-- Throws:
MapContextRuntimeException
-
registerLegendWriter
public void registerLegendWriter(Class legendClass, String format, Class writerClass) throws MapContextRuntimeException Description copied from interface:MapContextManagerRegisters legend writer. Format is a MIME type string. Examples: "application/zip; subtype=gvsleg", "text/xml; subtype=sld/1.0.0", "text/xml; subtype=sld/1.1.0",- Specified by:
registerLegendWriterin interfaceMapContextManager- Parameters:
legendClass- Legend classformat- File type in mime format.writerClass- Class object of the writer- Throws:
MapContextRuntimeException
-
createLegendReader
Description copied from interface:MapContextManagerCreates a legend reader for the given format ("sld", "gvsleg", etc are extracted from the MIME long string)- Specified by:
createLegendReaderin interfaceMapContextManager- Parameters:
format-- Returns:
- Throws:
MapContextRuntimeException
-
createLegendWriter
public ILegendWriter createLegendWriter(Class legendClass, String format) throws MapContextRuntimeException Description copied from interface:MapContextManagerCreates a legend writer for the specified legend class- Specified by:
createLegendWriterin interfaceMapContextManager- Parameters:
legendClass-format-- Returns:
- Throws:
MapContextRuntimeException
-
createMultiLayerSymbol
- Specified by:
createMultiLayerSymbolin interfaceMapContextManager- Parameters:
shapeType-- Returns:
- Throws:
MapContextRuntimeException
-
createMultiLayerSymbol
public IMultiLayerSymbol createMultiLayerSymbol(String symbolName) throws MapContextRuntimeException - Specified by:
createMultiLayerSymbolin interfaceMapContextManager- Parameters:
symbolName-- Returns:
- Throws:
MapContextRuntimeException
-
createSymbol
- Specified by:
createSymbolin interfaceMapContextManager- Parameters:
shapeType-color-- Returns:
- Throws:
MapContextRuntimeException
-
createSymbol
- Specified by:
createSymbolin interfaceMapContextManager- Parameters:
shapeType-- Returns:
- Throws:
MapContextRuntimeException
-
createSymbol
- Specified by:
createSymbolin interfaceMapContextManager- Parameters:
symbolName-color-- Returns:
- Throws:
MapContextRuntimeException
-
createSymbol
- Specified by:
createSymbolin interfaceMapContextManager- Parameters:
symbolName-- Returns:
- Throws:
MapContextRuntimeException
-
getWarningSymbol
public IWarningSymbol getWarningSymbol(String message, String symbolDesc, int symbolDrawExceptionType) throws MapContextRuntimeException - Specified by:
getWarningSymbolin interfaceMapContextManager- Parameters:
message-symbolDesc-symbolDrawExceptionType-- Returns:
- Throws:
MapContextRuntimeException
-
loadSymbols
- Throws:
SymbolException
-
loadSymbols
- Throws:
SymbolException
-
registerMultiLayerSymbol
public void registerMultiLayerSymbol(String symbolName, Class symbolClass) throws MapContextRuntimeException - Specified by:
registerMultiLayerSymbolin interfaceMapContextManager- Parameters:
symbolName-symbolClass-- Throws:
MapContextRuntimeException
-
registerMultiLayerSymbol
public void registerMultiLayerSymbol(String symbolName, int[] shapeTypes, Class symbolClass) throws MapContextRuntimeException - Specified by:
registerMultiLayerSymbolin interfaceMapContextManager- Parameters:
symbolName-shapeTypes-symbolClass-- Throws:
MapContextRuntimeException
-
registerSymbol
- Specified by:
registerSymbolin interfaceMapContextManager- Parameters:
symbolName-symbolClass-- Throws:
MapContextRuntimeException
-
registerSymbol
public void registerSymbol(String symbolName, int[] shapeTypes, Class symbolClass) throws MapContextException - Specified by:
registerSymbolin interfaceMapContextManager- Parameters:
symbolName-shapeTypes-symbolClass-- Throws:
MapContextException
-
saveSymbol
public void saveSymbol(ISymbol symbol, String fileName, File folder, boolean overwrite) throws SymbolException - Throws:
SymbolException
-
saveSymbol
- Throws:
SymbolException
-
registerLayer
- Specified by:
registerLayerin interfaceMapContextManager
-
registerLayer
Description copied from interface:MapContextManagerRegister a factory to create new layers based on the parameters of the store and the store itself. If the factory cannot create the layer, it returns null without throwing an exception. The returned layer must be fully initialized.- Specified by:
registerLayerin interfaceMapContextManager- Parameters:
factory-- Returns:
-
createLayer
public FLayer createLayer(String layerName, org.gvsig.fmap.dal.DataStoreParameters dataParameters) throws LoadLayerException Description copied from interface:MapContextManagerCreate a new layer from the data parameters passed as parameter.- Specified by:
createLayerin interfaceMapContextManager- Parameters:
layerName- name used in for the new layer.dataParameters- used for create theDataStoreof the new layer- Returns:
- the new FLayer
- Throws:
LoadLayerException
-
createLayer
public FLayer createLayer(String layerName, org.gvsig.fmap.dal.DataStore dataStore) throws LoadLayerException Description copied from interface:MapContextManagerCreate a layer from aDataStore.- Specified by:
createLayerin interfaceMapContextManager- Parameters:
layerName- name used in for the new layer.dataStore- used for the new layer- Returns:
- the new FLayer
- Throws:
LoadLayerException
-
createLayer
public FLayer createLayer(String layerName, MapContextManager.CreateLayerParameters parameters) throws LoadLayerException - Specified by:
createLayerin interfaceMapContextManager- Throws:
LoadLayerException
-
createLayer
public FLayer createLayer(String layerName, org.gvsig.fmap.dal.DataStore dataStore, MapContextManager.CreateLayerParameters parameters) throws LoadLayerException - Specified by:
createLayerin interfaceMapContextManager- Throws:
LoadLayerException
-
getLegend
Description copied from interface:MapContextManagerIt returns the legend associated with aDataStore. If the legend doesn't exist it returnsnull.- Specified by:
getLegendin interfaceMapContextManager- Parameters:
dataStore- the store that could have a legend.- Returns:
- the legend or
null.
-
getLabelingStrategy
Description copied from interface:MapContextManagerIt returns the labeling strategy associated with aDataStore. If the labeling strategy doesn't exist it returnsnull.- Specified by:
getLabelingStrategyin interfaceMapContextManager- Parameters:
dataStore- the store that could have a labeling strategy.- Returns:
- the labeling strategy or
null.
-
registerIconLayer
- Specified by:
registerIconLayerin interfaceMapContextManager
-
getIconLayer
- Specified by:
getIconLayerin interfaceMapContextManager
-
getIconLayer
- Specified by:
getIconLayerin interfaceMapContextManager
-
getDefaultCRS
public org.gvsig.crs.projection.lib.Projection getDefaultCRS()Description copied from interface:MapContextManagerReturns the default CRS. This is NOT taken from the app preferences because this is a library. It is a "hard-coded" default CRS, used as a last resort.- Specified by:
getDefaultCRSin interfaceMapContextManager- Returns:
- the default CRS
-
notifyLoadMapContext
-
notifyLoadLayer
-
addObserver
public void addObserver(org.gvsig.tools.observer.Observer o) - Specified by:
addObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObserver
public void deleteObserver(org.gvsig.tools.observer.Observer o) - Specified by:
deleteObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObservers
public void deleteObservers()- Specified by:
deleteObserversin interfaceorg.gvsig.tools.observer.Observable
-
notifyObservers
-
notifyObservers
-
notifyObservers
-
getColorTableLibraryFolder
- Specified by:
getColorTableLibraryFolderin interfaceMapContextManager
-
setColorTableLibraryFolder
- Specified by:
setColorTableLibraryFolderin interfaceMapContextManager
-
createLayerInformationBuilder
- Specified by:
createLayerInformationBuilderin interfaceMapContextManager
-
getIcon
- Specified by:
getIconin interfaceMapContextManager
-