jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
changeset 3938 ef327bd847c0
parent 3928 be186a33df9b
child 5506 202f599c92aa
child 5579 1a5e995a710b
equal deleted inserted replaced
3934:487e1aa949c4 3938:ef327bd847c0
    39 import java.net.NetworkInterface;
    39 import java.net.NetworkInterface;
    40 import java.net.SocketException;
    40 import java.net.SocketException;
    41 import java.net.UnknownHostException;
    41 import java.net.UnknownHostException;
    42 
    42 
    43 import java.util.*;
    43 import java.util.*;
    44 import java.util.logging.*;
       
    45 
    44 
    46 import sun.awt.motif.MFontConfiguration;
    45 import sun.awt.motif.MFontConfiguration;
    47 import sun.font.FcFontConfiguration;
    46 import sun.font.FcFontConfiguration;
    48 import sun.font.Font2D;
    47 import sun.font.Font2D;
    49 import sun.font.FontManager;
    48 import sun.font.FontManager;
    50 import sun.font.NativeFont;
    49 import sun.font.NativeFont;
    51 import sun.java2d.SunGraphicsEnvironment;
    50 import sun.java2d.SunGraphicsEnvironment;
    52 import sun.java2d.SurfaceManagerFactory;
    51 import sun.java2d.SurfaceManagerFactory;
    53 import sun.java2d.UnixSurfaceManagerFactory;
    52 import sun.java2d.UnixSurfaceManagerFactory;
       
    53 import sun.util.logging.PlatformLogger;
    54 
    54 
    55 /**
    55 /**
    56  * This is an implementation of a GraphicsEnvironment object for the
    56  * This is an implementation of a GraphicsEnvironment object for the
    57  * default local GraphicsEnvironment used by the Java Runtime Environment
    57  * default local GraphicsEnvironment used by the Java Runtime Environment
    58  * for X11 environments.
    58  * for X11 environments.
    61  * @see GraphicsConfiguration
    61  * @see GraphicsConfiguration
    62  */
    62  */
    63 public class X11GraphicsEnvironment
    63 public class X11GraphicsEnvironment
    64     extends SunGraphicsEnvironment
    64     extends SunGraphicsEnvironment
    65 {
    65 {
    66     private static final Logger log = Logger.getLogger("sun.awt.X11GraphicsEnvironment");
    66     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11GraphicsEnvironment");
    67     private static final Logger screenLog = Logger.getLogger("sun.awt.screen.X11GraphicsEnvironment");
    67     private static final PlatformLogger screenLog = PlatformLogger.getLogger("sun.awt.screen.X11GraphicsEnvironment");
    68 
    68 
    69     private static Boolean xinerState;
    69     private static Boolean xinerState;
    70 
    70 
    71     static {
    71     static {
    72         java.security.AccessController.doPrivileged(
    72         java.security.AccessController.doPrivileged(
   282     public boolean runningXinerama() {
   282     public boolean runningXinerama() {
   283         if (xinerState == null) {
   283         if (xinerState == null) {
   284             // pRunningXinerama() simply returns a global boolean variable,
   284             // pRunningXinerama() simply returns a global boolean variable,
   285             // so there is no need to synchronize here
   285             // so there is no need to synchronize here
   286             xinerState = Boolean.valueOf(pRunningXinerama());
   286             xinerState = Boolean.valueOf(pRunningXinerama());
   287             if (screenLog.isLoggable(Level.FINER)) {
   287             if (screenLog.isLoggable(PlatformLogger.FINER)) {
   288                 screenLog.log(Level.FINER, "Running Xinerama: " + xinerState);
   288                 screenLog.finer("Running Xinerama: " + xinerState);
   289             }
   289             }
   290         }
   290         }
   291         return xinerState.booleanValue();
   291         return xinerState.booleanValue();
   292     }
   292     }
   293 
   293 
   366         if ((unionRect.width / 2) + unionRect.x > center.x - 1 &&
   366         if ((unionRect.width / 2) + unionRect.x > center.x - 1 &&
   367             (unionRect.height / 2) + unionRect.y > center.y - 1 &&
   367             (unionRect.height / 2) + unionRect.y > center.y - 1 &&
   368             (unionRect.width / 2) + unionRect.x < center.x + 1 &&
   368             (unionRect.width / 2) + unionRect.x < center.x + 1 &&
   369             (unionRect.height / 2) + unionRect.y < center.y + 1) {
   369             (unionRect.height / 2) + unionRect.y < center.y + 1) {
   370 
   370 
   371             if (screenLog.isLoggable(Level.FINER)) {
   371             if (screenLog.isLoggable(PlatformLogger.FINER)) {
   372                 screenLog.log(Level.FINER, "Video Wall: center point is at center of all displays.");
   372                 screenLog.finer("Video Wall: center point is at center of all displays.");
   373             }
   373             }
   374             return unionRect;
   374             return unionRect;
   375         }
   375         }
   376 
   376 
   377         // next, check if at center of one monitor
   377         // next, check if at center of one monitor
   378         if (centerMonitorRect != null) {
   378         if (centerMonitorRect != null) {
   379             if (screenLog.isLoggable(Level.FINER)) {
   379             if (screenLog.isLoggable(PlatformLogger.FINER)) {
   380                 screenLog.log(Level.FINER, "Center point at center of a particular " +
   380                 screenLog.finer("Center point at center of a particular " +
   381                                            "monitor, but not of the entire virtual display.");
   381                                 "monitor, but not of the entire virtual display.");
   382             }
   382             }
   383             return centerMonitorRect;
   383             return centerMonitorRect;
   384         }
   384         }
   385 
   385 
   386         // otherwise, the center is at some weird spot: return unionRect
   386         // otherwise, the center is at some weird spot: return unionRect
   387         if (screenLog.isLoggable(Level.FINER)) {
   387         if (screenLog.isLoggable(PlatformLogger.FINER)) {
   388             screenLog.log(Level.FINER, "Center point is somewhere strange - return union of all bounds.");
   388             screenLog.finer("Center point is somewhere strange - return union of all bounds.");
   389         }
   389         }
   390         return unionRect;
   390         return unionRect;
   391     }
   391     }
   392 
   392 
   393     /**
   393     /**