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 sun.awt.windows;
27
28 import java.awt.*;
29 import java.awt.im.InputMethodHighlight;
30 import java.awt.im.spi.InputMethodDescriptor;
31 import java.awt.image.*;
32 import java.awt.peer.*;
33 import java.awt.event.KeyEvent;
34 import java.awt.datatransfer.Clipboard;
35 import java.awt.TrayIcon;
36 import java.beans.PropertyChangeListener;
37 import java.security.AccessController;
38 import java.security.PrivilegedAction;
39
40 import sun.awt.AWTAccessor;
41 import sun.awt.AppContext;
42 import sun.awt.AWTAutoShutdown;
43 import sun.awt.AWTPermissions;
44 import sun.awt.AppContext;
45 import sun.awt.LightweightFrame;
46 import sun.awt.SunToolkit;
47 import sun.awt.util.ThreadGroupUtils;
1093 }
1094
1095 @Override
1096 public void grab(Window w) {
1097 final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
1098 if (peer != null) {
1099 ((WWindowPeer) peer).grab();
1100 }
1101 }
1102
1103 @Override
1104 public void ungrab(Window w) {
1105 final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
1106 if (peer != null) {
1107 ((WWindowPeer) peer).ungrab();
1108 }
1109 }
1110
1111 @Override
1112 public native boolean syncNativeQueue(final long timeout);
1113 @Override
1114 public boolean isDesktopSupported() {
1115 return true;
1116 }
1117
1118 @Override
1119 public DesktopPeer createDesktopPeer(Desktop target) {
1120 return new WDesktopPeer();
1121 }
1122
1123 private static native void setExtraMouseButtonsEnabledNative(boolean enable);
1124
1125 @Override
1126 public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
1127 return areExtraMouseButtonsEnabled;
1128 }
1129
1130 private synchronized native int getNumberOfButtonsImpl();
1131
1132 @Override
1133 public int getNumberOfButtons(){
1134 if (numberOfButtons == 0) {
1135 numberOfButtons = getNumberOfButtonsImpl();
1136 }
1137 return (numberOfButtons > MAX_BUTTONS_SUPPORTED)? MAX_BUTTONS_SUPPORTED : numberOfButtons;
1138 }
1139
1140 @Override
|
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 sun.awt.windows;
27
28 import java.awt.peer.TaskbarPeer;
29 import java.awt.*;
30 import java.awt.im.InputMethodHighlight;
31 import java.awt.im.spi.InputMethodDescriptor;
32 import java.awt.image.*;
33 import java.awt.peer.*;
34 import java.awt.event.KeyEvent;
35 import java.awt.datatransfer.Clipboard;
36 import java.awt.TrayIcon;
37 import java.beans.PropertyChangeListener;
38 import java.security.AccessController;
39 import java.security.PrivilegedAction;
40
41 import sun.awt.AWTAccessor;
42 import sun.awt.AppContext;
43 import sun.awt.AWTAutoShutdown;
44 import sun.awt.AWTPermissions;
45 import sun.awt.AppContext;
46 import sun.awt.LightweightFrame;
47 import sun.awt.SunToolkit;
48 import sun.awt.util.ThreadGroupUtils;
1094 }
1095
1096 @Override
1097 public void grab(Window w) {
1098 final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
1099 if (peer != null) {
1100 ((WWindowPeer) peer).grab();
1101 }
1102 }
1103
1104 @Override
1105 public void ungrab(Window w) {
1106 final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
1107 if (peer != null) {
1108 ((WWindowPeer) peer).ungrab();
1109 }
1110 }
1111
1112 @Override
1113 public native boolean syncNativeQueue(final long timeout);
1114
1115 @Override
1116 public boolean isDesktopSupported() {
1117 return true;
1118 }
1119
1120 @Override
1121 public DesktopPeer createDesktopPeer(Desktop target) {
1122 return new WDesktopPeer();
1123 }
1124
1125 @Override
1126 public boolean isTaskbarSupported() {
1127 return WTaskbarPeer.isTaskbarSupported();
1128 }
1129
1130 @Override
1131 public TaskbarPeer createTaskbarPeer(Taskbar target) {
1132 return new WTaskbarPeer();
1133 }
1134
1135 private static native void setExtraMouseButtonsEnabledNative(boolean enable);
1136
1137 @Override
1138 public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
1139 return areExtraMouseButtonsEnabled;
1140 }
1141
1142 private synchronized native int getNumberOfButtonsImpl();
1143
1144 @Override
1145 public int getNumberOfButtons(){
1146 if (numberOfButtons == 0) {
1147 numberOfButtons = getNumberOfButtonsImpl();
1148 }
1149 return (numberOfButtons > MAX_BUTTONS_SUPPORTED)? MAX_BUTTONS_SUPPORTED : numberOfButtons;
1150 }
1151
1152 @Override
|