Class OnLineStrategy.UpsideComputingVisitor
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.styleelement.placement.OnLineStrategy.UpsideComputingVisitor
-
- All Implemented Interfaces:
MapViewPath.PathSegmentConsumer
- Enclosing class:
- OnLineStrategy
private static class OnLineStrategy.UpsideComputingVisitor extends java.lang.Object implements MapViewPath.PathSegmentConsumer
A visitor that computes the side of the way that is the upper one for each segment and computes the dominant upper side of the way. This is used to always place at least 50% of the text correctly.
-
-
Field Summary
Fields Modifier and Type Field Description private double
endOffset
private double
startOffset
private double
upsideDownLines
private double
upsideUpLines
-
Constructor Summary
Constructors Constructor Description UpsideComputingVisitor(double startOffset, double endOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLineBetween(double inLineOffset, MapViewState.MapViewPoint start, MapViewState.MapViewPoint end, boolean startIsOldEnd)
Add a line segment between two points(package private) boolean
shouldRotateText()
Check if the text should be rotated by 180°
-
-
-
Field Detail
-
startOffset
private final double startOffset
-
endOffset
private final double endOffset
-
upsideUpLines
private double upsideUpLines
-
upsideDownLines
private double upsideDownLines
-
-
Constructor Detail
-
UpsideComputingVisitor
UpsideComputingVisitor(double startOffset, double endOffset)
-
-
Method Detail
-
addLineBetween
public void addLineBetween(double inLineOffset, MapViewState.MapViewPoint start, MapViewState.MapViewPoint end, boolean startIsOldEnd)
Description copied from interface:MapViewPath.PathSegmentConsumer
Add a line segment between two points- Specified by:
addLineBetween
in interfaceMapViewPath.PathSegmentConsumer
- Parameters:
inLineOffset
- The offset of start in the linestart
- The start pointend
- The end pointstartIsOldEnd
- If the start point equals the last end point.
-
shouldRotateText
boolean shouldRotateText()
Check if the text should be rotated by 180°- Returns:
- if the text should be rotated.
-
-