Package java.awt

Examples of java.awt.Shape


     * not rendered.
     *
     * @param gr the AWT Graphics context
     */
    public synchronized void render(Graphics gr) {
        Shape shp = getShape();
        if (shp != null) {

            if (matted) {
                if (gr instanceof Graphics2D && stroke instanceof BasicStroke) {
                    ((Graphics2D) gr).setStroke(new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f));
View Full Code Here


                        failedFilter(omg);
                    }
                    continue;
                } else {
                    Shape omgShape = omg.getShape();
                    if (omgShape != null
                            && area.intersects(omgShape.getBounds2D())) {

                        if (DEBUG_DETAIL) {
                            Debug.output("   +++ omg intersects bounds");
                        }
View Full Code Here

            Graphics2D g2 = (Graphics2D) g;
            if (getTextMatteColor() != null) {
                FontRenderContext context = g2.getFontRenderContext();
                GlyphVector glyphVector = g2.getFont()
                        .createGlyphVector(context, string);
                Shape outline = glyphVector.getOutline();
                g2.translate(x, y);
                g2.setStroke(getTextMatteStroke());
                g2.setColor(getTextMatteColor());
                g2.draw(outline);
                g2.translate(-x, -y);
View Full Code Here

    }

    public static void addArrowHeads(int arrowDirectionType, int location,
                                     OMAbstractLine line) {

        Shape arrowHeads = createArrowHeads(arrowDirectionType, location, line);
        if (arrowHeads != null) {
            line.getShape().append(arrowHeads, false);
        }
    }
View Full Code Here

                OMGeometry graphic = (OMGeometry) iter.next();

                if (logger.isLoggable(Level.FINE))
                    logger.fine("examining " + graphic);

                Shape shape = graphic.getShape();
                if (shape == null)
                    continue;

                PathIterator path = shape.getPathIterator(new AffineTransform());
                int segment = 0;
                int itemsInPath = 0;
                boolean pathValid = true;

                for (; !path.isDone() && pathValid; path.next()) {
View Full Code Here

        da2.setLinePaint(Color.lightGray);
        da2.setStroke(new BasicStroke(2));

        int[] xpoints = new int[] { 15, 15, 50, 50, 90, 50, 50, 15 };
        int[] ypoints = new int[] { 30, 70, 70, 90, 50, 10, 30, 30 };
        Shape shape = new Polygon(xpoints, ypoints, xpoints.length);

        BasicIconPart testPart = new BasicIconPart(shape);
        testPart.setRenderingAttributes(da);
        testPart.setGradient(true);

        Shape shape2 = new Ellipse2D.Double(5, 5, 90, 90);
        BasicIconPart testPart2 = new BasicIconPart(shape2);
        testPart2.setRenderingAttributes(da2);
        testPart2.setGradient(true);

        IconPartList parts = new IconPartList();
View Full Code Here

        AffineTransform transform = AffineTransform.getScaleInstance((double) width / 100,
                (double) height / 100);
        transform.concatenate(baseTransform);

        // Handle clip area in Graphics, first
        Shape clip = getClip();
        if (clip != null) {
            g.setClip(new GeneralPath(clip).createTransformedShape(transform));
        }

        Shape shape = new GeneralPath(geometry).createTransformedShape(transform);
        getAttributesForRendering(appDA).render((Graphics2D) g, shape, gradient);
    }
View Full Code Here

        intersectionResultList.clear();
        repaint();
    }

    public OMGraphic getPointIntersectionImage(OMGraphic omg) {
        Shape s = omg.getShape();
        Projection p = getProjection();
        if (s != null && p != null && omg instanceof OMPoly) {
            Rectangle r = s.getBounds();

            double x = r.getX();
            double y = r.getY();
            double h = r.getHeight();
            double w = r.getWidth();
            float[] rawll = ((OMPoly) omg).getLatLonArray();
            LatLonPoint llHolder = new LatLonPoint();
            Geo g = new Geo(0, 0);
            int[] pix = new int[(int) (h * w)];

            for (double j = 0; j < h; j++) {
                for (double i = 0; i < w; i++) {

                    boolean inShape = s.contains(i + x, j + y);
                    p.inverse((int) (i + x), (int) (j + y), llHolder);

                    g.initialize(llHolder.getLatitude(), llHolder.getLongitude());
                    boolean inGeo = Intersection.isPointInPolygon(g,
                            rawll,
View Full Code Here

  /**
   * @see Graphics2D#drawGlyphVector(GlyphVector, float, float)
   */
  public void drawGlyphVector(GlyphVector g, float x, float y) {
      Shape s = g.getOutline(x, y);
      fill(s);
  }
View Full Code Here

    final double x = bounds.getX();
    final double y = bounds.getY();
    final double width = bounds.getWidth();
    final double height = bounds.getHeight();

    final Shape scaledShape = ShapeTransform.transformShape
        (shape, scale, keepAspectRatio, width, height);
    final Graphics2D clone = (Graphics2D) g2.create();
    final double extraPadding;
    if (layoutContext != null)
    {
View Full Code Here

TOP

Related Classes of java.awt.Shape

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.