Class RepeatImageElement
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement
-
- org.openstreetmap.josm.gui.mappaint.styleelement.RepeatImageElement
-
- All Implemented Interfaces:
StyleKeys
public class RepeatImageElement extends StyleElement
Style element that displays a repeated image pattern along a way.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RepeatImageElement.LineImageAlignment
The side on which the image should be aligned to the line.
-
Field Summary
Fields Modifier and Type Field Description RepeatImageElement.LineImageAlignment
align
The alignment of the imagefloat
offset
The offset to the side of the wayfloat
opacity
The opacityMapImage
pattern
The image to draw on the line repeatedlyfloat
phase
The offset of the first image along the wayprivate static java.lang.String[]
REPEAT_IMAGE_KEYS
float
spacing
The space between the images-
Fields inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement
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
-
Fields inherited from interface org.openstreetmap.josm.gui.mappaint.StyleKeys
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, TEXT_ROTATION, WAY_DIRECTION_ARROWS, WIDTH, Z_INDEX
-
-
Constructor Summary
Constructors Constructor Description RepeatImageElement(Cascade c, MapImage pattern, float offset, float spacing, float phase, float opacity, RepeatImageElement.LineImageAlignment align)
Create a new image element
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RepeatImageElement
create(Environment env)
Create a RepeatImageElement from the given environmentboolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isProperLineStyle()
Check if this is a style that makes the line visible to the uservoid
paintPrimitive(IPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, boolean selected, boolean outermember, boolean member)
draws a primitivejava.lang.String
toString()
-
Methods inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement
getFont, getWidth
-
-
-
-
Field Detail
-
offset
public float offset
The offset to the side of the way
-
spacing
public float spacing
The space between the images
-
phase
public float phase
The offset of the first image along the way
-
opacity
public float opacity
The opacity
-
align
public RepeatImageElement.LineImageAlignment align
The alignment of the image
-
REPEAT_IMAGE_KEYS
private static final java.lang.String[] REPEAT_IMAGE_KEYS
-
-
Constructor Detail
-
RepeatImageElement
public RepeatImageElement(Cascade c, MapImage pattern, float offset, float spacing, float phase, float opacity, RepeatImageElement.LineImageAlignment align)
Create a new image element- Parameters:
c
- The cascadepattern
- The image to draw on the line repeatedlyoffset
- The offset to the side of the wayspacing
- The space between the imagesphase
- The offset of the first image along the wayopacity
- The opacityalign
- The alignment of the image
-
-
Method Detail
-
create
public static RepeatImageElement create(Environment env)
Create a RepeatImageElement from the given environment- Parameters:
env
- The environment- Returns:
- The image style element or
null
if none should be painted
-
paintPrimitive
public void paintPrimitive(IPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, boolean selected, boolean outermember, boolean member)
Description copied from class:StyleElement
draws a primitive- Specified by:
paintPrimitive
in classStyleElement
- Parameters:
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 relation
-
isProperLineStyle
public boolean isProperLineStyle()
Description copied from class:StyleElement
Check if this is a style that makes the line visible to the user- Overrides:
isProperLineStyle
in classStyleElement
- Returns:
true
for line styles
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classStyleElement
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classStyleElement
-
toString
public java.lang.String toString()
- Overrides:
toString
in classStyleElement
-
-