< prev index next >
src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
Print this page
*** 49,58 ****
--- 49,60 ----
private native long nativeCreateNSWindow(long nsViewPtr,long ownerPtr, long styleBits, double x, double y, double w, double h);
private static native void nativeSetNSWindowStyleBits(long nsWindowPtr, int mask, int data);
private static native void nativeSetNSWindowMenuBar(long nsWindowPtr, long menuBarPtr);
private static native Insets nativeGetNSWindowInsets(long nsWindowPtr);
private static native void nativeSetNSWindowBounds(long nsWindowPtr, double x, double y, double w, double h);
+ private static native void nativeSetNSWindowStandardFrame(long nsWindowPtr,
+ double x, double y, double w, double h);
private static native void nativeSetNSWindowMinMax(long nsWindowPtr, double minW, double minH, double maxW, double maxH);
private static native void nativePushNSWindowToBack(long nsWindowPtr);
private static native void nativePushNSWindowToFront(long nsWindowPtr);
private static native void nativeSetNSWindowTitle(long nsWindowPtr, String title);
private static native void nativeRevalidateNSWindowShadow(long nsWindowPtr);
*** 244,253 ****
--- 246,263 ----
}
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height);
setPtr(nativeWindowPtr);
+ _peer.setMaximizedBounds(_peer.getMaximizedBounds());
+ if (_target instanceof Frame) {
+ Frame frame = (Frame) _target;
+ if (frame.getExtendedState() == Frame.MAXIMIZED_BOTH) {
+ maximize();
+ }
+ }
+
if (target instanceof javax.swing.RootPaneContainer) {
final javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane();
if (rootpane != null) rootpane.addPropertyChangeListener("ancestor", new PropertyChangeListener() {
public void propertyChange(final PropertyChangeEvent evt) {
CLIENT_PROPERTY_APPLICATOR.attachAndApplyClientProperties(rootpane);
*** 472,481 ****
--- 482,495 ----
@Override // PlatformWindow
public void setBounds(int x, int y, int w, int h) {
nativeSetNSWindowBounds(getNSWindowPtr(), x, y, w, h);
}
+ public void setMaximizedBounds(int x, int y, int w, int h) {
+ nativeSetNSWindowStandardFrame(getNSWindowPtr(), x, y, w, h);
+ }
+
private boolean isMaximized() {
return undecorated ? this.normalBounds != null
: CWrapper.NSWindow.isZoomed(getNSWindowPtr());
}
*** 981,999 ****
peer.notifyZoom(isZoomed);
}
}
private void checkZoom() {
! if (target instanceof Frame && isVisible()) {
! Frame targetFrame = (Frame)target;
! if (targetFrame.getExtendedState() != Frame.MAXIMIZED_BOTH && isMaximized()) {
deliverZoom(true);
! } else if (targetFrame.getExtendedState() == Frame.MAXIMIZED_BOTH && !isMaximized()) {
deliverZoom(false);
}
}
- }
private void deliverNCMouseDown() {
if (peer != null) {
peer.notifyNCMouseDown();
}
--- 995,1011 ----
peer.notifyZoom(isZoomed);
}
}
private void checkZoom() {
! int state = peer.getState();
! if (state != Frame.MAXIMIZED_BOTH && isMaximized()) {
deliverZoom(true);
! } else if (state == Frame.MAXIMIZED_BOTH && !isMaximized()) {
deliverZoom(false);
}
}
private void deliverNCMouseDown() {
if (peer != null) {
peer.notifyNCMouseDown();
}
< prev index next >