jdk/src/share/classes/java/awt/Dialog.java
Print this page
*** 743,753 ****
* @see Component#isDisplayable
* @see #removeNotify
*/
public void addNotify() {
synchronized (getTreeLock()) {
! if (parent != null && parent.getPeer() == null) {
parent.addNotify();
}
if (peer == null) {
peer = getToolkit().createDialog(this);
--- 743,753 ----
* @see Component#isDisplayable
* @see #removeNotify
*/
public void addNotify() {
synchronized (getTreeLock()) {
! if (parent != null && parent.peer == null) {
parent.addNotify();
}
if (peer == null) {
peer = getToolkit().createDialog(this);
*** 940,950 ****
setLocationByPlatform(false);
for (int i = 0; i < ownedWindowList.size(); i++) {
Window child = ownedWindowList.elementAt(i).get();
if ((child != null) && child.showWithParent) {
! child.show();
child.showWithParent = false;
} // endif
} // endfor
Window.updateChildFocusableWindowState(this);
--- 940,950 ----
setLocationByPlatform(false);
for (int i = 0; i < ownedWindowList.size(); i++) {
Window child = ownedWindowList.elementAt(i).get();
if ((child != null) && child.showWithParent) {
! child.setVisible(true);
child.showWithParent = false;
} // endif
} // endfor
Window.updateChildFocusableWindowState(this);
*** 1045,1057 ****
};
// if this dialog is toolkit-modal, the filter should be added
// to all EDTs (for all AppContexts)
if (modalityType == ModalityType.TOOLKIT_MODAL) {
! Iterator it = AppContext.getAppContexts().iterator();
while (it.hasNext()) {
! AppContext appContext = (AppContext)it.next();
if (appContext == showAppContext) {
continue;
}
EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
// it may occur that EDT for appContext hasn't been started yet, so
--- 1045,1057 ----
};
// if this dialog is toolkit-modal, the filter should be added
// to all EDTs (for all AppContexts)
if (modalityType == ModalityType.TOOLKIT_MODAL) {
! Iterator<AppContext> it = AppContext.getAppContexts().iterator();
while (it.hasNext()) {
! AppContext appContext = it.next();
if (appContext == showAppContext) {
continue;
}
EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
// it may occur that EDT for appContext hasn't been started yet, so
*** 1082,1094 ****
}
// if this dialog is toolkit-modal, its filter must be removed
// from all EDTs (for all AppContexts)
if (modalityType == ModalityType.TOOLKIT_MODAL) {
! Iterator it = AppContext.getAppContexts().iterator();
while (it.hasNext()) {
! AppContext appContext = (AppContext)it.next();
if (appContext == showAppContext) {
continue;
}
EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
EventDispatchThread edt = eventQueue.getDispatchThread();
--- 1082,1094 ----
}
// if this dialog is toolkit-modal, its filter must be removed
// from all EDTs (for all AppContexts)
if (modalityType == ModalityType.TOOLKIT_MODAL) {
! Iterator<AppContext> it = AppContext.getAppContexts().iterator();
while (it.hasNext()) {
! AppContext appContext = it.next();
if (appContext == showAppContext) {
continue;
}
EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
EventDispatchThread edt = eventQueue.getDispatchThread();
*** 1394,1404 ****
IdentityArrayList<Dialog> blockers = new IdentityArrayList<Dialog>();
for (Dialog d : modalDialogs) {
if (d.shouldBlock(this)) {
Window w = d;
while ((w != null) && (w != this)) {
! w = (Window)(w.getOwner_NoClientCode());
}
if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) {
blockers.add(d);
}
}
--- 1394,1404 ----
IdentityArrayList<Dialog> blockers = new IdentityArrayList<Dialog>();
for (Dialog d : modalDialogs) {
if (d.shouldBlock(this)) {
Window w = d;
while ((w != null) && (w != this)) {
! w = w.getOwner_NoClientCode();
}
if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) {
blockers.add(d);
}
}
*** 1609,1619 ****
// in 1.5 or earlier modalityType was absent, so use "modal" instead
if (modalityType == null) {
setModal(modal);
}
! blockedWindows = new IdentityArrayList();
}
/*
* --- Accessibility Support ---
*
--- 1609,1619 ----
// in 1.5 or earlier modalityType was absent, so use "modal" instead
if (modalityType == null) {
setModal(modal);
}
! blockedWindows = new IdentityArrayList<>();
}
/*
* --- Accessibility Support ---
*