< prev index next >

src/java.desktop/macosx/classes/com/apple/eawt/FullScreenHandler.java

Print this page




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.apple.eawt;
  27 

  28 import java.awt.*;
  29 import java.util.*;
  30 import java.util.List;
  31 
  32 import javax.swing.RootPaneContainer;
  33 
  34 import com.apple.eawt.AppEvent.FullScreenEvent;
  35 import sun.awt.SunToolkit;
  36 
  37 import java.lang.annotation.Native;
  38 
  39 final class FullScreenHandler {
  40     private static final String CLIENT_PROPERTY = "com.apple.eawt.event.internalFullScreenHandler";
  41 
  42     @Native static final int FULLSCREEN_WILL_ENTER = 1;
  43     @Native static final int FULLSCREEN_DID_ENTER = 2;
  44     @Native static final int FULLSCREEN_WILL_EXIT = 3;
  45     @Native static final int FULLSCREEN_DID_EXIT = 4;
  46 
  47     // installs a private instance of the handler, if necessary
  48     static void addFullScreenListenerTo(final RootPaneContainer window, final FullScreenListener listener) {
  49         final Object value = window.getRootPane().getClientProperty(CLIENT_PROPERTY);
  50         if (value instanceof FullScreenHandler) {
  51             ((FullScreenHandler)value).addListener(listener);
  52             return;
  53         }
  54 




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.apple.eawt;
  27 
  28 import com.apple.eawt.event.FullScreenEvent;
  29 import java.awt.*;
  30 import java.util.*;
  31 import java.util.List;
  32 
  33 import javax.swing.RootPaneContainer;
  34 

  35 import sun.awt.SunToolkit;
  36 
  37 import java.lang.annotation.Native;
  38 
  39 final class FullScreenHandler {
  40     private static final String CLIENT_PROPERTY = "com.apple.eawt.event.internalFullScreenHandler";
  41 
  42     @Native static final int FULLSCREEN_WILL_ENTER = 1;
  43     @Native static final int FULLSCREEN_DID_ENTER = 2;
  44     @Native static final int FULLSCREEN_WILL_EXIT = 3;
  45     @Native static final int FULLSCREEN_DID_EXIT = 4;
  46 
  47     // installs a private instance of the handler, if necessary
  48     static void addFullScreenListenerTo(final RootPaneContainer window, final FullScreenListener listener) {
  49         final Object value = window.getRootPane().getClientProperty(CLIENT_PROPERTY);
  50         if (value instanceof FullScreenHandler) {
  51             ((FullScreenHandler)value).addListener(listener);
  52             return;
  53         }
  54 


< prev index next >