Interface SymbolManager
- All Known Implementing Classes:
DefaultSymbolManager
public interface SymbolManager
Symbols management: creation, registration, etc.
- Author:
- gvSIG team
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateMultiLayerSymbol(int geomType) Creates a newIMultiLayerSymbolwhich can be used to render the givenGeometrytype.createMultiLayerSymbol(String symbolName) Creates a newIMultiLayerSymbol.createSymbol(int geomType) Creates a newISymbolwhich can be used to render the givenGeometrytype.createSymbol(int geomType, Color color) createSymbol(String symbolName) Creates a newISymbol.createSymbol(String symbolName, Color color) Returns the currentSymbolPreferences.getWarningSymbol(String message, String symbolDesc, int symbolDrawExceptionType) Returns an instance ofIWarningSymbol.loadSymbol(File file) ISymbol[]loadSymbols(File folder) Loads the symbols persisted into a folder.ISymbol[]loadSymbols(File folder, FileFilter filter) Loads the symbols persisted into a folder.org.gvsig.tools.task.CancellableTaskloadSymbols(File folder, FileFilter filter, org.gvsig.tools.visitor.Visitor visitor) voidregisterMultiLayerSymbol(String symbolName, int[] geomTypes, Class symbolClass) Registers aIMultiLayerSymbolimplementation class with a name and a list of geometry types which the symbol is able to render.voidregisterMultiLayerSymbol(String symbolName, Class symbolClass) Registers aIMultiLayerSymbolimplementation class with a name.voidregisterSymbol(String symbolName, int[] geomTypes, Class symbolClass) Registers aISymbolimplementation class with a name and a list of geometry types which the symbol is able to render.voidregisterSymbol(String symbolName, Class symbolClass) Registers aISymbolimplementation class with a name.voidsaveSymbol(ISymbol symbol, String fileName, File folder) Persists aISymbolinto the given folder, with the given file name.voidsaveSymbol(ISymbol symbol, String fileName, File folder, boolean overwrite) Persists aISymbolinto the given folder, with the given file name.voidsetSymbolPreferences(SymbolPreferences symbolPreferences)
-
Field Details
-
LEGEND_FILE_EXTENSION
- See Also:
-
LABELINGSTRATEGY_FILE_EXTENSION
- See Also:
-
-
Method Details
-
loadSymbol
- Throws:
SymbolException
-
loadSymbols
Loads the symbols persisted into a folder. It loads the symbols through the use of the currentPersistenceManager, loading all files found into the folder.- Parameters:
folder- to load the persisted symbols from- Returns:
- the list of loaded symbols
- Throws:
SymbolException- if there is an error loading the symbols
-
loadSymbols
Loads the symbols persisted into a folder. It loads the symbols through the use of the currentPersistenceManager, loading the files found into the folder which apply to the provided filter.- Parameters:
folder- to load the persisted symbols fromfilter- to apply to know which files to load- Returns:
- the list of loaded symbols
- Throws:
SymbolException- if there is an error loading the symbols
-
loadSymbols
org.gvsig.tools.task.CancellableTask loadSymbols(File folder, FileFilter filter, org.gvsig.tools.visitor.Visitor visitor) -
saveSymbol
Persists aISymbolinto the given folder, with the given file name.- Parameters:
symbol- to persistfileName- of the file to createfolder- where to create the file- Throws:
SymbolException- if there is an error persisting the symbol, or the file to create already exists
-
saveSymbol
void saveSymbol(ISymbol symbol, String fileName, File folder, boolean overwrite) throws SymbolException Persists aISymbolinto the given folder, with the given file name.- Parameters:
symbol- to persistfileName- of the file to createfolder- where to create the fileoverwrite- what to do if the file to create already exists- Throws:
SymbolException- if there is an error persisting the symbol, or the file to create already exists and overwrite is false
-
getSymbolPreferences
SymbolPreferences getSymbolPreferences()Returns the currentSymbolPreferences.- Returns:
- the current
SymbolPreferences
-
createSymbol
Creates a newISymbol.- Parameters:
symbolName- the name of the symbol to create- Returns:
- a new
ISymbol - Throws:
MapContextRuntimeException- if there is an error creating the symbol
-
createSymbol
Creates a newISymbolwhich can be used to render the givenGeometrytype.- Parameters:
geomType- theGeometrytype to render- Returns:
- a new
ISymbol - Throws:
MapContextRuntimeException- if there is an error creating the symbol
-
createSymbol
- Parameters:
symbolName- the name of the symbol to createcolor- the color for the symbol- Returns:
- a new
ISymbol - Throws:
MapContextRuntimeException- if there is an error creating the symbol
-
createSymbol
- Parameters:
geomType- theGeometrytype to rendercolor- the color for the symbol- Returns:
- a new
ISymbol - Throws:
MapContextRuntimeException- if there is an error creating the symbol
-
createMultiLayerSymbol
Creates a newIMultiLayerSymbol.- Parameters:
symbolName- the name of the symbol to create- Returns:
- a new
IMultiLayerSymbol - Throws:
MapContextRuntimeException- if there is an error creating the symbol
-
createMultiLayerSymbol
Creates a newIMultiLayerSymbolwhich can be used to render the givenGeometrytype.- Parameters:
geomType- theGeometrytype to render- Returns:
- a new
IMultiLayerSymbol - Throws:
MapContextRuntimeException- if there is an error creating the symbol
-
registerSymbol
Registers aISymbolimplementation class with a name. This way the symbol class is not related to any geometry type, so it can be created only through thecreateSymbol(String)method.- Parameters:
symbolName- the symbol namesymbolClass- the symbol implementation class- Throws:
MapContextRuntimeException- if the provided class does not implement the ISymbol interface
-
registerSymbol
void registerSymbol(String symbolName, int[] geomTypes, Class symbolClass) throws MapContextException Registers aISymbolimplementation class with a name and a list of geometry types which the symbol is able to render.- Parameters:
symbolName- the symbol namegeomTypes- the list of geometry types the symbol is able to rendersymbolClass- the symbol implementation class- Throws:
MapContextRuntimeException- if the provided class does not implement the ISymbol interfaceMapContextException
-
registerMultiLayerSymbol
void registerMultiLayerSymbol(String symbolName, Class symbolClass) throws MapContextRuntimeException Registers aIMultiLayerSymbolimplementation class with a name. This way the symbol class is not related to any geometry type, so it can be created only through thecreateMultiLayerSymbol(String)method.- Parameters:
symbolName- the symbol namesymbolClass- the symbol implementation class- Throws:
MapContextRuntimeException- if the provided class does not implement theIMultiLayerSymbolinterface
-
registerMultiLayerSymbol
void registerMultiLayerSymbol(String symbolName, int[] geomTypes, Class symbolClass) throws MapContextRuntimeException Registers aIMultiLayerSymbolimplementation class with a name and a list of geometry types which the symbol is able to render.- Parameters:
symbolName- the symbol namegeomTypes- the list of geometry types the symbol is able to rendersymbolClass- the symbol implementation class- Throws:
MapContextRuntimeException- if the provided class does not implement theIMultiLayerSymbolinterface
-
getWarningSymbol
IWarningSymbol getWarningSymbol(String message, String symbolDesc, int symbolDrawExceptionType) throws MapContextRuntimeException Returns an instance ofIWarningSymbol. TODO: revisar el uso de esto, a ver si es necesario o se puede ocultar dentro de la implementación.- Parameters:
message-symbolDesc-symbolDrawExceptionType-- Returns:
- the warning symbol
- Throws:
MapContextRuntimeException
-
setSymbolPreferences
-
getSymbolLibraryNames
List getSymbolLibraryNames() -
getSymbol
- Throws:
SymbolException
-