Code drop from //branches/cupcake/...@124589
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* @author Alexey A. Petrenko
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
package java.awt;
|
||||
|
||||
import java.awt.geom.AffineTransform;
|
||||
@@ -30,70 +31,76 @@ import org.apache.harmony.awt.internal.nls.Messages;
|
||||
/**
|
||||
* The GraphicsConfiguration class contains the characteristics of graphics
|
||||
* devices such as a printer or monitor, and represents device's capabilities
|
||||
* and modes. Many GraphicsConfiguration objects can be associated with
|
||||
* single graphics device.
|
||||
* and modes. Many GraphicsConfiguration objects can be associated with single
|
||||
* graphics device.
|
||||
*
|
||||
* @since Android 1.0
|
||||
*/
|
||||
public abstract class GraphicsConfiguration {
|
||||
|
||||
/**
|
||||
* Constructor could not be used directly and should be obtained in
|
||||
* extended classes.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructor could not be used directly and should be obtained in extended
|
||||
* classes.
|
||||
*/
|
||||
protected GraphicsConfiguration() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates BufferedImage image object with a data layout and color model
|
||||
* compatible with this GraphicsConfiguration with specified width
|
||||
* and height parameters.
|
||||
*
|
||||
* @param width the width of BufferedImage.
|
||||
* @param height the height of BufferedImage.
|
||||
*
|
||||
* @return the BufferedImage object with specified width and height
|
||||
* parameters.
|
||||
*/
|
||||
/**
|
||||
* Creates BufferedImage image object with a data layout and color model
|
||||
* compatible with this GraphicsConfiguration with specified width and
|
||||
* height parameters.
|
||||
*
|
||||
* @param width
|
||||
* the width of BufferedImage.
|
||||
* @param height
|
||||
* the height of BufferedImage.
|
||||
* @return the BufferedImage object with specified width and height
|
||||
* parameters.
|
||||
*/
|
||||
public abstract BufferedImage createCompatibleImage(int width, int height);
|
||||
|
||||
/**
|
||||
* Creates a BufferedImage that has the specified width, height,
|
||||
* transparency and has a data layout and color model compatible with this
|
||||
* GraphicsConfiguration.
|
||||
*
|
||||
* @param width the width of image.
|
||||
* @param height the height of image.
|
||||
* @param transparency the transparency mode.
|
||||
* transparency and has a data layout and color model compatible with this
|
||||
* GraphicsConfiguration.
|
||||
*
|
||||
* @param width
|
||||
* the width of image.
|
||||
* @param height
|
||||
* the height of image.
|
||||
* @param transparency
|
||||
* the transparency mode.
|
||||
* @return the BufferedImage object.
|
||||
*/
|
||||
public abstract BufferedImage createCompatibleImage(int width, int height, int transparency);
|
||||
|
||||
/**
|
||||
* Creates a VolatileImage that has the specified width and height
|
||||
* and has a data layout and color model compatible with this
|
||||
* GraphicsConfiguration.
|
||||
*
|
||||
* @param width the width of image.
|
||||
* @param height the height of image.
|
||||
* Creates a VolatileImage that has the specified width and height and has a
|
||||
* data layout and color model compatible with this GraphicsConfiguration.
|
||||
*
|
||||
* @param width
|
||||
* the width of image.
|
||||
* @param height
|
||||
* the height of image.
|
||||
* @return the VolatileImage object.
|
||||
*/
|
||||
public abstract VolatileImage createCompatibleVolatileImage(int width, int height);
|
||||
|
||||
/**
|
||||
* Creates a VolatileImage that supports the specified width, height,
|
||||
* transparency and has a data layout and color model compatible with this
|
||||
* GraphicsConfiguration.
|
||||
*
|
||||
* @param width the width of image.
|
||||
* @param height the height of image.
|
||||
* @param transparency the transparency mode.
|
||||
* transparency and has a data layout and color model compatible with this
|
||||
* GraphicsConfiguration.
|
||||
*
|
||||
* @param width
|
||||
* the width of image.
|
||||
* @param height
|
||||
* the height of image.
|
||||
* @param transparency
|
||||
* the transparency mode.
|
||||
* @return the VolatileImage object.
|
||||
*/
|
||||
public abstract VolatileImage createCompatibleVolatileImage(int width, int height, int transparency);
|
||||
public abstract VolatileImage createCompatibleVolatileImage(int width, int height,
|
||||
int transparency);
|
||||
|
||||
/**
|
||||
* Gets the bounds of area covered by the GraphicsConfiguration in the
|
||||
@@ -111,20 +118,19 @@ public abstract class GraphicsConfiguration {
|
||||
public abstract ColorModel getColorModel();
|
||||
|
||||
/**
|
||||
* Gets the ColorModel of the GraphicsConfiguration which
|
||||
* supports specified Transparency.
|
||||
* Gets the ColorModel of the GraphicsConfiguration which supports specified
|
||||
* Transparency.
|
||||
*
|
||||
* @param transparency the Transparency mode: OPAQUE, BITMASK, or
|
||||
* TRANSLUCENT.
|
||||
*
|
||||
* @return the ColorModel of the GraphicsConfiguration which
|
||||
* supports specified Transparency.
|
||||
* @param transparency
|
||||
* the Transparency mode: OPAQUE, BITMASK, or TRANSLUCENT.
|
||||
* @return the ColorModel of the GraphicsConfiguration which supports
|
||||
* specified Transparency.
|
||||
*/
|
||||
public abstract ColorModel getColorModel(int transparency);
|
||||
|
||||
/**
|
||||
* Gets the default AffineTransform of the GraphicsConfiguration.
|
||||
* This method translates user coordinates to device coordinates.
|
||||
* Gets the default AffineTransform of the GraphicsConfiguration. This
|
||||
* method translates user coordinates to device coordinates.
|
||||
*
|
||||
* @return the default AffineTransform of the GraphicsConfiguration.
|
||||
*/
|
||||
@@ -144,23 +150,24 @@ public abstract class GraphicsConfiguration {
|
||||
*/
|
||||
public abstract AffineTransform getNormalizingTransform();
|
||||
|
||||
|
||||
/**
|
||||
* Creates VolatileImage with specified width, height, ImageCapabilities;
|
||||
* a data layout and color model compatible with this GraphicsConfiguration.
|
||||
*
|
||||
* @param width the width of image.
|
||||
* @param height the height of image.
|
||||
* @param caps the ImageCapabilities object.
|
||||
* Creates VolatileImage with specified width, height, ImageCapabilities; a
|
||||
* data layout and color model compatible with this GraphicsConfiguration.
|
||||
*
|
||||
* @return the VolatileImage which data layout and color model compatible
|
||||
* with this GraphicsConfiguration.
|
||||
*
|
||||
* @throws AWTException if ImageCapabilities is not supported by the
|
||||
* GraphicsConfiguration.
|
||||
* @param width
|
||||
* the width of image.
|
||||
* @param height
|
||||
* the height of image.
|
||||
* @param caps
|
||||
* the ImageCapabilities object.
|
||||
* @return the VolatileImage which data layout and color model compatible
|
||||
* with this GraphicsConfiguration.
|
||||
* @throws AWTException
|
||||
* if ImageCapabilities is not supported by the
|
||||
* GraphicsConfiguration.
|
||||
*/
|
||||
public VolatileImage createCompatibleVolatileImage(int width, int height,
|
||||
ImageCapabilities caps) throws AWTException {
|
||||
public VolatileImage createCompatibleVolatileImage(int width, int height, ImageCapabilities caps)
|
||||
throws AWTException {
|
||||
VolatileImage res = createCompatibleVolatileImage(width, height);
|
||||
if (!res.getCapabilities().equals(caps)) {
|
||||
// awt.14A=Can not create VolatileImage with specified capabilities
|
||||
@@ -170,21 +177,23 @@ public abstract class GraphicsConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a VolatileImage with specified width, height, transparency
|
||||
* and ImageCapabilities; a data layout and color model compatible with
|
||||
* this GraphicsConfiguration.
|
||||
*
|
||||
* @param width the width of image.
|
||||
* @param height the height of image.
|
||||
* @param caps the ImageCapabilities object.
|
||||
* @param transparency the Transparency mode: OPAQUE, BITMASK, or
|
||||
* TRANSLUCENT.
|
||||
*
|
||||
* @return the VolatileImage which data layout and color model compatible
|
||||
* with this GraphicsConfiguration.
|
||||
*
|
||||
* @throws AWTException if ImageCapabilities is not supported by the
|
||||
* Creates a VolatileImage with specified width, height, transparency and
|
||||
* ImageCapabilities; a data layout and color model compatible with this
|
||||
* GraphicsConfiguration.
|
||||
*
|
||||
* @param width
|
||||
* the width of image.
|
||||
* @param height
|
||||
* the height of image.
|
||||
* @param caps
|
||||
* the ImageCapabilities object.
|
||||
* @param transparency
|
||||
* the Transparency mode: OPAQUE, BITMASK, or TRANSLUCENT.
|
||||
* @return the VolatileImage which data layout and color model compatible
|
||||
* with this GraphicsConfiguration.
|
||||
* @throws AWTException
|
||||
* if ImageCapabilities is not supported by the
|
||||
* GraphicsConfiguration.
|
||||
*/
|
||||
public VolatileImage createCompatibleVolatileImage(int width, int height,
|
||||
ImageCapabilities caps, int transparency) throws AWTException {
|
||||
@@ -199,7 +208,7 @@ public abstract class GraphicsConfiguration {
|
||||
/**
|
||||
* Gets the buffering capabilities of the GraphicsConfiguration.
|
||||
*
|
||||
* @return the BufferCapabilities object.
|
||||
* @return the BufferCapabilities object.
|
||||
*/
|
||||
public BufferCapabilities getBufferCapabilities() {
|
||||
return new BufferCapabilities(new ImageCapabilities(false), new ImageCapabilities(false),
|
||||
|
||||
Reference in New Issue
Block a user