public interface ILabelClass extends Cloneable, Persistent, CartographicSupport
PAPER, WORLD
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphics2D graphics,
ILabelLocationMetrics llm,
Geometry geom)
LabelLocationMetrics, contains the anchor point, rotation, and some
other geometric calculations computed by the PlacementManager.
|
void |
drawInsideRectangle(Graphics2D graphics,
Rectangle bounds)
Useful to render a Label with size inside little rectangles.
|
Rectangle |
getBounds() |
double |
getCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Gets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
String |
getClassName() |
String[] |
getLabelExpressions()
Returns the expression that defines the text which will be showed in
the label
|
ILabelStyle |
getLabelStyle()
Returns the style of the label
|
String |
getName()
Returns the name of the label
|
int |
getPriority() |
int |
getReferenceSystem()
Returns the Reference System used to draw the elements of the image.
|
Geometry |
getShape(ILabelLocationMetrics llm) |
String |
getSQLQuery() |
String |
getStringLabelExpression()
Returns the expression that defines the text which will be showed in
the label ready to be used for the label parser
|
String[] |
getTexts()
Return the text for the label
|
ITextSymbol |
getTextSymbol()
Returns the text symbol that is being used for the text(the font,
size,style,aligment)
|
int |
getUnit()
Returns the unit used to express measures.
|
boolean |
isUseSqlQuery() |
boolean |
isVisible()
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 |
setCartographicSize(double cartographicSize,
Geometry geom)
Sets the size of the cartographic element in pixels.
|
void |
setLabelExpressions(String[] lbl_exps)
Sets the expression that defines the text which will be showed in
the label
|
void |
setLabelStyle(ILabelStyle labelStyle)
Stablishes the style for the label.
|
void |
setName(String name)
Stablishes the name of the label
|
void |
setPriority(int priority) |
void |
setReferenceSystem(int referenceSystem)
Sets the Reference System that defines how this units have to be
handled.
|
void |
setSQLQuery(String sqlQuery) |
void |
setTexts(String[] texts)
Sets the text for the label
|
void |
setTextSymbol(ITextSymbol textSymbol)
Stablishes the text symbol that is going to be used for the text(the
font,size,style,aligment)
|
void |
setUnit(int unitIndex)
Defines the unit used to express measures.
|
void |
setUseSqlQuery(boolean use_sql) |
void |
setVisible(boolean isVisible)
Sets the visibility of the label in the map.
|
double |
toCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Computes and sets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
String |
toString() |
loadFromState, saveToState
boolean isVisible()
boolean isVisible(double scale)
void setVisible(boolean isVisible)
isVisible
- booleanITextSymbol getTextSymbol()
void setTextSymbol(ITextSymbol textSymbol)
textSymbol
- ITextSymbolvoid setLabelStyle(ILabelStyle labelStyle)
labelStyle
- ILabelStyleILabelStyle getLabelStyle()
String getName()
void setName(String name)
name
- void setTexts(String[] texts)
texts
- String[]String[] getTexts()
texts
- String[]void draw(Graphics2D graphics, ILabelLocationMetrics llm, 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
graphics,
- graphics to use to paint the label.llm,
- concrete settings of the placement of this layershp,
- the Shape over whose the label is paintedvoid drawInsideRectangle(Graphics2D graphics, Rectangle bounds) throws SymbolDrawingException
graphics
- Graphics2Dbounds
- RectangleSymbolDrawingException
int getPriority()
void setPriority(int priority)
Geometry getShape(ILabelLocationMetrics llm) throws CreateGeometryException
CreateGeometryException
String getClassName()
double getCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupport
getCartographicSize
in interface CartographicSupport
int getReferenceSystem()
CartographicSupport
The elements have to be scaled to pixel when the image is bein drawn in
order to compose the map. The elements of the map may define its size in
other units than pixel.
CartographicSupport enables the elements to define the size in
measure units but these units may refer to different reference system. Two
kinds of Reference Systems are allowed in this context: CartographicSupport.WORLD,
and CartographicSupport.PAPER.
Depending on which Reference System is used the unit used by this element
refers to distances in the real world (then they are map's CRS-dependant)
or screen or printer output (then they are output DPI-dependant)
In case the unit used is pixel then the reference system does not
have any effect since the source unit is the same than the target unit.
getReferenceSystem
in interface CartographicSupport
int getUnit()
CartographicSupport
getUnit
in interface CartographicSupport
void setCartographicSize(double cartographicSize, Geometry geom)
CartographicSupport
setCartographicSize
in interface CartographicSupport
void setReferenceSystem(int referenceSystem)
CartographicSupport
setReferenceSystem
in interface CartographicSupport
void setUnit(int unitIndex)
CartographicSupport
setUnit
in interface CartographicSupport
double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupport
toCartographicSize
in interface CartographicSupport
Rectangle getBounds()
String getSQLQuery()
void setSQLQuery(String sqlQuery)
String[] getLabelExpressions()
void setLabelExpressions(String[] lbl_exps)
void setUseSqlQuery(boolean use_sql)
boolean isUseSqlQuery()
String getStringLabelExpression()