Class NodeElement
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement
-
- org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement
-
- All Implemented Interfaces:
StyleKeys
public class NodeElement extends StyleElement
applies for Nodes and turn restriction relations
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
ICON_KEYS
MapImage
mapImage
The image that is used to display this node.RotationAngle
mapImageAngle
The angle that is used to rotatemapImage
.Symbol
symbol
The symbol that should be used for drawing this node.-
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 Modifier Constructor Description protected
NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeElement
create(Environment env)
Creates a new node element for the given Environment(package private) static NodeElement
create(Environment env, float defaultMajorZindex, boolean allowDefault)
static MapImage
createIcon(Environment env)
Create a map icon for the environment using the default keys.static MapImage
createIcon(Environment env, java.lang.String... keys)
Create a map icon for the environment.static RotationAngle
createRotationAngle(Environment env)
Reads the icon-rotation property and creates a rotation angle from it.private static RotationAngle
createRotationAngle(Environment env, java.lang.String key)
private static Symbol
createSymbol(Environment env)
Create a symbol for the environmentstatic RotationAngle
createTextRotationAngle(Environment env)
Reads the text-rotation property and creates a rotation angle from it.boolean
equals(java.lang.Object obj)
BoxTextElement.BoxProvider
getBoxProvider()
Gets the selection box for this element.int
hashCode()
private static int
max(int a, int b, int c, int d)
void
paintPrimitive(IPrimitive primitive, MapPaintSettings settings, StyledMapRenderer painter, boolean selected, boolean outermember, boolean member)
draws a primitiveprivate void
paintWithSymbol(MapPaintSettings settings, StyledMapRenderer painter, boolean selected, boolean member, INode n)
java.lang.String
toString()
-
Methods inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement
getFont, getWidth, isProperLineStyle
-
-
-
-
Field Detail
-
mapImageAngle
public final RotationAngle mapImageAngle
The angle that is used to rotatemapImage
. May benull
to indicate no rotation.
-
ICON_KEYS
private static final java.lang.String[] ICON_KEYS
-
-
Constructor Detail
-
NodeElement
protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle)
-
-
Method Detail
-
create
public static NodeElement create(Environment env)
Creates a new node element for the given Environment- Parameters:
env
- The environment- Returns:
- The node element style or
null
if the node should not be painted.
-
create
static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault)
-
createRotationAngle
public static RotationAngle createRotationAngle(Environment env)
Reads the icon-rotation property and creates a rotation angle from it.- Parameters:
env
- The environment- Returns:
- The angle
- Since:
- 11670
-
createTextRotationAngle
public static RotationAngle createTextRotationAngle(Environment env)
Reads the text-rotation property and creates a rotation angle from it.- Parameters:
env
- The environment- Returns:
- The angle
- Since:
- 16253
-
createRotationAngle
private static RotationAngle createRotationAngle(Environment env, java.lang.String key)
-
createIcon
public static MapImage createIcon(Environment env)
Create a map icon for the environment using the default keys.- Parameters:
env
- The environment to read the icon form- Returns:
- The icon or
null
if no icon is defined - Since:
- 11670
-
createIcon
public static MapImage createIcon(Environment env, java.lang.String... keys)
Create a map icon for the environment.- Parameters:
env
- The environment to read the icon formkeys
- The keys, indexed by the ICON_..._IDX constants.- Returns:
- The icon or
null
if no icon is defined
-
createSymbol
private static Symbol createSymbol(Environment env)
Create a symbol for the environment- Parameters:
env
- The environment to read the icon form- Returns:
- The symbol.
-
paintPrimitive
public void paintPrimitive(IPrimitive primitive, MapPaintSettings settings, 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 drawsettings
- 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
-
paintWithSymbol
private void paintWithSymbol(MapPaintSettings settings, StyledMapRenderer painter, boolean selected, boolean member, INode n)
-
getBoxProvider
public BoxTextElement.BoxProvider getBoxProvider()
Gets the selection box for this element.- Returns:
- The selection box as
BoxTextElement.BoxProvider
object.
-
max
private static int max(int a, int b, int c, int d)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classStyleElement
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classStyleElement
-
toString
public java.lang.String toString()
- Overrides:
toString
in classStyleElement
-
-