return new LineElemStyle(c, type.default_major_z_index, line, color, dashesLine, dashesBackground, offset, realWidth);
}
@Override
public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, boolean selected, boolean member) {
Way w = (Way)primitive;
/* show direction arrows, if draw.segment.relevant_directions_only is not set,
the way is tagged with a direction key
(even if the tag is negated as in oneway=false) or the way is selected */
boolean showOrientation = !isModifier && (selected || paintSettings.isShowDirectionArrow()) && !paintSettings.isUseRealWidth();
boolean showOneway = !isModifier && !selected &&
!paintSettings.isUseRealWidth() &&
paintSettings.isShowOnewayArrow() && w.hasDirectionKeys();
boolean onewayReversed = w.reversedDirection();
/* head only takes over control if the option is true,
the direction should be shown at all and not only because it's selected */
boolean showOnlyHeadArrowOnly = showOrientation && !selected && paintSettings.isShowHeadArrowOnly();
Node lastN;
Color myDashedColor = dashesBackground;
BasicStroke myLine = line, myDashLine = dashesLine;
if (realWidth > 0 && paintSettings.isUseRealWidth() && !showOrientation) {
float myWidth = (int) (100 / (float) (painter.getCircum() / realWidth));
if (myWidth < line.getLineWidth()) {
myWidth = line.getLineWidth();
}
myLine = new BasicStroke(myWidth, line.getEndCap(), line.getLineJoin(),
line.getMiterLimit(), line.getDashArray(), line.getDashPhase());
if (dashesLine != null) {
myDashLine = new BasicStroke(myWidth, dashesLine.getEndCap(), dashesLine.getLineJoin(),
dashesLine.getMiterLimit(), dashesLine.getDashArray(), dashesLine.getDashPhase());
}
}
Color myColor = color;
if (selected) {
myColor = paintSettings.getSelectedColor(color.getAlpha());
} else if (member) {
myColor = paintSettings.getRelationSelectedColor(color.getAlpha());
} else if(w.isDisabled()) {
myColor = paintSettings.getInactiveColor();
myDashedColor = paintSettings.getInactiveColor();
}
painter.drawWay(w, myColor, myLine, myDashLine, myDashedColor, offset, showOrientation,
showOnlyHeadArrowOnly, showOneway, onewayReversed);
if(paintSettings.isShowOrderNumber() && !painter.isInactiveMode()) {
int orderNumber = 0;
lastN = null;
for(Node n : w.getNodes()) {
if(lastN != null) {
orderNumber++;
painter.drawOrderNumber(lastN, n, orderNumber, myColor);
}
lastN = n;