<Swing Dev> Review Request for 7126823 : JInternalFrame.getNormalBounds() returns bad value after iconify/deiconify
Prem Balakrishnan
prem.balakrishnan at oracle.com
Tue Feb 9 09:09:32 UTC 2016
Hi,
Please review fix for JDK9,
Bug: https://bugs.openjdk.java.net/browse/JDK-7126823
Webrev: http://cr.openjdk.java.net/~arapte/prem/7126823/webrev.00/
Issue:
JInternalFrame.getNormalBounds() returns bad value after iconify/deiconify
Cause:
Regression: due to 4424247: DefaultDesktopManager does not handle InternalFrame state changes as expected.
https://bugs.openjdk.java.net/browse/JDK-4424247 related to https://bugs.openjdk.java.net/browse/JDK-4900778
Fix:
DefaultDesktopManager.java
setNormalBounds(getBounds()); call removed from iconifyFrame(JInternalFrame f) method.
Justification:
This fix is not breaking any of the previous fix i.e., related to 4424247 and 4900778.
(all previous scenarios are tested and validated with the current fix)
In JInternalFrame.java
getNormalBounds() returns getBounds() when normalBounds is NULL,
Hence no need to setNormaBounds externally.
public Rectangle getNormalBounds() {
/* we used to test (!isMaximum) here, but since this
method is used by the property listener for the
IS_MAXIMUM_PROPERTY, it ended up getting the wrong
answer... Since normalBounds get set to null when the
frame is restored, this should work better */
if (normalBounds != null) {
return normalBounds;
} else {
return getBounds();
}
}
As per Javadoc:
public Rectangle getNormalBounds()
If the JInternalFrame is not in maximized state, returns getBounds(); otherwise, returns the bounds that the JInternalFrame would be restored to.
In maximizeFrame() , normalBounds is set to a value which is not NULL, i.e., setNormalBounds(getBounds());
In minimizeFrame(), normalBounds is set to NULL, i.e., setNormalBounds(null);
NormalBounds should NOT be set elsewhere.
Test:
Integrated test for current bug and regression.
Regards,
Prem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20160209/3a3942b3/attachment.html>
More information about the swing-dev
mailing list