Java Doc for GraphicsConfiguration.java in  » 6.0-JDK-Core » AWT » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.GraphicsConfiguration

GraphicsConfiguration
abstract public class GraphicsConfiguration (Code)
The GraphicsConfiguration class describes the characteristics of a graphics destination such as a printer or monitor. There can be many GraphicsConfiguration objects associated with a single graphics device, representing different drawing modes or capabilities. The corresponding native structure will vary from platform to platform. For example, on X11 windowing systems, each visual is a different GraphicsConfiguration. On Microsoft Windows, GraphicsConfigurations represent PixelFormats available in the current resolution and color depth.

In a virtual device multi-screen environment in which the desktop area could span multiple physical screen devices, the bounds of the GraphicsConfiguration objects are relative to the virtual coordinate system. When setting the location of a component, use GraphicsConfiguration.getBounds() getBounds to get the bounds of the desired GraphicsConfiguration and offset the location with the coordinates of the GraphicsConfiguration, as the following code sample illustrates:

 Frame f = new Frame(gc);  // where gc is a GraphicsConfiguration
 Rectangle bounds = gc.getBounds();
 f.setLocation(10 + bounds.x, 10 + bounds.y); 

To determine if your environment is a virtual device environment, call getBounds on all of the GraphicsConfiguration objects in your system. If any of the origins of the returned bounds is not (0, 0), your environment is a virtual device environment.

You can also use getBounds to determine the bounds of the virtual device. To do this, first call getBounds on all of the GraphicsConfiguration objects in your system. Then calculate the union of all of the bounds returned from the calls to getBounds. The union is the bounds of the virtual device. The following code sample calculates the bounds of the virtual device.

 Rectangle virtualBounds = new Rectangle();
 GraphicsEnvironment ge = GraphicsEnvironment.
 getLocalGraphicsEnvironment();
 GraphicsDevice[] gs =
 ge.getScreenDevices();
 for (int j = 0; j < gs.length; j++) { 
 GraphicsDevice gd = gs[j];
 GraphicsConfiguration[] gc =
 gd.getConfigurations();
 for (int i=0; i < gc.length; i++) {
 virtualBounds =
 virtualBounds.union(gc[i].getBounds());
 }
 } 

See Also:   Window
See Also:   Frame
See Also:   GraphicsEnvironment
See Also:   GraphicsDevice



Constructor Summary
protected  GraphicsConfiguration()
     This is an abstract class that cannot be instantiated directly.

Method Summary
public  BufferedImagecreateCompatibleImage(int width, int height)
     Returns a BufferedImage with a data layout and color model compatible with this GraphicsConfiguration.
public  BufferedImagecreateCompatibleImage(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.
public  VolatileImagecreateCompatibleVolatileImage(int width, int height)
     Returns a VolatileImage with a data layout and color model compatible with this GraphicsConfiguration.
public  VolatileImagecreateCompatibleVolatileImage(int width, int height, int transparency)
     Returns a VolatileImage with a data layout and color model compatible with this GraphicsConfiguration.
public  VolatileImagecreateCompatibleVolatileImage(int width, int height, ImageCapabilities caps)
     Returns a VolatileImage with a data layout and color model compatible with this GraphicsConfiguration, using the specified image capabilities.
public  VolatileImagecreateCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency)
     Returns a VolatileImage with a data layout and color model compatible with this GraphicsConfiguration, using the specified image capabilities and transparency value.
abstract public  RectanglegetBounds()
     Returns the bounds of the GraphicsConfiguration in the device coordinates.
public  BufferCapabilitiesgetBufferCapabilities()
     Returns the buffering capabilities of this GraphicsConfiguration.
abstract public  ColorModelgetColorModel()
     Returns the ColorModel associated with this GraphicsConfiguration.
abstract public  ColorModelgetColorModel(int transparency)
     Returns the ColorModel associated with this GraphicsConfiguration that supports the specified transparency.
abstract public  AffineTransformgetDefaultTransform()
     Returns the default AffineTransform for this GraphicsConfiguration.
abstract public  GraphicsDevicegetDevice()
     Returns the GraphicsDevice associated with this GraphicsConfiguration.
public  ImageCapabilitiesgetImageCapabilities()
     Returns the image capabilities of this GraphicsConfiguration.
abstract public  AffineTransformgetNormalizingTransform()
     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.


Constructor Detail
GraphicsConfiguration
protected GraphicsConfiguration()(Code)
This is an abstract class that cannot be instantiated directly. Instances must be obtained from a suitable factory or query method.
See Also:   GraphicsDevice.getConfigurations
See Also:   GraphicsDevice.getDefaultConfiguration
See Also:   GraphicsDevice.getBestConfiguration
See Also:   Graphics2D.getDeviceConfiguration




Method Detail
createCompatibleImage
public BufferedImage createCompatibleImage(int width, int height)(Code)
Returns a 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.
Parameters:
  width - the width of the returned BufferedImage
