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 |
NAMEPAPER, 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, toCartographicUnitsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopyCartographicContext, copyCartographicContext, getCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, toCartographicUnitspublic 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 DynamicLabelingStrategypublic int getComputedRotation()
getComputedRotation in interface DynamicLabelingStrategypublic Expression getText()
getText in interface DynamicLabelingStrategypublic java.lang.String getComputedText()
getComputedText in interface DynamicLabelingStrategypublic Expression getHeight()
getHeight in interface DynamicLabelingStrategypublic int getComputedHeight()
getComputedHeight in interface DynamicLabelingStrategypublic Expression getColor()
getColor in interface DynamicLabelingStrategypublic java.awt.Color getComputedColor()
getComputedColor in interface DynamicLabelingStrategypublic Expression getFixedSize()
getFixedSize in interface DynamicLabelingStrategypublic double getComputedFixedSize()
getComputedFixedSize in interface DynamicLabelingStrategypublic int getComputedUnit()
getComputedUnit in interface DynamicLabelingStrategypublic void setText(Expression expression)
setText in interface DynamicLabelingStrategypublic void setRotation(Expression expression)
setRotation in interface DynamicLabelingStrategypublic void setHeight(Expression expression)
setHeight in interface DynamicLabelingStrategypublic void setColor(Expression expression)
setColor in interface DynamicLabelingStrategypublic void setUsesFixedSize(boolean b)
setUsesFixedSize in interface DynamicLabelingStrategypublic boolean usesFixedSize()
usesFixedSize in interface DynamicLabelingStrategypublic void setFixedSize(double fixedSize)
setFixedSize in interface DynamicLabelingStrategypublic void setUsesFixedColor(boolean b)
setUsesFixedColor in interface DynamicLabelingStrategypublic boolean usesFixedColor()
usesFixedColor in interface DynamicLabelingStrategypublic Expression getFixedColor()
getFixedColor in interface DynamicLabelingStrategypublic java.awt.Color getComputedFixedColor()
getComputedFixedColor in interface DynamicLabelingStrategypublic void setFixedColor(java.awt.Color fixedColor)
setFixedColor in interface DynamicLabelingStrategypublic Expression getColorFont()
getColorFont in interface DynamicLabelingStrategypublic java.awt.Color getComputedColorFont()
getComputedColorFont in interface DynamicLabelingStrategypublic void setColorFont(java.awt.Color colorFont)
setColorFont in interface DynamicLabelingStrategypublic Expression getFont()
getFont in interface DynamicLabelingStrategypublic java.awt.Font getComputedFont()
getComputedFont in interface DynamicLabelingStrategypublic void setFont(java.awt.Font selFont)
setFont in interface DynamicLabelingStrategypublic Expression getFontStyle()
getFontStyle in interface DynamicLabelingStrategypublic int getComputedFontStyle()
getComputedFontStyle in interface DynamicLabelingStrategypublic void setFontStyle(Expression expression)
setFontStyle in interface DynamicLabelingStrategypublic void setFeature(Feature f)
setFeature in interface DynamicLabelingStrategypublic ILabelingMethod getLabelingMethod()
ILabelingStrategygetLabelingMethod in interface ILabelingStrategyILabelingMethodpublic void setLabelingMethod(ILabelingMethod method)
ILabelingStrategysetLabelingMethod in interface ILabelingStrategypublic IPlacementConstraints getPlacementConstraints()
ILabelingStrategygetPlacementConstraints in interface ILabelingStrategypublic void setPlacementConstraints(IPlacementConstraints constraints)
ILabelingStrategysetPlacementConstraints in interface ILabelingStrategypublic IZoomConstraints getZoomConstraints()
ILabelingStrategygetZoomConstraints in interface ILabelingStrategypublic void setZoomConstraints(IZoomConstraints constraints)
ILabelingStrategysetZoomConstraints in interface ILabelingStrategypublic Expression getUnitExp()
getUnitExp in interface DynamicLabelingStrategypublic Expression getReferenceSystemExp()
public void draw(java.awt.image.BufferedImage mapImage,
java.awt.Graphics2D mapGraphics,
double scale,
ViewPort viewPort,
Cancellable cancel,
double dpi)
throws ReadException
ILabelingStrategydraw in interface ILabelingStrategydpi - TODOReadExceptionpublic void print(java.awt.Graphics2D g,
double scale,
ViewPort viewPort,
Cancellable cancel,
PrintAttributes properties)
throws ReadException
ILabelingStrategyprint in interface ILabelingStrategyReadExceptionpublic java.lang.String[] getUsedFields()
ILabelingStrategygetUsedFields in interface ILabelingStrategypublic void setLayer(FLayer flayer)
setLayer in interface ILabelingStrategypublic boolean shouldDrawLabels(double scale)
shouldDrawLabels in interface ILabelingStrategypublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentPersistenceExceptionpublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentPersistenceExceptionpublic void setUnit(int unitIndex)
CartographicSupportsetUnit in interface CartographicSupportsetUnit in class AbstractCartographicSupportpublic void setUnit(Expression expression)
setUnit in interface DynamicLabelingStrategypublic int getUnit()
CartographicSupportgetUnit in interface CartographicSupportgetUnit in class AbstractCartographicSupportpublic 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 CartographicSupportgetReferenceSystem in class AbstractCartographicSupportpublic void setReferenceSystem(int referenceSystem)
CartographicSupportsetReferenceSystem in interface CartographicSupportsetReferenceSystem in class AbstractCartographicSupportpublic void setFont(Expression expression)
setFont in interface DynamicLabelingStrategypublic void setFontStyle(int style)
setFontStyle in interface DynamicLabelingStrategypublic void setReferenceSystem(Expression expression)
setReferenceSystem in interface DynamicLabelingStrategy