Package org.apache.harmony.awt.gl

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


        }
        if (r.isEmpty()) {
            return null;
        }
        r.translate(x, y);
        MultiRectArea ret = parent.getObscuredRegion(r);
        if (ret != null) {
            parent.addObscuredRegions(ret, this);
            ret.translate(-x, -y);
            ret.intersect(new Rectangle(0, 0, w, h));
        }
        return ret;
    }
View Full Code Here


                                                    stringWidth + TEXT_SPACING,
                                                    stringHeight + 2*TEXT_SPACING);

                if (titleRect.intersects(g.getClipBounds())) {
                    Rectangle[] difference = SwingUtilities.computeDifference(g.getClipBounds(), titleRect);
                    MultiRectArea clipArea = new MultiRectArea(difference);
                    g.setClip(clipArea);
                }
            }
        }

View Full Code Here

        }
        Point menuPos = menuBar.getLocation();
        Rectangle bounds = new Rectangle(menuPos.x, menuPos.y,
                                         menuBar.getWidth(),
                                         menuBar.getHeight());
        MultiRectArea menuClip = new MultiRectArea(clipArea);
        if (menuClip.getRectCount() > 0) {
            clipArea.substract(bounds);
            menuClip.translate(-menuPos.x, -menuPos.y);
            Graphics g = menuBar.getGraphics(menuClip);
            if (g != null) {
                menuBar.paint(g);
            }
            g.dispose();
View Full Code Here

            return;
        }
        if (selectedItemIndex >= 0 && getItem(selectedItemIndex) instanceof Menu) {
            ((Menu) getItem(selectedItemIndex)).hide();
        }
        MultiRectArea clip = getUpdateClip(index, selectedItemIndex);
        selectedItemIndex = index;
        Graphics gr = getGraphics(clip);
        if (gr != null) {
            paint(gr);
        }
View Full Code Here

     * @param index1 - old selected item
     * @param index2 - new selected item
     * @return - the region to repaint
     */
    final MultiRectArea getUpdateClip(int index1, int index2) {
        MultiRectArea clip = new MultiRectArea();
        if (index1 >= 0) {
            clip.add(getItemRect(index1));
        }
        if (index2 >= 0) {
            clip.add(getItemRect(index2));
        }
        return clip;
    }
View Full Code Here

        boolean grow = newBounds.contains(oldBounds);
        boolean shrink = oldBounds.contains(newBounds);
        if (isParentShowing() && !grow) {
            Component parent = component.parent;
            if (!shrink) {
                parent.repaintRegion = new MultiRectArea(oldBounds);
                parent.repaintRegion.substract(newBounds);
            }
            parent.repaint(oldBounds.x, oldBounds.y, oldBounds.width, oldBounds.height);
        }
        if (visible && displayable && !shrink) {
View Full Code Here

        RepaintManager.currentManager(blitingComponent).markCompletelyClean(parent);

        g.copyArea(adjustedCopyRect.x - dx, adjustedCopyRect.y - dy, adjustedCopyRect.width, adjustedCopyRect.height, dx, dy);

        wasPainted = false;
        MultiRectArea affectedArea = new MultiRectArea(visibleBounds);
        affectedArea.add(lastPaintedRect);
        affectedArea.substract(adjustedCopyRect);
        if (!affectedArea.isEmpty()) {
            Shape oldClip = g.getClip();

            g.setClip(affectedArea);
            parent.paint(g);
View Full Code Here

        return true;
    }

    private boolean isObscured(final int x, final int y, final int width, final int height) {
        ComponentInternals ci = ComponentInternals.getComponentInternals();
        MultiRectArea obscuredArea = ci.getObscuredRegion(parent);
        ci.addObscuredRegions(obscuredArea, blitingComponent, parent);
        if (obscuredArea == null || obscuredArea.isEmpty()) {
            return false;
        }
        return obscuredArea.intersects(x, y, width, height);
    }
View Full Code Here

            updateNeeded = false;
        }
    }

    private static void addRegion(Map<Component, MultiRectArea> map, Component c, Rectangle r) {
        MultiRectArea area = map.get(c);
        if (area != null) {
            area.add(r);
        } else {
            area = new MultiRectArea(r);
            map.put(c, area);
        }

    }
View Full Code Here

        }

    }

    private static void addRegion(Map<Component, MultiRectArea> map, Component c, MultiRectArea r) {
        MultiRectArea area = map.get(c);
        if (area != null) {
            area.add(r);
        } else {
            area = new MultiRectArea(r);
            map.put(c, area);
        }

    }
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.