Class WireframeMapRenderer
java.lang.Object
org.openstreetmap.josm.data.osm.visitor.paint.AbstractMapRenderer
org.openstreetmap.josm.data.osm.visitor.paint.WireframeMapRenderer
- All Implemented Interfaces:
Rendering,PrimitiveVisitor
A map renderer that paints a simple scheme of every primitive it visits to a
previous set graphic environment.
- Since:
- 23
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ArrowPaintHelperprotected ColorColor Preference for multiply connected nodesprotected intPreference: size of multiply connected nodesprotected ColorColor cache to draw subsequent segments of same color as onePath.protected MapPath2DPath store to draw subsequent segments of same color as onePath.protected ColorColor Preference for ways not matching any other groupprotected booleanPreference: should multiply connected nodes be filledprotected booleanPreference: should selected nodes be filledprotected booleanPreference: should tagged nodes be filledprotected booleanPreference: should unselected nodes be filledprivate final StrokeHelper variable forvisit(IRelation)protected ColorColor Preference for relationsprotected intPreference: size of selected nodesprotected booleanPreference: should directional arrows be displayedprotected booleanPreference: should only the last arrow of a way be displayedprotected booleanPreference: should arrows for oneways be displayedprotected booleanPreference: should the segment numbers of ways be displayedprotected booleanPreference: should the segment numbers of the selected be displayedprotected ColorColor Preference for tagged nodesprotected ColorColor Preference for tagged and multiply connected nodesprotected intPreference: size of tagged nodesprotected intPreference: size of unselected nodesprotected ColorColor Preference for untagged waysprotected booleanPreference: should relation ways be shown with outlinesprivate MapViewState.MapViewRectangleFields inherited from class org.openstreetmap.josm.data.osm.visitor.paint.AbstractMapRenderer
backgroundColor, doSlowOperations, g, highlightColor, inactiveColor, isInactiveMode, mapState, nc, nodeColor, relationSelectedColor, segmentNumberSpace, selectedColor, virtualNodeSize, virtualNodeSpace -
Constructor Summary
ConstructorsConstructorDescriptionWireframeMapRenderer(Graphics2D g, NavigatableComponent nc, boolean isInactiveMode) Creates an wireframe render -
Method Summary
Modifier and TypeMethodDescriptionprotected voidFinally display all segments in currect path.protected voiddisplaySegments(Color newColor) Finally display all segments in currect path.voidDraw the node as small square with the given color.protected voiddrawSegment(MapPath2D path, MapViewState.MapViewPoint mv1, MapViewState.MapViewPoint mv2, boolean showDirection) Draw a line with the given color.protected voiddrawSegment(MapViewState.MapViewPoint p1, MapViewState.MapViewPoint p2, Color col, boolean showDirection) Draw a line with the given color.voidReads the color definitions from preferences.protected voidgetSettings(boolean virtual) Reads all the settings from preferences.private static booleanprivate static intmax(int a, int b, int c, int d) Helper function to calculate maximum of 4 values.voidRenders the OSM data indatavoidDraw a small rectangle.voidDraw objects used in relations.voidDraw a line for all way segments.Methods inherited from class org.openstreetmap.josm.data.osm.visitor.paint.AbstractMapRenderer
drawOrderNumber, drawVirtualNodes, enableSlowOperations, isLargeSegment, isSegmentVisible, isSegmentVisible, visitVirtual
-
Field Details
-
dfltWayColor
Color Preference for ways not matching any other group -
relationColor
Color Preference for relations -
untaggedWayColor
Color Preference for untagged ways -
taggedColor
Color Preference for tagged nodes -
connectionColor
Color Preference for multiply connected nodes -
taggedConnectionColor
Color Preference for tagged and multiply connected nodes -
showDirectionArrow
Preference: should directional arrows be displayed -
showOnewayArrow
Preference: should arrows for oneways be displayed -
showHeadArrowOnly
Preference: should only the last arrow of a way be displayed -
showOrderNumber
Preference: should the segment numbers of ways be displayed -
showOrderNumberOnSelectedWay
Preference: should the segment numbers of the selected be displayed -
fillSelectedNode
Preference: should selected nodes be filled -
fillUnselectedNode
Preference: should unselected nodes be filled -
fillTaggedNode
Preference: should tagged nodes be filled -
fillConnectionNode
Preference: should multiply connected nodes be filled -
useRelatedWayStroke
Preference: should relation ways be shown with outlines -
selectedNodeSize
Preference: size of selected nodes -
unselectedNodeSize
Preference: size of unselected nodes -
connectionNodeSize
Preference: size of multiply connected nodes -
taggedNodeSize
Preference: size of tagged nodes -
currentColor
Color cache to draw subsequent segments of same color as onePath. -
currentPath
Path store to draw subsequent segments of same color as onePath. -
ARROW_PAINT_HELPER
-
viewClip
-
-
Constructor Details
-
Method Details
-
getColors
Description copied from class:AbstractMapRendererReads the color definitions from preferences. This function ispublic, so that color names in preferences can be displayed even without calling the wireframe display before.- Overrides:
getColorsin classAbstractMapRenderer
-
getSettings
Description copied from class:AbstractMapRendererReads all the settings from preferences. Calls theAbstractMapRenderer.getColors()function.- Overrides:
getSettingsin classAbstractMapRenderer- Parameters:
virtual-trueif virtual nodes are used
-
render
Description copied from interface:RenderingRenders the OSM data in
data -
max
Helper function to calculate maximum of 4 values.- Parameters:
a- First valueb- Second valuec- Third valued- Fourth value- Returns:
- maximumof
a,b,c,d
-
visit
Draw a small rectangle. White if selected (as always) or red otherwise.- Specified by:
visitin interfacePrimitiveVisitor- Parameters:
n- The node to draw.
-
isNodeTagged
-
visit
Draw a line for all way segments.- Specified by:
visitin interfacePrimitiveVisitor- Parameters:
w- The way to draw.
-
visit
Draw objects used in relations.- Specified by:
visitin interfacePrimitiveVisitor- Parameters:
r- The relation to draw.
-
drawNode
Description copied from class:AbstractMapRendererDraw the node as small square with the given color.- Specified by:
drawNodein classAbstractMapRenderer- Parameters:
n- The node to draw.color- The color of the node.size- size in pixelsfill- determines if the square must be filled
-
drawSegment
protected void drawSegment(MapPath2D path, MapViewState.MapViewPoint mv1, MapViewState.MapViewPoint mv2, boolean showDirection) Draw a line with the given color.- Parameters:
path- The path to append this segment.mv1- First point of the way segment.mv2- Second point of the way segment.showDirection-trueif segment direction should be indicated- Since:
- 10827
-
drawSegment
protected void drawSegment(MapViewState.MapViewPoint p1, MapViewState.MapViewPoint p2, Color col, boolean showDirection) Draw a line with the given color.- Parameters:
p1- First point of the way segment.p2- Second point of the way segment.col- The color to use for drawing line.showDirection-trueif segment direction should be indicated.- Since:
- 10827
-
displaySegments
Finally display all segments in currect path. -
displaySegments
Finally display all segments in currect path.- Parameters:
newColor- This color is set after the path is drawn.
-