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_KEYSMapImagemapImageThe image that is used to display this node.RotationAnglemapImageAngleThe angle that is used to rotatemapImage.SymbolsymbolThe 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 protectedNodeElement(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 NodeElementcreate(Environment env)Creates a new node element for the given Environment(package private) static NodeElementcreate(Environment env, float defaultMajorZindex, boolean allowDefault)static MapImagecreateIcon(Environment env)Create a map icon for the environment using the default keys.static MapImagecreateIcon(Environment env, java.lang.String... keys)Create a map icon for the environment.static RotationAnglecreateRotationAngle(Environment env)Reads the icon-rotation property and creates a rotation angle from it.private static RotationAnglecreateRotationAngle(Environment env, java.lang.String key)private static SymbolcreateSymbol(Environment env)Create a symbol for the environmentstatic RotationAnglecreateTextRotationAngle(Environment env)Reads the text-rotation property and creates a rotation angle from it.booleanequals(java.lang.Object obj)BoxTextElement.BoxProvidergetBoxProvider()Gets the selection box for this element.inthashCode()private static intmax(int a, int b, int c, int d)voidpaintPrimitive(IPrimitive primitive, MapPaintSettings settings, StyledMapRenderer painter, boolean selected, boolean outermember, boolean member)draws a primitiveprivate voidpaintWithSymbol(MapPaintSettings settings, StyledMapRenderer painter, boolean selected, boolean member, INode n)java.lang.StringtoString()-
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 benullto 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
nullif 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
nullif 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
nullif 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:StyleElementdraws a primitive- Specified by:
paintPrimitivein 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.BoxProviderobject.
-
max
private static int max(int a, int b, int c, int d)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classStyleElement
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classStyleElement
-
toString
public java.lang.String toString()
- Overrides:
toStringin classStyleElement
-
-