Package org.geotools.styling

Examples of org.geotools.styling.GraphicImpl


    }

    public void testGraphicLegend2() throws Exception {

        StyledShapePainter painter = new StyledShapePainter();
        GraphicImpl legend = new GraphicImpl(CommonFactoryFinder.getFilterFactory(GeoTools
                .getDefaultHints()));
        legend.setRotation(0);
        legend.setOpacity(1);
        Style pStyle = RendererBaseTest.loadStyle(this, "externalGraphic.sld");
        URL url = StreamingRenderer.class.getResource("test-data/");
        StyleFactory sf = CommonFactoryFinder.getStyleFactory(null);
        ExternalGraphic eg = sf.createExternalGraphic(url + "icon64.png", "image/png");
        legend.addExternalGraphic(eg);
        BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = (Graphics2D) image.getGraphics();
        MathTransform transform = ProjectiveTransform.create(new AffineTransform());
        Decimator decimator = new Decimator(transform);
        Point point = new GeometryFactory().createPoint(new Coordinate(10, 10));
View Full Code Here


     */
    public void testTextSymbolizer2() {
        TextSymbolizer2 symb = (TextSymbolizer2) sf.createTextSymbolizer();
       
        // Create a Graphic with two recognizable values
        GraphicImpl gr = new GraphicImpl(ff);
        gr.setOpacity(ff.literal(0.77));
        gr.setSize(ff.literal(77));
        symb.setGraphic(gr);
        Literal snippet = ff.literal("no idea what a snipet is good for");
    symb.setSnippet(snippet);
        Literal fD = ff.literal("some description");
    symb.setFeatureDescription(fD);
        OtherTextImpl otherText = new OtherTextImpl();
        otherText.setTarget("otherTextTarget");
        otherText.setText(ff.literal("otherTextText"));
    symb.setOtherText(otherText);

    // copy it
        TextSymbolizer2 copy = (TextSymbolizer2) visitor.copy(symb);

        // compare it
        assertEquals("Graphic of TextSymbolizer2 has not been correctly duplicated", gr, copy
                .getGraphic());
        assertEquals("Graphic of TextSymbolizer2 has not been correctly duplicated", gr.getOpacity(), copy
                .getGraphic().getOpacity());
        assertEquals("Graphic of TextSymbolizer2 has not been correctly duplicated", gr.getSize(), copy
                .getGraphic().getSize());       
        assertEquals("Snippet of TextSymbolizer2 has not been correctly duplicated", snippet, copy
                .getSnippet());
        assertEquals("FeatureDescription of TextSymbolizer2 has not been correctly duplicated", fD, copy
                .getFeatureDescription());
View Full Code Here

        List<Symbolizer> symbolizers = rule.symbolizers();
        for (Symbolizer symbolizer : symbolizers) {
          if (symbolizer.getClass().isAssignableFrom(
              PointSymbolizerImpl.class)) {
            PointSymbolizerImpl pointSymbolizerImpl = (PointSymbolizerImpl) symbolizer;
            GraphicImpl graphicImpl = pointSymbolizerImpl
                .getGraphic();
            if (graphicImpl.getClass().isAssignableFrom(
                ModelImpl.class)) {
              kmlModels.add(new KmlModel(rule,
                  (ModelImpl) graphicImpl));
            }
          }
View Full Code Here

        List<Symbolizer> symbolizers = rule.symbolizers();
        for (Symbolizer symbolizer : symbolizers) {
          if (symbolizer.getClass().isAssignableFrom(
              PointSymbolizerImpl.class)) {
            PointSymbolizerImpl pointSymbolizerImpl = (PointSymbolizerImpl) symbolizer;
            GraphicImpl graphicImpl = pointSymbolizerImpl
                .getGraphic();
            if (graphicImpl.getClass().isAssignableFrom(
                ModelImpl.class)) {
              inlineModels.add(new X3DInlineModel(rule,
                  (ModelImpl) graphicImpl));
            }
          }
View Full Code Here

TOP

Related Classes of org.geotools.styling.GraphicImpl

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.