|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.mappaint.TextElement
public class TextElement
Represents the rendering style for a textual label placed somewhere on the map.
Field Summary | |
---|---|
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
|
Fields inherited from interface org.openstreetmap.josm.gui.mappaint.StyleKeys |
---|
COLOR, DASHES, DASHES_BACKGROUND_COLOR, DASHES_BACKGROUND_OPACITY, DASHES_OFFSET, FILL_COLOR, FILL_IMAGE, FILL_OPACITY, ICON_IMAGE, MODIFIER, OBJECT_Z_INDEX, OFFSET, OPACITY, REAL_WIDTH, TEXT, TEXT_POSITION, WIDTH, Z_INDEX |
Constructor Summary | |
---|---|
TextElement(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 |
|
TextElement(TextElement other)
Copy constructor |
Method Summary | |
---|---|
protected static LabelCompositionStrategy |
buildLabelCompositionStrategy(Cascade c,
boolean defaultAnnotate)
Derives a suitable label composition strategy from the style properties in c . |
static TextElement |
create(Cascade c,
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public TextElement(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
- yOffset
- color
- the color to be used. Must not be nullhaloRadius
- haloColor
- public TextElement(TextElement other)
other
- the other element.Method Detail |
---|
protected static LabelCompositionStrategy buildLabelCompositionStrategy(Cascade c, boolean defaultAnnotate)
c
.
c
- the style properties
public static TextElement create(Cascade c, java.awt.Color defaultTextColor, boolean defaultAnnotate) throws java.lang.IllegalArgumentException
c
and the
default text color defaultTextColor
c
- the style propertiesdefaultTextColor
- 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 declarations
java.lang.IllegalArgumentException
- thrown if defaultTextColor
is nullpublic java.lang.String getString(OsmPrimitive osm)
osm
.
osm
- the OSM object
osm
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |