Package org.geotools.styling

Examples of org.geotools.styling.StyleBuilder$EqualClasses


        UomRescaleStyleVisitor visitor = null;
        double size = 100;
        double scaleMetersToPixel = 10;
        double expectedRescaledSize = computeExpectedRescaleSize(size, scaleMetersToPixel, SI.METER);

        StyleBuilder styleBuilder = new StyleBuilder();
        LineSymbolizerImpl lineSymb = (LineSymbolizerImpl) styleBuilder.createLineSymbolizer();
        lineSymb.setUnitOfMeasure(NonSI.FOOT);
        lineSymb.getStroke().setWidth(ff.literal(size + "m"));

        visitor = new UomRescaleStyleVisitor(scaleMetersToPixel);
View Full Code Here


    public void visitLocalUomPixelOverridingMeters() {
        UomRescaleStyleVisitor visitor = null;
        double size = 100;
        double scaleMetersToPixel = 10;

        StyleBuilder styleBuilder = new StyleBuilder();
        LineSymbolizerImpl lineSymb = (LineSymbolizerImpl) styleBuilder.createLineSymbolizer();
        lineSymb.setUnitOfMeasure(SI.METER);
        lineSymb.getStroke().setWidth(ff.literal(size + "px"));

        visitor = new UomRescaleStyleVisitor(scaleMetersToPixel);
View Full Code Here

        {
            UomRescaleStyleVisitor visitor = null;
            double size = 100;
            double expectedRescaledSize = computeExpectedRescaleSize(size, scaleMetersToPixel, uom);
           
            StyleBuilder styleBuilder = new StyleBuilder();

            PointSymbolizerImpl pointSymb = (PointSymbolizerImpl) styleBuilder.createPointSymbolizer();
            pointSymb.setUnitOfMeasure(uom);
           
            FilterFactory2 filterFactory  = new FilterFactoryImpl();
            pointSymb.getGraphic().setSize(filterFactory.literal(size));
View Full Code Here

        {
            UomRescaleStyleVisitor visitor = null;
            double size = 100;
            double expectedRescaledSize = computeExpectedRescaleSize(size, scaleMetersToPixel, uom);
           
            StyleBuilder styleBuilder = new StyleBuilder();

            LineSymbolizerImpl lineSymb = (LineSymbolizerImpl) styleBuilder.createLineSymbolizer();
            lineSymb.setUnitOfMeasure(uom);
           
            FilterFactory2 filterFactory  = new FilterFactoryImpl();
            lineSymb.getStroke().setWidth(filterFactory.literal(size));
View Full Code Here

        {
            UomRescaleStyleVisitor visitor = null;
            double size = 100;
            double expectedRescaledSize = computeExpectedRescaleSize(size, scaleMetersToPixel, uom);
           
            StyleBuilder styleBuilder = new StyleBuilder();

            PolygonSymbolizerImpl polySymb = (PolygonSymbolizerImpl) styleBuilder.createPolygonSymbolizer();
            polySymb.setUnitOfMeasure(uom);
           
            FilterFactory2 filterFactory  = new FilterFactoryImpl();
            polySymb.getStroke().setWidth(filterFactory.literal(size));
View Full Code Here

            double expectedRescaledDisplacementYSize = computeExpectedRescaleSize(displacementY, scaleMetersToPixel, uom);
            int expectedMaxDisplacement = (int) computeExpectedRescaleSize(maxDisplacement, scaleMetersToPixel, uom);
            int expectedGraphicMargin1 = (int) computeExpectedRescaleSize(maxDisplacement, scaleMetersToPixel, uom);
            int expectedGraphicMargin2 = (int) computeExpectedRescaleSize(maxDisplacement * 2, scaleMetersToPixel, uom);
           
            StyleBuilder styleBuilder = new StyleBuilder();

            TextSymbolizerImpl textSymb = (TextSymbolizerImpl) styleBuilder.createTextSymbolizer();
            textSymb.setUnitOfMeasure(uom);
           
            Font font = styleBuilder.createFont(new java.awt.Font("Verdana",java.awt.Font.PLAIN,fontSize));
            textSymb.setFont(font);
           
            PointPlacement placement = styleBuilder.createPointPlacement(0.3, 0.3, displacementX, displacementY, 10);
            textSymb.setLabelPlacement(placement);
           
            // check we can rescale properly also vendor options
            textSymb.addToOptions("maxDisplacement", String.valueOf(maxDisplacement));
            textSymb.addToOptions(TextSymbolizer.GRAPHIC_MARGIN_KEY, maxDisplacement + " " + maxDisplacement * 2);
 
View Full Code Here

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

            Stroke stroke = null;
            LineSymbolizerImpl lineSymb = (LineSymbolizerImpl) styleBuilder.createLineSymbolizer(stroke);
            lineSymb.setUnitOfMeasure(SI.METER);
           
            visitor = new UomRescaleStyleVisitor(10);

            lineSymb.accept(visitor);
View Full Code Here

    {
        try
        {
            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);
            PolygonSymbolizer rescaledPolySymb = (PolygonSymbolizer) visitor.getCopy();
View Full Code Here

            double expectedRescaledFontSize = computeExpectedRescaleSize(fontSize, scaleMetersToPixel, uom);
            double expectedRescaledPerpOffset = computeExpectedRescaleSize(perpOffset, scaleMetersToPixel, uom);
            double expectedRescaledGap = computeExpectedRescaleSize(gap, scaleMetersToPixel, uom);
            double expectedRescaledInitialGap = computeExpectedRescaleSize(initialGap, scaleMetersToPixel, uom);
           
            StyleBuilder styleBuilder = new StyleBuilder();

            TextSymbolizerImpl textSymb = (TextSymbolizerImpl) styleBuilder.createTextSymbolizer();
            textSymb.setUnitOfMeasure(uom);
           
            Font font = styleBuilder.createFont(new java.awt.Font("Verdana",java.awt.Font.PLAIN,fontSize));
            textSymb.setFont(font);
           
            LinePlacement placement = styleBuilder.createLinePlacement(perpOffset);
            placement.setGap(styleBuilder.literalExpression(gap));
            placement.setInitialGap(styleBuilder.literalExpression(initialGap));
           
            textSymb.setLabelPlacement(placement);
           
            visitor = new UomRescaleStyleVisitor(scaleMetersToPixel);
View Full Code Here

        {
            double widthValue = 13;
            double scaleMetersToPixel = 17;
            Unit<Length> uom = SI.METER;
         
            StyleBuilder styleBuilder = new StyleBuilder();
            UomRescaleStyleVisitor visitor = null;

            // creates the feature used for the test
            SimpleFeatureTypeBuilder featureTypeBuilder = new SimpleFeatureTypeBuilder();
            featureTypeBuilder.setName("TestType");
            featureTypeBuilder.add("geom", LineString.class, DefaultGeographicCRS.WGS84);
            featureTypeBuilder.add("width", Double.class);
            SimpleFeatureType featureType = featureTypeBuilder.buildFeatureType();
           
            GeometryFactory geomFactory = new GeometryFactory();
            Geometry geom = geomFactory.createLineString(new Coordinate[] { new Coordinate(1,1), new Coordinate(2,2) });
           
            SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(featureType);
            featureBuilder.set("geom", geom);
            featureBuilder.set("width", widthValue);
            SimpleFeature feature = featureBuilder.buildFeature("1");
           

            // creates the symbolizer for the test
            Expression color = styleBuilder.colorExpression(Color.RED);
            Expression width = styleBuilder.attributeExpression("width");
            Stroke stroke = styleBuilder.createStroke(color, width);
            LineSymbolizerImpl lineSymb = (LineSymbolizerImpl) styleBuilder.createLineSymbolizer(stroke);
            lineSymb.setUnitOfMeasure(uom);

           
            // rescales symbolizer
            visitor = new UomRescaleStyleVisitor(scaleMetersToPixel);
View Full Code Here

TOP

Related Classes of org.geotools.styling.StyleBuilder$EqualClasses

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.