Package org.geotools.styling

Examples of org.geotools.styling.Displacement


    }

    public void visit(Graphic gr) {
        Graphic copy = null;

        Displacement displacementCopy = copy( gr.getDisplacement() );
        ExternalGraphic[] externalGraphicsCopy = copy( gr.getExternalGraphics() );
        Mark[] marksCopy = copy( gr.getMarks() );
        Expression opacityCopy = copy( gr.getOpacity() );
        Expression rotationCopy = copy( gr.getRotation() );
        Expression sizeCopy = copy( gr.getSize() );
View Full Code Here


    }

    public void visit(Displacement dis) {
        Expression x = copy( dis.getDisplacementX() );
        Expression y = copy( dis.getDisplacementY() );
        Displacement copy = sf.createDisplacement(x, y);
       
        if( STRICT && !copy.equals( dis )){
            throw new IllegalStateException("Was unable to duplicate provided Displacement:"+dis );
        }
        pages.push(copy);
    }
View Full Code Here

                .literal(4));
        assertEqualsContract(clone, other, anchorPoint);
    }

    public void testDisplacement() {
        Displacement displacement = sf.createDisplacement(ff.literal(1),
                ff.literal(2));
       
        displacement.accept(visitor);
        Displacement clone = (Displacement) visitor.getCopy();
        assertCopy(displacement, clone);

        Displacement other = sf.createDisplacement(ff.literal(3),
                ff.literal(4));
        assertEqualsContract(clone, other, displacement);
    }
View Full Code Here

    }

    public void testNormal() throws Exception {
        SLDMockData.displacement(document, document);

        Displacement d = (Displacement) parse();
        assertEquals(Filters.asInt(d.getDisplacementX()), 1);
        assertEquals(Filters.asInt(d.getDisplacementY()), 2);
    }
View Full Code Here

        throws Exception {
        //<xsd:element ref="sld:AnchorPoint" minOccurs="0"/>
        AnchorPoint anchorPoint = (AnchorPoint) node.getChildValue("AnchorPoint");

        //<xsd:element ref="sld:Displacement" minOccurs="0"/>
        Displacement displacement = (Displacement) node.getChildValue("Displacement");

        //<xsd:element ref="sld:Rotation" minOccurs="0"/>
        Expression rotation = (Expression) node.getChildValue("Rotation");

        return styleFactory.createPointPlacement(anchorPoint, displacement, rotation);
View Full Code Here

      LOGGER.finest("parsing pointPlacement");
    }

    Expression rotation = ff.literal(0.0);
    AnchorPoint ap = null;
    Displacement dp = null;

    NodeList children = root.getChildNodes();
    final int length = children.getLength();
    for (int i = 0; i < length; i++) {
      Node child = children.item(i);
View Full Code Here

      if (childName.equalsIgnoreCase("DisplacementY")) {
        y = (parseCssParameter(child));
      }
    }

    Displacement dd = factory.createDisplacement(x, y);

    return dd;
  }
View Full Code Here

TOP

Related Classes of org.geotools.styling.Displacement

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.