Examples of AbstractStyleVisitor


Examples of org.geotools.styling.AbstractStyleVisitor

        assertTrue(style.isPresent());

        transformer.transform(style.get()); // assert it can be converted to SLD

        final List<Rule> rules = Lists.newArrayList();
        style.get().accept(new AbstractStyleVisitor() {
            @Override
            public void visit(Rule rule) {
                rules.add(rule);
            }
        });
View Full Code Here

Examples of org.geotools.styling.AbstractStyleVisitor

        final Configuration configuration = new Configuration();
        final Style gridStyle = configuration.getDefaultStyle(Constants.Style.Grid.NAME);
        final AtomicInteger foundLineSymb = new AtomicInteger(0);
        final AtomicInteger foundTextSymb = new AtomicInteger(0);

        final AbstractStyleVisitor styleValidator = new AbstractStyleVisitor() {
            @Override
            public void visit(LineSymbolizer line) {
                foundLineSymb.incrementAndGet();
                super.visit(line);
            }

            @Override
            public void visit(TextSymbolizer text) {
                foundTextSymb.incrementAndGet();
                final PointPlacement labelPlacement = (PointPlacement) text.getLabelPlacement();
                assertNotNull(labelPlacement.getDisplacement());
                super.visit(text);
            }
        };

        styleValidator.visit(gridStyle);

        assertEquals(1, foundLineSymb.intValue());
        assertEquals(1, foundTextSymb.intValue());
    }
View Full Code Here

Examples of org.geotools.styling.AbstractStyleVisitor

    private List<Resource> additionalResources(StyleInfo s) throws IOException {
        final List<Resource> files = new ArrayList<Resource>();
        final Resource baseDir = dd.get(s);
        try {
            Style parsedStyle = dd.parsedStyle(s);
            parsedStyle.accept(new AbstractStyleVisitor() {
                @Override
                public void visit(ExternalGraphic exgr) {
                    if (exgr.getOnlineResource() == null) {
                        return;
                    }
View Full Code Here

Examples of org.geotools.styling.AbstractStyleVisitor

    List<Resource> additionalStyleResources(StyleInfo s) throws IOException {
        final List<Resource> resources = new ArrayList<Resource>();
        final Resource baseDir = get(s);
        try {
            Style parsedStyle = parsedStyleResources(s);
            parsedStyle.accept(new AbstractStyleVisitor() {
                @Override
                public void visit(ExternalGraphic exgr) {
                    if (exgr.getOnlineResource() == null) {
                        return;
                    }
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.