Methods Summary |
---|
public abstract java.awt.image.BufferedImage | createCompatibleImage(int width, int height)Returns a {@link BufferedImage} with a data layout and color model
compatible with this GraphicsConfiguration . This
method has nothing to do with memory-mapping
a device. The returned BufferedImage has
a layout and color model that is closest to this native device
configuration and can therefore be optimally blitted to this
device.
|
public java.awt.image.BufferedImage | createCompatibleImage(int width, int height, int transparency)Returns a BufferedImage that supports the specified
transparency and has a data layout and color model
compatible with this GraphicsConfiguration . This
method has nothing to do with memory-mapping
a device. The returned BufferedImage has a layout and
color model that can be optimally blitted to a device
with this GraphicsConfiguration .
if (getColorModel().getTransparency() == transparency) {
return createCompatibleImage(width, height);
}
ColorModel cm = getColorModel(transparency);
if (cm == null) {
throw new IllegalArgumentException("Unknown transparency: " +
transparency);
}
WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
return new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);
|
public java.awt.image.VolatileImage | createCompatibleVolatileImage(int width, int height)Returns a {@link VolatileImage} with a data layout and color model
compatible with this GraphicsConfiguration .
The returned VolatileImage
may have data that is stored optimally for the underlying graphics
device and may therefore benefit from platform-specific rendering
acceleration.
VolatileImage vi = null;
try {
vi = createCompatibleVolatileImage(width, height,
null, Transparency.OPAQUE);
} catch (AWTException e) {
// shouldn't happen: we're passing in null caps
assert false;
}
return vi;
|
public java.awt.image.VolatileImage | createCompatibleVolatileImage(int width, int height, int transparency)Returns a {@link VolatileImage} with a data layout and color model
compatible with this GraphicsConfiguration .
The returned VolatileImage
may have data that is stored optimally for the underlying graphics
device and may therefore benefit from platform-specific rendering
acceleration.
VolatileImage vi = null;
try {
vi = createCompatibleVolatileImage(width, height, null, transparency);
} catch (AWTException e) {
// shouldn't happen: we're passing in null caps
assert false;
}
return vi;
|
public java.awt.image.VolatileImage | createCompatibleVolatileImage(int width, int height, java.awt.ImageCapabilities caps)Returns a {@link VolatileImage} with a data layout and color model
compatible with this GraphicsConfiguration , using
the specified image capabilities.
If the caps parameter is null, it is effectively ignored
and this method will create a VolatileImage without regard to
ImageCapabilities constraints.
The returned VolatileImage has
a layout and color model that is closest to this native device
configuration and can therefore be optimally blitted to this
device.
return createCompatibleVolatileImage(width, height, caps,
Transparency.OPAQUE);
|
public java.awt.image.VolatileImage | createCompatibleVolatileImage(int width, int height, java.awt.ImageCapabilities caps, int transparency)Returns a {@link VolatileImage} with a data layout and color model
compatible with this GraphicsConfiguration , using
the specified image capabilities and transparency value.
If the caps parameter is null, it is effectively ignored
and this method will create a VolatileImage without regard to
ImageCapabilities constraints.
The returned VolatileImage has
a layout and color model that is closest to this native device
configuration and can therefore be optimally blitted to this
device.
VolatileImage vi =
new SunVolatileImage(this, width, height, transparency, caps);
if (caps != null && caps.isAccelerated() &&
!vi.getCapabilities().isAccelerated())
{
throw new AWTException("Supplied image capabilities could not " +
"be met by this graphics configuration.");
}
return vi;
|
public abstract java.awt.Rectangle | getBounds()Returns the bounds of the GraphicsConfiguration
in the device coordinates. In a multi-screen environment
with a virtual device, the bounds can have negative X
or Y origins.
|
public java.awt.BufferCapabilities | getBufferCapabilities()Returns the buffering capabilities of this
GraphicsConfiguration .
if (defaultBufferCaps == null) {
defaultBufferCaps = new DefaultBufferCapabilities(
getImageCapabilities());
}
return defaultBufferCaps;
|
public abstract java.awt.image.ColorModel | getColorModel(int transparency)Returns the ColorModel associated with this
GraphicsConfiguration that supports the specified
transparency.
|
public abstract java.awt.image.ColorModel | getColorModel()Returns the {@link ColorModel} associated with this
GraphicsConfiguration .
|
public abstract java.awt.geom.AffineTransform | getDefaultTransform()Returns the default {@link AffineTransform} for this
GraphicsConfiguration . This
AffineTransform is typically the Identity transform
for most normal screens. The default AffineTransform
maps coordinates onto the device such that 72 user space
coordinate units measure approximately 1 inch in device
space. The normalizing transform can be used to make
this mapping more exact. Coordinates in the coordinate space
defined by the default AffineTransform for screen and
printer devices have the origin in the upper left-hand corner of
the target region of the device, with X coordinates
increasing to the right and Y coordinates increasing downwards.
For image buffers not associated with a device, such as those not
created by createCompatibleImage ,
this AffineTransform is the Identity transform.
|
public abstract java.awt.GraphicsDevice | getDevice()Returns the {@link GraphicsDevice} associated with this
GraphicsConfiguration .
|
public java.awt.ImageCapabilities | getImageCapabilities()Returns the image capabilities of this
GraphicsConfiguration .
if (defaultImageCaps == null) {
defaultImageCaps = new ImageCapabilities(false);
}
return defaultImageCaps;
|
public abstract java.awt.geom.AffineTransform | getNormalizingTransform()Returns a AffineTransform that can be concatenated
with the default AffineTransform
of a GraphicsConfiguration so that 72 units in user
space equals 1 inch in device space.
For a particular {@link Graphics2D}, g, one
can reset the transformation to create
such a mapping by using the following pseudocode:
GraphicsConfiguration gc = g.getDeviceConfiguration();
g.setTransform(gc.getDefaultTransform());
g.transform(gc.getNormalizingTransform());
Note that sometimes this AffineTransform is identity,
such as for printers or metafile output, and that this
AffineTransform is only as accurate as the information
supplied by the underlying system. For image buffers not
associated with a device, such as those not created by
createCompatibleImage , this
AffineTransform is the Identity transform
since there is no valid distance measurement.
|