Package org.apache.harmony.awt.gl

Examples of org.apache.harmony.awt.gl.MultiRectArea


            rect.translate(dx, dy);
            rgn[i] = rect;
        }
        bufferPtr.unlock();

        return new MultiRectArea(rgn);
    }
View Full Code Here


public class ClipRegion extends Rectangle {
    private final MultiRectArea clip;

    public ClipRegion(final MultiRectArea clip) {
        this.clip = new MultiRectArea(clip);
        setBounds(clip.getBounds());
    }
View Full Code Here

            jtr = new OGLTextRenderer();
        }
    }

    public OGLGraphics2D(NativeWindow nwin, int tx, int ty, int width, int height) {
        this(nwin, tx, ty, new MultiRectArea(new Rectangle(width, height)));
    }
View Full Code Here

        // Have to copy transform and clip explicitly, since we use opengl transforms
        res.setTransform(new AffineTransform(glTransform));
        if (clip == null) {
            res.setTransformedClip(null);
        } else {
            res.setTransformedClip(new MultiRectArea(clip));
        }

        return res;
    }
View Full Code Here

    public Shape getClip() {
        if (clip == null) {
            return null;
        }

        MultiRectArea res = new MultiRectArea(clip);
        return res;
    }
View Full Code Here

        setTransform(newTransform);
    }

    @Override
    public void clipRect(int x, int y, int width, int height) {
        MultiRectArea mra = new MultiRectArea(x, y, x+width-1, y+height-1);

        if (clip == null) {
            setTransformedClip(mra);
        } else {
            clip.intersect(mra);
View Full Code Here

        public boolean contains(int index) {
            return contains(index, 0);
        }

        public void insertIndices(int index, int length, boolean multiSelectionAllowed) {
            MultiRectArea modified = new MultiRectArea();
            Rectangle[] rects = getRectangles();
            for (int i = 0; i < rects.length; i++) {
                Rectangle rect = (Rectangle) rects[i].clone();
                if (index < rect.x) {
                    rect.x += length;
                } else if (rect.x <= index && index < rect.x + rect.width) {
                    if (multiSelectionAllowed) {
                        rect.width += length;
                    } else {
                        rect.x += length;
                    }
                }
                modified.add(rect);
            }
            clear();
            add(modified);
        }
View Full Code Here

            clear();
            add(modified);
        }

        public void removeIndices(int index, int length) {
            MultiRectArea modified = new MultiRectArea();
            Rectangle[] rects = getRectangles();
            for (int i = 0; i < rects.length; i++) {
                Rectangle rect = rects[i];
                int rectEnd = rect.x + rect.width - length - 1;
                if (index <= rect.x) {
                    if (rectEnd >= index) {
                        int rectBegin = rect.x - length < index ? index : rect.x - length;
                        modified.add(new Segment(rectBegin, rectEnd));
                    }
                } else if (rect.x < index && index < rect.x + rect.width) {
                    if (rectEnd < index - 1) {
                        rectEnd = index - 1;
                    }
                    modified.add(new Segment(rect.x, rectEnd));
                } else {
                    modified.add((Rectangle) rect.clone());
                }
            }
            clear();
            add(modified);
        }
View Full Code Here

            clear();
            add(modified);
        }

        public Segment getDifferenceBounds(Selection anotherSelection) {
            MultiRectArea thisFromAnother = MultiRectArea.subtract(this, anotherSelection);
            MultiRectArea anotherFromThis = MultiRectArea.subtract(anotherSelection, this);
            MultiRectArea diff = MultiRectArea.union(thisFromAnother, anotherFromThis);
            if (diff.isEmpty()) {
                return null;
            }
            Rectangle diffBounds = diff.getBounds();
            return new Segment(diffBounds.x, diffBounds.x + diffBounds.width - 1);
        }
View Full Code Here

        PathIterator path = shape.getPathIterator(null, flatness);

        // Shape is empty
        if (path.isDone()) {
            return new MultiRectArea();
        }

        makeBuffer(path, flatness);

        init();
View Full Code Here

TOP

Related Classes of org.apache.harmony.awt.gl.MultiRectArea

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.