Class SmartTextSymbolLabelClass

java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
org.gvsig.labeling.label.SmartTextSymbolLabelClass
All Implemented Interfaces:
Cloneable, org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass, org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.persistence.Persistent

public class SmartTextSymbolLabelClass extends org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport implements org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass

SmartTextSymbolLabelClass.java

This is a wrapper to be able to use a SmartTextSymbol as a LabelClass. A SmartTextSymbol uses a line instead of a point. Being in fact a Line and not a Marker, it does not make any sense to have label styles since the label styles are well-defined rectangle areas where texts are placed in fields backgrounded by an image. In this contexts, the area is defined dinamically for each line, and there is no sense to have texts fields. They will be rendered as a single string along a line.

The label itself is the SmartTextSymbol, the geometry (the line), the label expression, and the text applied to the symbol.

Most of the operations performed by this LabelClass are in fact delegated to the symbol.

Author:
jldominguez
  • Nested Class Summary

    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 interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport

    PAPER, WORLD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    draw(Graphics2D graphics, org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelLocationMetrics llm, org.gvsig.fmap.geom.Geometry geo)
     
    void
     
     
     
     
    org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle
     
     
    int
     
    org.gvsig.fmap.geom.Geometry
    getShape(org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelLocationMetrics llm)
     
     
     
     
    org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
     
    boolean
     
    boolean
     
    boolean
    isVisible(double scale)
     
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    static void
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    setCartographicContext(org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport.CartographicContext ctx)
     
    void
     
    void
    setLabelStyle(org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle labelStyle)
     
    void
     
    void
    setPriority(int priority)
     
    void
    setSQLQuery(String sqlQuery)
     
    void
    setTexts(String[] texts)
     
    void
    setTextSymbol(org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol textSymbol)
     
    void
    setUseSqlQuery(boolean use_sql)
     
    void
    setVisible(boolean isVisible)
     

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

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

    Methods inherited from class java.lang.Object

    equals, 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, setReferenceSystem, setUnit, toCartographicUnits

    Methods inherited from interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass

    toString
  • Field Details

    • SMART_LABEL_CLASS_PERSISTENCE_DEFINITION_NAME

      public static final String SMART_LABEL_CLASS_PERSISTENCE_DEFINITION_NAME
      See Also:
  • Constructor Details

    • SmartTextSymbolLabelClass

      public SmartTextSymbolLabelClass()
  • Method Details

    • draw

      public void draw(Graphics2D graphics, org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelLocationMetrics llm, org.gvsig.fmap.geom.Geometry geo)
      Specified by:
      draw in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • drawInsideRectangle

      public void drawInsideRectangle(Graphics2D graphics, Rectangle bounds) throws org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
      Specified by:
      drawInsideRectangle in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Throws:
      org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
    • getClassName

      public String getClassName()
      Specified by:
      getClassName in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getLabelStyle

      public org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle getLabelStyle()
      Specified by:
      getLabelStyle in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getTextSymbol

      public org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol getTextSymbol()
      Specified by:
      getTextSymbol in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setLabelStyle

      public void setLabelStyle(org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle labelStyle)
      Specified by:
      setLabelStyle in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setTextSymbol

      public void setTextSymbol(org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol textSymbol)
      Specified by:
      setTextSymbol in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • 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
      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
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • registerPersistent

      public static void registerPersistent()
    • isVisible

      public boolean isVisible()
      Specified by:
      isVisible in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • isVisible

      public boolean isVisible(double scale)
      Specified by:
      isVisible in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setVisible

      public void setVisible(boolean isVisible)
      Specified by:
      setVisible in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getName

      public String getName()
      Specified by:
      getName in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setName

      public void setName(String name)
      Specified by:
      setName in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setTexts

      public void setTexts(String[] texts)
      Specified by:
      setTexts in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getTexts

      public String[] getTexts()
      Specified by:
      getTexts in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getPriority

      public int getPriority()
      Specified by:
      getPriority in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setPriority

      public void setPriority(int priority)
      Specified by:
      setPriority in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getShape

      public org.gvsig.fmap.geom.Geometry getShape(org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelLocationMetrics llm) throws org.gvsig.fmap.geom.exception.CreateGeometryException
      Specified by:
      getShape in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Throws:
      org.gvsig.fmap.geom.exception.CreateGeometryException
    • setCartographicContext

      public void setCartographicContext(org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport.CartographicContext ctx)
      Specified by:
      setCartographicContext in interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
      Overrides:
      setCartographicContext in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
    • getBounds

      public Rectangle getBounds()
      Specified by:
      getBounds in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getSQLQuery

      public String getSQLQuery()
      Specified by:
      getSQLQuery in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setSQLQuery

      public void setSQLQuery(String sqlQuery)
      Specified by:
      setSQLQuery in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getLabelExpressions

      public String[] getLabelExpressions()
      Specified by:
      getLabelExpressions in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setLabelExpressions

      public void setLabelExpressions(String[] lbl_exps)
      Specified by:
      setLabelExpressions in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • setUseSqlQuery

      public void setUseSqlQuery(boolean use_sql)
      Specified by:
      setUseSqlQuery in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • isUseSqlQuery

      public boolean isUseSqlQuery()
      Specified by:
      isUseSqlQuery in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getStringLabelExpression

      public String getStringLabelExpression()
      Specified by:
      getStringLabelExpression in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException