SunGraphicsEnvironment.java revision 3441
2362N/A * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. 893N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 893N/A * This code is free software; you can redistribute it and/or modify it 893N/A * under the terms of the GNU General Public License version 2 only, as 893N/A * published by the Free Software Foundation. Oracle designates this 893N/A * particular file as subject to the "Classpath" exception as provided 893N/A * by Oracle in the LICENSE file that accompanied this code. 893N/A * This code is distributed in the hope that it will be useful, but WITHOUT 893N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 893N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 893N/A * version 2 for more details (a copy is included in the LICENSE file that 893N/A * accompanied this code). 893N/A * You should have received a copy of the GNU General Public License version 893N/A * 2 along with this work; if not, write to the Free Software Foundation, 2362N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 893N/A * or visit www.oracle.com if you need additional information or have any 893N/A * This is an implementation of a GraphicsEnvironment object for the 893N/A * default local GraphicsEnvironment. 893N/A * @see GraphicsConfiguration 893N/A /* We are using isOpenSolaris as meaning 893N/A * we know the Solaris commercial fonts aren't 893N/A * present. "Solaris Next" (03/10) did not 893N/A * include these even though its was not 893N/A * OpenSolaris. Need to revisit how this is 893N/A * handled but for now as in 6ux, we'll use 893N/A * the test for a standard font resource as 893N/A * being an indicator as to whether we need 893N/A * to treat this as OpenSolaris from a font 893N/A /* Establish the default font to be used by SG2D etc */ 893N/A * Returns an array of all of the screen devices. 893N/A * Returns the number of screen devices of this graphics environment. 893N/A * @return the number of screen devices of this graphics environment 893N/A * Create and return the screen device with the specified number. The 893N/A * device with number <code>0</code> will be the default device (returned 893N/A * by {@link #getDefaultScreenDevice()}. 893N/A * @param screennum the number of the screen to create 893N/A * @return the created screen device 893N/A * Returns the default screen graphics device. 893N/A * Returns a Graphics2D object for rendering into the 893N/A * @throws NullPointerException if BufferedImage argument is null 893N/A * Returns all fonts available in this environment. 893N/A /* Use a new TreeMap as used in getInstalledFontFamilyNames 893N/A * and insert all the keys in lower case, so that the sort order 893N/A * is the same as the installed families. This preserves historical 893N/A * behaviour and inserts new families in the right place. 893N/A * It would have been marginally more efficient to directly obtain 893N/A * the tree map and just insert new entries, but not so much as 893N/A * to justify the extra internal interface. 893N/A * Return the bounds of a GraphicsDevice, less its screen insets. 893N/A * See also java.awt.GraphicsEnvironment.getUsableBounds(); 893N/A * From the DisplayChangedListener interface; called 893N/A * when the display mode has been changed. // notify screens in device array to do display update stuff // notify SunDisplayChanger list (e.g. VolatileSurfaceManagers and // SurfaceDataProxies) about the display change event * Part of the DisplayChangedListener interface: * propagate this event to listeners * Returns true when the display is local, false for remote displays. * @return true when the display is local, false for remote displays * ----DISPLAY CHANGE SUPPORT---- * Add a DisplayChangeListener to be notified when the display settings * Remove a DisplayChangeListener from Win32GraphicsEnvironment * ----END DISPLAY CHANGE SUPPORT---- * Returns true if FlipBufferStrategy with COPIED buffer contents * is preferred for this peer's GraphicsConfiguration over * BlitBufferStrategy, false otherwise. * The reason FlipBS could be preferred is that in some configurations * an accelerated copy to the screen is supported (like Direct3D 9) * @return true if flip strategy should be used, false otherwise