//----------------------------------------------------------------------------//
//                                                                            //
//                        P i x e l R e c t a n g l e                         //
//                                                                            //
//  Copyright (C) Herve Bitteur 2000-2007. All rights reserved.               //
//  This software is released under the GNU General Public License.           //
//  Contact author at herve.bitteur@laposte.net to report bugs & suggestions. //
//----------------------------------------------------------------------------//
//
package omr.score.common;

import java.awt.Rectangle;

/**
 * Class <code>PixelRectangle</code> is a simple Rectangle that is meant to
 * represent a rectangle in a sheet, with its components specified in pixels, so
 * the name.
 *
 * <p> This specialization is used to take benefit of compiler checks, to
 * prevent the use of rectangles with incorrect meaning or units. </p>
 *
 * @author Herv&eacute; Bitteur
 * @version $Id$
 */
public class PixelRectangle
    extends SimpleRectangle
{
    //~ Constructors -----------------------------------------------------------

    //----------------//
    // PixelRectangle //
    //----------------//
    /**
     * Creates an instance of <code>PixelRectangle</code> with all data set to
     * zero.
     */
    public PixelRectangle ()
    {
    }

    //----------------//
    // PixelRectangle //
    //----------------//
    /**
     * Creates an instance of <code>PixelRectangle</code> by cloning another
     * instance.
     */
    public PixelRectangle (PixelRectangle other)
    {
        this(other.x, other.y, other.width, other.height);
    }

    //----------------//
    // PixelRectangle //
    //----------------//
    /**
     * Construct a <code>PixelRectangle</code> and initialize it with the
     * specified data
     *
     * @param x the specified x
     * @param y the specified y
     * @param width the specified width
     * @param height the specified height
     */
    public PixelRectangle (int x,
                           int y,
                           int width,
                           int height)
    {
        super(x, y, width, height);
    }

    //~ Methods ----------------------------------------------------------------

    //-------//
    // union //
    //-------//
    /**
     * Union with another PixelRectangle
     *
     * @param other another PixelRectangle
     * @return the union of these 2 rectangles
     */
    public PixelRectangle union (PixelRectangle other)
    {
        Rectangle r = super.union(other);

        return new PixelRectangle(r.x, r.y, r.width, r.height);
    }
}

@@ -1446,314 +1446,8 @@
  %7D%0A%0A
-    //----------------//%0A    // PixelRectangle //%0A    //----------------//%0A    /**%0A     * Creates an instance of %3Ccode%3EPixelRectangle%3C/code%3E by cloning another%0A     * instance.%0A     */%0A    public PixelRectangle (PixelRectangle other)%0A    %7B%0A        this(other.x, other.y, other.width, other.height);%0A    %7D%0A%0A
     
@@ -1972,24 +1972,687 @@
 ht);%0A    %7D%0A%0A
+    //----------------//%0A    // PixelRectangle //%0A    //----------------//%0A    /**%0A     * Construct a %3Ccode%3EPixelRectangle%3C/code%3E and initialize it with the%0A     * specified generic rectangle%0A     *%0A     * @param rect the specified generic rectangle%0A     */%0A    public PixelRectangle (Rectangle rect)%0A    %7B%0A        super(rect.x, rect.y, rect.width, rect.height);%0A    %7D%0A%0A    //----------------//%0A    // PixelRectangle //%0A    //----------------//%0A    /**%0A     * Construct a %3Ccode%3EPixelRectangle%3C/code%3E with just a PixelPoint%0A     *%0A     * @param pt the specified point%0A     */%0A    public PixelRectangle (PixelPoint pt)%0A    %7B%0A        super(pt.x, pt.y, 0, 0);%0A    %7D%0A%0A
     //~ Meth

Use of a more convenient constructor for PixelRectangle