Class SimpleTextSymbol
java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol
- 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 SimpleTextSymbol
extends org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
implements org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol, org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol
SimpleTextSymbol is a 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).
- Author:
- 2005-2008 jaume dominguez faus - jaume.dominguez@iver.es, 2009- César Ordiñana - gvSIG team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested 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
Constructors -
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, Rectangle r) doublegetCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom) getColor()getFont()floatdoubleprotected org.gvsig.fmap.geom.primitive.Pointorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbolintgetText()org.gvsig.fmap.geom.GeometrygetTextWrappingShape(org.gvsig.fmap.geom.primitive.Point p) Returns an Geometry which represents a rectangle containing the text in screen units.booleanbooleanbooleanisSuitableFor(org.gvsig.fmap.geom.Geometry geom) voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetAutoresizeEnabled(boolean autoresizeFlag) voidsetCartographicSize(double cartographicSize, org.gvsig.fmap.geom.Geometry geom) voidvoidsetDrawWithHalo(boolean drawWithHalo) voidvoidsetFontSize(double size) voidsetHaloColor(Color co) voidsetHaloWidth(float haloWidth) voidsetRotation(double rotation) Defines the angle of rotation for the text that composes the symbolvoidvoidsetTextColor(Color color) doubletoCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom) Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
cloneForSelection, cloneForSelection, draw, drawInsideRectangle, equals, getDescription, getFeature, getID, getRequiredFeatureAttributeNames, getSymbolForSelection, isShapeVisible, print, 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.IPrintable
printMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
draw, drawInsideRectangle, getDescription, getFeature, getID, getSymbolForSelection, isShapeVisible, setDescription, setFeature, setID
-
Field Details
-
SIMPLE_TEXT_SYMBOL_PERSISTENCE_DEFINITION_NAME
- See Also:
-
-
Constructor Details
-
SimpleTextSymbol
public SimpleTextSymbol()
-
-
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, Rectangle r) - Specified by:
drawin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
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
-
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
-
getClassName
-
getText
- Specified by:
getTextin 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
-
setText
- Specified by:
setTextin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setFont
- Specified by:
setFontin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setTextColor
- Specified by:
setTextColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getColor
- Specified by:
getColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
setColor
- Specified by:
setColorin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
setFontSize
public void setFontSize(double size) - Specified by:
setFontSizein 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 rotation) Defines the angle of rotation for the text that composes the symbol- Specified by:
setRotationin interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol- Parameters:
rotation-
-
getTextWrappingShape
public org.gvsig.fmap.geom.Geometry getTextWrappingShape(org.gvsig.fmap.geom.primitive.Point p) Returns an Geometry which represents a rectangle containing the text in screen units.- Specified by:
getTextWrappingShapein interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getBounds
- Specified by:
getBoundsin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setCartographicSize
public void setCartographicSize(double cartographicSize, org.gvsig.fmap.geom.Geometry geom) -
toCartographicSize
public double toCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom) -
getCartographicSize
public double getCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom) -
isAutoresizeEnabled
public boolean isAutoresizeEnabled()- Specified by:
isAutoresizeEnabledin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
setAutoresizeEnabled
public void setAutoresizeEnabled(boolean autoresizeFlag) - Specified by:
setAutoresizeEnabledin 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
-
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
-
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 haloWidth) - 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 drawWithHalo) - Specified by:
setDrawWithHaloin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
-
getSamplePoint
-