public class LineElement extends StyleElement
Modifier and Type | Class and Description |
---|---|
static class |
LineElement.LineType
The type of this line
|
Modifier and Type | Field and Description |
---|---|
java.awt.Color |
color
The color of the line.
|
java.awt.Color |
dashesBackground
The secondary color of the line that is used for the gaps in dashed lines.
|
private java.awt.BasicStroke |
dashesLine
The stroke used to paint the gaps between the dashes
|
private java.awt.BasicStroke |
line
The stroke used to paint the line
|
float |
offset
The dash offset.
|
float |
realWidth
the real width of this line in meter.
|
static LineElement |
UNTAGGED_WAY
The default style for any untagged way.
|
boolean |
wayDirectionArrows
A flag indicating if the direction arrwos should be painted.
|
defaultSelectedHandling, ICON_HEIGHT_IDX, ICON_IMAGE_IDX, ICON_OFFSET_X_IDX, ICON_OFFSET_Y_IDX, ICON_OPACITY_IDX, ICON_WIDTH_IDX, isModifier, majorZIndex, objectZIndex, zIndex
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 |
LineElement(Cascade c,
float defaultMajorZindex,
java.awt.BasicStroke line,
java.awt.Color color,
java.awt.BasicStroke dashesLine,
java.awt.Color dashesBackground,
float offset,
float realWidth,
boolean wayDirectionArrows) |
Modifier and Type | Method and Description |
---|---|
private static java.lang.Float |
computeOffset(LineElement.LineType type,
Cascade c,
Cascade cDef,
java.lang.Float width) |
private static float |
computeRealWidth(Environment env,
LineElement.LineType type,
Cascade c) |
private static java.lang.Float |
computeWidth(LineElement.LineType type,
Cascade c,
Cascade cDef) |
static LineElement |
createCasing(Environment env)
Create a line element for the casing from the given MapCSS environment
|
private static LineElement |
createImpl(Environment env,
LineElement.LineType type) |
static LineElement |
createLeftCasing(Environment env)
Create a line element for the left casing from the given MapCSS environment
|
static LineElement |
createLine(Environment env)
Create a line element from the given MapCSS environment
|
static LineElement |
createRightCasing(Environment env)
Create a line element for the right casing from the given MapCSS environment
|
static LineElement |
createSimpleLineStyle(java.awt.Color color,
boolean isAreaEdge)
Creates a simple line with default width.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isProperLineStyle()
Check if this is a style that makes the line visible to the user
|
java.lang.String |
linecapToString(int linecap)
Converts a linecap of a
BasicStroke to a MapCSS string |
java.lang.String |
linejoinToString(int linejoin)
Converts a linejoin of a
BasicStroke to a MapCSS string |
void |
paintPrimitive(IPrimitive primitive,
MapPaintSettings paintSettings,
StyledMapRenderer painter,
boolean selected,
boolean outermember,
boolean member)
draws a primitive
|
java.lang.String |
toString() |
getFont, getWidth
public static final LineElement UNTAGGED_WAY
private final java.awt.BasicStroke line
public java.awt.Color color
private final java.awt.BasicStroke dashesLine
public java.awt.Color dashesBackground
public float offset
public float realWidth
public boolean wayDirectionArrows
protected LineElement(Cascade c, float defaultMajorZindex, java.awt.BasicStroke line, java.awt.Color color, java.awt.BasicStroke dashesLine, java.awt.Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows)
public void paintPrimitive(IPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, boolean selected, boolean outermember, boolean member)
StyleElement
paintPrimitive
in class StyleElement
primitive
- primitive to drawpaintSettings
- paint settingspainter
- painterselected
- true, if primitive is selectedoutermember
- true, if primitive is not selected and outer member of a selected multipolygon relationmember
- true, if primitive is not selected and member of a selected relationpublic boolean isProperLineStyle()
StyleElement
isProperLineStyle
in class StyleElement
true
for line stylespublic java.lang.String linejoinToString(int linejoin)
BasicStroke
to a MapCSS stringlinejoin
- The linejoinnull
on error.BasicStroke.getLineJoin()
public java.lang.String linecapToString(int linecap)
BasicStroke
to a MapCSS stringlinecap
- The linecapnull
on error.BasicStroke.getEndCap()
public boolean equals(java.lang.Object obj)
equals
in class StyleElement
public int hashCode()
hashCode
in class StyleElement
public java.lang.String toString()
toString
in class StyleElement
public static LineElement createSimpleLineStyle(java.awt.Color color, boolean isAreaEdge)
color
- The color to useisAreaEdge
- If this is an edge for an area. Edges are drawn at lower Z-Index.public static LineElement createLine(Environment env)
env
- The environmentnull
if none should be painted.public static LineElement createLeftCasing(Environment env)
env
- The environmentnull
if none should be painted.public static LineElement createRightCasing(Environment env)
env
- The environmentnull
if none should be painted.public static LineElement createCasing(Environment env)
env
- The environmentnull
if none should be painted.private static LineElement createImpl(Environment env, LineElement.LineType type)
private static java.lang.Float computeWidth(LineElement.LineType type, Cascade c, Cascade cDef)
private static float computeRealWidth(Environment env, LineElement.LineType type, Cascade c)
private static java.lang.Float computeOffset(LineElement.LineType type, Cascade c, Cascade cDef, java.lang.Float width)