Modifier and Type | Field and Description |
---|---|
static LabelCompositionStrategy |
AUTO_LABEL_COMPOSITION_STRATEGY
The default strategy to use when determining the label of a element.
|
java.awt.Color |
color
The color to draw the text in, includes alpha.
|
java.awt.Font |
font
the font to be used when rendering
|
java.awt.Color |
haloColor
The color of the halo effect.
|
java.lang.Float |
haloRadius
The radius of the halo effect.
|
LabelCompositionStrategy |
labelCompositionStrategy
The strategy for building the actual label value for a given a
OsmPrimitive . |
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_POSITION, 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, WAY_DIRECTION_ARROWS, WIDTH, Z_INDEX
Modifier | Constructor and Description |
---|---|
protected |
TextLabel(LabelCompositionStrategy strategy,
java.awt.Font font,
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(IPrimitive osm)
Replies the label to be rendered for the primitive
osm . |
static java.awt.geom.Point2D |
getTextOffset(Cascade c)
Gets the text-offset property from a cascade
|
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 java.awt.Color color
public java.lang.Float haloRadius
public java.awt.Color haloColor
protected TextLabel(LabelCompositionStrategy strategy, java.awt.Font font, 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.color
- 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 static java.awt.geom.Point2D getTextOffset(Cascade c)
c
- The cascadepublic java.lang.String getString(IPrimitive 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