Parameters:
  height - the height of the returned BufferedImage a BufferedImage whose data layout and colormodel is compatible with this GraphicsConfiguration.



createCompatibleImage
public BufferedImage createCompatibleImage(int width, int height, int transparency)(Code)
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.
Parameters:
  width - the width of the returned BufferedImage
Parameters:
  height - the height of the returned BufferedImage
Parameters:
  transparency - the specified transparency mode a BufferedImage whose data layout and color model is compatible with this GraphicsConfigurationand also supports the specified transparency.
throws:
  IllegalArgumentException - if the transparency is not a valid value
See Also:   Transparency.OPAQUE
See Also:   Transparency.BITMASK
See Also:   Transparency.TRANSLUCENT



createCompatibleVolatileImage
public VolatileImage createCompatibleVolatileImage(int width, int height)(Code)
Returns a 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.
Parameters:
  width - the width of the returned VolatileImage
Parameters:
  height - the height of the returned VolatileImage a VolatileImage whose data layout and colormodel is compatible with this GraphicsConfiguration.
See Also:   Component.createVolatileImage(intint)
since:
   1.4



createCompatibleVolatileImage
public VolatileImage createCompatibleVolatileImage(int width, int height, int transparency)(Code)
Returns a 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.
Parameters:
  width - the width of the returned VolatileImage
Parameters:
  height - the height of the returned VolatileImage
Parameters:
  transparency - the specified transparency mode a VolatileImage whose data layout and colormodel is compatible with this GraphicsConfiguration.
throws:
  IllegalArgumentException - if the transparency is not a valid value
See Also:   Transparency.OPAQUE
See Also:   Transparency.BITMASK
See Also:   Transparency.TRANSLUCENT
See Also:   Component.createVolatileImage(intint)
since:
   1.5



createCompatibleVolatileImage
public VolatileImage createCompatibleVolatileImage(int width, int height, ImageCapabilities caps) throws AWTException(Code)
Returns a 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. a VolatileImage whose data layout and color model is compatible with this GraphicsConfiguration.
Parameters:
  width - the width of the returned VolatileImage
Parameters:
  height - the height of the returned VolatileImage
Parameters:
  caps - the image capabilities
exception:
  AWTException - if the supplied image capabilities could not be met by this graphics configuration
since:
   1.4



createCompatibleVolatileImage
public VolatileImage createCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) throws AWTException(Code)
Returns a 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.
Parameters:
  width - the width of the returned VolatileImage
Parameters:
  height - the height of the returned VolatileImage
Parameters:
  caps - the image capabilities
Parameters:
  transparency - the specified transparency mode a VolatileImage whose data layout and colormodel is compatible with this GraphicsConfiguration.
See Also:   Transparency.OPAQUE
See Also:   Transparency.BITMASK
See Also:   Transparency.TRANSLUCENT
throws:
  IllegalArgumentException - if the transparency is not a valid value
exception:
  AWTException - if the supplied image capabilities could notbe met by this graphics configuration
See Also:   Component.createVolatileImage(intint)
since:
   1.5



getBounds
abstract public Rectangle getBounds()(Code)
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. the bounds of the area covered by thisGraphicsConfiguration.
since:
   1.3



getBufferCapabilities
public BufferCapabilities getBufferCapabilities()(Code)
Returns the buffering capabilities of this GraphicsConfiguration. the buffering capabilities of this graphicsconfiguration object
since:
   1.4



getColorModel
abstract public ColorModel getColorModel()(Code)
Returns the ColorModel associated with this GraphicsConfiguration. a ColorModel object that is associated withthis GraphicsConfiguration.



getColorModel
abstract public ColorModel getColorModel(int transparency)(Code)
Returns the ColorModel associated with this GraphicsConfiguration that supports the specified transparency.
Parameters:
  transparency - the specified transparency mode a ColorModel object that is associated withthis GraphicsConfiguration and supports the specified transparency or null if the transparency is not a validvalue.
See Also:   Transparency.OPAQUE
See Also:   Transparency.BITMASK
See Also:   Transparency.TRANSLUCENT



getDefaultTransform
abstract public AffineTransform getDefaultTransform()(Code)
Returns the default 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. the default AffineTransform for thisGraphicsConfiguration.



getDevice
abstract public GraphicsDevice getDevice()(Code)
Returns the GraphicsDevice associated with this GraphicsConfiguration. a GraphicsDevice object that is associated with this GraphicsConfiguration.



getImageCapabilities
public ImageCapabilities getImageCapabilities()(Code)
Returns the image capabilities of this GraphicsConfiguration. the image capabilities of this graphicsconfiguration object
since:
   1.4



getNormalizingTransform
abstract public AffineTransform getNormalizingTransform()(Code)
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 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. an AffineTransform to concatenate to thedefault AffineTransform so that 72 units in userspace is mapped to 1 inch in device space.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.