ComponentRenderer<Panel>
public class Panel.DefaultPanelRenderer extends Object implements ComponentRenderer<Panel>
Constructor | Description |
---|---|
DefaultPanelRenderer() |
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?
|
void |
setFillAreaBeforeDrawingComponents(boolean fillAreaBeforeDrawingComponents) |
If setting this to
false (default is true ), the Panel will not reset it's drawable
area with the space character ' ' before drawing all the components. |
public void setFillAreaBeforeDrawingComponents(boolean fillAreaBeforeDrawingComponents)
false
(default is true
), the Panel
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 the FullScreenTextGUITest
.fillAreaBeforeDrawingComponents
- Should the panels area be cleared before drawing components?public TerminalSize getPreferredSize(Panel component)
ComponentRenderer
getPreferredSize
in interface ComponentRenderer<Panel>
component
- Component to calculate the preferred size ofpublic void drawComponent(TextGUIGraphics graphics, Panel panel)
ComponentRenderer
drawComponent
in interface ComponentRenderer<Panel>
graphics
- Graphics object to use for drawingpanel
- Component to drawCopyright © 2020. All rights reserved.