FileDocCategorySizeDatePackage
ClipRegion.javaAPI DocAndroid 1.5 API2597Wed May 06 22:41:54 BST 2009org.apache.harmony.awt

ClipRegion

public class ClipRegion extends Rectangle
author
Pavel Dolgov, Anton Avtamonov
version
$Revision$

Fields Summary
private final org.apache.harmony.awt.gl.MultiRectArea
clip
Constructors Summary
public ClipRegion(org.apache.harmony.awt.gl.MultiRectArea clip)

        this.clip = new MultiRectArea(clip);
        setBounds(clip.getBounds());
    
Methods Summary
public voidconvertRegion(java.awt.Component child, java.awt.Component parent)

        convertRegion(child, clip, parent);
    
public static voidconvertRegion(java.awt.Component child, org.apache.harmony.awt.gl.MultiRectArea region, java.awt.Component parent)

        int x = 0, y = 0;
        Component c = child;
        //???AWT
        /*
        for (; c != null && c != parent; c = c.getParent()) {
            x += c.getX();
            y += c.getY();
        }
        */
        if (c == null) {
            // awt.51=Component expected to be a parent
            throw new IllegalArgumentException(Messages.getString("awt.51")); //$NON-NLS-1$
        }
        region.translate(x, y);
    
public org.apache.harmony.awt.gl.MultiRectAreagetClip()

        return clip;
    
public voidintersect(java.awt.Rectangle rect)

        clip.intersect(rect);
    
public booleanisEmpty()

        return clip.isEmpty();
    
public java.lang.StringtoString()

        String str = clip.toString();
        int i = str.indexOf('[");
        str = str.substring(i);
        if (clip.getRectCount() == 1) {
            str = str.substring(1, str.length() - 1);
        }
        return getClass().getName() + str;