
You may, on occasion, have the need to create a custom AffineTransform object
fr om a set of six numbers. A number of
AffineTransform constructors and meth-
ods take matrix elements as arguments. These matrix elements are either passed in
explicitly or specified in an array. Note that the matrix-element naming system
used by the
AffineTransform class is differ ent than the system I’ve used here. The
parameter names for
AffineTransform methods are based on the following matrix:
m00
m10
m01
m11
m02
m12
This is nothing more that a differ ent naming scheme for the elements we are
alr eady familiar with:
sx
shy
shx
sy
tx
ty
When matrix elements are passed to or retur ned by an AffineTransform in an
array of
float or double values, they are stor ed in this order:
m00, m10, m01, m11, m01, m12
This corresponds to the following order using our mnemonic names:
sx, shy, sy, tx, ty
Color Spaces
The java.awt.Color class repr esents a color in Java. As we discussed earlier, Java
2D has added several new constructors to the
Color class, to support the creation
of translucent colors. Another important change to the
Color class is support for
arbitrary color spaces. A color space is a system for repr esenting a color using
some characteristic set of axes.
Java 2D introduces the
java.awt.color package for working with color spaces.
The most important piece of this package is the abstract
ColorSpace class, which
repr ...