1 /*
2 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
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
142 /**
143 * Character with reasonable value between the minimum width and maximum.
144 */
145 static final char WIDE_CHAR = '0';
146
147 /**
148 * The back buffer provide user with a BufferStrategy.
149 */
150 private Image backBuffer;
151
152 /**
153 * All Swing delegates use delegateContainer as a parent. This container
154 * intentionally do not use parent of the peer.
155 */
156 @SuppressWarnings("serial")// Safe: outer class is non-serializable.
157 private final class DelegateContainer extends Container {
158 {
159 enableEvents(0xFFFFFFFF);
160 }
161
162 // Empty non private constructor was added because access to this
163 // class shouldn't be emulated by a synthetic accessor method.
164 DelegateContainer() {
165 super();
166 }
167
168 @Override
169 public boolean isLightweight() {
170 return false;
171 }
172
173 @Override
174 public Point getLocation() {
175 return getLocationOnScreen();
176 }
177
178 @Override
179 public Point getLocationOnScreen() {
180 return LWComponentPeer.this.getLocationOnScreen();
181 }
182
183 @Override
184 public int getX() {
185 return getLocation().x;
186 }
187
|
1 /*
2 * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Oracle designates this
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
142 /**
143 * Character with reasonable value between the minimum width and maximum.
144 */
145 static final char WIDE_CHAR = '0';
146
147 /**
148 * The back buffer provide user with a BufferStrategy.
149 */
150 private Image backBuffer;
151
152 /**
153 * All Swing delegates use delegateContainer as a parent. This container
154 * intentionally do not use parent of the peer.
155 */
156 @SuppressWarnings("serial")// Safe: outer class is non-serializable.
157 private final class DelegateContainer extends Container {
158 {
159 enableEvents(0xFFFFFFFF);
160 }
161
162 @Override
163 public boolean isLightweight() {
164 return false;
165 }
166
167 @Override
168 public Point getLocation() {
169 return getLocationOnScreen();
170 }
171
172 @Override
173 public Point getLocationOnScreen() {
174 return LWComponentPeer.this.getLocationOnScreen();
175 }
176
177 @Override
178 public int getX() {
179 return getLocation().x;
180 }
181
|