Examples of Fill


Examples of org.geotools.styling.Fill

     * a Symbolizer tailored to the geometry type of the features that
     * we are displaying.
     */
    private Rule createRule(Color outlineColor, Color fillColor) {
        Symbolizer symbolizer = null;
        Fill fill = null;
        Stroke stroke = sf.createStroke(ff.literal(outlineColor), ff.literal(LINE_WIDTH));

        switch (geometryType) {
            case POLYGON:
                fill = sf.createFill(ff.literal(fillColor), ff.literal(OPACITY));
View Full Code Here

Examples of org.geotools.styling.Fill

  private PolygonSymbolizer polysym1(StyleFactory sFac)
      throws IllegalFilterException {
    Stroke myStroke;
    PolygonSymbolizer polysym = sFac.createPolygonSymbolizer();
    Fill myFill = sFac.getDefaultFill();
    myFill.setColor(filterFactory.literal("#00ff00"));
    polysym.setFill(myFill);
    myStroke = sFac.getDefaultStroke();
    myStroke.setColor(filterFactory.literal("#00ff00"));
    myStroke
        .setWidth(filterFactory.literal(new Integer(2)));
View Full Code Here

Examples of org.geotools.styling.Fill

    ftsL.setRules(new Rule[] { rule2 });
    ftsL.setFeatureTypeName("querytest");

    PolygonSymbolizer polysym = sFac.createPolygonSymbolizer();
    polysym.setGeometryPropertyName("polygon");
    Fill myFill = sFac.getDefaultFill();
    myFill.setColor(filterFactory.literal("#ff0000"));
    polysym.setFill(myFill);
    polysym.setStroke(sFac.getDefaultStroke());
    Rule rule = sFac.createRule();
    rule.setSymbolizers(new Symbolizer[] { polysym });
    FeatureTypeStyle ftsPoly = sFac
View Full Code Here

Examples of org.geotools.styling.Fill

                filterFactory.literal(Color.BLUE),
                filterFactory.literal(1),
                filterFactory.literal(0.5));

        // create a partial opaque fill
        Fill fill = styleFactory.createFill(
                filterFactory.literal(Color.CYAN),
                filterFactory.literal(0.5));

        /*
         * Setting the geometryPropertyName arg to null signals that we want to
View Full Code Here

Examples of org.geotools.styling.Fill

    public void testResizeGraphicFill() throws Exception {
        URL url = StreamingRenderer.class.getResource("test-data/");
        PolygonSymbolizer symb = sf.createPolygonSymbolizer();
        ExternalGraphic eg = sf.createExternalGraphic(url + "icon64.png", "image/png");
        Graphic g = sf.createGraphic(new ExternalGraphic[] {eg}, null, null, null, ff.literal(20), null);
        Fill fill = sf.createFill(null, null, null, g);
        symb.setFill(fill);
       
        PolygonStyle2D ps = sld.createPolygonStyle(feature, symb, range);
        assertTrue(ps.getFill() instanceof TexturePaint);
        TexturePaint paint = (TexturePaint) ps.getFill();
View Full Code Here

Examples of org.geotools.styling.Fill

   * @param symbolizer
   * @param scaleRange
   */
  void setPolygonStyleFill(Object feature, PolygonStyle2D style,
      PolygonSymbolizer symbolizer, Range scaleRange) {
    Fill fill = symbolizer.getFill();
    if (fill == null)
      return;

    // sets Style2D fill making sure we don't use too much memory for the
    // rasterization
    if (fill.getGraphicFill() != null) {
      double size = evalToDouble(fill.getGraphicFill().getSize(),
          feature, 0);
      if (isVectorRenderingEnabled() || size > MAX_RASTERIZATION_SIZE) {
        // sets graphic fill if available and vector rendering is
        // enabled
        Style2D style2DFill = createPointStyle(feature, symbolizer, fill
            .getGraphicFill(), scaleRange, false);
        style.setGraphicFill(style2DFill);
        return;
      }
    }
View Full Code Here

Examples of org.geotools.styling.Fill

    rule1.setFilter(ff.less(ff.property("POPULATION"), ff.literal(50000)));
   
    //
    // create the graphical mark used to represent a city
    Stroke stroke = sf.stroke(ff.literal("#000000"), null, null, null, null, null, null);
    Fill fill = sf.fill(null, ff.literal(Color.BLUE), ff.literal(1.0));
   
    // OnLineResource implemented by gt-metadata - so no factory!
    OnLineResourceImpl svg = new OnLineResourceImpl(new URI("file:city.svg"));
    svg.freeze(); // freeze to prevent modification at runtime
   
View Full Code Here

Examples of org.geotools.styling.Fill

        anchorPoint.accept(this);
        return (AnchorPoint) pages.pop();
    }

    public void visit(Fill fill) {
        Fill copy = sf.getDefaultFill();
        copy.setBackgroundColor( copy( fill.getBackgroundColor()) );
        copy.setColor(copy( fill.getColor()));
        copy.setGraphicFill( copy(fill.getGraphicFill()));
        copy.setOpacity( copy(fill.getOpacity()));
       
        if( STRICT && !copy.equals( fill )){
            throw new IllegalStateException("Was unable to duplicate provided Fill:"+fill );
        }
        pages.push(copy);
    }
View Full Code Here

Examples of org.geotools.styling.Fill

        }
        pages.push(copy);
    }

    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);
View Full Code Here

Examples of org.opengis.style.Fill

        // check the mark
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
        Mark mark = (Mark) symbols.get(0);
        assertEquals("triangle", mark.getWellKnownName().evaluate(null));
        Fill fill = mark.getFill();
        assertEquals(Color.RED, fill.getColor().evaluate(null, Color.class));
        assertEquals(0.2, (double) fill.getOpacity().evaluate(null, Double.class), 0);
        Stroke stroke = mark.getStroke();
        assertEquals(Color.BLUE, stroke.getColor().evaluate(null, Color.class));
        assertEquals(2, (int) stroke.getWidth().evaluate(null, Integer.class));
    }
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.