Class AbstractSymbol
java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
- All Implemented Interfaces:
Cloneable,CartographicSupport,IPrintable,ISymbol,ISymbol_v2,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.persistence.Persistent
public abstract class AbstractSymbol
extends AbstractCartographicSupport
implements ISymbol_v2, CartographicSupport
Abstract class that implements the interface the interface for symbols.It is
considered as the father of all XXXSymbols and will implement all the methods
that these classes had not developed (and correspond with one of the methods
of AbstractSymbol class)
- Author:
- gvSIG Team
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
CartographicSupport.CartographicContext -
Field Summary
FieldsFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
PAPER, WORLDFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
SELECTION_COLOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()protected ISymbolprotected ISymbolcloneForSelection(Color selectionColor) voiddraw(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.fmap.dal.feature.Feature f, org.gvsig.tools.task.Cancellable cancel) Used when a symbol is going to be drawn.The method to do it will depend on the derived version of the symbol.voiddrawInsideRectangle(Graphics2D g, AffineTransform affineTransform, Rectangle r) Useful to render the symbol inside the TOC, or inside little rectangles.booleanfinal StringThe description is a human-readable text used to label it when show in a symbol menu or something like that.org.gvsig.fmap.dal.feature.Featurefinal StringgetID()Get the id ob the symbol (the basename of file).This attribute is not persistent.String[]getRequiredFeatureAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore featureStore) Returns the derived version of the symbol that will be used to draw the feature when it is selected.getSymbolForSelection(Color selectionColor) booleanTells whether the shape of the symbol will be drawn or not.voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidprint(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) final voidsetDescription(String desc) Sets the description of this symbolvoidsetFeature(org.gvsig.fmap.dal.feature.Feature feature) final voidSet the id ob the symbol (the basename of file).final voidsetIsShapeVisible(boolean isShapeVisible) Sets this symbol to visibleMethods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnitsMethods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnitsMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
draw, getColor, getSymbolType, isSuitableFor, setColor
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
SYMBOL_PERSISTENCE_DEFINITION_NAME
- See Also:
-
-
Constructor Details
-
AbstractSymbol
public AbstractSymbol()
-
-
Method Details
-
getFeature
public org.gvsig.fmap.dal.feature.Feature getFeature()- Specified by:
getFeaturein interfaceISymbol
-
setFeature
public void setFeature(org.gvsig.fmap.dal.feature.Feature feature) - Specified by:
setFeaturein interfaceISymbol
-
setDescription
Description copied from interface:ISymbolSets the description of this symbol- Specified by:
setDescriptionin interfaceISymbol- Parameters:
desc- , a string with the description
-
getDescription
Description copied from interface:ISymbolThe description is a human-readable text used to label it when show in a symbol menu or something like that.- Specified by:
getDescriptionin interfaceISymbol- Returns:
- description of this symbol.
-
setID
Description copied from interface:ISymbolSet the id ob the symbol (the basename of file). This attribute is not persistent. -
getID
Description copied from interface:ISymbolGet the id ob the symbol (the basename of file).This attribute is not persistent. -
isShapeVisible
public boolean isShapeVisible()Description copied from interface:ISymbolTells whether the shape of the symbol will be drawn or not.- Specified by:
isShapeVisiblein interfaceISymbol- Returns:
- true if Shape must be drawn. Useful if you are labelling
-
setIsShapeVisible
public final void setIsShapeVisible(boolean isShapeVisible) Sets this symbol to visible- Parameters:
isShapeVisible-
-
equals
-
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
cloneForSelection
-
cloneForSelection
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
getRequiredFeatureAttributeNames
public String[] getRequiredFeatureAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore featureStore) throws org.gvsig.fmap.dal.exception.DataException - Throws:
org.gvsig.fmap.dal.exception.DataException
-
draw
public void draw(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.fmap.dal.feature.Feature f, org.gvsig.tools.task.Cancellable cancel) Description copied from interface:ISymbolUsed when a symbol is going to be drawn.The method to do it will depend on the derived version of the symbol. -
drawInsideRectangle
public void drawInsideRectangle(Graphics2D g, AffineTransform affineTransform, Rectangle r) throws SymbolDrawingException Description copied from interface:ISymbolUseful to render the symbol inside the TOC, or inside little rectangles. For example, think about rendering a Label with size in meters => You will need to specify a size in pixels. Of course, you can also to choose to render a prepared image, etc.- Specified by:
drawInsideRectanglein interfaceISymbol- Parameters:
affineTransform-r-- Throws:
SymbolDrawingException- TODO
-
print
public void print(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties) - Specified by:
printin interfaceIPrintable
-
getSymbolForSelection
Description copied from interface:ISymbolReturns the derived version of the symbol that will be used to draw the feature when it is selected.- Specified by:
getSymbolForSelectionin interfaceISymbol- Returns:
- ISymbol applied to a feature when it has been selected.
-
getSymbolForSelection
- Specified by:
getSymbolForSelectionin interfaceISymbol
-