ColorModel.java (getRGBdefault): Default ColorModel has 32 bit pixels not 8 bit pixels.

2004-05-04  Ingo Proetel  <proetel@aicas.com>

	* java/awt/image/ColorModel.java (getRGBdefault): Default ColorModel has
        32 bit pixels not 8 bit pixels.
	(isCompatibleRaster): Added javadoc comment.

2004-05-04  Ingo Proetel  <proetel@aicas.com>

	* java/awt/image/ComponentSampleModel.java (setDataSamples):Do not reset
	scanline stride.

2004-05-04  Ingo Proetel  <proetel@aicas.com>

	* java/awt/ColorPaintContext.java (<init>): Added ColorModel to signature.
	(getColorModel): Return the actual color model.
	(getRaster): Implemented.
	(ColorRaster): New inner class.
	* java/awt/SystemColor.java (createContext): Use ColorModel when creating
	a PaintContext.
	* java/awt/Color.java (<init>): Make exception more verbose.
	(createContext): Use ColorModel when creating a PaintContext.

From-SVN: r81486
This commit is contained in:
Ingo Proetel 2004-05-04 19:27:11 +00:00 committed by Michael Koch
parent fae4c98f1b
commit 27c2c3ec4a
6 changed files with 144 additions and 21 deletions

View file

@ -319,7 +319,12 @@ public class Color implements Paint, Serializable
{
if ((red & 255) != red || (green & 255) != green || (blue & 255) != blue
|| (alpha & 255) != alpha)
throw new IllegalArgumentException("Bad RGB values");
throw new IllegalArgumentException("Bad RGB values"
+" red=0x"+Integer.toHexString(red)
+" green=0x"+Integer.toHexString(green)
+" blue=0x"+Integer.toHexString(blue)
+" alpha=0x"+Integer.toHexString(alpha) );
value = (alpha << 24) | (red << 16) | (green << 8) | blue;
falpha = 1;
cs = null;
@ -950,7 +955,7 @@ public class Color implements Paint, Serializable
* object, regardless of the parameters. Subclasses, however, may have a
* mutable result.
*
* @param cm the requested color model, ignored
* @param cm the requested color model
* @param deviceBounds the bounding box in device coordinates, ignored
* @param userBounds the bounding box in user coordinates, ignored
* @param xform the bounds transformation, ignored
@ -962,8 +967,8 @@ public class Color implements Paint, Serializable
AffineTransform xform,
RenderingHints hints)
{
if (context == null)
context = new ColorPaintContext(value);
if (context == null || !context.getColorModel().equals(cm))
context = new ColorPaintContext(cm,value);
return context;
}