Package sun.java2d.pipe

Examples of sun.java2d.pipe.Region


        if (w < 0 || h < 0) {
            return;
        }
        int x2 = Region.dimAdd(Region.dimAdd(x, w), 1);
        int y2 = Region.dimAdd(Region.dimAdd(y, h), 1);
        Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2);
        if (r.isEmpty()) {
            return;
        }
        int cx1 = r.getLoX();
        int cy1 = r.getLoY();
        int cx2 = r.getHiX();
        int cy2 = r.getHiY();

        if (w < 2 || h < 2) {
            doSetRect(sData, pw, cx1, cy1, cx2, cy2);
            return;
        }
View Full Code Here


    public void FillRect(SunGraphics2D sg2d, SurfaceData sData,
                         int x, int y, int w, int h)
    {
        PixelWriter pw = GeneralRenderer.createSolidPixelWriter(sg2d, sData);

        Region r = sg2d.getCompClip().getBoundsIntersectionXYWH(x, y, w, h);

        GeneralRenderer.doSetRect(sData, pw,
                                  r.getLoX(), r.getLoY(),
                                  r.getHiX(), r.getHiY());
    }
View Full Code Here

                             boolean close)
    {
        PixelWriter pw = GeneralRenderer.createSolidPixelWriter(sg2d, sData);

        int off = 0;
        Region clip = sg2d.getCompClip();
        for (int i = 0; i < numPolys; i++) {
            int numpts = nPoints[i];
            GeneralRenderer.doDrawPoly(sData, pw,
                                       xPoints, yPoints, off, numpts,
                                       clip, transx, transy, close);
View Full Code Here

    public void FillRect(SunGraphics2D sg2d, SurfaceData sData,
                            int x, int y, int w, int h)
    {
        PixelWriter pw = GeneralRenderer.createXorPixelWriter(sg2d, sData);

        Region r = sg2d.getCompClip().getBoundsIntersectionXYWH(x, y, w, h);

        GeneralRenderer.doSetRect(sData, pw,
                                  r.getLoX(), r.getLoY(),
                                  r.getHiX(), r.getHiY());
    }
View Full Code Here

        return nextBelow >= parent.getComponentCount() ? -1 : nextBelow;
    }

    private Region calculateCurrentShape() {
        checkTreeLock();
        Region s = getNormalShape();

        if (mixingLog.isLoggable(Level.FINE)) {
            mixingLog.fine("this = " + this + "; normalShape=" + s);
        }

        if (getContainer() != null) {
            Component comp = this;
            Container cont = comp.getContainer();

            while (cont != null) {
                for (int index = comp.getSiblingIndexAbove(); index != -1; --index) {
                    /* It is assumed that:
                     *
                     *    getComponent(getContainer().getComponentZOrder(comp)) == comp
                     *
                     * The assumption has been made according to the current
                     * implementation of the Container class.
                     */
                    Component c = cont.getComponent(index);
                    if (c.isLightweight() && c.isShowing() && c.isOpaque()) {
                        s = s.getDifference(c.getNormalShape());
                    }
                }

                if (cont.isLightweight()) {
                    s = s.getIntersection(cont.getNormalShape());
                } else {
                    break;
                }

                comp = cont;
View Full Code Here

                             boolean close)
    {
        PixelWriter pw = GeneralRenderer.createXorPixelWriter(sg2d, sData);

        int off = 0;
        Region clip = sg2d.getCompClip();
        for (int i = 0; i < numPolys; i++) {
            int numpts = nPoints[i];
            GeneralRenderer.doDrawPoly(sData, pw,
                                       xPoints, yPoints, off, numpts,
                                       clip, transx, transy, close);
View Full Code Here

            } else {
                if (becameHigher) {
                    applyCurrentShape();
                } else {
                    if (parent != null) {
                        Region shape = getAppliedShape();

                        for (int index = oldZorder; index < newZorder; index++) {
                            Component c = parent.getComponent(index);
                            if (c.isLightweight() && c.isShowing() && c.isOpaque()) {
                                shape = shape.getDifference(c.getNormalShape());
                            }
                        }
                        applyCompoundShape(shape);
                    }
                }
View Full Code Here

    private void clipAndDrawLine(SunGraphics2D sg2d,
                                 int x1, int y1, int x2, int y2)
    {
        // If any of these are true, the line lies outside of the
        // clip bounds
        Region clip = sg2d.getCompClip();
        int cx1 = clip.getLoX();
        int cy1 = clip.getLoY();
        int cx2 = clip.getHiX();
        int cy2 = clip.getHiY();
        // For each edge, clip the appropriate coordinate against
        // that edge.  We are only dealing with horizontal or vertical lines
        // for now, so there is no interpolation between points to
        // the proper clip coordinate.
        if (x1 <  cx1) x1 = cx1;
View Full Code Here

        clipLeft = x + sg2d.transX;
        clipTop = y + sg2d.transY;
        clipRight = clipLeft + width;
        clipBottom = clipTop + height;

        Region clip = sg2d.getCompClip();

        // Clip each edge of the rect to the appropriate edge of the clip
        // bounds.
        if (clipLeft   < clip.getLoX()) clipLeft   = clip.getLoX();
        if (clipTop    < clip.getLoY()) clipTop    = clip.getLoY();
        if (clipRight  > clip.getHiX()) clipRight  = clip.getHiX();
        if (clipBottom > clip.getHiY()) clipBottom = clip.getHiY();

        if (clipRight > clipLeft && clipBottom > clipTop) {
            doFillRectDD(sg2d.surfaceData, sg2d.pixel, clipLeft, clipTop,
                         clipRight, clipBottom);
        }
View Full Code Here

            y += sg2d.transY;
            int dstx1 = x + dx;
            int dsty1 = y + dy;
            int dstx2 = dstx1 + w;
            int dsty2 = dsty1 + h;
            Region clip = sg2d.getCompClip();
            if (dstx1 < clip.getLoX()) dstx1 = clip.getLoX();
            if (dsty1 < clip.getLoY()) dsty1 = clip.getLoY();
            if (dstx2 > clip.getHiX()) dstx2 = clip.getHiX();
            if (dsty2 > clip.getHiY()) dsty2 = clip.getHiY();
            if (dstx1 < dstx2 && dsty1 < dsty2) {
                gdiPipe.devCopyArea(this, dstx1 - dx, dsty1 - dy,
                                    dx, dy,
                                    dstx2 - dstx1, dsty2 - dsty1);
            }
View Full Code Here

TOP

Related Classes of sun.java2d.pipe.Region

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.