Examples of LabelPlacement


Examples of org.geotools.styling.LabelPlacement

            Expression haloRadiusExpression = halo.getRadius();
            haloRadius = haloRadiusExpression.evaluate(null, String.class);
        }

        LabelPlacement labelPlacement = textSymbolizer.getLabelPlacement();
        if (geomType != null) {
            switch( geomType ) {
            case POINT:
            case POLYGON:
                if (labelPlacement instanceof PointPlacement) {
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

        Stroke stroke = null;
        Fill fill = null;
        Graphic graphic = null;
        TextSymbolizer text = null;
        LabelPlacement placement = null;

        List<Rule> rules = fts.rules();
        if (rules.size() > 1) {
            // simple mode trimms away all but the first rule
            Rule keepRule = rules.get(0);
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

     * Creates a default {@link TextSymbolizer} for a given type.
     *
     * @return the default symbolizer.
     */
    public static TextSymbolizer createDefaultTextSymbolizer( SLD type ) {
        LabelPlacement labelPlacement = null;

        switch( type ) {
        case POINT:
        case POLYGON:
            labelPlacement = sf.createPointPlacement(sf.createAnchorPoint(ff.literal(0.0), ff.literal(0.0)),
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

        double fontSize = this.font[0].getHeight();
        Font gtFont = build.createFont(
                fontName, fontItalic, fontBold, fontSize);
        Fill fill = build.createFill(this.colour);
       
        LabelPlacement placement;
        if (pointPlacement) {
            //PointPlacement
            double horiz;
            if (this.place.getSelectionIndex() < 3) {
                switch (this.place.getSelectionIndex()) {
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

    public TextSymbolizerBuilder reset(TextSymbolizer symbolizer) {
        fill.reset(symbolizer.getFill());
        halo.reset(symbolizer.getHalo());
        label = symbolizer.getLabel();
        geometry = symbolizer.getGeometryPropertyName();
        LabelPlacement otherPlacement = symbolizer.getLabelPlacement();
        if (symbolizer.getLabelPlacement() instanceof PointPlacement) {
            PointPlacementBuilder builder = new PointPlacementBuilder(this);
            builder.reset((PointPlacement) otherPlacement);
            placement = builder;
        } else if (symbolizer.getLabelPlacement() instanceof LabelPlacement) {
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

    Font[] fonts = symbolizer.getFonts();
    java.awt.Font javaFont = getFont(feature, fonts);
    ts2d.setFont(javaFont);

    // compute label position, anchor, rotation and displacement
    LabelPlacement placement = symbolizer.getLabelPlacement();
    double anchorX = 0;
    double anchorY = 0;
    double rotation = 0;
    double dispX = 0;
    double dispY = 0;
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

        for (Font font : fonts)
            font.setSize(rescale(font.getSize(), uom));
        copy.setFonts(fonts);

        // rescales label placement
        LabelPlacement placement = copy.getLabelPlacement();
        if (placement instanceof PointPlacement) {
            // rescales point label placement
            PointPlacement pointPlacement = (PointPlacement) placement;
            Displacement disp = pointPlacement.getDisplacement();
            if (disp != null) {
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

                font.setSize(rescale(font.getSize()));
            }
            copy.setFonts(fonts);

            // rescales label placement
            LabelPlacement placement = copy.getLabelPlacement();
            if (placement instanceof PointPlacement) {
                // rescales point label placement
                PointPlacement pointPlacement = (PointPlacement) placement;
                Displacement disp = pointPlacement.getDisplacement();
                if (disp != null) {
View Full Code Here

Examples of org.geotools.styling.LabelPlacement

       
        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

Examples of org.geotools.styling.LabelPlacement

        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
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.