Package org.geotools.styling

Examples of org.geotools.styling.AnchorPoint


        assertEqualsContract(textSymb, clone);
       
        TextSymbolizer notEq = sf.getDefaultTextSymbolizer();
        Expression ancX = ff.literal(10);
        Expression ancY = ff.literal(10);
        AnchorPoint ancPoint = sf.createAnchorPoint(ancX, ancY);
        LabelPlacement placement = sf.createPointPlacement(ancPoint,
                null, null);
        notEq.setLabelPlacement(placement);
        assertEqualsContract(clone, notEq, textSymb);
    }
View Full Code Here


        assertEqualsContract(textSymb, clone);

        TextSymbolizer notEq = sf.getDefaultTextSymbolizer();
        Expression ancX = ff.literal(10);
        Expression ancY = ff.literal(10);
        AnchorPoint ancPoint = sf.createAnchorPoint(ancX, ancY);
        LabelPlacement placement = sf.createPointPlacement(ancPoint,
                null, null);
        notEq.setLabelPlacement(placement);
        assertEqualsContract(clone, notEq, textSymb);
    }
View Full Code Here

        LinePlacement other = sf.createLinePlacement(ff.property("NAME"));
        assertEqualsContract(clone, other, linePlacement);
    }

    public void testAnchorPoint() {
        AnchorPoint anchorPoint = sf.createAnchorPoint(ff.literal(1),
                ff.literal(2));
        anchorPoint.accept(visitor);
       
        AnchorPoint clone = (AnchorPoint) visitor.getCopy();
        assertCopy(anchorPoint, clone);

        AnchorPoint other = sf.createAnchorPoint(ff.literal(3), ff
                .literal(4));
        assertEqualsContract(clone, other, anchorPoint);
    }
View Full Code Here

    }

    public void testXY() throws Exception {
        SLDMockData.anchorPoint(document, document);

        AnchorPoint point = (AnchorPoint) parse();
        assertNotNull(point);

        assertEquals(Filters.asInt(point.getAnchorPointX()), 1);
        assertEquals(Filters.asInt(point.getAnchorPointY()), 2);
    }
View Full Code Here

        Element anchorPoint = SLDMockData.anchorPoint(document, document);
        NodeList anchorPointX = anchorPoint.getElementsByTagNameNS(SLD.NAMESPACE,
                SLD.ANCHORPOINTY.getLocalPart());
        anchorPoint.removeChild(anchorPointX.item(0));

        AnchorPoint point = (AnchorPoint) parse();
        assertNotNull(point);

        assertEquals(Filters.asInt(point.getAnchorPointX()), 1);
        assertNull(point.getAnchorPointY());
    }
View Full Code Here

     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        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"/>
View Full Code Here

                        this.place.select(1); // middle
                        this.place2.select(1); // center
                    }
                    this.place3.select(0); // 0 degrees rotation
                } else {
                    AnchorPoint anchor = ((PointPlacement) labelPlacement).getAnchorPoint();
                    String anchorX = anchor.getAnchorPointX().toString();
                    String anchorY = anchor.getAnchorPointY().toString();
                    // use labels if 0, 0.5, or 1, otherwise use value for align
                    if (anchorX.equals(Double.toString(SLDs.ALIGN_LEFT))) {
                        this.place2.select(0);
                    } else if (anchorX.equals(Double.toString(SLDs.ALIGN_CENTER))) {
                        this.place2.select(1);
View Full Code Here

    if (LOGGER.isLoggable(Level.FINEST)) {
      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++) {
View Full Code Here

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

    AnchorPoint dap = factory.createAnchorPoint(x, y);

    return dap;
  }
View Full Code Here

TOP

Related Classes of org.geotools.styling.AnchorPoint

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.