jdk/src/java.desktop/share/classes/java/awt/doc-files/Modality.html
changeset 29882 d36e2fcc5f55
parent 25859 3317bb8137f4
equal deleted inserted replaced
29881:8931052def61 29882:d36e2fcc5f55
     1 <!--
     1 <!--
     2  Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     2  Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
     3  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 
     4 
     5  This code is free software; you can redistribute it and/or modify it
     5  This code is free software; you can redistribute it and/or modify it
     6  under the terms of the GNU General Public License version 2 only, as
     6  under the terms of the GNU General Public License version 2 only, as
     7  published by the Free Software Foundation.  Oracle designates this
     7  published by the Free Software Foundation.  Oracle designates this
    87       then all its owned windows and child components are also excluded.
    87       then all its owned windows and child components are also excluded.
    88     </p><p>
    88     </p><p>
    89       <u>Scope of blocking (SB)</u> - the set of windows (instances of
    89       <u>Scope of blocking (SB)</u> - the set of windows (instances of
    90       <code>java.awt.Window</code> and all derived classes) that are blocked by 
    90       <code>java.awt.Window</code> and all derived classes) that are blocked by 
    91       the modal dialog while it is visible.
    91       the modal dialog while it is visible.
    92     </p><p>
       
    93      <blockquote><hr>
    92      <blockquote><hr>
    94       <b>Note</b>: Everywhere in this document the notion of "window" is equal
    93       <b>Note</b>: Everywhere in this document the notion of "window" is equal
    95       to a top-level window in the Java programming language &mdash; in other words
    94       to a top-level window in the Java programming language &mdash; in other words
    96       an instance of <code>java.awt.Window</code> or any descendant class.
    95       an instance of <code>java.awt.Window</code> or any descendant class.
    97       <hr></blockquote>
    96       <hr></blockquote>
   107         </li><li>document
   106         </li><li>document
   108         </li><li>modeless
   107         </li><li>modeless
   109       </li></ul>
   108       </li></ul>
   110       A dialog is, by default, modeless.  A modal dialog is, by default,
   109       A dialog is, by default, modeless.  A modal dialog is, by default,
   111       application-modal.
   110       application-modal.
   112     <p>
   111     <ol>
   113     </p><ol>
       
   114       <li><u>Modeless dialogs</u><br>
   112       <li><u>Modeless dialogs</u><br>
   115         A modeless dialog doesn't block any windows while visible.
   113         A modeless dialog doesn't block any windows while visible.
   116       </li><li><u>Document-modal dialogs</u><br>
   114       </li><li><u>Document-modal dialogs</u><br>
   117         A document-modal dialog blocks all windows from the same
   115         A document-modal dialog blocks all windows from the same
   118         document except those from its child hierarchy. The document root
   116         document except those from its child hierarchy. The document root
   154           The scope of blocking for an application- or toolkit-modal
   152           The scope of blocking for an application- or toolkit-modal
   155           dialog, as opposed to a document-modal dialog, doesn't depend on
   153           dialog, as opposed to a document-modal dialog, doesn't depend on
   156           its owner. Thus, in this case the only thing that the owner
   154           its owner. Thus, in this case the only thing that the owner
   157           affects is the Z-order: the dialog always stays on top of its owner.
   155           affects is the Z-order: the dialog always stays on top of its owner.
   158       </li></ul>
   156       </li></ul>
   159     <p>
       
   160     <blockquote><hr>
   157     <blockquote><hr>
   161       <b>Implementation note</b>: Changing the modality type for a visible
   158       <b>Implementation note</b>: Changing the modality type for a visible
   162       dialog may have no effect until it is hidden and then shown again.
   159       dialog may have no effect until it is hidden and then shown again.
   163       <hr></blockquote>
   160       <hr></blockquote>
   164 
   161 
   275       </p><ul>
   272       </p><ul>
   276         <li>Exclusion from blocking of toolkit-modal dialogs
   273         <li>Exclusion from blocking of toolkit-modal dialogs
   277         </li><li>Exclusion from blocking of application-modal dialogs
   274         </li><li>Exclusion from blocking of application-modal dialogs
   278       </li></ul>
   275       </li></ul>
   279       By default, a window's modal exclusion property is turned off.
   276       By default, a window's modal exclusion property is turned off.
   280     <p>
   277       <ol>
   281       </p><ol>
       
   282         <li><u>Application-modal exclusion</u><br>
   278         <li><u>Application-modal exclusion</u><br>
   283           If a window is application-modal excluded, it is not blocked by any
   279           If a window is application-modal excluded, it is not blocked by any
   284           application-modal dialogs. Also, it is not blocked by document-modal
   280           application-modal dialogs. Also, it is not blocked by document-modal
   285           dialogs from outside of its child hierarchy.
   281           dialogs from outside of its child hierarchy.
   286         </li><li><u>Toolkit-modal exclusion</u><br>
   282         </li><li><u>Toolkit-modal exclusion</u><br>
   287           If a window is toolkit-modal excluded, it is not blocked
   283           If a window is toolkit-modal excluded, it is not blocked
   288           by any application- or toolkit-modal dialogs. Also, it is not
   284           by any application- or toolkit-modal dialogs. Also, it is not
   289           blocked by document-modal dialogs from outside of their child hierarchy.
   285           blocked by document-modal dialogs from outside of their child hierarchy.
   290       </li></ol>
   286       </li></ol>
   291     <p>
       
   292     <blockquote>
   287     <blockquote>
   293       <hr>
   288       <hr>
   294         <b>Implementation note</b>: Changing the modal exclusion type for a visible window
   289         <b>Implementation note</b>: Changing the modal exclusion type for a visible window
   295         may have no effect until it is hidden and then shown again.
   290         may have no effect until it is hidden and then shown again.
   296     </blockquote>
   291     </blockquote>
   397 	      same document<br>
   392 	      same document<br>
   398 	  </ol>
   393 	  </ol>
   399           <br>
   394           <br>
   400         </td>
   395         </td>
   401         <td align="center">
   396         <td align="center">
   402           <img src="modal-example1.gif">
   397           <img src="modal-example1.gif" alt="Example 1">
   403           <br>
   398           <br>
   404         </td>
   399         </td>
   405       </tr>
   400       </tr>
   406       <tr>
   401       <tr>
   407         <td align="left">
   402         <td align="left">
   416          <li>F becomes blocked by D<sub>ii</sub> &mdash; it's in the same document<br>
   411          <li>F becomes blocked by D<sub>ii</sub> &mdash; it's in the same document<br>
   417          </ol>
   412          </ol>
   418 	 <br>
   413 	 <br>
   419         </td>
   414         </td>
   420         <td align="center">
   415         <td align="center">
   421           <img src="modal-example2.gif">
   416           <img src="modal-example2.gif" alt="Example 2">
   422           <br>
   417           <br>
   423         </td>
   418         </td>
   424       </tr>
   419       </tr>
   425       <tr>
   420       <tr>
   426         <td align="left">
   421         <td align="left">
   438 	      D<sub>ii</sub> blocks D<sub>i</sub><br>
   433 	      D<sub>ii</sub> blocks D<sub>i</sub><br>
   439 	  </ol>
   434 	  </ol>
   440           <br>
   435           <br>
   441         </td>
   436         </td>
   442         <td align="center">
   437         <td align="center">
   443           <img src="modal-example3.gif">
   438           <img src="modal-example3.gif" alt="Example 3">
   444           <br>
   439           <br>
   445         </td>
   440         </td>
   446       </tr>
   441       </tr>
   447       <tr>
   442       <tr>
   448         <td align="left">
   443         <td align="left">
   460           <li>D<sub>i</sub> remains unblocked<br>
   455           <li>D<sub>i</sub> remains unblocked<br>
   461 	  </ol>
   456 	  </ol>
   462           <br>
   457           <br>
   463         </td>
   458         </td>
   464         <td align="center">
   459         <td align="center">
   465           <img src="modal-example4.gif">
   460           <img src="modal-example4.gif" alt="Example 4">
   466           <br>
   461           <br>
   467         </td>
   462         </td>
   468       </tr>
   463       </tr>
   469     </tbody></table>
   464     </tbody></table>
   470 
   465