src/share/classes/sun/java2d/SunGraphicsEnvironment.java

Print this page
rev 9629 : 8038644: Fix raw and unchecked warnings in sun.java2d.*
Reviewed-by:


  65 import sun.font.FontManager;
  66 import sun.font.FontManagerFactory;
  67 import sun.font.FontManagerForSGE;
  68 import sun.font.NativeFont;
  69 
  70 /**
  71  * This is an implementation of a GraphicsEnvironment object for the
  72  * default local GraphicsEnvironment.
  73  *
  74  * @see GraphicsDevice
  75  * @see GraphicsConfiguration
  76  */
  77 public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
  78     implements DisplayChangedListener {
  79 
  80     public static boolean isOpenSolaris;
  81     private static Font defaultFont;
  82 
  83     public SunGraphicsEnvironment() {
  84         java.security.AccessController.doPrivileged(
  85                                     new java.security.PrivilegedAction() {
  86             public Object run() {
  87                     String version = System.getProperty("os.version", "0.0");
  88                     try {
  89                         float ver = Float.parseFloat(version);
  90                         if (ver > 5.10f) {
  91                             File f = new File("/etc/release");
  92                             FileInputStream fis = new FileInputStream(f);
  93                             InputStreamReader isr
  94                                 = new InputStreamReader(fis, "ISO-8859-1");
  95                             BufferedReader br = new BufferedReader(isr);
  96                             String line = br.readLine();
  97                             if (line.indexOf("OpenSolaris") >= 0) {
  98                                 isOpenSolaris = true;
  99                             } else {
 100                                 /* We are using isOpenSolaris as meaning
 101                                  * we know the Solaris commercial fonts aren't
 102                                  * present. "Solaris Next" (03/10) did not
 103                                  * include these even though its was not
 104                                  * OpenSolaris. Need to revisit how this is
 105                                  * handled but for now as in 6ux, we'll use




  65 import sun.font.FontManager;
  66 import sun.font.FontManagerFactory;
  67 import sun.font.FontManagerForSGE;
  68 import sun.font.NativeFont;
  69 
  70 /**
  71  * This is an implementation of a GraphicsEnvironment object for the
  72  * default local GraphicsEnvironment.
  73  *
  74  * @see GraphicsDevice
  75  * @see GraphicsConfiguration
  76  */
  77 public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
  78     implements DisplayChangedListener {
  79 
  80     public static boolean isOpenSolaris;
  81     private static Font defaultFont;
  82 
  83     public SunGraphicsEnvironment() {
  84         java.security.AccessController.doPrivileged(
  85                                     new java.security.PrivilegedAction<Object>() {
  86             public Object run() {
  87                     String version = System.getProperty("os.version", "0.0");
  88                     try {
  89                         float ver = Float.parseFloat(version);
  90                         if (ver > 5.10f) {
  91                             File f = new File("/etc/release");
  92                             FileInputStream fis = new FileInputStream(f);
  93                             InputStreamReader isr
  94                                 = new InputStreamReader(fis, "ISO-8859-1");
  95                             BufferedReader br = new BufferedReader(isr);
  96                             String line = br.readLine();
  97                             if (line.indexOf("OpenSolaris") >= 0) {
  98                                 isOpenSolaris = true;
  99                             } else {
 100                                 /* We are using isOpenSolaris as meaning
 101                                  * we know the Solaris commercial fonts aren't
 102                                  * present. "Solaris Next" (03/10) did not
 103                                  * include these even though its was not
 104                                  * OpenSolaris. Need to revisit how this is
 105                                  * handled but for now as in 6ux, we'll use