/** * @param mark * @param size * @param uom * @param context * @param x * @param y * @param rotation */ public static void renderMark( Mark mark, int size, UOM uom, RendererContext context, double x, double y, double rotation ) { if ( size == 0 ) { LOG.debug( "Not rendering a symbol because the size is zero." ); return; } if ( mark.fill == null && mark.stroke == null ) { LOG.debug( "Not rendering a symbol because no fill/stroke is available/configured." ); return; } Shape shape = getShapeFromMark( mark, size - 1, rotation, true, x, y ); if ( mark.fill != null ) { context.fillRenderer.applyFill( mark.fill, uom ); context.graphics.fill( shape ); } if ( mark.stroke != null ) { context.strokeRenderer.applyStroke( mark.stroke, uom, shape, 0, null ); } }
void render( PolygonStyling styling, Surface surface ) { for ( SurfacePatch patch : surface.getPatches() ) { if ( patch instanceof PolygonPatch ) { LinkedList<Double> lines = new LinkedList<Double>(); PolygonPatch polygonPatch = (PolygonPatch) patch; // just appending the holes appears to work, the Java2D rendering mechanism can determine that they lie // inside and thus no substraction etc. is needed. This speeds up things SIGNIFICANTLY GeneralPath polygon = new GeneralPath( WIND_EVEN_ODD ); for ( Curve curve : polygonPatch.getBoundaryRings() ) { Double d = geomHelper.fromCurve( curve, true ); lines.add( d ); polygon.append( d, false ); } fillRenderer.applyFill( styling.fill, styling.uom ); graphics.fill( polygon ); for ( Double d : lines ) { strokeRenderer.applyStroke( styling.stroke, styling.uom, d, styling.perpendicularOffset, styling.perpendicularOffsetType ); } } else { throw new IllegalArgumentException( "Cannot render non-planar surfaces." ); } } }
rendererContext.strokeRenderer.applyStroke( styling.stroke, styling.uom, line, styling.perpendicularOffset, styling.perpendicularOffsetType ); } else if ( renderGeometry instanceof Surface ) {
applyStroke( stroke.stroke.mark.stroke, uom, transed, 0, null ); graphics.draw( transed );