Package org.geotools.styling

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


                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

    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

   * @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

    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

        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

        }
        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

        {
            UomRescaleStyleVisitor visitor = null;
           
            StyleBuilder styleBuilder = new StyleBuilder();

            Fill fill = styleBuilder.createFill(Color.RED);
            PolygonSymbolizerImpl polySymb = (PolygonSymbolizerImpl) styleBuilder.createPolygonSymbolizer(null, fill);
           
            visitor = new UomRescaleStyleVisitor(10);

            polySymb.accept(visitor);
View Full Code Here

        Stroke stroke = sb.createStroke();
        stroke.setColor(null);
        stroke.setGraphicStroke(sb.createGraphic(null, sb.createMark("square", null, sb.createStroke(1)), null));
       
        // a graphic fill
        Fill fill = sb.createFill();
        fill.setColor(null);
        fill.setGraphicFill(sb.createGraphic(null, sb.createMark("square", null, sb.createStroke(2)), null));
       
        // a polygon and line symbolizer using them
        PolygonSymbolizer ps = sb.createPolygonSymbolizer(stroke, fill);
        ps.setUnitOfMeasure(SI.METER);
       
View Full Code Here

        Mark notEq = sf.getStarMark();
        assertEqualsContract(clone, notEq, mark);
    }

    public void testFill() {
        Fill fill = sf.getDefaultFill();
        Fill clone = visitor.copy( fill);
        assertCopy(fill, clone);

        Fill notEq = sf.createFill(ff.literal("#FF0000"));
        assertEqualsContract(clone, notEq, fill);
    }
View Full Code Here

TOP

Related Classes of org.geotools.styling.Fill

Copyright © 2018 www.massapicom. 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.