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.
|
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. |
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 GuiDriver<?,?> gd
private boolean decorated
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)
wnd
- The subjected window.private int getSlotsPerRow(WindowGuiImpl wnd)
wnd
- A window reference.