Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/awt/SunDisplayChanger.java
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.awt;
import java.awt.IllegalComponentStateException;
import java.util.Collections;
import java.util.Iterator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import sun.util.logging.PlatformLogger;
/**
* This class is used to aid in keeping track of DisplayChangedListeners and
* notifying them when a display change has taken place. DisplayChangedListeners
* are notified when the display's bit depth is changed, or when a top-level
* window has been dragged onto another screen.
*
* It is safe for a DisplayChangedListener to be added while the list is being
* iterated.
*
* The displayChanged() call is propagated after some occurrence (either
* due to user action or some other application) causes the display mode
* (e.g., depth or resolution) to change. All heavyweight components need
* to know when this happens because they need to create new surfaceData
* objects based on the new depth.
*
* displayChanged() is also called on Windows when they are moved from one
* screen to another on a system equipped with multiple displays.
*/
public class SunDisplayChanger {
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.multiscreen.SunDisplayChanger");
// Create a new synchronized map with initial capacity of one listener.
// It is asserted that the most common case is to have one GraphicsDevice
// and one top-level Window.
private Map<DisplayChangedListener, Void> listeners =
Collections.synchronizedMap(new WeakHashMap<DisplayChangedListener, Void>(1));
public SunDisplayChanger() {}
/*
* Add a DisplayChangeListener to this SunDisplayChanger so that it is
* notified when the display is changed.
*/
public void add(DisplayChangedListener theListener) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
if (theListener == null) {
log.fine("Assertion (theListener != null) failed");
}
}
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("Adding listener: " + theListener);
}
listeners.put(theListener, null);
}
/*
* Remove the given DisplayChangeListener from this SunDisplayChanger.
*/
public void remove(DisplayChangedListener theListener) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
if (theListener == null) {
log.fine("Assertion (theListener != null) failed");
}
}
if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("Removing listener: " + theListener);
}
listeners.remove(theListener);
}
/*
* Notify our list of DisplayChangedListeners that a display change has
* taken place by calling their displayChanged() methods.
*/
public void notifyListeners() {
if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("notifyListeners");
}
// This method is implemented by making a clone of the set of listeners,
// and then iterating over the clone. This is because during the course
// of responding to a display change, it may be appropriate for a
// DisplayChangedListener to add or remove itself from a SunDisplayChanger.
// If the set itself were iterated over, rather than a clone, it is
// trivial to get a ConcurrentModificationException by having a
// DisplayChangedListener remove itself from its list.
// Because all display change handling is done on the event thread,
// synchronization provides no protection against modifying the listener
// list while in the middle of iterating over it. -bchristi 7/10/2001
Set<DisplayChangedListener> cloneSet;
synchronized(listeners) {
cloneSet = new HashSet<DisplayChangedListener>(listeners.keySet());
}
Iterator<DisplayChangedListener> itr = cloneSet.iterator();
while (itr.hasNext()) {
DisplayChangedListener current = itr.next();
try {
if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("displayChanged for listener: " + current);
}
current.displayChanged();
} catch (IllegalComponentStateException e) {
// This DisplayChangeListener is no longer valid. Most
// likely, a top-level window was dispose()d, but its
// Java objects have not yet been garbage collected. In any
// case, we no longer need to track this listener, though we
// do need to remove it from the original list, not the clone.
listeners.remove(current);
}
}
}
/*
* Notify our list of DisplayChangedListeners that a palette change has
* taken place by calling their paletteChanged() methods.
*/
public void notifyPaletteChanged() {
if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("notifyPaletteChanged");
}
// This method is implemented by making a clone of the set of listeners,
// and then iterating over the clone. This is because during the course
// of responding to a display change, it may be appropriate for a
// DisplayChangedListener to add or remove itself from a SunDisplayChanger.
// If the set itself were iterated over, rather than a clone, it is
// trivial to get a ConcurrentModificationException by having a
// DisplayChangedListener remove itself from its list.
// Because all display change handling is done on the event thread,
// synchronization provides no protection against modifying the listener
// list while in the middle of iterating over it. -bchristi 7/10/2001
Set<DisplayChangedListener> cloneSet;
synchronized (listeners) {
cloneSet = new HashSet<DisplayChangedListener>(listeners.keySet());
}
Iterator<DisplayChangedListener> itr = cloneSet.iterator();
while (itr.hasNext()) {
DisplayChangedListener current = itr.next();
try {
if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("paletteChanged for listener: " + current);
}
current.paletteChanged();
} catch (IllegalComponentStateException e) {
// This DisplayChangeListener is no longer valid. Most
// likely, a top-level window was dispose()d, but its
// Java objects have not yet been garbage collected. In any
// case, we no longer need to track this listener, though we
// do need to remove it from the original list, not the clone.
listeners.remove(current);
}
}
}
}
⏎ sun/awt/SunDisplayChanger.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, ≈889🔥, 5💬
Popular Posts:
Apache Avalon began in 1999 as the Java Apache Server Framework and in late 2002 separated from the ...
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
What Is commons-logging-1.2.jar? commons-logging-1.2.jar is the JAR file for Apache Commons Logging ...
JSP(tm) Standard Tag Library 1.0 implementation - Jakarta Taglibs hosts the Standard Taglib 1.0, an ...
JDK 17 jdk.internal.le.jmod is the JMOD file for JDK 17 Internal Line Editing module. JDK 17 Interna...