Package com.google.code.appengine.awt.geom

Examples of com.google.code.appengine.awt.geom.GeneralPath


     * displays the tag using the renderer
     *
     * @param renderer EMFRenderer storing the drawing session data
     */
    public void render(EMFRenderer renderer) {
        GeneralPath currentPath = renderer.getPath();
        Stroke currentPenStroke = renderer.getPenStroke();
        // The WidenPath function redefines the current path as the area
        // that would be painted if the path were stroked using the pen
        // currently selected into the given device context.
        if (currentPath != null && currentPenStroke != null) {
            GeneralPath newPath = new GeneralPath(
                renderer.getWindingRule());
            newPath.append(currentPenStroke.createStrokedShape(currentPath), false);
            renderer.setPath(newPath);
        }
    }
View Full Code Here


     * displays the tag using the renderer
     *
     * @param renderer EMFRenderer storing the drawing session data
     */
    public void render(EMFRenderer renderer) {
        GeneralPath currentPath = renderer.getPath();
        // fills the current path
        if (currentPath != null) {
            renderer.drawShape(currentPath);
            renderer.setPath(null);
        }
View Full Code Here

     * @param renderer EMFRenderer storing the drawing session data
     */
    public void render(EMFRenderer renderer) {
        // The BeginPath function opens a path bracket in the specified
        // device context.
        renderer.setPath(new GeneralPath(
            renderer.getWindingRule()));
        renderer.setPathTransform(new AffineTransform());
    }
View Full Code Here

    public void render(EMFRenderer renderer) {
        Point[] points = getPoints();
        int numberOfPoints = getNumberOfPoints();

        if (points != null && points.length > 0) {
            GeneralPath gp = new GeneralPath(
                renderer.getWindingRule());
            Point p = points[0];
            gp.moveTo((float) p.getX()(float)p.getY());

            for (int point = 1; point < numberOfPoints; point = point + 3) {
                // add a point to gp
                Point p1 = points[point];
                Point p2 = points[point + 1];
                Point p3 = points[point + 2];
                if (point > 0) {
                    gp.curveTo(
                        (float)p1.getX(), (float)p1.getY(),
                        (float)p2.getX(), (float)p2.getY(),
                        (float)p3.getX(), (float)p3.getY());
                }
            }
View Full Code Here

            Rectangle2D blackBox = vector[glyphIndex].getGlyphMetrics().getBounds2D();
            at.translate(visualPositions[idx], visualPositions[idx+1]);
            return(at.createTransformedShape(blackBox));
        }

        GeneralPath shape = (GeneralPath)this.getGlyphOutline(glyphIndex);
        shape.transform(at);
        return shape.getBounds2D();
    }
View Full Code Here

            double xOffs = x + visualPositions[idx] + fontTransform.getTranslateX();
            double yOffs = y + visualPositions[idx+1] + fontTransform.getTranslateY();
            return new Rectangle((int)xOffs, (int)yOffs, 0, 0);
        }

        GeneralPath shape = (GeneralPath)this.getGlyphOutline(glyphIndex);

        AffineTransform at = AffineTransform.getTranslateInstance(x, y);

        if (frc != null){
            at.concatenate(frc.getTransform());
       
/*          if (frc.usesFractionalMetrics()){
                shape.transform(at);
                Rectangle2D bounds = shape.getBounds2D();
                Rectangle rect = new Rectangle();
                rect.setRect(bounds);
                return rect;
            }*/
        }
       
        shape.transform(at);

        Rectangle bounds = shape.getBounds();
        return new Rectangle((int)bounds.getX(), (int)bounds.getY(),
                            (int)bounds.getWidth()-1, (int)bounds.getHeight()-1);
        }
View Full Code Here

        if (gvShapes[glyphIndex] == null) {
            gvShapes[glyphIndex] = vector[glyphIndex].getShape();
        }

        GeneralPath gp = (GeneralPath)((GeneralPath)gvShapes[glyphIndex]).clone();

        /* Applying GlyphVector font transform */
        AffineTransform at = (AffineTransform)this.transform.clone();

        /* Applying Glyph transform */
        AffineTransform glyphAT = getGlyphTransform(glyphIndex);
        if (glyphAT != null){
            at.preConcatenate(glyphAT);
        }

        int idx  = glyphIndex << 1;

        gp.transform(at);
        gp.transform(AffineTransform.getTranslateInstance(visualPositions[idx], visualPositions[idx+1]));
        return gp;
    }
View Full Code Here

     * @return a Shape object that is the outline of this GlyphVector
     * at the specified coordinates.
     */
    @Override
    public Shape getOutline(float x, float y) {
        GeneralPath gp = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        for (int i = 0; i < this.vector.length; i++) {
            GeneralPath outline = (GeneralPath)getGlyphOutline(i);

            /* Applying translation to actual visual bounds */
            outline.transform(AffineTransform.getTranslateInstance(x, y));
            gp.append(outline, false);
        }

        return gp;
    }
View Full Code Here

        float x0 = visualPositions[glyphIndex*2];
        float y0 = visualPositions[glyphIndex*2+1];
        float advanceX = glyph.getGlyphPointMetrics().getAdvanceX();

        GeneralPath gp = new GeneralPath();
        gp.moveTo(0, -ascent - leading);
        gp.lineTo(advanceX ,-ascent - leading);
        gp.lineTo(advanceX, descent);
        gp.lineTo(0, descent);
        gp.lineTo(0, -ascent - leading);
        gp.closePath();

        /* Applying GlyphVector font transform */
        AffineTransform at = (AffineTransform)this.transform.clone();

        /* Applying Glyph transform */
        AffineTransform glyphTransform = getGlyphTransform(glyphIndex);
        if (glyphTransform != null){
            at.concatenate(glyphTransform);
        }

        /* Applying translation to actual visual bounds */
        at.preConcatenate(AffineTransform.getTranslateInstance(x0, y0));
        gp.transform(at);
        return gp;
    }
View Full Code Here

     * @param caret1 - 1st caret
     * @param caret2 - 2nd caret
     * @return highlight shape
     */
    GeneralPath connectCarets(Line2D caret1, Line2D caret2) {
        GeneralPath path = new GeneralPath(GeneralPath.WIND_NON_ZERO);
        path.moveTo((float) caret1.getX1(), (float) caret1.getY1());
        path.lineTo((float) caret2.getX1(), (float) caret2.getY1());
        path.lineTo((float) caret2.getX2(), (float) caret2.getY2());
        path.lineTo((float) caret1.getX2(), (float) caret1.getY2());

        path.closePath();

        return path;
    }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.geom.GeneralPath

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.