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

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


    public void transform(AffineTransform t) {
        t.transform(points, 0, points, 0, pointSize / 2);
    }

    public Shape createTransformedShape(AffineTransform t) {
        GeneralPath p = (GeneralPath)clone();
        if (t != null) {
            p.transform(t);
        }
        return p;
    }
View Full Code Here


    }

    @Override
    public Object clone() {
        try {
            GeneralPath p = (GeneralPath) super.clone();
            p.types = types.clone();
            p.points = points.clone();
            return p;
        } catch (CloneNotSupportedException e) {
            throw new InternalError();
View Full Code Here

        }
        if (src instanceof GeneralPath) {
            return ((GeneralPath)src).createTransformedShape(this);
        }
        PathIterator path = src.getPathIterator(this);
        GeneralPath dst = new GeneralPath(path.getWindingRule());
        dst.append(path, false);
        return dst;
    }
View Full Code Here

        boolean drawClipped = false;

        // test if clip intersects pi
        if (getClip() != null) {
            GeneralPath gp = new GeneralPath();
            gp.append(pi, true);
            // create the stroked shape
            Stroke stroke = getStroke() == null? defaultStroke : getStroke();
            Rectangle2D bounds = stroke.createStrokedShape(gp).getBounds();
            // clip should intersect the path
            // if clip contains the bounds completely, clipping is not needed
View Full Code Here


    //AreaChartProperties areaChartProperties=(AreaChartProperties) iAxisChartDataSet.getChartTypeProperties();
    float xPosition=axisChart.getXAxis().getTickStart();

    GeneralPath generalPaths[]=new GeneralPath[ iAxisChartDataSet.getNumberOfDataSets() ];


    //---AreaCharts can not be drawn on a horizontal axis so y-axis will always be the data axis
    //DataAxisProperties dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties();


    //LOOP
    //---initial postion of each line must be set with call to moveTo()
    //---Do this here so every point does not have to check....if( i == 0 )... in loop
    for( int i=0; i < generalPaths.length; i++ )
    {
      generalPaths[ i ]=new GeneralPath();
      generalPaths[ i ].moveTo( xPosition, axisChart.getYAxis().getZeroLineCoordinate() );
      generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(),
                                                            iAxisChartDataSet.getValue( i, 0 ),
                                                            axisChart.getYAxis().getScaleCalculator().getMinValue() ) );
    }
View Full Code Here

         */
    }

    protected Shape createShape(double[] xPoints, double[] yPoints,
            int nPoints, boolean close) {
        GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        if (nPoints > 0) {
            path.moveTo((float) xPoints[0], (float) yPoints[0]);
            for (int i = 1; i < nPoints; i++) {
                path.lineTo((float) xPoints[i], (float) yPoints[i]);
            }
            if (close)
                path.closePath();
        }
        return path;
    }
View Full Code Here

        TextLayout layout = new TextLayout(text, font, getFontRenderContext());
        float width = Math.max(
            layout.getAdvance(),
            (float) layout.getBounds().getWidth());

        GeneralPath path = new GeneralPath();
        path.moveTo(x, y + (float) layout.getBounds().getY() - layout.getAscent());
        path.lineTo(x + width, y + (float) layout.getBounds().getY() - layout.getAscent() - layout.getAscent());
        draw(path);
    }
View Full Code Here

     * Implementation of createShape makes sure that the points are different by
     * at least one Unit.
     */
    protected Shape createShape(double[] xPoints, double[] yPoints,
            int nPoints, boolean close) {
        GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        if (nPoints > 0) {
            path.moveTo((float) xPoints[0], (float) yPoints[0]);
            double lastX = xPoints[0];
            double lastY = yPoints[0];
            if (close && (Math.abs(xPoints[nPoints - 1] - lastX) < 1)
                    && (Math.abs(yPoints[nPoints - 1] - lastY) < 1)) {
                nPoints--;
            }
            for (int i = 1; i < nPoints; i++) {
                if ((Math.abs(xPoints[i] - lastX) > 1)
                        || (Math.abs(yPoints[i] - lastY) > 1)) {
                    path.lineTo((float) xPoints[i], (float) yPoints[i]);
                    lastX = xPoints[i];
                    lastY = yPoints[i];
                }
            }
            if (close)
                path.closePath();
        }
        return path;
    }
View Full Code Here

        public GeneralPath getShape() {
            if (shape != null) {
                return shape;
            }

            shape = new GeneralPath(GeneralPath.WIND_NON_ZERO);
            int p = 0;
            for (int i = 0; i < endPtsOfContours.length; i++) {
                int startIndex = p++;
                shape.moveTo(xCoordinates[startIndex], yCoordinates[startIndex]);
                boolean lastOnCurve = true;
View Full Code Here

            e.printStackTrace();
        }
    }

    private Shape createUndefined() {
        GeneralPath ud = new GeneralPath(GeneralPath.WIND_EVEN_ODD, 10);
        ud.append(new Rectangle2D.Double(0, 0, FONT_SIZE, FONT_SIZE), false);
        ud.append(new Rectangle2D.Double(FONT_SIZE / 20, FONT_SIZE / 20,
                18 * FONT_SIZE / 20, 18 * FONT_SIZE / 20), false);
        return ud;
    }
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.