public class DefaultDynamicLabelingStrategy extends AbstractCartographicSupport implements DynamicLabelingStrategy
CartographicSupport.CartographicContext
Modifier and Type | Field and Description |
---|---|
static Expression |
expColor |
static Expression |
expFont |
static Expression |
expFontStyle |
static Expression |
expHeight |
static Expression |
expReferenceSystem |
static Expression |
expRotation |
static Expression |
expText |
static Expression |
expUnit |
java.lang.String |
LCOLOR |
java.lang.String |
LFONT |
java.lang.String |
LFONTSTYLE |
java.lang.String |
LHEIGHT |
java.lang.String |
LROTATION |
java.lang.String |
LTEXT |
NAME
PAPER, WORLD
Constructor and Description |
---|
DefaultDynamicLabelingStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.image.BufferedImage mapImage,
java.awt.Graphics2D mapGraphics,
double scale,
ViewPort viewPort,
Cancellable cancel,
double dpi)
Causes the labels to be drawn.
|
Expression |
getColor() |
Expression |
getColorFont() |
java.awt.Color |
getComputedColor() |
java.awt.Color |
getComputedColorFont() |
java.awt.Color |
getComputedFixedColor() |
double |
getComputedFixedSize() |
java.awt.Font |
getComputedFont() |
int |
getComputedFontStyle() |
int |
getComputedHeight() |
int |
getComputedReferenceSystem() |
int |
getComputedRotation() |
java.lang.String |
getComputedText() |
int |
getComputedUnit() |
int |
getComputedUnitExp() |
java.lang.Object |
getComputedValue(java.lang.String field) |
SymbolTable |
getFeatureSymbolTable() |
Expression |
getFixedColor() |
Expression |
getFixedSize() |
Expression |
getFont() |
Expression |
getFontStyle() |
Expression |
getHeight() |
ILabelingMethod |
getLabelingMethod()
Returns the labeling method currently in use.
|
IPlacementConstraints |
getPlacementConstraints()
Returns the current placement constraints that determine the position
where the label is placed.
|
int |
getReferenceSystem()
Returns the Reference System used to draw the elements of the image.
|
Expression |
getReferenceSystemExp() |
Expression |
getRotation() |
Expression |
getText() |
int |
getUnit()
Returns the unit used to express measures.
|
Expression |
getUnitExp() |
java.lang.String[] |
getUsedFields()
Returns a non-null String[] containing the names of the fields involved in the
labeling.
|
IZoomConstraints |
getZoomConstraints()
Returns the current placement constraints that determine the position
where the label is placed.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
print(java.awt.Graphics2D g,
double scale,
ViewPort viewPort,
Cancellable cancel,
PrintAttributes properties)
Applies the printer properties to the rendering process to match its attributes.
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setColor(Expression expression) |
void |
setColorFont(java.awt.Color colorFont) |
void |
setFeature(Feature f) |
void |
setFixedColor(java.awt.Color fixedColor) |
void |
setFixedSize(double fixedSize) |
void |
setFont(Expression expression) |
void |
setFont(java.awt.Font selFont) |
void |
setFontStyle(Expression expression) |
void |
setFontStyle(int style) |
void |
setHeight(Expression expression) |
void |
setLabelingMethod(ILabelingMethod method)
Sets the labeling method that will be used the next time the the draw is invoked.
|
void |
setLayer(FLayer flayer) |
void |
setPlacementConstraints(IPlacementConstraints constraints)
Sets the PlacementConstraints that will determine where to place the labels.
|
void |
setReferenceSystem(Expression expression) |
void |
setReferenceSystem(int referenceSystem)
Sets the Reference System that defines how this units have to be
handled.
|
void |
setRotation(Expression expression) |
void |
setText(Expression expression) |
void |
setUnit(Expression expression) |
void |
setUnit(int unitIndex)
Defines the unit used to express measures.
|
void |
setUsesFixedColor(boolean b) |
void |
setUsesFixedSize(boolean b) |
void |
setZoomConstraints(IZoomConstraints constraints)
Sets the PlacementConstraints that will determine where to place the labels.
|
boolean |
shouldDrawLabels(double scale) |
boolean |
usesFixedColor() |
boolean |
usesFixedSize() |
copyCartographicContext, getCartographicContext, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, toCartographicUnits
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copyCartographicContext, copyCartographicContext, getCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, toCartographicUnits
public java.lang.String LROTATION
public java.lang.String LTEXT
public java.lang.String LHEIGHT
public java.lang.String LCOLOR
public java.lang.String LFONT
public java.lang.String LFONTSTYLE
public static Expression expRotation
public static Expression expText
public static Expression expHeight
public static Expression expColor
public static Expression expFont
public static Expression expFontStyle
public static Expression expUnit
public static Expression expReferenceSystem
public SymbolTable getFeatureSymbolTable()
public java.lang.Object getComputedValue(java.lang.String field)
public Expression getRotation()
getRotation
in interface DynamicLabelingStrategy
public int getComputedRotation()
getComputedRotation
in interface DynamicLabelingStrategy
public Expression getText()
getText
in interface DynamicLabelingStrategy
public java.lang.String getComputedText()
getComputedText
in interface DynamicLabelingStrategy
public Expression getHeight()
getHeight
in interface DynamicLabelingStrategy
public int getComputedHeight()
getComputedHeight
in interface DynamicLabelingStrategy
public Expression getColor()
getColor
in interface DynamicLabelingStrategy
public java.awt.Color getComputedColor()
getComputedColor
in interface DynamicLabelingStrategy
public Expression getFixedSize()
getFixedSize
in interface DynamicLabelingStrategy
public double getComputedFixedSize()
getComputedFixedSize
in interface DynamicLabelingStrategy
public int getComputedUnit()
getComputedUnit
in interface DynamicLabelingStrategy
public void setText(Expression expression)
setText
in interface DynamicLabelingStrategy
public void setRotation(Expression expression)
setRotation
in interface DynamicLabelingStrategy
public void setHeight(Expression expression)
setHeight
in interface DynamicLabelingStrategy
public void setColor(Expression expression)
setColor
in interface DynamicLabelingStrategy
public void setUsesFixedSize(boolean b)
setUsesFixedSize
in interface DynamicLabelingStrategy
public boolean usesFixedSize()
usesFixedSize
in interface DynamicLabelingStrategy
public void setFixedSize(double fixedSize)
setFixedSize
in interface DynamicLabelingStrategy
public void setUsesFixedColor(boolean b)
setUsesFixedColor
in interface DynamicLabelingStrategy
public boolean usesFixedColor()
usesFixedColor
in interface DynamicLabelingStrategy
public Expression getFixedColor()
getFixedColor
in interface DynamicLabelingStrategy
public java.awt.Color getComputedFixedColor()
getComputedFixedColor
in interface DynamicLabelingStrategy
public void setFixedColor(java.awt.Color fixedColor)
setFixedColor
in interface DynamicLabelingStrategy
public Expression getColorFont()
getColorFont
in interface DynamicLabelingStrategy
public java.awt.Color getComputedColorFont()
getComputedColorFont
in interface DynamicLabelingStrategy
public void setColorFont(java.awt.Color colorFont)
setColorFont
in interface DynamicLabelingStrategy
public Expression getFont()
getFont
in interface DynamicLabelingStrategy
public java.awt.Font getComputedFont()
getComputedFont
in interface DynamicLabelingStrategy
public void setFont(java.awt.Font selFont)
setFont
in interface DynamicLabelingStrategy
public Expression getFontStyle()
getFontStyle
in interface DynamicLabelingStrategy
public int getComputedFontStyle()
getComputedFontStyle
in interface DynamicLabelingStrategy
public void setFontStyle(Expression expression)
setFontStyle
in interface DynamicLabelingStrategy
public void setFeature(Feature f)
setFeature
in interface DynamicLabelingStrategy
public ILabelingMethod getLabelingMethod()
ILabelingStrategy
getLabelingMethod
in interface ILabelingStrategy
ILabelingMethod
public void setLabelingMethod(ILabelingMethod method)
ILabelingStrategy
setLabelingMethod
in interface ILabelingStrategy
public IPlacementConstraints getPlacementConstraints()
ILabelingStrategy
getPlacementConstraints
in interface ILabelingStrategy
public void setPlacementConstraints(IPlacementConstraints constraints)
ILabelingStrategy
setPlacementConstraints
in interface ILabelingStrategy
public IZoomConstraints getZoomConstraints()
ILabelingStrategy
getZoomConstraints
in interface ILabelingStrategy
public void setZoomConstraints(IZoomConstraints constraints)
ILabelingStrategy
setZoomConstraints
in interface ILabelingStrategy
public Expression getUnitExp()
getUnitExp
in interface DynamicLabelingStrategy
public Expression getReferenceSystemExp()
public void draw(java.awt.image.BufferedImage mapImage, java.awt.Graphics2D mapGraphics, double scale, ViewPort viewPort, Cancellable cancel, double dpi) throws ReadException
ILabelingStrategy
draw
in interface ILabelingStrategy
dpi
- TODOReadException
public void print(java.awt.Graphics2D g, double scale, ViewPort viewPort, Cancellable cancel, PrintAttributes properties) throws ReadException
ILabelingStrategy
print
in interface ILabelingStrategy
ReadException
public java.lang.String[] getUsedFields()
ILabelingStrategy
getUsedFields
in interface ILabelingStrategy
public void setLayer(FLayer flayer)
setLayer
in interface ILabelingStrategy
public boolean shouldDrawLabels(double scale)
shouldDrawLabels
in interface ILabelingStrategy
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void setUnit(int unitIndex)
CartographicSupport
setUnit
in interface CartographicSupport
setUnit
in class AbstractCartographicSupport
public void setUnit(Expression expression)
setUnit
in interface DynamicLabelingStrategy
public int getUnit()
CartographicSupport
getUnit
in interface CartographicSupport
getUnit
in class AbstractCartographicSupport
public int getComputedUnitExp()
public int getComputedReferenceSystem()
public 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
getReferenceSystem
in class AbstractCartographicSupport
public void setReferenceSystem(int referenceSystem)
CartographicSupport
setReferenceSystem
in interface CartographicSupport
setReferenceSystem
in class AbstractCartographicSupport
public void setFont(Expression expression)
setFont
in interface DynamicLabelingStrategy
public void setFontStyle(int style)
setFontStyle
in interface DynamicLabelingStrategy
public void setReferenceSystem(Expression expression)
setReferenceSystem
in interface DynamicLabelingStrategy