1 /*
2 * Copyright (c) 1996, 2015, 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
160 private native void _setTitle(String title);
161
162 public void setResizable(boolean resizable) {
163 _setResizable(resizable);
164 }
165
166 private native void _setResizable(boolean resizable);
167
168 // Toolkit & peer internals
169
170 WWindowPeer(Window target) {
171 super(target);
172 }
173
174 @Override
175 void initialize() {
176 super.initialize();
177
178 updateInsets(insets_);
179
180 Font f = ((Window)target).getFont();
181 if (f == null) {
182 f = defaultFont;
183 ((Window)target).setFont(f);
184 setFont(f);
185 }
186 // Express our interest in display changes
187 GraphicsConfiguration gc = getGraphicsConfiguration();
188 ((Win32GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
189
190 initActiveWindowsTracking((Window)target);
191
192 updateIconImages();
193
194 Shape shape = ((Window)target).getShape();
195 if (shape != null) {
196 applyShape(Region.getInstance(shape, null));
197 }
198
199 float opacity = ((Window)target).getOpacity();
200 if (opacity < 1.0f) {
201 setOpacity(opacity);
202 }
203
204 synchronized (getStateLock()) {
205 // default value of a boolean field is 'false', so set isOpaque to
|
1 /*
2 * Copyright (c) 1996, 2016, 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
160 private native void _setTitle(String title);
161
162 public void setResizable(boolean resizable) {
163 _setResizable(resizable);
164 }
165
166 private native void _setResizable(boolean resizable);
167
168 // Toolkit & peer internals
169
170 WWindowPeer(Window target) {
171 super(target);
172 }
173
174 @Override
175 void initialize() {
176 super.initialize();
177
178 updateInsets(insets_);
179
180 if (!((Window) target).isFontSet()) {
181 ((Window) target).setFont(defaultFont);
182 setFont(defaultFont);
183 }
184 if (!((Window) target).isForegroundSet()) {
185 ((Window) target).setForeground(SystemColor.windowText);
186 }
187 if (!((Window) target).isBackgroundSet()) {
188 ((Window) target).setBackground(SystemColor.window);
189 }
190
191 // Express our interest in display changes
192 GraphicsConfiguration gc = getGraphicsConfiguration();
193 ((Win32GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
194
195 initActiveWindowsTracking((Window)target);
196
197 updateIconImages();
198
199 Shape shape = ((Window)target).getShape();
200 if (shape != null) {
201 applyShape(Region.getInstance(shape, null));
202 }
203
204 float opacity = ((Window)target).getOpacity();
205 if (opacity < 1.0f) {
206 setOpacity(opacity);
207 }
208
209 synchronized (getStateLock()) {
210 // default value of a boolean field is 'false', so set isOpaque to
|