@Test
public void testPointStyling()
                        throws Exception {

    BufferedImage img = new BufferedImage( 1000, 1000, TYPE_INT_ARGB );
    long time = currentTimeMillis();
    Graphics2D g = img.createGraphics();
    GeometryFactory geomFac = new GeometryFactory();
    Java2DRenderer r = new Java2DRenderer( g, img.getWidth(), img.getHeight(),
                                           geomFac.createEnvelope( new double[] { 0, 0 },
                                                                   new double[] { 5000d, 5000d }, mapcs ) );
    PointStyling style = new PointStyling();
    r.render( style, geomFac.createPoint( null, new double[] { 100, 4900 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.SQUARE;
    r.render( style, geomFac.createPoint( null, new double[] { 200, 4900 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.CIRCLE;
    r.render( style, geomFac.createPoint( null, new double[] { 300, 4900 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.TRIANGLE;
    r.render( style, geomFac.createPoint( null, new double[] { 400, 4900 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.STAR;
    r.render( style, geomFac.createPoint( null, new double[] { 500, 4900 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.CROSS;
    r.render( style, geomFac.createPoint( null, new double[] { 600, 4900 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.X;
    r.render( style, geomFac.createPoint( null, new double[] { 700, 4900 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    style.graphic.mark.fill.color = red;
    style.graphic.mark.stroke.color = green;
    r.render( style, geomFac.createPoint( null, new double[] { 500, 4500 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.SQUARE;
    r.render( style, geomFac.createPoint( null, new double[] { 1000, 4500 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.CIRCLE;
    r.render( style, geomFac.createPoint( null, new double[] { 1500, 4500 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.TRIANGLE;
    r.render( style, geomFac.createPoint( null, new double[] { 2000, 4500 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.STAR;
    r.render( style, geomFac.createPoint( null, new double[] { 2500, 4500 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.CROSS;
    r.render( style, geomFac.createPoint( null, new double[] { 3000, 4500 }, mapcs ) );
    style.graphic.mark.wellKnown = Mark.SimpleMark.X;
    r.render( style, geomFac.createPoint( null, new double[] { 3500, 4500 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 500, 4000 }, mapcs ) );
    style.graphic.size = 16;
    r.render( style, geomFac.createPoint( null, new double[] { 500, 4000 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 1000, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.anchorPointX = 0;
    style.graphic.anchorPointY = 0;
    r.render( style, geomFac.createPoint( null, new double[] { 1000, 4000 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 1500, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.anchorPointX = 1;
    style.graphic.anchorPointY = 1;
    r.render( style, geomFac.createPoint( null, new double[] { 1500, 4000 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 2000, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.anchorPointX = 0;
    style.graphic.anchorPointY = 0;
    style.graphic.displacementX = -16;
    style.graphic.displacementY = -16;
    r.render( style, geomFac.createPoint( null, new double[] { 2000, 4000 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 2500, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.anchorPointX = 1;
    style.graphic.anchorPointY = 1;
    style.graphic.displacementX = 16;
    style.graphic.displacementY = 16;
    r.render( style, geomFac.createPoint( null, new double[] { 2500, 4000 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 3000, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.rotation = 45;
    r.render( style, geomFac.createPoint( null, new double[] { 3000, 4000 }, mapcs ) );
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 3500, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.rotation = 45;
    style.graphic.displacementX = 16;
    style.graphic.displacementY = 16;
    r.render( style, geomFac.createPoint( null, new double[] { 3500, 4000 }, mapcs ) );
    // TODO: fix required!
    style = new PointStyling();
    style.graphic.size = 32;
    r.render( style, geomFac.createPoint( null, new double[] { 4000, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.anchorPointX = 0.5;
    style.graphic.anchorPointY = 0;
    style.graphic.displacementX = 16;
    style.graphic.displacementY = 16;
    r.render( style, geomFac.createPoint( null, new double[] { 4000, 4000 }, mapcs ) );
    style.graphic.size = 16;
    style.graphic.anchorPointX = 0.5;
    style.graphic.anchorPointY = 0;
    style.graphic.rotation = 45;
    style.graphic.displacementX = 16;
    style.graphic.displacementY = 16;
    r.render( style, geomFac.createPoint( null, new double[] { 4000, 4000 }, mapcs ) );
    g.dispose();
    long time2 = currentTimeMillis();
    List<String> texts = new LinkedList<String>();
    texts.add( "first line: all the marks in the first line (size 6, gray fill, black line)" );
    texts.add( "second line: all the marks in the second line (size 32, red fill, green line)" );
    texts.add( "third line: 32 pixel default square, inside centered a 16 pixel default square" );
    texts.add( "third line: 32 pixel default square, inside a 16 pixel default square (lower right corner)" );
    texts.add( "third line: 32 pixel default square, inside a 16 pixel default square (upper left corner), two times" );
    texts.add( "third line: 32 pixel default square, inside a 16 pixel default square (lower right corner) again" );
    texts.add( "third line: 32 pixel default square, inside a 16 pixel rotated square" );
    texts.add( "third line: 32 pixel default square, outside a 16 pixel rotated square (lower right corner)" );
    texts.add( "third line: 32 pixel default square, outside a 16 pixel square (upper center at lower right corner of the large square) and a 16 pixel rotated square (lower right corner)" );
    validateImage( img, time2 - time, "pointstyling" );
}