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 Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport

    org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport.CartographicContext
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol

    LOGGER, SYMBOL_PERSISTENCE_DEFINITION_NAME

    Fields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport

    PAPER, WORLD

    Fields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol

    SELECTION_COLOR

    Fields 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    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)
     
     
    double
    getCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom)
     
     
     
     
     
    float
     
    double
     
    protected org.gvsig.fmap.geom.primitive.Point
     
    org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
     
    int
     
     
     
    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.
    boolean
     
    boolean
     
    boolean
    isSuitableFor(org.gvsig.fmap.geom.Geometry geom)
     
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    setAutoresizeEnabled(boolean autoresizeFlag)
     
    void
    setCartographicSize(double cartographicSize, org.gvsig.fmap.geom.Geometry geom)
     
    void
    setColor(Color color)
     
    void
    setDrawWithHalo(boolean drawWithHalo)
     
    void
    setFont(Font font)
     
    void
    setFontSize(double size)
     
    void
     
    void
    setHaloWidth(float haloWidth)
     
    void
    setRotation(double rotation)
    Defines the angle of rotation for the text that composes the symbol
    void
     
    void
     
    double
    toCartographicSize(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, setIsShapeVisible

    Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport

    copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnits

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport

    copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnits

    Methods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable

    print

    Methods 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

      public static final String 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:
      draw in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • getSymbolForSelection

      public org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol getSymbolForSelection()
      Specified by:
      getSymbolForSelection in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
      Overrides:
      getSymbolForSelection in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
    • getSymbolType

      public int getSymbolType()
      Specified by:
      getSymbolType in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • isSuitableFor

      public boolean isSuitableFor(org.gvsig.fmap.geom.Geometry geom)
      Specified by:
      isSuitableFor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • getClassName

      public String getClassName()
    • getText

      public String getText()
      Specified by:
      getText in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • getFont

      public Font getFont()
      Specified by:
      getFont in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • getTextColor

      public Color getTextColor()
      Specified by:
      getTextColor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • setText

      public void setText(String text)
      Specified by:
      setText in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • setFont

      public void setFont(Font font)
      Specified by:
      setFont in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • setTextColor

      public void setTextColor(Color color)
      Specified by:
      setTextColor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • getColor

      public Color getColor()
      Specified by:
      getColor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • setColor

      public void setColor(Color color)
      Specified by:
      setColor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • setFontSize

      public void setFontSize(double size)
      Specified by:
      setFontSize in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • getRotation

      public double getRotation()
      Specified by:
      getRotation in interface org.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:
      setRotation in interface org.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:
      getTextWrappingShape in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • getBounds

      public Rectangle getBounds()
      Specified by:
      getBounds in interface org.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:
      isAutoresizeEnabled in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • setAutoresizeEnabled

      public void setAutoresizeEnabled(boolean autoresizeFlag)
      Specified by:
      setAutoresizeEnabled in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class org.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:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Overrides:
      loadFromState in class org.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:
      saveToState in interface org.gvsig.tools.persistence.Persistent
      Overrides:
      saveToState in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • getHaloColor

      public Color getHaloColor()
      Specified by:
      getHaloColor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • setHaloColor

      public void setHaloColor(Color co)
      Specified by:
      setHaloColor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • getHaloWidth

      public float getHaloWidth()
      Specified by:
      getHaloWidth in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • setHaloWidth

      public void setHaloWidth(float haloWidth)
      Specified by:
      setHaloWidth in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • isDrawWithHalo

      public boolean isDrawWithHalo()
      Specified by:
      isDrawWithHalo in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • setDrawWithHalo

      public void setDrawWithHalo(boolean drawWithHalo)
      Specified by:
      setDrawWithHalo in interface org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    • getSamplePoint

      protected org.gvsig.fmap.geom.primitive.Point getSamplePoint(Rectangle r)