Package org.opengis.style

Examples of org.opengis.style.GraphicalSymbol


        symbolizer = styleBuilder.createLineSymbolizer(createStroke(featureStyle));
        break;
      case POINT:
      case MULTIPOINT:
        PointSymbolizer ps = styleBuilder.createPointSymbolizer();
        GraphicalSymbol symbol = createSymbol(featureStyle);
        if (symbol instanceof Mark) {
          ps.getGraphic().setSize(((Mark) symbol).getSize());
        } else {
          Expression size = styleBuilder.literalExpression(featureStyle.getSymbol().getImage().getHeight());
          ps.getGraphic().setSize(size);
View Full Code Here


           
            strokeGraphicStroke = stroke.getGraphicStroke();
            if (strokeGraphicStroke != null) {
                List<GraphicalSymbol> graphicalSymbolsList = strokeGraphicStroke.graphicalSymbols();
                if (graphicalSymbolsList.size() > 0) {
                    GraphicalSymbol graphicalSymbol = graphicalSymbolsList.get(0);
                    if (graphicalSymbol instanceof ExternalGraphic) {
                        strokeExternalGraphicStroke = (ExternalGraphic) graphicalSymbol;
                    }
                }
            }
View Full Code Here

            strokeGraphicStroke = stroke.getGraphicStroke();
            if (strokeGraphicStroke != null) {
                List<GraphicalSymbol> graphicalSymbolsList = strokeGraphicStroke.graphicalSymbols();
                if (graphicalSymbolsList.size() > 0) {
                    GraphicalSymbol graphicalSymbol = graphicalSymbolsList.get(0);
                    if (graphicalSymbol instanceof ExternalGraphic) {
                        strokeExternalGraphicStroke = (ExternalGraphic) graphicalSymbol;
                    }
                }
            }

            // dash
            float[] dashArray = stroke.getDashArray();
            if (dashArray != null) {
                dash = Utilities.getDashString(dashArray);
            } else {
                dash = ""; //$NON-NLS-1$
            }
            // dashoffset
            dashOffset = stroke.getDashOffset().evaluate(null, String.class);
            // line cap
            lineCap = stroke.getLineCap().evaluate(null, String.class);
            // line join
            lineJoin = stroke.getLineJoin().evaluate(null, String.class);

            hasStroke = true;
        } else {
            hasStroke = false;
        }

        fill = polygonSymbolizer.getFill();
        if (fill != null) {
            Expression color = fill.getColor();
            if (color != null) {
                fillColor = expressionToString(color);
            }
            Expression opacity = fill.getOpacity();
            fillOpacity = expressionToString(opacity);

            fillGraphicFill = fill.getGraphicFill();
            if (fillGraphicFill != null) {
                List<GraphicalSymbol> graphicalSymbolsList = fillGraphicFill.graphicalSymbols();

                if (graphicalSymbolsList.size() > 0) {
                    GraphicalSymbol graphicalSymbol = graphicalSymbolsList.get(0);
                    if (graphicalSymbol instanceof ExternalGraphic) {
                        fillExternalGraphicFill = (ExternalGraphic) graphicalSymbol;
                    } else if (graphicalSymbol instanceof Mark) {
                        mark = (Mark) graphicalSymbol;
                        wkMarkNameFill = mark.getWellKnownName().evaluate(null, String.class);
View Full Code Here

        }
        Iterator<GraphicalSymbol> symbolIter = legend.graphicalSymbols().iterator();
       
        while(symbolIter.hasNext()) {
       
            GraphicalSymbol symbol = symbolIter.next();

            if (symbol instanceof ExternalGraphic) {
                float[] coords = new float[2];
                PathIterator iter = getPathIterator(shape);
                iter.currentSegment(coords);
View Full Code Here

        Graphic graphicFill = fill.getGraphicFill();
        assertNotNull(graphicFill);
       
        assertEquals(1, graphicFill.graphicalSymbols().size());

        GraphicalSymbol symbol = graphicFill.graphicalSymbols().get(0);
        assertTrue(symbol instanceof ExternalGraphic);
        return (ExternalGraphic) symbol;
    }
View Full Code Here

                return null;
            }
            if (g.graphicalSymbols().size() != 1) {
                return null;
            }
            GraphicalSymbol gSym = g.graphicalSymbols().get(0);
            if (! (gSym instanceof ExternalGraphic)) {
                return null;
            }
            ExternalGraphic exGraphic = (ExternalGraphic) gSym;
            try {
View Full Code Here

       
        if (rotation == null) {
            rotation = getRotation(g, f);
        }
       
        GraphicalSymbol gs = g.graphicalSymbols().iterator().next();
       
        if(gs instanceof Mark) {
            Stroke stroke = ((Mark) gs).getStroke();
            if(stroke!=null){
                Double width = stroke.getWidth().evaluate(f, Double.class);
View Full Code Here

    @Test
    public void testExternalImage() throws Exception {
        StyleFactory sfact =  CommonFactoryFinder.getStyleFactory();
        FilterFactory ffact =  CommonFactoryFinder.getFilterFactory();
       
        GraphicalSymbol gs = sfact.createExternalGraphic(getClass().getClassLoader().getResource("arrow-16.png"), "image/png");
       
        Graphic g = sfact.graphic(Arrays.asList(gs), Expression.NIL, Expression.NIL, Expression.NIL, null, null);
        Symbolizer symb = sfact.pointSymbolizer(null, ffact.property(null), null, null, g);
        Rule r = sfact.rule(null, null, null, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, Arrays.asList(symb), null);
        FeatureTypeStyle fts = sfact.featureTypeStyle(null, null, null, Collections.<Name> emptySet(), Collections.<SemanticType> emptySet(), Arrays.asList(r));
View Full Code Here

    @Test
    public void testExternalImageRotated45() throws Exception {
        StyleFactory sfact =  CommonFactoryFinder.getStyleFactory();
        FilterFactory ffact =  CommonFactoryFinder.getFilterFactory();
       
        GraphicalSymbol gs = sfact.createExternalGraphic(getClass().getClassLoader().getResource("arrow-16.png"), "image/png");
       
        Graphic g = sfact.graphic(Arrays.asList(gs), Expression.NIL, Expression.NIL, ffact.literal(45.0), null, null);
        Symbolizer symb = sfact.pointSymbolizer(null, ffact.property(null), null, null, g);
        Rule r = sfact.rule(null, null, null, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, Arrays.asList(symb), null);
        FeatureTypeStyle fts = sfact.featureTypeStyle(null, null, null, Collections.<Name> emptySet(), Collections.<SemanticType> emptySet(), Arrays.asList(r));
View Full Code Here

    @Test
    public void testBigExternalImage() throws Exception {
        StyleFactory sfact =  CommonFactoryFinder.getStyleFactory();
        FilterFactory ffact =  CommonFactoryFinder.getFilterFactory();
       
        GraphicalSymbol gs = sfact.createExternalGraphic(getClass().getClassLoader().getResource("planet-42.png"), "image/png");
       
        Graphic g = sfact.graphic(Arrays.asList(gs), Expression.NIL, Expression.NIL, Expression.NIL, null, null);
        Symbolizer symb = sfact.pointSymbolizer(null, ffact.property(null), null, null, g);
        Rule r = sfact.rule(null, null, null, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, Arrays.asList(symb), null);
        FeatureTypeStyle fts = sfact.featureTypeStyle(null, null, null, Collections.<Name> emptySet(), Collections.<SemanticType> emptySet(), Arrays.asList(r));
View Full Code Here

TOP

Related Classes of org.opengis.style.GraphicalSymbol

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.