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