<AWT Dev> [9] setMaximumSize() and setMaximizedBounds()
Artem Ananiev
artem.ananiev at oracle.com
Thu Dec 19 03:58:38 PST 2013
On 12/19/2013 2:46 PM, Alexander Zvegintsev wrote:
> Hello AWT team,
>
> I am currently looking at JDK-6464548 issue[1], and as you can see in
> javadoc[2]
> we have only setMinimumSize() implemented in java.awt.Window and
> setMaximumSize() is not implemented.
>
> So my question is about how setMaximumSize() (and setMinimumSize())
> should interfere with setMaximizedBounds()[3]?
>
> I see several options here:
>
> 1. setMaximizedBounds() refers to a different state and does not depend
> on setMaximumSize() and setMinimumSize()
> 2. setMaximizedBounds() respects setMaximumSize() and setMinimumSize().
> If the window is maximized and maximized
> bounds does not conform with maximum or minimum size then window will
> shrunk or enlarge to honor these sizes.
> 3. If maximum size is set then we deny window maximize operation and
> setMaximizedBounds() have no effect.
>
> What do you think?
I would vote for #2 or #3. #3 seems to be slightly better than #2,
because to implement #2 we'll need to track, what was called first,
setMaximumSize() or setMaximizedBounds(). Another problem is that if we
restrict the maximized bounds to conform to minimum/maximum size, when a
window is maximized it won't occupy the right place as requested by the
application. In other words, I think that in case #2 maximized bounds
feature is broken anyway, so it doesn't make sense to allow window
maximization at all (which is exactly #3).
Thanks,
Artem
> [1] https://bugs.openjdk.java.net/browse/JDK-6464548
> [2]
> http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#setMinimumSize(java.awt.Dimension)
>
> [3]
> http://docs.oracle.com/javase/7/docs/api/java/awt/Frame.html#setMaximizedBounds(java.awt.Rectangle)
>
>
>
More information about the awt-dev
mailing list