Examples of Halo


Examples of org.geotools.styling.Halo

        assertEquals(0.5, valueOf(placement.getAnchorPoint().getAnchorPointX()));
        assertEquals(0.5, valueOf(placement.getAnchorPoint().getAnchorPointY()));
        assertEquals(labelXOffset, valueOf(placement.getDisplacement().getDisplacementX()).toString());
        assertEquals(labelYOffset, valueOf(placement.getDisplacement().getDisplacementY()).toString());

        Halo halo = symbolizer.getHalo();
        assertFill(0.7, haloColor, halo.getFill());
        assertEquals(haloRadius, valueOf(halo.getRadius()).toString());

        style.put("label", "label");
        style.put("fontSize", "15");
        symbolizer = helper.createTextSymbolizer(pStyle);
        assertEquals("label", valueOf(symbolizer.getLabel()));
View Full Code Here

Examples of org.geotools.styling.Halo

        assertEquals("fontColor", propertyName(textSymbolizer.getFill().getColor()));
        assertEquals("fontFamily", propertyName(textSymbolizer.getFont().getFamily().get(0)));
        assertEquals("fontSize", propertyName(textSymbolizer.getFont().getSize()));
        assertEquals("fontStyle", propertyName(textSymbolizer.getFont().getStyle()));
        assertEquals("fontWeight", propertyName(textSymbolizer.getFont().getWeight()));
        final Halo halo = textSymbolizer.getHalo();
        assertEquals("haloColor", propertyName(halo.getFill().getColor()));
        assertEquals("haloOpacity", propertyName(halo.getFill().getOpacity()));
        assertEquals("haloRadius", propertyName(halo.getRadius()));
        assertEquals("label", propertyName(textSymbolizer.getLabel()));
        assertEquals("labelRotation", propertyName(((PointPlacement)textSymbolizer.getLabelPlacement()).getRotation()));


    }
View Full Code Here

Examples of org.geotools.styling.Halo

    public Halo build() {
        if (unset)
            return null;

        Halo halo = sf.createHalo(fill.build(), radius);
        if (parent == null)
            reset();

        return halo;
    }
View Full Code Here

Examples of org.geotools.styling.Halo

    // setup fill and composite
    ts2d.setFill(getPaint(symbolizer.getFill(), feature, symbolizer));
    ts2d.setComposite(getComposite(symbolizer.getFill(), feature));

    // compute halo parameters
    Halo halo = symbolizer.getHalo();

    if (halo != null) {
      ts2d.setHaloFill(getPaint(halo.getFill(), feature, symbolizer));
      ts2d.setHaloComposite(getComposite(halo.getFill(), feature));
      ts2d.setHaloRadius(evalToFloat(halo.getRadius(), feature, 1));
    }

    Graphic graphicShield = null;
    if (symbolizer instanceof TextSymbolizer2) {
      graphicShield = ((TextSymbolizer2) symbolizer).getGraphic();
View Full Code Here

Examples of org.geotools.styling.Halo

    }

    public void visit(Halo halo) {
        Fill fill = copy(halo.getFill());
        Expression radius = copy(halo.getRadius());
        Halo copy = sf.createHalo(fill, radius);

        if (STRICT && !copy.equals(halo)) {
            throw new IllegalStateException("Was unable to duplicate provided raster:" + halo);
        }
        pages.push(copy);
    }
View Full Code Here

Examples of org.geotools.styling.Halo

        assertEqualsContract(clone, other, font);
    }

    public void testHalo() {
        Halo halo = sf.createHalo(sf.getDefaultFill(),
                ff.literal(10));
       
        halo.accept(visitor);
        Halo clone = (Halo) visitor.getCopy();
       
        assertCopy(halo, clone);

        Halo other = sf.createHalo(sf.getDefaultFill(),
                ff.literal(12));
        assertEqualsContract(clone, other, halo);
    }
View Full Code Here

Examples of org.geotools.styling.Halo

    }

    public void test() throws Exception {
        SLDMockData.halo(document, document, true);

        Halo halo = (Halo) parse();
        assertNotNull(halo);
        assertNotNull(halo.getFill());
        assertEquals(1.0d, Filters.asDouble(halo.getRadius()), 0d);
    }
View Full Code Here

Examples of org.geotools.styling.Halo

    }
   
    public void testDefaults() throws Exception {
        SLDMockData.halo(document, document, false);

        Halo halo = (Halo) parse();
        assertNotNull(halo);
        assertNotNull(halo.getFill());
        assertEquals(1.0d, Filters.asDouble(halo.getRadius()), 0d);
    }
View Full Code Here

Examples of org.geotools.styling.Halo

  /** Internal parse method - made protected for unit testing */
  protected Halo parseHalo(Node root) {
    if (LOGGER.isLoggable(Level.FINEST)) {
      LOGGER.finest("parsing halo");
    }
    Halo halo = factory.createHalo(
        factory.createFill(ff.literal("#FFFFFF")), ff.literal(1.0));

    NodeList children = root.getChildNodes();
    final int length = children.getLength();
    for (int i = 0; i < length; i++) {
      Node child = children.item(i);

      if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)) {
        continue;
      }
      String childName = child.getLocalName();
      if (childName == null) {
        childName = child.getNodeName();
      }
      if (childName.equalsIgnoreCase(fillSt)) {
        halo.setFill(parseFill(child));
      } else if (childName.equalsIgnoreCase("Radius")) {
        halo.setRadius(parseCssParameter(child));
      }

    }

    return halo;
View Full Code Here

Examples of org.opengis.style.Halo

    }

    @Test
    public void halo() {
        HaloBuilder b = new HaloBuilder(null);
        Halo halo = b.build();

        assertNotNull(halo);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.