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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
drawComponent
(TextGUIGraphics graphics, Panel panel) Using the supplied graphics object, draws the component passed in.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.
-
Field Details
-
fillAreaBeforeDrawingComponents
private boolean fillAreaBeforeDrawingComponents
-
-
Constructor Details
-
DefaultPanelRenderer
public DefaultPanelRenderer()
-
-
Method Details
-
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
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
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
-