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