public class AttrInTableLabelingStrategy extends Object implements IAttrInTableLabelingStrategy
Modifier and Type | Class and Description |
---|---|
static class |
AttrInTableLabelingStrategy.RegisterPersistence |
Modifier and Type | Field and Description |
---|---|
static double |
MIN_TEXT_SIZE |
PAPER, WORLD
Constructor and Description |
---|
AttrInTableLabelingStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
draw(BufferedImage image,
Graphics2D g,
double scale,
ViewPort viewPort,
Cancellable cancel,
double dpi)
Causes the labels to be drawn.
|
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 |
getColorField() |
Color |
getColorFont() |
Color |
getFixedColor() |
double |
getFixedSize() |
Font |
getFont() |
String |
getHeightField() |
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.
|
String |
getRotationField() |
String |
getTextField() |
int |
getUnit()
Returns the unit used to express measures.
|
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(Graphics2D g,
double scale,
ViewPort viewPort,
Cancellable cancel,
PrintAttributes props)
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 |
setCartographicSize(double cartographicSize,
Geometry geom)
Sets the size of the cartographic element in pixels.
|
void |
setColorField(String colorFieldName) |
void |
setColorFont(Color colorFont) |
void |
setFixedColor(Color fixedColor) |
void |
setFixedSize(double fixedSize) |
void |
setFont(Font selFont) |
void |
setHeightField(String heightFieldName)
Sets the field that contains the size of the text.
|
void |
setLabelingMethod(ILabelingMethod method)
Sets the labeling method that will be used the next time the the draw is invoked.
|
void |
setLayer(FLayer layer) |
void |
setPlacementConstraints(IPlacementConstraints constraints)
Sets the PlacementConstraints that will determine where to place the labels.
|
void |
setReferenceSystem(int referenceSystem)
Sets the Reference System that defines how this units have to be
handled.
|
void |
setRotationField(String rotationFieldName) |
void |
setTextField(String textFieldName) |
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) |
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).
|
boolean |
usesFixedColor() |
boolean |
usesFixedSize() |
public static final double MIN_TEXT_SIZE
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 void draw(BufferedImage image, Graphics2D g, double scale, ViewPort viewPort, Cancellable cancel, double dpi) throws ReadException
ILabelingStrategy
draw
in interface ILabelingStrategy
dpi
- TODOReadException
public String getRotationField()
getRotationField
in interface IAttrInTableLabelingStrategy
public String getTextField()
getTextField
in interface IAttrInTableLabelingStrategy
public String getHeightField()
getHeightField
in interface IAttrInTableLabelingStrategy
public String getColorField()
getColorField
in interface IAttrInTableLabelingStrategy
public void setTextField(String textFieldName)
setTextField
in interface IAttrInTableLabelingStrategy
public void setRotationField(String rotationFieldName)
setRotationField
in interface IAttrInTableLabelingStrategy
public void setHeightField(String heightFieldName)
setHeightField
in interface IAttrInTableLabelingStrategy
heightFieldName
- public void setColorField(String colorFieldName)
setColorField
in interface IAttrInTableLabelingStrategy
public void print(Graphics2D g, double scale, ViewPort viewPort, Cancellable cancel, PrintAttributes props) throws ReadException
ILabelingStrategy
print
in interface ILabelingStrategy
ReadException
public void setUsesFixedSize(boolean b)
setUsesFixedSize
in interface IAttrInTableLabelingStrategy
public boolean usesFixedSize()
usesFixedSize
in interface IAttrInTableLabelingStrategy
public double getFixedSize()
getFixedSize
in interface IAttrInTableLabelingStrategy
public void setFixedSize(double fixedSize)
setFixedSize
in interface IAttrInTableLabelingStrategy
public void setUsesFixedColor(boolean b)
setUsesFixedColor
in interface IAttrInTableLabelingStrategy
public boolean usesFixedColor()
usesFixedColor
in interface IAttrInTableLabelingStrategy
public Color getFixedColor()
getFixedColor
in interface IAttrInTableLabelingStrategy
public void setFixedColor(Color fixedColor)
setFixedColor
in interface IAttrInTableLabelingStrategy
public void setUnit(int unitIndex)
CartographicSupport
setUnit
in interface CartographicSupport
public int getUnit()
CartographicSupport
getUnit
in interface CartographicSupport
public String[] getUsedFields()
ILabelingStrategy
getUsedFields
in interface ILabelingStrategy
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
public void setReferenceSystem(int referenceSystem)
CartographicSupport
setReferenceSystem
in interface CartographicSupport
public double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupport
toCartographicSize
in interface CartographicSupport
public void setCartographicSize(double cartographicSize, Geometry geom)
CartographicSupport
setCartographicSize
in interface CartographicSupport
public double getCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
CartographicSupport
getCartographicSize
in interface CartographicSupport
public void setLayer(FLayer layer)
setLayer
in interface ILabelingStrategy
public boolean shouldDrawLabels(double scale)
shouldDrawLabels
in interface ILabelingStrategy
public Color getColorFont()
getColorFont
in interface IAttrInTableLabelingStrategy
public void setColorFont(Color colorFont)
setColorFont
in interface IAttrInTableLabelingStrategy
public Font getFont()
getFont
in interface IAttrInTableLabelingStrategy
public void setFont(Font selFont)
setFont
in interface IAttrInTableLabelingStrategy
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException