java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.LabelClass
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 LabelClass extends org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport implements org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
LabelClass is the model of the label in the new simbology of gvSIG. In this class is contained its definition, the expresion that defines the text which is going to be showed, if it will be visible or not, the text symbol that is going to paint the label and the style for its background.
Author:
gvSIG Team
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    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 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 geom)
    LabelLocationMetrics, contains the anchor point, rotation, and some other geometric calculations computed by the PlacementManager.
    void
    Useful to render a Label with size inside little rectangles.
     
    double
    getCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom)
     
     
    Returns the expression that defines the text which will be showed in the label
    org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle
    Returns the style of the label
    Returns the name of the label
    int
     
    org.gvsig.fmap.geom.Geometry
    getShape(org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelLocationMetrics llm)
     
     
     
    Return the text for the label
    org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol
    Returns the text symbol that is being used for the text(the font, size,style,aligment)
    boolean
     
    boolean
    Returns true if the label will be showed in the map
    boolean
    isVisible(double scale)
    Returns true if the label will be showed in the map
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    Stablishes the expresion that, when it is evaluated, returns the text which will be showed by the label.
    void
    setLabelStyle(org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle labelStyle)
    Stablishes the style for the label.
    void
    Stablishes the name of the label
    void
    setPriority(int priority)
     
    void
    setReferenceSystem(int referenceSystem)
     
    void
    setSQLQuery(String sqlQuery)
     
    void
    setTexts(String[] texts)
    Sets the text for the label
    void
    setTextSymbol(org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol textSymbol)
    Stablishes the text symbol that is going to be used for the text(the font,size,style,aligment)
    void
    setUnit(int unitIndex)
     
    void
    setUseSqlQuery(boolean use_sql)
     
    void
    setVisible(boolean isVisible)
    Sets the visibility of the label in the map.
     

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

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

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

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

    copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, toCartographicUnits
  • Constructor Details

    • LabelClass

      public LabelClass()
  • Method Details

    • isVisible

      public boolean isVisible()
      Returns true if the label will be showed in the map
      Specified by:
      isVisible in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Returns:
      isVisible boolean
    • isVisible

      public boolean isVisible(double scale)
      Returns true if the label will be showed in the map
      Specified by:
      isVisible in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Returns:
      isVisible boolean
    • setVisible

      public void setVisible(boolean isVisible)
      Sets the visibility of the label in the map.
      Specified by:
      setVisible in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      isVisible - boolean
    • getLabelExpressions

      public String[] getLabelExpressions()
      Returns the expression that defines the text which will be showed in the label
      Specified by:
      getLabelExpressions in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Returns:
      labelExpression String
    • setLabelExpressions

      public void setLabelExpressions(String[] lbl_exps)
      Stablishes the expresion that, when it is evaluated, returns the text which will be showed by the label.
      Specified by:
      setLabelExpressions in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      labelExpression - String
    • getTextSymbol

      public org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol getTextSymbol()
      Returns the text symbol that is being used for the text(the font, size,style,aligment)
      Specified by:
      getTextSymbol in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Returns:
      label ITextSymbol
    • setTextSymbol

      public void setTextSymbol(org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol textSymbol)
      Stablishes the text symbol that is going to be used for the text(the font,size,style,aligment)
      Specified by:
      setTextSymbol in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      textSymbol - ITextSymbol
    • setLabelStyle

      public void setLabelStyle(org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle labelStyle)
      Stablishes the style for the label.
      Specified by:
      setLabelStyle in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      labelStyle - ILabelStyle
    • getLabelStyle

      public org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle getLabelStyle()
      Returns the style of the label
      Specified by:
      getLabelStyle in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
    • getName

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

      public void setName(String name)
      Stablishes the name of the label
      Specified by:
      setName in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      name -
    • toString

      public String toString()
      Specified by:
      toString in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Overrides:
      toString in class Object
    • setTexts

      public void setTexts(String[] texts)
      Sets the text for the label
      Specified by:
      setTexts in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      texts - String[]
    • getTexts

      public String[] getTexts()
      Return the text for the label
      Specified by:
      getTexts in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      texts - String[]
    • draw

      public void draw(Graphics2D graphics, org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelLocationMetrics llm, org.gvsig.fmap.geom.Geometry geom)

      LabelLocationMetrics, contains the anchor point, rotation, and some other geometric calculations computed by the PlacementManager.

      The shp argument is passed as an accessory for subclasses of this class in case they need futher geometric calculations

      Specified by:
      draw in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      graphics - , graphics to use to paint the label.
      llm - , concrete settings of the placement of this layer
      shp - , the Shape over whose the label is painted
    • drawInsideRectangle

      public void drawInsideRectangle(Graphics2D graphics, Rectangle bounds) throws org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
      Useful to render a Label with size inside little rectangles.
      Specified by:
      drawInsideRectangle in interface org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
      Parameters:
      graphics - Graphics2D
      bounds - Rectangle
      Throws:
      org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
    • 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
    • getClassName

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

      public double getCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom)
    • setReferenceSystem

      public void setReferenceSystem(int referenceSystem)
      Specified by:
      setReferenceSystem in interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
      Overrides:
      setReferenceSystem in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
    • setUnit

      public void setUnit(int unitIndex)
      Specified by:
      setUnit in interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
      Overrides:
      setUnit 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
    • 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
    • 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
    • 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