Module com.googlecode.lanterna
Package com.googlecode.lanterna.gui2
Class DefaultWindowDecorationRenderer
- java.lang.Object
-
- com.googlecode.lanterna.gui2.DefaultWindowDecorationRenderer
-
- All Implemented Interfaces:
WindowDecorationRenderer
public class DefaultWindowDecorationRenderer extends java.lang.Object implements WindowDecorationRenderer
Default window decoration renderer that is used unless overridden with another decoration renderer. The windows are drawn using a bevel colored line and the window title in the top-left corner, very similar to ordinary titled borders.
-
-
Field Summary
Fields Modifier and Type Field Description private static TerminalPosition
OFFSET
private static int
TITLE_POSITION_WITH_PADDING
private static int
TITLE_POSITION_WITHOUT_PADDING
-
Constructor Summary
Constructors Constructor Description DefaultWindowDecorationRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextGUIGraphics
draw(WindowBasedTextGUI textGUI, TextGUIGraphics graphics, Window window)
Draws the window decorations for a particular window and returns a new TextGraphics that is locked to the area inside of the window decorations where the content of the window should be drawnTerminalSize
getDecoratedSize(Window window, TerminalSize contentAreaSize)
Retrieves the full size of the window, including all window decorations, given all components inside the window.TerminalPosition
getOffset(Window window)
Returns how much to step right and down from the top left position of the window decorations to the top left position of the actual window-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.googlecode.lanterna.gui2.WindowDecorationRenderer
getTitleBarRectangle
-
-
-
-
Field Detail
-
TITLE_POSITION_WITH_PADDING
private static final int TITLE_POSITION_WITH_PADDING
- See Also:
- Constant Field Values
-
TITLE_POSITION_WITHOUT_PADDING
private static final int TITLE_POSITION_WITHOUT_PADDING
- See Also:
- Constant Field Values
-
OFFSET
private static final TerminalPosition OFFSET
-
-
Method Detail
-
draw
public TextGUIGraphics draw(WindowBasedTextGUI textGUI, TextGUIGraphics graphics, Window window)
Description copied from interface:WindowDecorationRenderer
Draws the window decorations for a particular window and returns a new TextGraphics that is locked to the area inside of the window decorations where the content of the window should be drawn- Specified by:
draw
in interfaceWindowDecorationRenderer
- Parameters:
textGUI
- Which TextGUI is callinggraphics
- Graphics to use for drawingwindow
- Window to draw- Returns:
- A new TextGraphics that is limited to the area inside the decorations just drawn
-
getDecoratedSize
public TerminalSize getDecoratedSize(Window window, TerminalSize contentAreaSize)
Description copied from interface:WindowDecorationRenderer
Retrieves the full size of the window, including all window decorations, given all components inside the window.- Specified by:
getDecoratedSize
in interfaceWindowDecorationRenderer
- Parameters:
window
- Window to calculate size forcontentAreaSize
- Size of the content area in the window- Returns:
- Full size of the window, including decorations
-
getOffset
public TerminalPosition getOffset(Window window)
Description copied from interface:WindowDecorationRenderer
Returns how much to step right and down from the top left position of the window decorations to the top left position of the actual window- Specified by:
getOffset
in interfaceWindowDecorationRenderer
- Parameters:
window
- Window to get the offset for- Returns:
- Position of the top left corner of the window, relative to the top left corner of the window decoration
-
-