Java 8 RenderingHints - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 RenderingHints class.

This code example shows how to use the following methods:add
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));
 
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        RenderingHints hints = new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
        hints.add(new RenderingHints(KEY_STROKE_CONTROL, VALUE_STROKE_PURE));
        renderer.setJava2DHints(hints);
 
        BufferedImage image = RendererBaseTest
                .showRender("Curved polygons", renderer, TIME, bounds);
        File reference = new File(
                "./src/test/resources/org/geotools/renderer/lite/test-data/curvedPolygons.png"); 
        ImageAssert.assertEquals(reference, image, 100);
    } 
 
    @Test
    public void testCurveLines() throws Exception {
        File property = new File(TestData.getResource(this, "curvelines.properties").toURI());
        PropertyDataStore ds = new PropertyDataStore(property.getParentFile());
6
CodeRank
This code example shows how to use the following methods:
      g2d.setFont(font);
       
 
 
 
      g2d.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON));
 
      g2d.setColor(getBackground());
      g2d.fill(flagShape);
       
      // draw outline 
      Stroke pen = new BasicStroke(1.0F);
      g2d.setStroke(pen);
      //g2d.setColor(new Color(0.6f,0.6f,0.6f)); 
      g2d.setColor(Color.white);
      g2d.draw(flagShape);      
 
      g2d.setColor(getForeground());
      g2d.drawString(text, textBox.x + PADDING_X, 
6
CodeRank
This code example shows how to use the following methods:put
This code example shows how to use the following methods:
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(squareFS, style));
 
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
 
        BufferedImage image = RendererBaseTest.showRender(styleName, renderer, TIME, bounds);
        ImageAssert.assertEquals(new File(
                "./src/test/resources/org/geotools/renderer/lite/test-data/" + styleName + ".png"),
                image, 1000);
    } 
 
    @Test
    public void testImageFill() throws Exception {
        runFillTest("fillHouse.sld"); 
    } 
     
    @Test
    public void testRandomImageFill() throws Exception {
6
CodeRank
This code example shows how to use the following methods:
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(polyfs, style));
 
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
 
        RendererBaseTest.showRender("FillAlignment", renderer, TIME, leftTileBounds,
                rightTileBounds);
    } 
 
    @Test
    public void testStrokeAlignment() throws Exception {
        Style style = RendererBaseTest.loadStyle(this, "dotsStars.sld");
 
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(linefs, style));
 
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
6
CodeRank
This code example shows how to use the following methods:
        mc.addLayer(new FeatureLayer(lineFS, lStyle));
        mc.addLayer(new FeatureLayer(pointFS, pStyle));
         
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
         
        RendererBaseTest.showRender("Decorative marks", renderer, TIME, bounds);
    } 
     
    public void testRenderingBufferCircle() throws Exception {
        Style pStyle = RendererBaseTest.loadStyle(this, "markCircle.sld");
 
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(pointFS, pStyle));
 
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setRendererHints(Collections.singletonMap(
                StreamingRenderer.ADVANCED_PROJECTION_HANDLING_KEY, true)); 
6
CodeRank
This code example shows how to use the following methods:put
This code example shows how to use the following methods:
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));
         
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
        return renderer;
    } 
     
    @Test
    @Ignore 
    public void testPerPropertyUOM10() throws Exception {
        StreamingRenderer renderer = setupLineMap("linePerPropertyUom.sld");
         
        BufferedImage image = RendererBaseTest.showRender("linePerPropertyUom", renderer, TIME, bounds);
        ImageAssert.assertEquals(file("linePerPropertyUom10"), image, 10);
    } 
     
    @Test
    public void testLineRailway() throws Exception {
6
CodeRank
This code example shows how to use the following methods:
        myTranslateX = deltaX;
        myTranslateY = deltaY;
 
        myStreamingRenderer.setContext( map );
        myStreamingRenderer.setInteractive( true );
        myStreamingRenderer.setJava2DHints( new RenderingHints( RenderingHints.KEY_ANTIALIASING,
                                                                RenderingHints.VALUE_ANTIALIAS_ON ) );
    } 
 
    public MapTextureRenderer( final MapContext mapContextToRender, final Color color )
    { 
        this( mapContextToRender, color, DEFAULT_SCALE, DEFAULT_SCALE, 0, 0 );
    } 
 
    //---------------------------------------------------------------------- 
    // TextureRenderer Implementation 
 
    public void renderArea( final BoundingRectangle area, final BufferedImage target )
    { 
        final int width = target.getWidth();
6
CodeRank
This code example shows how to use the following methods:
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));
 
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
         
        BufferedImage image = RendererBaseTest.showRender(styleName, renderer, TIME, bounds);
        File reference = new File("./src/test/resources/org/geotools/renderer/lite/test-data/"
                + styleName + ".png");
        ImageAssert.assertEquals(reference, image, threshold);
    } 
     
 
    @Test
    public void testSolidFill() throws Exception {
        runSingleLayerTest("fillSolid.sld"); 
    } 
 
    @Test
5
CodeRank
See Code Examples for Java 8 RenderingHints Methods: