Class LabelClass
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 ClassesNested 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 -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddraw(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.voiddrawInsideRectangle(Graphics2D graphics, Rectangle bounds) Useful to render a Label with size inside little rectangles.doublegetCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom) String[]Returns the expression that defines the text which will be showed in the labelorg.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyleReturns the style of the labelgetName()Returns the name of the labelintorg.gvsig.fmap.geom.GeometrygetShape(org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelLocationMetrics llm) String[]getTexts()Return the text for the labelorg.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbolReturns the text symbol that is being used for the text(the font, size,style,aligment)booleanbooleanReturns true if the label will be showed in the mapbooleanisVisible(double scale) Returns true if the label will be showed in the mapvoidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetLabelExpressions(String[] lbl_exps) Stablishes the expresion that, when it is evaluated, returns the text which will be showed by the label.voidsetLabelStyle(org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle labelStyle) Stablishes the style for the label.voidStablishes the name of the labelvoidsetPriority(int priority) voidsetReferenceSystem(int referenceSystem) voidsetSQLQuery(String sqlQuery) voidSets the text for the labelvoidsetTextSymbol(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)voidsetUnit(int unitIndex) voidsetUseSqlQuery(boolean use_sql) voidsetVisible(boolean isVisible) Sets the visibility of the label in the map.toString()Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, toCartographicUnitsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
isVisiblein interfaceorg.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:
isVisiblein interfaceorg.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:
setVisiblein interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass- Parameters:
isVisible- boolean
-
getLabelExpressions
Returns the expression that defines the text which will be showed in the label- Specified by:
getLabelExpressionsin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass- Returns:
- labelExpression String
-
setLabelExpressions
Stablishes the expresion that, when it is evaluated, returns the text which will be showed by the label.- Specified by:
setLabelExpressionsin interfaceorg.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:
getTextSymbolin interfaceorg.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:
setTextSymbolin interfaceorg.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:
setLabelStylein interfaceorg.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:
getLabelStylein interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
getName
Returns the name of the label- Specified by:
getNamein interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
setName
Stablishes the name of the label- Specified by:
setNamein interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass- Parameters:
name-
-
toString
-
setTexts
Sets the text for the label- Specified by:
setTextsin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass- Parameters:
texts- String[]
-
getTexts
Return the text for the label- Specified by:
getTextsin interfaceorg.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:
drawin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass- Parameters:
graphics- , graphics to use to paint the label.llm- , concrete settings of the placement of this layershp- , 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:
drawInsideRectanglein interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass- Parameters:
graphics- Graphics2Dbounds- Rectangle- Throws:
org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
setPriority
public void setPriority(int priority) - Specified by:
setPriorityin interfaceorg.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:
getShapein interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass- Throws:
org.gvsig.fmap.geom.exception.CreateGeometryException
-
getClassName
- Specified by:
getClassNamein interfaceorg.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:
setReferenceSystemin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport- Overrides:
setReferenceSystemin classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
-
setUnit
public void setUnit(int unitIndex) - Specified by:
setUnitin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport- Overrides:
setUnitin classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
-
getBounds
- Specified by:
getBoundsin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
getSQLQuery
- Specified by:
getSQLQueryin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
setSQLQuery
- Specified by:
setSQLQueryin interfaceorg.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:
saveToStatein interfaceorg.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:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
setUseSqlQuery
public void setUseSqlQuery(boolean use_sql) - Specified by:
setUseSqlQueryin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
isUseSqlQuery
public boolean isUseSqlQuery()- Specified by:
isUseSqlQueryin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
getStringLabelExpression
- Specified by:
getStringLabelExpressionin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass
-
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-