182 183 Shape shape = ((Window)target).getShape(); 184 if (shape != null) { 185 applyShape(Region.getInstance(shape, null)); 186 } 187 188 float opacity = ((Window)target).getOpacity(); 189 if (opacity < 1.0f) { 190 setOpacity(opacity); 191 } 192 193 synchronized (getStateLock()) { 194 // default value of a boolean field is 'false', so set isOpaque to 195 // true here explicitly 196 this.isOpaque = true; 197 setOpaque(((Window)target).isOpaque()); 198 } 199 } 200 201 native void createAwtWindow(WComponentPeer parent); 202 void create(WComponentPeer parent) { 203 createAwtWindow(parent); 204 } 205 206 // should be overriden in WDialogPeer 207 protected void realShow() { 208 super.show(); 209 } 210 211 public void show() { 212 updateFocusableWindowState(); 213 214 boolean alwaysOnTop = ((Window)target).isAlwaysOnTop(); 215 216 // Fix for 4868278. 217 // If we create a window with a specific GraphicsConfig, and then move it with 218 // setLocation() or setBounds() to another one before its peer has been created, 219 // then calling Window.getGraphicsConfig() returns wrong config. That may lead 220 // to some problems like wrong-placed tooltips. It is caused by calling 221 // super.displayChanged() in WWindowPeer.displayChanged() regardless of whether 222 // GraphicsDevice was really changed, or not. So we need to track it here. | 182 183 Shape shape = ((Window)target).getShape(); 184 if (shape != null) { 185 applyShape(Region.getInstance(shape, null)); 186 } 187 188 float opacity = ((Window)target).getOpacity(); 189 if (opacity < 1.0f) { 190 setOpacity(opacity); 191 } 192 193 synchronized (getStateLock()) { 194 // default value of a boolean field is 'false', so set isOpaque to 195 // true here explicitly 196 this.isOpaque = true; 197 setOpaque(((Window)target).isOpaque()); 198 } 199 } 200 201 native void createAwtWindow(WComponentPeer parent); 202 203 private volatile Window.Type windowType = Window.Type.NORMAL; 204 205 // This method must be called for Window, Dialog, and Frame before creating 206 // the hwnd 207 void preCreate(WComponentPeer parent) { 208 windowType = ((Window)target).getType(); 209 } 210 211 void create(WComponentPeer parent) { 212 preCreate(parent); 213 createAwtWindow(parent); 214 } 215 216 // should be overriden in WDialogPeer 217 protected void realShow() { 218 super.show(); 219 } 220 221 public void show() { 222 updateFocusableWindowState(); 223 224 boolean alwaysOnTop = ((Window)target).isAlwaysOnTop(); 225 226 // Fix for 4868278. 227 // If we create a window with a specific GraphicsConfig, and then move it with 228 // setLocation() or setBounds() to another one before its peer has been created, 229 // then calling Window.getGraphicsConfig() returns wrong config. That may lead 230 // to some problems like wrong-placed tooltips. It is caused by calling 231 // super.displayChanged() in WWindowPeer.displayChanged() regardless of whether 232 // GraphicsDevice was really changed, or not. So we need to track it here. |