Interface ISymbol
- All Superinterfaces:
Cloneable,org.gvsig.tools.lang.Cloneable,IPrintable,org.gvsig.tools.persistence.Persistent
- All Known Subinterfaces:
IMultiLayerSymbol,ISymbol_v2,ITextSymbol,IWarningSymbol
- All Known Implementing Classes:
AbstractSymbol
public interface ISymbol
extends org.gvsig.tools.persistence.Persistent, IPrintable, org.gvsig.tools.lang.Cloneable
Interface for symbols.It is the most general one which is implemented by other
specific symbols.For this reason this interface has a method to obtain the derived
version of a common symbol(apart from others). The main purpose is to offer a set of
symbols that will be part of the FMap kernel and allow the developer to add new symbols
without changes in the initial implementation.
- Author:
- jaume dominguez faus - jaume.dominguez@iver.es
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(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.voiddraw(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.fmap.dal.feature.Feature f, org.gvsig.tools.task.Cancellable cancel, Rectangle r) voiddrawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r) Useful to render the symbol inside the TOC, or inside little rectangles.getColor()Returns theColorto use to render the symbol.The 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.FeaturegetID()Get the id ob the symbol (the basename of file).This attribute is not persistent.Returns the derived version of the symbol that will be used to draw the feature when it is selected.getSymbolForSelection(Color selectionColor) intThe use of this method -and its mechanism- is being valorated.booleanTells whether the shape of the symbol will be drawn or not.booleanisSuitableFor(org.gvsig.fmap.geom.Geometry geom) True if this symbol is ok for the geometry.voidSets theColorto use to render the symbol.voidsetDescription(String desc) Sets the description of this symbolvoidsetFeature(org.gvsig.fmap.dal.feature.Feature feature) voidSet the id ob the symbol (the basename of file).Methods inherited from interface org.gvsig.tools.lang.Cloneable
cloneMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable
printMethods inherited from interface org.gvsig.tools.persistence.Persistent
loadFromState, saveToState
-
Field Details
-
SELECTION_COLOR
-
-
Method Details
-
getSymbolForSelection
ISymbol getSymbolForSelection()Returns the derived version of the symbol that will be used to draw the feature when it is selected.- Returns:
- ISymbol applied to a feature when it has been selected.
-
getSymbolForSelection
-
draw
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) Used when a symbol is going to be drawn.The method to do it will depend on the derived version of the symbol.- Parameters:
g-affineTransform-cancel- TODOshp-
-
getDescription
String getDescription()The description is a human-readable text used to label it when show in a symbol menu or something like that.- Returns:
- description of this symbol.
-
isShapeVisible
boolean isShapeVisible()Tells whether the shape of the symbol will be drawn or not.- Returns:
- true if Shape must be drawn. Useful if you are labelling
-
setDescription
Sets the description of this symbol- Parameters:
desc- , a string with the description
-
getSymbolType
int getSymbolType()The use of this method -and its mechanism- is being valorated. It probably will be deprecated.- Returns:
- FSymbol constants. I think it is better to use isSuitableFor
-
isSuitableFor
boolean isSuitableFor(org.gvsig.fmap.geom.Geometry geom) True if this symbol is ok for the geometry. For example, a FillSymbol will be suitable for a Polygon.- Parameters:
geom-- Returns:
-
drawInsideRectangle
void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r) throws SymbolDrawingException Useful 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.- Parameters:
scaleInstance-r-g2-- Throws:
SymbolDrawingException- TODO
-
getColor
Color getColor()Returns theColorto use to render the symbol.- Returns:
- the
Colorto use to render the symbol
-
setColor
Sets theColorto use to render the symbol.- Parameters:
color- to render the symbol
-
setID
Set the id ob the symbol (the basename of file). This attribute is not persistent.- Parameters:
id-
-
getID
String getID()Get the id ob the symbol (the basename of file).This attribute is not persistent.- Returns:
-
getFeature
org.gvsig.fmap.dal.feature.Feature getFeature() -
setFeature
void setFeature(org.gvsig.fmap.dal.feature.Feature feature) -
draw
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, Rectangle r)
-