}
}
}
if (style instanceof LineStyle2D) {
LineStyle2D ls2d = (LineStyle2D) style;
if (ls2d.getStroke() != null) {
// see if a graphic stroke is to be used, the drawing method
// is completely
// different in this case
if (ls2d.getGraphicStroke() != null) {
drawWithGraphicsStroke(graphics, dashShape(shape, ls2d.getStroke()), ls2d.getGraphicStroke(), isLabelObstacle);
} else {
Paint paint = ls2d.getContour();
if (paint instanceof TexturePaint) {
TexturePaint tp = (TexturePaint) paint;
BufferedImage image = tp.getImage();
Rectangle2D rect = tp.getAnchorRect();
AffineTransform at = graphics.getTransform();
double width = rect.getWidth() * at.getScaleX();
double height = rect.getHeight() * at.getScaleY();
Rectangle2D scaledRect = new Rectangle2D.Double(0,
0, width, height);
paint = new TexturePaint(image, scaledRect);
}
// debugShape(shape);
Stroke stroke = ls2d.getStroke();
if (graphics
.getRenderingHint(RenderingHints.KEY_ANTIALIASING) == RenderingHints.VALUE_ANTIALIAS_ON) {
if (stroke instanceof BasicStroke) {
BasicStroke bs = (BasicStroke) stroke;
stroke = new BasicStroke(
bs.getLineWidth() + 0.5f, bs
.getEndCap(), bs.getLineJoin(),
bs.getMiterLimit(), bs.getDashArray(),
bs.getDashPhase());
}
}
graphics.setPaint(paint);
graphics.setStroke(stroke);
graphics.setComposite(ls2d.getContourComposite());
graphics.draw(shape);
}
}
}
}