public class WindowLayout extends java.lang.Object implements LayoutManager<GuiOutputManager>
Modifier and Type | Field and Description |
---|---|
private boolean |
decorated
Flag indicating if the window has decorations.
|
private GuiDriver<?,?> |
gd
Cached GUI driver.
|
private static NativePoint |
lastDesktopMinimizedLocation
Last desktop minimized location
|
private NativeDimension |
maxSize
Maximum window size.
|
static int |
MIN_HEIGHT_PIXELS
Minimal window height.
|
static int |
MIN_SLOT_WIDTH |
static int |
MIN_SLOTS_TOTAL |
static int |
MIN_WIDTH_PIXELS
Minimal window width.
|
Constructor and Description |
---|
WindowLayout() |
Modifier and Type | Method and Description |
---|---|
void |
doLayout(Container<GuiOutputManager> container)
Place components in specified container.
|
private int |
getSlotsPerRow(WindowGuiImpl wnd)
Calculates the number of "slots" that fit the width of the screen.
|
private void |
layoutMinimized(WindowGuiImpl window)
Layouts a desktop-minimized top-level window.
|
private void |
layoutRegular(GuiWindow window)
Layouts a top-level gui window.
|
Dimension |
minimumSize(Container<GuiOutputManager> container)
Get the minimum size of the specified container.
|
void |
setDecorated(boolean decorated)
Set the
decorated flag. |
void |
setMaxSize(int width,
int height)
Sets maximum window size.
|
private void |
setMinimizedLocation(WindowGuiImpl wnd)
The method calculates a default window desktop-minimized location based on the location
of previously desktop-minimized window.
|
public static final int MIN_WIDTH_PIXELS
public static final int MIN_HEIGHT_PIXELS
public static final int MIN_SLOT_WIDTH
public static final int MIN_SLOTS_TOTAL
private static NativePoint lastDesktopMinimizedLocation
private GuiDriver<?,?> gd
private NativeDimension maxSize
private boolean decorated
public void setMaxSize(int width, int height)
width
- Maximum window width.height
- Maximum window height.public Dimension minimumSize(Container<GuiOutputManager> container)
minimumSize
in interface LayoutManager<GuiOutputManager>
container
- The container.null
.public void setDecorated(boolean decorated)
decorated
flag.decorated
- The window's decorated state.public void doLayout(Container<GuiOutputManager> container)
doLayout
in interface LayoutManager<GuiOutputManager>
container
- Container to process - must be a window.private void layoutRegular(GuiWindow window)
window
- The window to layout.private void layoutMinimized(WindowGuiImpl window)
window
- The window to layout.private void setMinimizedLocation(WindowGuiImpl wnd)
private int getSlotsPerRow(WindowGuiImpl wnd)
wnd
- A window reference.