public class DefaultMapContextManager extends java.lang.Object implements MapContextManager
MapContextManager
.MapContextManager.CreateLayerParameters
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 and Description |
---|
DefaultMapContextManager() |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer o) |
MapContextDrawer |
createDefaultMapContextDrawerInstance()
Creates a new instance of the default
MapContextDrawer
implementation. |
RasterLegend |
createDefaultRasterLegend(java.util.List<BandDescriptor> bands) |
IVectorLegend |
createDefaultVectorLegend(int shapeType) |
GraphicLayer |
createGraphicsLayer(IProjection projection)
Create a layer to be used as the
GraphicLayer . |
FLayer |
createLayer(java.lang.String layerName,
DataStore dataStore)
Create a layer from a
DataStore . |
FLayer |
createLayer(java.lang.String layerName,
DataStore dataStore,
MapContextManager.CreateLayerParameters parameters) |
FLayer |
createLayer(java.lang.String layerName,
DataStoreParameters dataParameters)
Create a new layer from the data parameters passed as parameter.
|
FLayer |
createLayer(java.lang.String layerName,
MapContextManager.CreateLayerParameters parameters) |
LayerInformationBuilder |
createLayerInformationBuilder() |
ILegend |
createLegend(java.lang.String legendName) |
ILegendReader |
createLegendReader(java.lang.String format)
Creates a legend reader for the given format ("sld", "gvsleg", etc are
extracted from the MIME long string)
|
ILegendWriter |
createLegendWriter(java.lang.Class legendClass,
java.lang.String format)
Creates a legend writer for the specified legend class
|
MapContext |
createMapContext() |
MapContextDrawer |
createMapContextDrawerInstance(java.lang.Class drawerClazz)
Creates a new instance of the provided
MapContextDrawer
implementation. |
IMultiLayerSymbol |
createMultiLayerSymbol(int shapeType) |
IMultiLayerSymbol |
createMultiLayerSymbol(java.lang.String symbolName) |
ISymbol |
createSymbol(int shapeType) |
ISymbol |
createSymbol(int shapeType,
java.awt.Color color) |
ISymbol |
createSymbol(java.lang.String symbolName) |
ISymbol |
createSymbol(java.lang.String symbolName,
java.awt.Color color) |
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
java.io.File |
getColorTableLibraryFolder() |
int |
getDefaultCartographicSupportMeasureUnit() |
int |
getDefaultCartographicSupportReferenceSystem() |
IProjection |
getDefaultCRS()
Returns the default CRS.
|
java.lang.String |
getDefaultRasterLegend() |
java.awt.Color |
getDefaultSymbolColor() |
java.awt.Color |
getDefaultSymbolFillColor() |
java.awt.Font |
getDefaultSymbolFont() |
java.lang.String |
getDefaultVectorLegend() |
javax.swing.Icon |
getIcon(int geometryType,
boolean withSelection) |
java.lang.String |
getIconLayer(DataStore store) |
java.lang.String |
getIconLayer(java.lang.String providerName) |
ILabelingStrategy |
getLabelingStrategy(DataStore dataStore)
It returns the labeling strategy associated with a
DataStore . |
ILegend |
getLegend(DataStore dataStore)
It returns the legend associated with a
DataStore . |
java.util.List<java.lang.String> |
getLegendReadingFormats()
Format is a MIME type string.
|
java.util.List<java.lang.String> |
getLegendWritingFormats()
Format is a MIME type string.
|
java.lang.String |
getSymbolFileExtension() |
java.lang.String |
getSymbolLibraryPath() |
SymbolManager |
getSymbolManager()
Returns the current
SymbolManager . |
IWarningSymbol |
getWarningSymbol(java.lang.String message,
java.lang.String symbolDesc,
int symbolDrawExceptionType) |
boolean |
isDefaultSymbolFillColorAleatory() |
ISymbol[] |
loadSymbols(java.io.File folder) |
ISymbol[] |
loadSymbols(java.io.File folder,
java.io.FileFilter filter) |
Notification |
notifyLoadLayer(FLayer layer) |
Notification |
notifyLoadMapContext(MapContext mapContext) |
protected Notification |
notifyObservers(java.lang.String type,
java.lang.Object value) |
protected Notification |
notifyObservers(java.lang.String type,
java.lang.Object value1,
java.lang.Object value2) |
protected Notification |
notifyObservers(java.lang.String type,
java.lang.Object value1,
java.lang.Object value2,
java.lang.Object value3) |
void |
registerIconLayer(java.lang.String storeProviderName,
java.lang.String iconName) |
boolean |
registerLayer(java.lang.Class theClass,
java.lang.Class<? extends FLayer> layerClass) |
boolean |
registerLayer(Factory<FLayer> factory)
Register a factory to create new layers based on the parameters
of the store and the store itself.
|
void |
registerLegend(java.lang.String legendName,
java.lang.Class legendClass) |
void |
registerLegendReader(java.lang.String format,
java.lang.Class readerClass)
Registers legend reader.
|
void |
registerLegendWriter(java.lang.Class legendClass,
java.lang.String format,
java.lang.Class writerClass)
Registers legend writer.
|
void |
registerMultiLayerSymbol(java.lang.String symbolName,
java.lang.Class symbolClass) |
void |
registerMultiLayerSymbol(java.lang.String symbolName,
int[] shapeTypes,
java.lang.Class symbolClass) |
void |
registerSymbol(java.lang.String symbolName,
java.lang.Class symbolClass) |
void |
registerSymbol(java.lang.String symbolName,
int[] shapeTypes,
java.lang.Class symbolClass) |
void |
resetDefaultSymbolColor() |
void |
resetDefaultSymbolFillColor() |
void |
resetDefaultSymbolFillColorAleatory() |
void |
resetDefaultSymbolFont() |
void |
resetSymbolLibraryPath() |
void |
saveSymbol(ISymbol symbol,
java.lang.String fileName,
java.io.File folder) |
void |
saveSymbol(ISymbol symbol,
java.lang.String fileName,
java.io.File folder,
boolean overwrite) |
void |
setColorTableLibraryFolder(java.io.File colorTableLibraryFolder) |
void |
setDefaultCartographicSupportMeasureUnit(int defaultCartographicSupportMeasureUnit) |
void |
setDefaultCartographicSupportReferenceSystem(int defaultCartographicSupportReferenceSystem) |
void |
setDefaultMapContextDrawer(java.lang.Class drawerClazz)
Sets the class to use as the default implementation for the
MapContextDrawer . |
void |
setDefaultRasterLegend(java.lang.String defaultRasterLegend) |
void |
setDefaultSymbolColor(java.awt.Color defaultSymbolColor) |
void |
setDefaultSymbolFillColor(java.awt.Color defaultSymbolFillColor) |
void |
setDefaultSymbolFillColorAleatory(boolean defaultSymbolFillColorAleatory) |
void |
setDefaultSymbolFont(java.awt.Font defaultSymbolFont) |
void |
setDefaultVectorLegend(java.lang.String defaultVectorLegend) |
void |
setSymbolFileExtension(java.lang.String extension) |
void |
setSymbolLibraryPath(java.lang.String symbolLibraryPath) |
void |
validateMapContextDrawer(java.lang.Class drawerClazz) |
public MapContext createMapContext()
createMapContext
in interface MapContextManager
public SymbolManager getSymbolManager()
MapContextManager
SymbolManager
.getSymbolManager
in interface MapContextManager
SymbolManager
public java.lang.String getSymbolLibraryPath()
getSymbolLibraryPath
in interface MapContextManager
SymbolPreferences}.
public void setSymbolLibraryPath(java.lang.String symbolLibraryPath)
setSymbolLibraryPath
in interface MapContextManager
SymbolPreferences}.
public void resetSymbolLibraryPath()
resetSymbolLibraryPath
in interface MapContextManager
SymbolPreferences}.
public java.awt.Color getDefaultSymbolColor()
getDefaultSymbolColor
in interface MapContextManager
SymbolPreferences}.
public java.awt.Color getDefaultSymbolFillColor()
getDefaultSymbolFillColor
in interface MapContextManager
SymbolPreferences}.
public java.awt.Font getDefaultSymbolFont()
getDefaultSymbolFont
in interface MapContextManager
SymbolPreferences}.
public java.lang.String getSymbolFileExtension()
public boolean isDefaultSymbolFillColorAleatory()
isDefaultSymbolFillColorAleatory
in interface MapContextManager
SymbolPreferences}.
public void resetDefaultSymbolColor()
resetDefaultSymbolColor
in interface MapContextManager
SymbolPreferences}.
public void resetDefaultSymbolFillColor()
resetDefaultSymbolFillColor
in interface MapContextManager
SymbolPreferences}.
public void resetDefaultSymbolFillColorAleatory()
resetDefaultSymbolFillColorAleatory
in interface MapContextManager
SymbolPreferences}.
public void resetDefaultSymbolFont()
resetDefaultSymbolFont
in interface MapContextManager
SymbolPreferences}.
public void setDefaultSymbolColor(java.awt.Color defaultSymbolColor)
setDefaultSymbolColor
in interface MapContextManager
SymbolPreferences}.
public void setDefaultSymbolFillColor(java.awt.Color defaultSymbolFillColor)
setDefaultSymbolFillColor
in interface MapContextManager
SymbolPreferences}.
public void setDefaultSymbolFillColorAleatory(boolean defaultSymbolFillColorAleatory)
setDefaultSymbolFillColorAleatory
in interface MapContextManager
SymbolPreferences}.
public void setDefaultSymbolFont(java.awt.Font defaultSymbolFont)
setDefaultSymbolFont
in interface MapContextManager
SymbolPreferences}.
public void setSymbolFileExtension(java.lang.String extension)
public int getDefaultCartographicSupportMeasureUnit()
getDefaultCartographicSupportMeasureUnit
in interface MapContextManager
SymbolPreferences}.
public void setDefaultCartographicSupportMeasureUnit(int defaultCartographicSupportMeasureUnit)
setDefaultCartographicSupportMeasureUnit
in interface MapContextManager
SymbolPreferences}.
public int getDefaultCartographicSupportReferenceSystem()
getDefaultCartographicSupportReferenceSystem
in interface MapContextManager
SymbolPreferences}.
public void setDefaultCartographicSupportReferenceSystem(int defaultCartographicSupportReferenceSystem)
setDefaultCartographicSupportReferenceSystem
in interface MapContextManager
SymbolPreferences}.
public MapContextDrawer createMapContextDrawerInstance(java.lang.Class drawerClazz) throws MapContextException
MapContextManager
MapContextDrawer
implementation.createMapContextDrawerInstance
in interface MapContextManager
drawerClazz
- the MapContextDrawer
implementation classMapContextDrawer
instanceMapContextException
- if there is an error creating the new object
instancepublic MapContextDrawer createDefaultMapContextDrawerInstance() throws MapContextException
MapContextManager
MapContextDrawer
implementation.createDefaultMapContextDrawerInstance
in interface MapContextManager
MapContextDrawer
instanceMapContextException
- if there is an error creating the new object
instancepublic void setDefaultMapContextDrawer(java.lang.Class drawerClazz) throws MapContextException
MapContextManager
MapContextDrawer
.setDefaultMapContextDrawer
in interface MapContextManager
drawerClazz
- the MapContextDrawer
class to useMapContextException
- if there is any error setting the classpublic void validateMapContextDrawer(java.lang.Class drawerClazz) throws MapContextException
validateMapContextDrawer
in interface MapContextManager
MapContextException
public GraphicLayer createGraphicsLayer(IProjection projection)
MapContextManager
GraphicLayer
.createGraphicsLayer
in interface MapContextManager
projection
- used in the layer.GraphicLayer
.public java.lang.String getDefaultVectorLegend()
getDefaultVectorLegend
in interface MapContextManager
public void setDefaultVectorLegend(java.lang.String defaultVectorLegend)
setDefaultVectorLegend
in interface MapContextManager
public java.lang.String getDefaultRasterLegend()
getDefaultRasterLegend
in interface MapContextManager
public void setDefaultRasterLegend(java.lang.String defaultRasterLegend)
setDefaultRasterLegend
in interface MapContextManager
public void registerLegend(java.lang.String legendName, java.lang.Class legendClass) throws MapContextRuntimeException
registerLegend
in interface MapContextManager
MapContextRuntimeException
public ILegend createLegend(java.lang.String legendName) throws MapContextRuntimeException
createLegend
in interface MapContextManager
MapContextRuntimeException
public IVectorLegend createDefaultVectorLegend(int shapeType) throws MapContextRuntimeException
createDefaultVectorLegend
in interface MapContextManager
MapContextRuntimeException
public RasterLegend createDefaultRasterLegend(java.util.List<BandDescriptor> bands) throws MapContextRuntimeException
createDefaultRasterLegend
in interface MapContextManager
MapContextRuntimeException
public java.util.List<java.lang.String> getLegendReadingFormats()
MapContextManager
getLegendReadingFormats
in interface MapContextManager
public java.util.List<java.lang.String> getLegendWritingFormats()
MapContextManager
getLegendWritingFormats
in interface MapContextManager
public void registerLegendReader(java.lang.String format, java.lang.Class readerClass) throws MapContextRuntimeException
MapContextManager
registerLegendReader
in interface MapContextManager
MapContextRuntimeException
public void registerLegendWriter(java.lang.Class legendClass, java.lang.String format, java.lang.Class writerClass) throws MapContextRuntimeException
MapContextManager
registerLegendWriter
in interface MapContextManager
legendClass
- Legend classformat
- File type in mime format.writerClass
- Class object of the writerMapContextRuntimeException
public ILegendReader createLegendReader(java.lang.String format) throws MapContextRuntimeException
MapContextManager
createLegendReader
in interface MapContextManager
MapContextRuntimeException
public ILegendWriter createLegendWriter(java.lang.Class legendClass, java.lang.String format) throws MapContextRuntimeException
MapContextManager
createLegendWriter
in interface MapContextManager
MapContextRuntimeException
public IMultiLayerSymbol createMultiLayerSymbol(int shapeType) throws MapContextRuntimeException
createMultiLayerSymbol
in interface MapContextManager
MapContextRuntimeException
public IMultiLayerSymbol createMultiLayerSymbol(java.lang.String symbolName) throws MapContextRuntimeException
createMultiLayerSymbol
in interface MapContextManager
MapContextRuntimeException
public ISymbol createSymbol(int shapeType, java.awt.Color color) throws MapContextRuntimeException
createSymbol
in interface MapContextManager
MapContextRuntimeException
public ISymbol createSymbol(int shapeType) throws MapContextRuntimeException
createSymbol
in interface MapContextManager
MapContextRuntimeException
public ISymbol createSymbol(java.lang.String symbolName, java.awt.Color color) throws MapContextRuntimeException
createSymbol
in interface MapContextManager
MapContextRuntimeException
public ISymbol createSymbol(java.lang.String symbolName) throws MapContextRuntimeException
createSymbol
in interface MapContextManager
MapContextRuntimeException
public IWarningSymbol getWarningSymbol(java.lang.String message, java.lang.String symbolDesc, int symbolDrawExceptionType) throws MapContextRuntimeException
getWarningSymbol
in interface MapContextManager
MapContextRuntimeException
public ISymbol[] loadSymbols(java.io.File folder, java.io.FileFilter filter) throws SymbolException
SymbolException
public ISymbol[] loadSymbols(java.io.File folder) throws SymbolException
SymbolException
public void registerMultiLayerSymbol(java.lang.String symbolName, java.lang.Class symbolClass) throws MapContextRuntimeException
registerMultiLayerSymbol
in interface MapContextManager
MapContextRuntimeException
public void registerMultiLayerSymbol(java.lang.String symbolName, int[] shapeTypes, java.lang.Class symbolClass) throws MapContextRuntimeException
registerMultiLayerSymbol
in interface MapContextManager
MapContextRuntimeException
public void registerSymbol(java.lang.String symbolName, java.lang.Class symbolClass) throws MapContextRuntimeException
registerSymbol
in interface MapContextManager
MapContextRuntimeException
public void registerSymbol(java.lang.String symbolName, int[] shapeTypes, java.lang.Class symbolClass) throws MapContextException
registerSymbol
in interface MapContextManager
MapContextException
public void saveSymbol(ISymbol symbol, java.lang.String fileName, java.io.File folder, boolean overwrite) throws SymbolException
SymbolException
public void saveSymbol(ISymbol symbol, java.lang.String fileName, java.io.File folder) throws SymbolException
SymbolException
public boolean registerLayer(java.lang.Class theClass, java.lang.Class<? extends FLayer> layerClass)
registerLayer
in interface MapContextManager
public boolean registerLayer(Factory<FLayer> factory)
MapContextManager
registerLayer
in interface MapContextManager
public FLayer createLayer(java.lang.String layerName, DataStoreParameters dataParameters) throws LoadLayerException
MapContextManager
createLayer
in interface MapContextManager
layerName
- name used in for the new layer.dataParameters
- used for create the DataStore
of the new layerLoadLayerException
public FLayer createLayer(java.lang.String layerName, DataStore dataStore) throws LoadLayerException
MapContextManager
DataStore
.createLayer
in interface MapContextManager
layerName
- name used in for the new layer.dataStore
- used for the new layerLoadLayerException
public FLayer createLayer(java.lang.String layerName, MapContextManager.CreateLayerParameters parameters) throws LoadLayerException
createLayer
in interface MapContextManager
LoadLayerException
public FLayer createLayer(java.lang.String layerName, DataStore dataStore, MapContextManager.CreateLayerParameters parameters) throws LoadLayerException
createLayer
in interface MapContextManager
LoadLayerException
public ILegend getLegend(DataStore dataStore)
MapContextManager
DataStore
. If the legend
doesn't exist it returns null
.getLegend
in interface MapContextManager
dataStore
- the store that could have a legend.null
.public ILabelingStrategy getLabelingStrategy(DataStore dataStore)
MapContextManager
DataStore
. If
the labeling strategy doesn't exist it returns null
.getLabelingStrategy
in interface MapContextManager
dataStore
- the store that could have a labeling strategy.null
.public void registerIconLayer(java.lang.String storeProviderName, java.lang.String iconName)
registerIconLayer
in interface MapContextManager
public java.lang.String getIconLayer(DataStore store)
getIconLayer
in interface MapContextManager
public java.lang.String getIconLayer(java.lang.String providerName)
getIconLayer
in interface MapContextManager
public IProjection getDefaultCRS()
MapContextManager
getDefaultCRS
in interface MapContextManager
public Notification notifyLoadMapContext(MapContext mapContext)
public Notification notifyLoadLayer(FLayer layer)
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
protected Notification notifyObservers(java.lang.String type, java.lang.Object value)
protected Notification notifyObservers(java.lang.String type, java.lang.Object value1, java.lang.Object value2)
protected Notification notifyObservers(java.lang.String type, java.lang.Object value1, java.lang.Object value2, java.lang.Object value3)
public java.io.File getColorTableLibraryFolder()
getColorTableLibraryFolder
in interface MapContextManager
public void setColorTableLibraryFolder(java.io.File colorTableLibraryFolder)
setColorTableLibraryFolder
in interface MapContextManager
public LayerInformationBuilder createLayerInformationBuilder()
createLayerInformationBuilder
in interface MapContextManager
public javax.swing.Icon getIcon(int geometryType, boolean withSelection)
getIcon
in interface MapContextManager