AffineTransform newTransform = new AffineTransform(oldTransform);
newTransform.concatenate(transform);
graphics.setTransform(newTransform);
// draw the label shield first, underneath the halo
Style2D graphic = labelItem.getTextStyle().getGraphic();
if (graphic != null) {
// take into account the graphic margins, if any
double offsetY = 0;
double offsetX = 0;
final int[] margin = labelItem.getGraphicMargin();
if(margin != null) {
offsetX = margin[1] - margin[3];
offsetY = margin[2] - margin[0];
}
LiteShape2 tempShape = new LiteShape2(gf.createPoint(new Coordinate(labelBounds
.getWidth() / 2.0 + offsetX, -1.0 * labelBounds.getHeight() / 2.0 + offsetY)), null, null,
false, false);
// resize graphic and transform it based on the position of the last line
graphic = resizeGraphic(graphic);
AffineTransform graphicTx = new AffineTransform(transform);
LineInfo lastLine = lines.get(lines.size() - 1);
graphicTx.translate(lastLine.x, lastLine.y);
graphics.setTransform(graphicTx);
shapePainter.paint(graphics, tempShape, graphic, graphic.getMaxScale());
}
// 0 is unfortunately an acceptable value if people only want to draw shields
// (to leverage conflict resolution, priority when placing symbols)
if(labelItem.getTextStyle().getFont().getSize() == 0)