/*
* 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.
*/
implements DisplayChangedListener {
/**
* CoreGraphics display ID. This identifier can become non-valid at any time
* therefore methods, which is using this id should be ready to it.
*/
private volatile int displayID;
private volatile double xResolution;
private volatile double yResolution;
private volatile int scale;
// Array of all GraphicsConfig instances for this device
// Default config (temporarily hard coded)
configs = new GraphicsConfiguration[] {
};
}
/**
* Returns CGDirectDisplayID, which is the same id as @"NSScreenNumber" in
* NSScreen.
*
* @return CoreGraphics display id.
*/
public int getCGDisplayID() {
return displayID;
}
/**
* Return a list of all configurations.
*/
}
/**
* Return the default configuration.
*/
return configs[DEFAULT_CONFIG];
}
/**
* Return a human-readable screen description.
*/
return "Display " + displayID;
}
/**
* Returns the type of the graphics device.
* @see #TYPE_RASTER_SCREEN
* @see #TYPE_PRINTER
* @see #TYPE_IMAGE_BUFFER
*/
public int getType() {
return TYPE_RASTER_SCREEN;
}
public double getXResolution() {
return xResolution;
}
public double getYResolution() {
return yResolution;
}
return screenInsets;
}
public int getScaleFactor() {
return scale;
}
}
public void displayChanged() {
//TODO configs/fullscreenWindow/modes?
}
public void paletteChanged() {
// devices do not need to react to this event.
}
/**
* Enters full-screen mode, or returns to windowed mode.
*/
if (w == old) {
return;
}
boolean fsSupported = isFullScreenSupported();
// restore original display mode and enter windowed mode.
if (originalMode != null) {
originalMode = null;
}
}
super.setFullScreenWindow(w);
if (fsSupported && w != null) {
if (isDisplayChangeSupported()) {
}
// enter fullscreen mode
}
}
/**
* Returns true if this GraphicsDevice supports
* full-screen exclusive mode and false otherwise.
*/
public boolean isFullScreenSupported() {
return isFSExclusiveModeAllowed();
}
private static boolean isFSExclusiveModeAllowed() {
if (fullScreenExclusivePermission == null) {
new AWTPermission("fullScreenExclusive");
}
try {
} catch (SecurityException e) {
return false;
}
}
return true;
}
}
}
}
}
public boolean isDisplayChangeSupported() {
return true;
}
throw new IllegalArgumentException("Attempt to set null as a DisplayMode");
}
final Window w = getFullScreenWindow();
if (w != null) {
}
if (isFullScreenSupported() && w != null) {
}
}
}
return nativeGetDisplayMode(displayID);
}
return nativeGetDisplayModes(displayID);
}
}