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 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
FieldsModifier and TypeFieldDescriptionprivate final doubleprivate final doubleprivate doubleprivate double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLineBetween(double inLineOffset, MapViewState.MapViewPoint start, MapViewState.MapViewPoint end, boolean startIsOldEnd) Add a line segment between two points(package private) booleanCheck if the text should be rotated by 180°
-
Field Details
-
startOffset
-
endOffset
-
upsideUpLines
-
upsideDownLines
-
-
Constructor Details
-
UpsideComputingVisitor
UpsideComputingVisitor(double startOffset, double endOffset)
-
-
Method Details
-
addLineBetween
public void addLineBetween(double inLineOffset, MapViewState.MapViewPoint start, MapViewState.MapViewPoint end, boolean startIsOldEnd) Description copied from interface:MapViewPath.PathSegmentConsumerAdd a line segment between two points- Specified by:
addLineBetweenin 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.
-