Package org.gvsig.labeling.symbol
Class SmartTextSymbol
java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
org.gvsig.labeling.symbol.SmartTextSymbol
- All Implemented Interfaces:
Cloneable,org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport,org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable,org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol,org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol_v2,org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol,org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.persistence.Persistent
public class SmartTextSymbol
extends org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
implements org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol
Class used to create symbols composed using a text defined by
the user.This text can be edited (changing the color, the font of the characters, and
the rotation of the text)and has the property that can follow a path.If this path
does not exist, the text is treated as a simpletextsymbol (when is drawn).
- Author:
- jaume dominguez faus - jaume.dominguez@iver.es
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol.RegisterPersistenceNested classes/interfaces inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport.CartographicContext -
Field Summary
FieldsFields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
LOGGER, SYMBOL_PERSISTENCE_DEFINITION_NAMEFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
PAPER, WORLDFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
SELECTION_COLORFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
SYMBOL_NAME, SYMBOL_STYLE_ALIGNMENT_CENTERED, SYMBOL_STYLE_ALIGNMENT_JUSTIFY, SYMBOL_STYLE_ALIGNMENT_LEFT, SYMBOL_STYLE_ALIGNMENT_RIGHT -
Constructor Summary
ConstructorsConstructorDescriptionSmartTextSymbol(org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol sym, org.gvsig.fmap.mapcontext.rendering.legend.styling.IPlacementConstraints constraints) -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddraw(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.fmap.dal.feature.Feature f, org.gvsig.tools.task.Cancellable cancel) Draws the text according.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) getColor()getFont()floatintvoidgetPixExtentPlus(org.gvsig.fmap.geom.Geometry shp, float[] distances, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi) doubleorg.gvsig.fmap.geom.Geometryorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbolintgetText()org.gvsig.fmap.geom.GeometrygetTextWrappingShape(org.gvsig.fmap.geom.primitive.Point p) booleanbooleanbooleanisOneDotOrPixel(org.gvsig.fmap.geom.Geometry geom, double[] positionOfDotOrPixel, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi) booleanisSuitableFor(org.gvsig.fmap.geom.Geometry geom) voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidprint(Graphics2D g, AffineTransform at, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties) static voidvoidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetAlignment(int alignment) voidsetAutoresizeEnabled(boolean ar) voidsetCharacterSpacing(double charSpacing) voidvoidsetDrawWithHalo(boolean h) voidvoidsetFontSize(double d) voidsetHaloColor(Color co) voidsetHaloWidth(float w) voidsetKerning(boolean kerning) voidsetMargin(double margin) voidsetRightToLeft(boolean rightToLeft) voidsetRotation(double rot) voidvoidsetTextColor(Color color) voidsetWordSpacing(double wordSpacing) Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
cloneForSelection, cloneForSelection, equals, getDescription, getFeature, getID, getRequiredFeatureAttributeNames, getSymbolForSelection, isShapeVisible, setDescription, setFeature, setID, setIsShapeVisibleMethods 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
getDescription, getFeature, getID, getSymbolForSelection, isShapeVisible, setDescription, setFeature, setID
-
Field Details
-
SMART_TEXT_SYMBOL_PERSISTENCE_DEFINITION_NAME
- See Also:
-
-
Constructor Details
-
SmartTextSymbol
public SmartTextSymbol(org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol sym, org.gvsig.fmap.mapcontext.rendering.legend.styling.IPlacementConstraints constraints) -
SmartTextSymbol
public SmartTextSymbol()
-
-
Method Details
-
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) Draws the text according. If this symbol has the text path set, then it is used as the text line, otherwise shp must be an FPoint2D indicating the starting point of the text and then the text will be rendered from there and following the rotation previously set.- Specified by:
drawin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol- Overrides:
drawin classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
-
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, Rectangle r) - Specified by:
drawin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
getPixExtentPlus
public void getPixExtentPlus(org.gvsig.fmap.geom.Geometry shp, float[] distances, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi) -
getOnePointRgb
public int getOnePointRgb() -
getSymbolType
public int getSymbolType()- Specified by:
getSymbolTypein interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
isSuitableFor
public boolean isSuitableFor(org.gvsig.fmap.geom.Geometry geom) - Specified by:
isSuitableForin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
getSampleGeometry
-
drawInsideRectangle
public void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r) throws org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException - Specified by:
drawInsideRectanglein interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol- Overrides:
drawInsideRectanglein classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol- Throws:
org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
-
setText
- Specified by:
setTextin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getText
- Specified by:
getTextin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setCharacterSpacing
public void setCharacterSpacing(double charSpacing) -
setWordSpacing
public void setWordSpacing(double wordSpacing) -
setAlignment
public void setAlignment(int alignment) -
setKerning
public void setKerning(boolean kerning) -
setMargin
public void setMargin(double margin) -
setRightToLeft
public void setRightToLeft(boolean rightToLeft) -
getSymbolForSelection
public org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol getSymbolForSelection()- Specified by:
getSymbolForSelectionin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol- Overrides:
getSymbolForSelectionin classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
-
isOneDotOrPixel
public boolean isOneDotOrPixel(org.gvsig.fmap.geom.Geometry geom, double[] positionOfDotOrPixel, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi) -
getColor
- Specified by:
getColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
setColor
- Specified by:
setColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
print
public void print(Graphics2D g, AffineTransform at, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties) - Specified by:
printin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.IPrintable- Overrides:
printin classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
-
setFont
- Specified by:
setFontin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getFont
- Specified by:
getFontin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getTextColor
- Specified by:
getTextColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setTextColor
- Specified by:
setTextColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setFontSize
public void setFontSize(double d) - Specified by:
setFontSizein interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getTextWrappingShape
public org.gvsig.fmap.geom.Geometry getTextWrappingShape(org.gvsig.fmap.geom.primitive.Point p) - Specified by:
getTextWrappingShapein interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getBounds
- Specified by:
getBoundsin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getRotation
public double getRotation()- Specified by:
getRotationin interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol
-
setRotation
public void setRotation(double rot) - Specified by:
setRotationin interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol
-
setAutoresizeEnabled
public void setAutoresizeEnabled(boolean ar) - Specified by:
setAutoresizeEnabledin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
isAutoresizeEnabled
public boolean isAutoresizeEnabled()- Specified by:
isAutoresizeEnabledin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getHaloColor
- Specified by:
getHaloColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setHaloColor
- Specified by:
setHaloColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getHaloWidth
public float getHaloWidth()- Specified by:
getHaloWidthin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setHaloWidth
public void setHaloWidth(float w) - Specified by:
setHaloWidthin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
isDrawWithHalo
public boolean isDrawWithHalo()- Specified by:
isDrawWithHaloin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setDrawWithHalo
public void setDrawWithHalo(boolean h) - Specified by:
setDrawWithHaloin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol- Throws:
CloneNotSupportedException
-
registerPersistent
public static void registerPersistent() -
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- Overrides:
loadFromStatein classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol- 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- Overrides:
saveToStatein classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-