public class CenterWindowStrategy extends java.lang.Object implements WindowPlacementStrategyI
Constructor and Description |
---|
CenterWindowStrategy(java.awt.Point center,
java.awt.Dimension explicitMaxSize,
boolean maximize) |
Modifier and Type | Method and Description |
---|---|
java.awt.Rectangle |
calculateBounds(AbstractClientDesktopElement window) |
static CenterWindowStrategy |
of(javax.swing.JFrame parentFrame,
boolean maximize) |
static CenterWindowStrategy |
of(java.awt.Rectangle parentBounds,
int maximumInitialWindowWidth,
boolean maximize) |
boolean |
wantsMaximum() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCDEInsets, assertPointInRectangle, getPreferredInitialSize
public CenterWindowStrategy(java.awt.Point center, java.awt.Dimension explicitMaxSize, boolean maximize)
center
- the point in screenspace where the center of the window should be located at, nonnull.explicitMaxSize
- nullable dimension with explicit size restrictions. Negative values are ignored.maximize
- if true, then the window should be maximized afterwardspublic static CenterWindowStrategy of(java.awt.Rectangle parentBounds, int maximumInitialWindowWidth, boolean maximize)
parentBounds
- the rectangle the new window should be centered at. Nonnull.maximumInitialWindowWidth
- allows to further restrict the usable width of the new window (if larger than 0).maximize
- if true, then the window should be maximized after openingpublic static CenterWindowStrategy of(javax.swing.JFrame parentFrame, boolean maximize)
public java.awt.Rectangle calculateBounds(AbstractClientDesktopElement window)
calculateBounds
in interface WindowPlacementStrategyI
public boolean wantsMaximum()
wantsMaximum
in interface WindowPlacementStrategyI
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.