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

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


    }


    Area[] areas=new Area[ generalPaths.length ];

    Area totalArea=null;
    Area newArea;


    //LOOP
    //---close the path and create an Area so can stack them
    for( int i=0; i < generalPaths.length; i++ )
    {
      generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().getZeroLineCoordinate() );

      generalPaths[ i ].closePath();
      //generalPaths[ i ].lineTo( axisChart.getXAxisProperties().getTickStartX(), axisChart.getYAxisProperties().getZeroLineCoordinate() );

      newArea=new Area( generalPaths[ i ] );

      //---if this is not the first area, subtract cumulative area
      if( i > 0 )
      {
        areas[ i ]=(Area) newArea.clone();
        areas[ i ].subtract( totalArea );

        totalArea=newArea;
      }
      else
View Full Code Here


        if (getTransform() != null) {
            s = getTransform().createTransformedShape(s);
        }

        Area area = new Area(s);
        if (getClip() != null) {
            area.intersect(new Area(getClip()));
        }

        return area.intersects(rect);
    }
View Full Code Here

    ) {
        if (d == null || !d.ulOn && d.imUlStroke == null && !d.strikeThrough) {
            return segmentOutline; // Nothing to do
        }

        Area res = new Area(segmentOutline);

        float left = (float) trs.getLogicalBounds().getMinX() - trs.x;
        float right = (float) trs.getLogicalBounds().getMaxX() - trs.x;

        d.getStrokes(trs.metrics);

        if (d.strikeThrough) {
            float y = trs.metrics.strikethroughOffset;
            res.add(new Area(d.strikeThroughStroke.createStrokedShape(
                    new Line2D.Float(left, y, right, y)
            )));
        }

        if (d.ulOn) {
            float y = trs.metrics.underlineOffset;
            res.add(new Area(d.ulStroke.createStrokedShape(
                    new Line2D.Float(left, y, right, y)
            )));
        }

        if (d.imUlStroke != null) {
            float y = trs.metrics.underlineOffset;
            res.add(new Area(d.imUlStroke.createStrokedShape(
                    new Line2D.Float(left, y, right, y)
            )));

            if (d.imUlStroke2 != null) {
                y++;
                res.add(new Area(d.imUlStroke2.createStrokedShape(
                        new Line2D.Float(left, y, right, y)
                )));
            }
        }
View Full Code Here

            // The new clipping region includes the areas of the
            // current clipping region with those of the current shape excluded.
            else if (mode == EMFConstants.RGN_DIFF) {
                Shape clip = renderer.getClip();
                if (clip != null) {
                    Area a = new Area(shape);
                    a.subtract(new Area(clip));
                    renderer.setClip(a);
                } else {
                    renderer.setClip(shape);
                }
            }
            // The new clipping region includes the union (combined areas)
            // of the current clipping region and the current shape.
            else if(mode == EMFConstants.RGN_OR) {
                GeneralPath path = new GeneralPath(shape);
                Shape clip = renderer.getClip();
                if (clip != null) {
                    path.append(clip, false);
                }
                renderer.setClip(path);
            }
            // The new clipping region includes the union of the current
            // clipping region and the current shape but without the overlapping areas.
            else if(mode == EMFConstants.RGN_XOR) {
                Shape clip = renderer.getClip();
                if (clip != null) {
                    Area a = new Area(shape);
                    a.exclusiveOr(new Area(clip));
                    renderer.setClip(a);
                } else {
                    renderer.setClip(shape);
                }
            }
View Full Code Here

        setFont(new Font("sanserif", Font.PLAIN, 12));
        this.cb = cb;
        cb.saveState();
        this.width = width;
        this.height = height;
        clip = new Area(new Rectangle2D.Float(0, 0, width, height));
        clip(clip);
        originalStroke = stroke = oldStroke = strokeOne;
        setStrokeDiff(stroke, null);
        cb.saveState();
    }
View Full Code Here

    public boolean hit(Rectangle rect, Shape s, boolean onStroke) {
        if (onStroke) {
            s = stroke.createStrokedShape(s);
        }
        s = transform.createTransformedShape(s);
        Area area = new Area(s);
        if (clip != null)
            area.intersect(clip);
        return area.intersects(rect.x, rect.y, rect.width, rect.height);
    }
View Full Code Here

        g2.setFont(this.font);
        g2.cb = this.cb.getDuplicate();
        g2.cb.saveState();
        g2.width = this.width;
        g2.height = this.height;
        g2.followPath(new Area(new Rectangle2D.Float(0, 0, width, height)), CLIP);
        if (this.clip != null)
            g2.clip = new Area(this.clip);
        g2.composite = composite;
        g2.stroke = stroke;
        g2.originalStroke = originalStroke;
        g2.strokeOne = (BasicStroke)g2.transformStroke(g2.strokeOne);
        g2.oldStroke = g2.strokeOne;
View Full Code Here

            setClip(null);
            return;
        }
        s = transform.createTransformedShape(s);
        if (clip == null)
            clip = new Area(s);
        else
            clip.intersect(new Area(s));
        followPath(s, CLIP);
    }
View Full Code Here

            s = transform.createTransformedShape(s);
        if (s == null) {
            clip = null;
        }
        else {
            clip = new Area(s);
            followPath(s, CLIP);
        }
        paintFill = paintStroke = null;
        currentFillGState = currentStrokeGState = 255;
        oldStroke = strokeOne;
View Full Code Here

TOP

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

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.