Methods Summary |
---|
public FilterAction | acceptEvent(java.awt.AWTEvent event)
if (disabled || !modalDialog.isVisible()) {
return FilterAction.ACCEPT;
}
int eventID = event.getID();
if ((eventID >= MouseEvent.MOUSE_FIRST &&
eventID <= MouseEvent.MOUSE_LAST) ||
(eventID >= ActionEvent.ACTION_FIRST &&
eventID <= ActionEvent.ACTION_LAST) ||
eventID == WindowEvent.WINDOW_CLOSING)
{
Object o = event.getSource();
if (o instanceof sun.awt.ModalExclude) {
// Exclude this object from modality and
// continue to pump it's events.
} else if (o instanceof Component) {
Component c = (Component)o;
while ((c != null) && !(c instanceof Window)) {
c = c.getParent_NoClientCode();
}
if (c != null) {
return acceptWindow((Window)c);
}
}
}
return FilterAction.ACCEPT;
|
protected abstract FilterAction | acceptWindow(java.awt.Window w)
|
int | compareTo(java.awt.ModalEventFilter another)
Dialog anotherDialog = another.getModalDialog();
// check if modalDialog is from anotherDialog's hierarchy
// or vice versa
Component c = modalDialog;
while (c != null) {
if (c == anotherDialog) {
return 1;
}
c = c.getParent_NoClientCode();
}
c = anotherDialog;
while (c != null) {
if (c == modalDialog) {
return -1;
}
c = c.getParent_NoClientCode();
}
// check if one dialog blocks (directly or indirectly) another
Dialog blocker = modalDialog.getModalBlocker();
while (blocker != null) {
if (blocker == anotherDialog) {
return -1;
}
blocker = blocker.getModalBlocker();
}
blocker = anotherDialog.getModalBlocker();
while (blocker != null) {
if (blocker == modalDialog) {
return 1;
}
blocker = blocker.getModalBlocker();
}
// compare modality types
return modalDialog.getModalityType().compareTo(anotherDialog.getModalityType());
|
static java.awt.ModalEventFilter | createFilterForDialog(java.awt.Dialog modalDialog)
switch (modalDialog.getModalityType()) {
case DOCUMENT_MODAL: return new DocumentModalEventFilter(modalDialog);
case APPLICATION_MODAL: return new ApplicationModalEventFilter(modalDialog);
case TOOLKIT_MODAL: return new ToolkitModalEventFilter(modalDialog);
}
return null;
|
void | disable()
disabled = true;
|
java.awt.Dialog | getModalDialog()
return modalDialog;
|