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