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

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


     */
    public Shape getLogicalHighlightShape(
            int firstEndpoint, int secondEndpoint,
            Rectangle2D bounds, TextLayout layout
    ) {
        GeneralPath res = new GeneralPath();

        for (int i=firstEndpoint; i<=secondEndpoint; i++) {
            int endRun = breaker.getLevelRunLimit(i, secondEndpoint);
            TextHitInfo hit1 = TextHitInfo.leading(i);
            TextHitInfo hit2 = TextHitInfo.trailing(endRun-1);

            Line2D caret1 = getCaretShape(hit1, layout, false, true, bounds);
            Line2D caret2 = getCaretShape(hit2, layout, false, true, bounds);

            res.append(connectCarets(caret1, caret2), false);

            i = endRun;
        }

        return res;
View Full Code Here


     * @param firstEndpoint - start position
     * @param secondEndpoint - end position
     * @return black box bounds shape
     */
    public Shape getBlackBoxBounds(int firstEndpoint, int secondEndpoint) {
        GeneralPath bounds = new GeneralPath();

        TextRunSegment segment;

        for (int idx = firstEndpoint; idx < secondEndpoint; idx=segment.getEnd()) {
            segment = runSegments.get(logical2segment[idx]);
            bounds.append(segment.getCharsBlackBoxBounds(idx, secondEndpoint), false);
        }

        return bounds;
    }
View Full Code Here

    /**
     * Creates outline shape for the managed text
     * @return outline
     */
    public GeneralPath getOutline() {
        GeneralPath outline = new GeneralPath();

        TextRunSegment segment;

        for (int i = 0; i < runSegments.size(); i++) {
            segment = runSegments.get(i);
            outline.append(segment.getOutline(), false);
        }

        return outline;
    }
View Full Code Here

            if (limit > info.length) {
                limit = info.length;
            }

            GeneralPath result = new GeneralPath();

            int glyphIndex = 0;

            for (int i=start; i<limit; i++) {
                glyphIndex = getChar2Glyph()[i];
                result.append(getGlyphVector().getGlyphVisualBounds(glyphIndex), false);
            }

            // Shift to the segment's coordinates
            result.transform(AffineTransform.getTranslateInstance(x, y));

            return result;
        }
View Full Code Here

                }
            }
            // 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.
View Full Code Here

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

        // Safety check.
        if (points.length > 1) {
            GeneralPath path = new GeneralPath(
                renderer.getWindingRule());
            path.moveTo((float)points[0].getX(), (float)points[0].getY());
            for (int i = 1; i < points.length; i++) {
                path.lineTo((float)points[i].getX(), (float)points[i].getY());
            }
            path.closePath();
            renderer.fillAndDrawOrAppend(path);
        }
    }
View Full Code Here

     * @param renderer EMFRenderer storing the drawing session data
     */
    public void render(EMFRenderer renderer) {
        Point[] points = getPoints();
        int numberOfPoints = getNumberOfPoints();
        GeneralPath currentFigure = renderer.getFigure();

        if (points != null) {
            for (int point = 0; point < numberOfPoints; point ++) {
                // add a point to gp
                currentFigure.lineTo(
                    (float) points[point].getX(),
                    (float) points[point].getY());
            }
        }
    }
View Full Code Here

    throw new UnsupportedOperationException();
  }

  @Override
  public Shape initOutline(char c) {
    GeneralPath path = new GeneralPath();
    if(glyph instanceof SimpleGlyph) {
      SimpleGlyph simpleGlyph = (SimpleGlyph) glyph;
      int numContours = simpleGlyph.numberOfContours();
      for(int iContour=0;iContour!=numContours;++iContour) {
        int numPoints = simpleGlyph.numberOfPoints(iContour);
        for(int iPoint=0;iPoint!=numPoints;++iPoint) {
          int x = simpleGlyph.xCoordinate(iContour, iPoint);
          int y = simpleGlyph.yCoordinate(iContour, iPoint);
          float fx = scale * x;
          float fy = - (scale * y) - fontSize;
          if(iPoint == 0) {
            path.moveTo(fx, fy);
          } else {
            path.lineTo(fx, fy);
          }
        }
      }
    }
   
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;
            for (int point = 0; point < numberOfPoints; point ++) {
                // add a point to gp
                p = points[point];
                if (point > 0) {
                    gp.lineTo((float) p.getX()(float)p.getY());
                } else {
                    gp.moveTo((float) p.getX()(float)p.getY());
                }
            }
            renderer.drawOrAppend(gp);
        }
    }
View Full Code Here

     */
    public void render(EMFRenderer renderer) {
        // The MoveToEx function updates the current position to the
        // specified point
        // and optionally returns the previous position.
        GeneralPath currentFigure = new GeneralPath(
            renderer.getWindingRule());
        currentFigure.moveTo(
            (float) point.getX(),
            (float) point.getY());
        renderer.setFigure(currentFigure);
    }
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.