Module com.googlecode.lanterna
Package com.googlecode.lanterna.gui2
Class Panel.DefaultPanelRenderer
- java.lang.Object
-
- com.googlecode.lanterna.gui2.Panel.DefaultPanelRenderer
-
- All Implemented Interfaces:
ComponentRenderer<Panel>
- Enclosing class:
- Panel
public class Panel.DefaultPanelRenderer extends java.lang.Object implements ComponentRenderer<Panel>
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
fillAreaBeforeDrawingComponents
-
Constructor Summary
Constructors Constructor Description DefaultPanelRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawComponent(TextGUIGraphics graphics, Panel panel)
Using the supplied graphics object, draws the component passed in.TerminalSize
getPreferredSize(Panel component)
Given the supplied component, how large does this renderer want the component to be? Notice that this is the responsibility of the renderer and not the component itself, since the component has no idea what its visual representation looks like.void
setFillAreaBeforeDrawingComponents(boolean fillAreaBeforeDrawingComponents)
If setting this tofalse
(default istrue
), thePanel
will not reset it's drawable area with the space character ' ' before drawing all the components.
-
-
-
Method Detail
-
setFillAreaBeforeDrawingComponents
public void setFillAreaBeforeDrawingComponents(boolean fillAreaBeforeDrawingComponents)
If setting this tofalse
(default istrue
), thePanel
will not reset it's drawable area with the space character ' ' before drawing all the components. Usually you do want to reset this area before drawing but you might have a custom renderer that has prepared the area already and just want the panel renderer to layout and draw the components in the panel without touching the existing content. One such example is theFullScreenTextGUITest
.- Parameters:
fillAreaBeforeDrawingComponents
- Should the panels area be cleared before drawing components?
-
getPreferredSize
public TerminalSize getPreferredSize(Panel component)
Description copied from interface:ComponentRenderer
Given the supplied component, how large does this renderer want the component to be? Notice that this is the responsibility of the renderer and not the component itself, since the component has no idea what its visual representation looks like.- Specified by:
getPreferredSize
in interfaceComponentRenderer<Panel>
- Parameters:
component
- Component to calculate the preferred size of- Returns:
- The size this renderer would like the component to take up
-
drawComponent
public void drawComponent(TextGUIGraphics graphics, Panel panel)
Description copied from interface:ComponentRenderer
Using the supplied graphics object, draws the component passed in.- Specified by:
drawComponent
in interfaceComponentRenderer<Panel>
- Parameters:
graphics
- Graphics object to use for drawingpanel
- Component to draw
-
-