Modifier and Type | Field and Description |
---|---|
static LabelCompositionStrategy |
AUTO_LABEL_COMPOSITION_STRATEGY |
java.awt.Color |
color |
java.awt.Font |
font
the font to be used when rendering
|
java.awt.Color |
haloColor |
java.lang.Float |
haloRadius |
LabelCompositionStrategy |
labelCompositionStrategy
the strategy for building the actual label value for a given a
OsmPrimitive . |
int |
xOffset |
int |
yOffset |
COLOR, DASHES, DASHES_BACKGROUND_COLOR, DASHES_BACKGROUND_OPACITY, DASHES_OFFSET, FILL_COLOR, FILL_EXTENT, FILL_EXTENT_THRESHOLD, FILL_IMAGE, FILL_OPACITY, FONT_FAMILY, FONT_SIZE, FONT_STYLE, FONT_WEIGHT, ICON_HEIGHT, ICON_IMAGE, ICON_OFFSET_X, ICON_OFFSET_Y, ICON_OPACITY, ICON_ROTATION, ICON_WIDTH, LINECAP, LINEJOIN, MAJOR_Z_INDEX, MITERLIMIT, MODIFIER, OBJECT_Z_INDEX, OFFSET, OPACITY, REAL_WIDTH, REPEAT_IMAGE, REPEAT_IMAGE_ALIGN, REPEAT_IMAGE_HEIGHT, REPEAT_IMAGE_OFFSET, REPEAT_IMAGE_OPACITY, REPEAT_IMAGE_PHASE, REPEAT_IMAGE_SPACING, REPEAT_IMAGE_WIDTH, TEXT, TEXT_ANCHOR_HORIZONTAL, TEXT_ANCHOR_VERTICAL, TEXT_COLOR, TEXT_HALO_COLOR, TEXT_HALO_OPACITY, TEXT_HALO_RADIUS, TEXT_OFFSET, TEXT_OFFSET_X, TEXT_OFFSET_Y, TEXT_OPACITY, TEXT_POSITION, WIDTH, Z_INDEX
Constructor and Description |
---|
TextLabel(LabelCompositionStrategy strategy,
java.awt.Font font,
int xOffset,
int yOffset,
java.awt.Color color,
java.lang.Float haloRadius,
java.awt.Color haloColor)
Creates a new text element
|
TextLabel(TextLabel other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
protected static LabelCompositionStrategy |
buildLabelCompositionStrategy(Cascade c,
boolean defaultAnnotate)
Derives a suitable label composition strategy from the style properties in
c . |
static TextLabel |
create(Environment env,
java.awt.Color defaultTextColor,
boolean defaultAnnotate)
Builds a text element from style properties in
c and the
default text color defaultTextColor |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getString(OsmPrimitive osm)
Replies the label to be rendered for the primitive
osm . |
int |
hashCode() |
java.lang.String |
toString() |
protected java.lang.String |
toStringImpl() |
public static final LabelCompositionStrategy AUTO_LABEL_COMPOSITION_STRATEGY
public LabelCompositionStrategy labelCompositionStrategy
OsmPrimitive
.
Check for null before accessing.public java.awt.Font font
public int xOffset
public int yOffset
public java.awt.Color color
public java.lang.Float haloRadius
public java.awt.Color haloColor
public TextLabel(LabelCompositionStrategy strategy, java.awt.Font font, int xOffset, int yOffset, java.awt.Color color, java.lang.Float haloRadius, java.awt.Color haloColor)
strategy
- the strategy indicating how the text is composed for a specific OsmPrimitive
to be rendered.
If null, no label is rendered.font
- the font to be used. Must not be null.xOffset
- x offsetyOffset
- y offsetcolor
- the color to be used. Must not be nullhaloRadius
- halo radiushaloColor
- halo colorprotected static LabelCompositionStrategy buildLabelCompositionStrategy(Cascade c, boolean defaultAnnotate)
c
.c
- the style propertiesdefaultAnnotate
- whether to return AUTO_LABEL_COMPOSITION_STRATEGY
if not strategy is foundnull
public static TextLabel create(Environment env, java.awt.Color defaultTextColor, boolean defaultAnnotate)
c
and the
default text color defaultTextColor
env
- the environmentdefaultTextColor
- the default text color. Must not be null.defaultAnnotate
- true, if a text label shall be rendered by default, even if the style sheet
doesn't include respective style declarationsjava.lang.IllegalArgumentException
- if defaultTextColor
is nullpublic java.lang.String getString(OsmPrimitive osm)
osm
.osm
- the OSM objectosm
is null or if no label can be
derived for osm
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String toStringImpl()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object