Package java.awt.geom

Examples of java.awt.geom.Area.subtract()


            // system
            Rectangle popupArea = SwingUtilities.convertRectangle(
                rootPane.getLayeredPane(), popup.getBounds(),
                menuItem);
            // and subtract this area from the clip
            clip.subtract(new Area(popupArea));
          }
          // at this point we have the original clip minus
          // all the overlapping lightweight popups that are painted
          // after this menu item
          g2d.setClip(clip);
View Full Code Here


        return path.getBounds2D();
      }
    } else {
      Area pathArea = new Area(path);
      Area wholeMap = new Area(new Rectangle2D.Double(0.0, 0.0, 360.0, 180.0));
      wholeMap.subtract(pathArea);
      return wholeMap.getBounds2D();
    }
  }

  /**
 
View Full Code Here

            ClipRable clip = CSSUtilities.convertClipPath(child,
                                                          outlineNode,
                                                          ctx);
            if (clip != null) {
                Area area = new Area(outline);
                area.subtract(new Area(clip.getClipPath()));
                outline = area;
            }
            clipPath.add(new Area(outline));
        }
        if (!hasChildren) {
View Full Code Here

            g2.setColor(RED);
            g2.draw(p1);
            g2.draw(p2);
            return;
        } else if (areaType.equals("add" )) { area.add        (new Area(p2));
        } else if (areaType.equals("sub" )) { area.subtract   (new Area(p2));
        } else if (areaType.equals("xor" )) { area.exclusiveOr(new Area(p2));
        } else if (areaType.equals("int" )) { area.intersect  (new Area(p2));
        } else if (areaType.equals("pear")) {

            double sx = w/100;
View Full Code Here

            // Creates the stem by filling the Area resulting from the
            // subtraction of two Area objects created from an ellipse.
            Ellipse2D stem = new Ellipse2D.Double(x, y-42, 40.0, 40.0);
            Area st1 = new Area(stem);
            stem.setFrame(x+3, y-47, 50.0, 50.0);
            st1.subtract(new Area(stem));
            g2.setColor(BLACK);
            g2.fill(st1);

            // Creates the pear itself by filling the Area resulting from the
            // union of two Area objects created by two different ellipses.
View Full Code Here

                // don't paint over the selection background
                Area selection = getTextPaneSkin().getSelection();
                if (selection != null) {
                    Area fillArea = new Area(new Rectangle(nodeViewBounds.x, nodeViewBounds.y, nodeViewBounds.width, nodeViewBounds.height));
                    selection = selection.createTransformedArea(AffineTransform.getTranslateInstance(-skinX, -skinY));
                    fillArea.subtract(selection);
                    nodeViewGraphics.setColor(styledBackgroundColor);
                    nodeViewGraphics.fill(fillArea);
                } else {
                    nodeViewGraphics.setColor(styledBackgroundColor);
                    nodeViewGraphics.fillRect(nodeViewBounds.x, nodeViewBounds.y, nodeViewBounds.width, nodeViewBounds.height);
View Full Code Here

            graphics.drawString(heading, padding.left, lm.getAscent() + padding.top);

            Rectangle2D headingBounds = font.getStringBounds(heading, fontRenderContext);

            Area titleClip = new Area(graphics.getClip());
            titleClip.subtract(new Area(new Rectangle2D.Double(padding.left, padding.top,
                headingBounds.getWidth() + padding.right, headingBounds.getHeight())));
            graphics.clip(titleClip);

            separatorY += (lm.getAscent() + lm.getDescent()) / 2 + 1;
        }
View Full Code Here

                Rectangle selection = new Rectangle(x0, 0, x1 - x0, height);

                // Paint the unselected text
                Area unselectedArea = new Area();
                unselectedArea.add(new Area(new Rectangle(0, 0, width, height)));
                unselectedArea.subtract(new Area(selection));

                Graphics2D textGraphics = (Graphics2D)graphics.create();
                textGraphics.setColor(getEffectiveForegroundColor());
                textGraphics.clip(unselectedArea);
                textGraphics.drawGlyphVector(glyphVector, 0, ascent);
View Full Code Here

    int mult = 1;
    while (occ > (MORE_JOBS_MAX)) {
      occ = (occ / 10);
      mult = mult * 10;
    }
    moreStatiA.subtract(new Area(new Rectangle2D.Double(x, y, ELEM_WIDTH * 2 - ELEM_WIDTH * occ * 2 / MORE_JOBS_MAX, ELEM_HEIGHT)));
    if (gradientFill) {
      GradientPaint gp;
      gp = new GradientPaint((float) x, (float) y, emptyc.brighter(), (float) x, (float) (y + ELEM_HEIGHT), emptyc.darker(), false);
      g2d.setPaint(gp);
      g2d.fill(moreStatiRect);
View Full Code Here

    int mult = 1;
    while (occ > LOST_JOBS_MAX) {
      occ = (occ / 10);
      mult = mult * 10;
    }
    moreStatiA.subtract(new Area(new Rectangle2D.Double(x, y, ELEM_WIDTH * 2 - ELEM_WIDTH * occ * 2 / LOST_JOBS_MAX, ELEM_HEIGHT)));
    if (gradientFill) {
      GradientPaint gp;
      gp = new GradientPaint((float) x, (float) y, emptyc.brighter(), (float) x, (float) (y + ELEM_HEIGHT), emptyc.darker(), false);
      g2d.setPaint(gp);
      g2d.fill(moreStatiRect);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.