Package org.geotools.renderer.style

Examples of org.geotools.renderer.style.LineStyle2D


                if (!lineStyles.isEmpty()) {
                    Iterator<LineSymbolizer> iter = lineStyles.iterator();
                    while (iter.hasNext()) {
                        LineSymbolizer sym = (LineSymbolizer) iter.next();
                        try {
                            LineStyle2D style = (LineStyle2D) styleFactory
                                    .createStyle(feature, sym, scaleRange);
                            encodeLineStyle(feature, style, sym);
                        } catch (IllegalArgumentException iae) {
                            LOGGER.fine(iae.getMessage() + " for "
                                    + sym.toString());
View Full Code Here


                    }
                }
            }

            if (style instanceof LineStyle2D) {
                LineStyle2D ls2d = (LineStyle2D) style;

                if (ls2d.getStroke() != null) {
                    // see if a graphic stroke is to be used, the drawing method
                    // is completely
                    // different in this case
                    if (ls2d.getGraphicStroke() != null) {
                        drawWithGraphicsStroke(graphics, dashShape(shape, ls2d.getStroke()), ls2d.getGraphicStroke(), isLabelObstacle);
                    } else {
                        Paint paint = ls2d.getContour();

                        if (paint instanceof TexturePaint) {
                            TexturePaint tp = (TexturePaint) paint;
                            BufferedImage image = tp.getImage();
                            Rectangle2D rect = tp.getAnchorRect();
                            AffineTransform at = graphics.getTransform();
                            double width = rect.getWidth() * at.getScaleX();
                            double height = rect.getHeight() * at.getScaleY();
                            Rectangle2D scaledRect = new Rectangle2D.Double(0,
                                    0, width, height);
                            paint = new TexturePaint(image, scaledRect);
                        }

                        // debugShape(shape);
                        Stroke stroke = ls2d.getStroke();
                        if (graphics
                                .getRenderingHint(RenderingHints.KEY_ANTIALIASING) == RenderingHints.VALUE_ANTIALIAS_ON) {
                            if (stroke instanceof BasicStroke) {
                                BasicStroke bs = (BasicStroke) stroke;
                                stroke = new BasicStroke(
                                        bs.getLineWidth() + 0.5f, bs
                                                .getEndCap(), bs.getLineJoin(),
                                        bs.getMiterLimit(), bs.getDashArray(),
                                        bs.getDashPhase());
                            }
                        }

                        graphics.setPaint(paint);
                        graphics.setStroke(stroke);
                        graphics.setComposite(ls2d.getContourComposite());
                        graphics.draw(shape);
                    }
                }
            }
        }
View Full Code Here

           return maxSize(image.getWidth(), image.getHeight());
        } else if(style instanceof IconStyle2D) {
           final Icon icon = ((IconStyle2D) style).getIcon();
           return maxSize(icon.getIconWidth(), icon.getIconHeight());
        } else if(style instanceof LineStyle2D) {
            LineStyle2D ls = ((LineStyle2D) style);
            double gsSize = getStyle2DSize(ls.getGraphicStroke());
            double strokeSize = 0;
            if(ls.getStroke() instanceof BasicStroke) {
                strokeSize = ((BasicStroke) ls.getStroke()).getLineWidth();
            }
            return maxSize(gsSize, strokeSize);
        } else {
            return 0;
        }
View Full Code Here

                if (!lineStyles.isEmpty()) {
                    Iterator<LineSymbolizer> iter = lineStyles.iterator();
                    while (iter.hasNext()) {
                        LineSymbolizer sym = (LineSymbolizer) iter.next();
                        try {
                            LineStyle2D style = (LineStyle2D) styleFactory.createStyle(feature,
                                    sym, scaleRange);
                            encodeLineStyle(feature, style, sym);
                        } catch (IllegalArgumentException iae) {
                            LOGGER.fine(iae.getMessage() + " for " + sym.toString());
                        }
View Full Code Here

                if (!lineStyles.isEmpty()) {
                    Iterator<LineSymbolizer> iter = lineStyles.iterator();
                    while (iter.hasNext()) {
                        LineSymbolizer sym = (LineSymbolizer) iter.next();
                        try {
                            LineStyle2D style = (LineStyle2D) styleFactory
                                    .createStyle(feature, sym, scaleRange);
                            encodeLineStyle(feature, style, sym);
                        } catch (IllegalArgumentException iae) {
                            LOGGER.fine(iae.getMessage() + " for "
                                    + sym.toString());
View Full Code Here

TOP

Related Classes of org.geotools.renderer.style.LineStyle2D

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.