public void draw(ViewportGraphics g, GraticuleStyle style) { Color old = g.getColor(); g.setColor(style.getFontColor()); g.setFont(font); g.drawString( text, anchor.x, anchor.y, ViewportGraphics.ALIGN_MIDDLE, ViewportGraphics.ALIGN_MIDDLE); // Restore old state g.setColor(old); }