public class DefaultSymbolManager extends Object implements SymbolManager
SymbolManager implementation.| Modifier and Type | Class and Description |
|---|---|
class |
DefaultSymbolManager.SymbolsLoaderTask |
LABELINGSTRATEGY_FILE_EXTENSION, LEGEND_FILE_EXTENSION| Constructor and Description |
|---|
DefaultSymbolManager() |
| Modifier and Type | Method and Description |
|---|---|
IMultiLayerSymbol |
createMultiLayerSymbol(int shapeType)
Creates a new
IMultiLayerSymbol which can be used to render the
given Geometry type. |
IMultiLayerSymbol |
createMultiLayerSymbol(String symbolName)
Creates a new
IMultiLayerSymbol. |
ISymbol |
createSymbol(int shapeType)
|
ISymbol |
createSymbol(int shapeType,
Color color)
|
ISymbol |
createSymbol(String symbolName)
Creates a new
ISymbol. |
ISymbol |
createSymbol(String symbolName,
Color color)
|
static Color |
darker(Color col) |
ISymbol |
getSymbol(String libraryName,
String symbolID) |
List |
getSymbolLibraryNames() |
SymbolPreferences |
getSymbolPreferences()
Returns the current
SymbolPreferences. |
IWarningSymbol |
getWarningSymbol(String message,
String symbolDesc,
int symbolDrawExceptionType)
Returns an instance of
IWarningSymbol. |
static Color |
invert(Color col) |
static Color |
lighter(Color col) |
ISymbol[] |
loadSymbols(File folder)
Loads the symbols persisted into a folder.
|
ISymbol[] |
loadSymbols(File folder,
FileFilter fileFilter)
Loads the symbols persisted into a folder.
|
CancellableTask |
loadSymbols(File folder,
FileFilter filter,
Visitor visitor) |
void |
registerMultiLayerSymbol(String symbolName,
Class symbolClass)
Registers a
IMultiLayerSymbol implementation class with a name. |
void |
registerMultiLayerSymbol(String symbolName,
int[] shapeTypes,
Class symbolClass)
Registers a
IMultiLayerSymbol implementation class with a name
and a list of geometry types which the symbol is able to render. |
void |
registerSymbol(String symbolName,
Class symbolClass)
Registers a
ISymbol implementation class with a name. |
void |
registerSymbol(String symbolName,
int[] shapeTypes,
Class symbolClass)
Registers a
ISymbol implementation class with a name and a list
of geometry types which the symbol is able to render. |
void |
saveSymbol(ISymbol symbol,
String fileName,
File folder)
Persists a
ISymbol into the given folder, with the given file
name. |
void |
saveSymbol(ISymbol symbol,
String fileName,
File folder,
boolean overwrite)
Persists a
ISymbol into the given folder, with the given file
name. |
void |
setSymbolPreferences(SymbolPreferences symbolPreferences) |
public ISymbol[] loadSymbols(File folder) throws SymbolException
SymbolManagerPersistenceManager, loading all files
found into the folder.loadSymbols in interface SymbolManagerfolder - to load the persisted symbols fromSymbolException - if there is an error loading the symbolspublic ISymbol[] loadSymbols(File folder, FileFilter fileFilter) throws SymbolException
SymbolManagerPersistenceManager, loading the files
found into the folder which apply to the provided filter.loadSymbols in interface SymbolManagerfolder - to load the persisted symbols fromfileFilter - to apply to know which files to loadSymbolException - if there is an error loading the symbolspublic CancellableTask loadSymbols(File folder, FileFilter filter, Visitor visitor)
loadSymbols in interface SymbolManagerpublic void saveSymbol(ISymbol symbol, String fileName, File folder) throws SymbolException
SymbolManagerISymbol into the given folder, with the given file
name.saveSymbol in interface SymbolManagersymbol - to persistfileName - of the file to createfolder - where to create the fileSymbolException - if there is an error persisting the symbol, or the file to
create already existspublic void saveSymbol(ISymbol symbol, String fileName, File folder, boolean overwrite) throws SymbolException
SymbolManagerISymbol into the given folder, with the given file
name.saveSymbol in interface SymbolManagersymbol - to persistfileName - of the file to createfolder - where to create the fileoverwrite - what to do if the file to create already existsSymbolException - if there is an error persisting the symbol, or the file to
create already exists and overwrite is falsepublic SymbolPreferences getSymbolPreferences()
SymbolManagerSymbolPreferences.getSymbolPreferences in interface SymbolManagerSymbolPreferencespublic ISymbol createSymbol(String symbolName) throws MapContextRuntimeException
SymbolManagerISymbol.createSymbol in interface SymbolManagersymbolName - the name of the symbol to createISymbolMapContextRuntimeException - if there is an error creating the symbolpublic ISymbol createSymbol(int shapeType) throws MapContextRuntimeException
SymbolManagercreateSymbol in interface SymbolManagershapeType - the Geometry type to renderISymbolMapContextRuntimeException - if there is an error creating the symbolpublic ISymbol createSymbol(String symbolName, Color color) throws MapContextRuntimeException
SymbolManagercreateSymbol in interface SymbolManagersymbolName - the name of the symbol to createcolor - the color for the symbolISymbolMapContextRuntimeException - if there is an error creating the symbolpublic ISymbol createSymbol(int shapeType, Color color) throws MapContextRuntimeException
SymbolManagercreateSymbol in interface SymbolManagershapeType - the Geometry type to rendercolor - the color for the symbolISymbolMapContextRuntimeException - if there is an error creating the symbolpublic IMultiLayerSymbol createMultiLayerSymbol(String symbolName) throws MapContextRuntimeException
SymbolManagerIMultiLayerSymbol.createMultiLayerSymbol in interface SymbolManagersymbolName - the name of the symbol to createIMultiLayerSymbolMapContextRuntimeException - if there is an error creating the symbolpublic IMultiLayerSymbol createMultiLayerSymbol(int shapeType) throws MapContextRuntimeException
SymbolManagerIMultiLayerSymbol which can be used to render the
given Geometry type.createMultiLayerSymbol in interface SymbolManagershapeType - the Geometry type to renderIMultiLayerSymbolMapContextRuntimeException - if there is an error creating the symbolpublic void registerSymbol(String symbolName, Class symbolClass) throws MapContextRuntimeException
SymbolManagerISymbol implementation class with a name. This way
the symbol class is not related to any geometry type, so it can be
created only through the SymbolManager.createSymbol(String) method.registerSymbol in interface SymbolManagersymbolName - the symbol namesymbolClass - the symbol implementation classMapContextRuntimeException - if the provided class does not implement the ISymbol
interfacepublic void registerSymbol(String symbolName, int[] shapeTypes, Class symbolClass) throws MapContextRuntimeException
SymbolManagerISymbol implementation class with a name and a list
of geometry types which the symbol is able to render.registerSymbol in interface SymbolManagersymbolName - the symbol nameshapeTypes - the list of geometry types the symbol is able to rendersymbolClass - the symbol implementation classMapContextRuntimeException - if the provided class does not implement the ISymbol
interfacepublic void registerMultiLayerSymbol(String symbolName, Class symbolClass) throws MapContextRuntimeException
SymbolManagerIMultiLayerSymbol implementation class with a name.
This way the symbol class is not related to any geometry type, so it can
be created only through the SymbolManager.createMultiLayerSymbol(String)
method.registerMultiLayerSymbol in interface SymbolManagersymbolName - the symbol namesymbolClass - the symbol implementation classMapContextRuntimeException - if the provided class does not implement the
IMultiLayerSymbol interfacepublic void registerMultiLayerSymbol(String symbolName, int[] shapeTypes, Class symbolClass) throws MapContextRuntimeException
SymbolManagerIMultiLayerSymbol implementation class with a name
and a list of geometry types which the symbol is able to render.registerMultiLayerSymbol in interface SymbolManagersymbolName - the symbol nameshapeTypes - the list of geometry types the symbol is able to rendersymbolClass - the symbol implementation classMapContextRuntimeException - if the provided class does not implement the
IMultiLayerSymbol interfacepublic IWarningSymbol getWarningSymbol(String message, String symbolDesc, int symbolDrawExceptionType) throws MapContextRuntimeException
SymbolManagerIWarningSymbol.
TODO: revisar el uso de esto, a ver si es necesario o se puede ocultar
dentro de la implementación.getWarningSymbol in interface SymbolManagerMapContextRuntimeExceptionpublic void setSymbolPreferences(SymbolPreferences symbolPreferences)
setSymbolPreferences in interface SymbolManagerpublic List getSymbolLibraryNames()
getSymbolLibraryNames in interface SymbolManagerpublic ISymbol getSymbol(String libraryName, String symbolID) throws SymbolException
getSymbol in interface SymbolManagerSymbolException