Class NodeElement
java.lang.Object
org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement
org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement
- All Implemented Interfaces:
StyleKeys
applies for Nodes and turn restriction relations
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]final MapImageThe image that is used to display this node.final RotationAngleThe angle that is used to rotatemapImage.final SymbolThe 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, zIndexFields 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
ConstructorsModifierConstructorDescriptionprotectedNodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) -
Method Summary
Modifier and TypeMethodDescriptionstatic 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, String... keys) Create a map icon for the environment.static RotationAngleReads the icon-rotation property and creates a rotation angle from it.private static RotationAnglecreateRotationAngle(Environment env, String key) private static SymbolcreateSymbol(Environment env) Create a symbol for the environmentstatic RotationAngleReads the text-rotation property and creates a rotation angle from it.booleanGets 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) toString()Methods inherited from class org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement
getFont, getWidth, isProperLineStyle
-
Field Details
-
mapImage
The image that is used to display this node. May benull -
mapImageAngle
The angle that is used to rotatemapImage. May benullto indicate no rotation. -
symbol
The symbol that should be used for drawing this node. -
ICON_KEYS
-
-
Constructor Details
-
NodeElement
protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle)
-
-
Method Details
-
create
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
-
createRotationAngle
Reads the icon-rotation property and creates a rotation angle from it.- Parameters:
env- The environment- Returns:
- The angle
- Since:
- 11670
-
createTextRotationAngle
Reads the text-rotation property and creates a rotation angle from it.- Parameters:
env- The environment- Returns:
- The angle
- Since:
- 16253
-
createRotationAngle
-
createIcon
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
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
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
Gets the selection box for this element.- Returns:
- The selection box as
BoxTextElement.BoxProviderobject.
-
max
-
hashCode
- Overrides:
hashCodein classStyleElement
-
equals
- Overrides:
equalsin classStyleElement
-
toString
- Overrides:
toStringin classStyleElement
-