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 Object implements ComponentRenderer<Panel>
  • Field Details

    • fillAreaBeforeDrawingComponents

      private boolean fillAreaBeforeDrawingComponents
  • Constructor Details

    • DefaultPanelRenderer

      public DefaultPanelRenderer()
  • Method Details

    • setFillAreaBeforeDrawingComponents

      public 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. 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.
      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 interface ComponentRenderer<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 interface ComponentRenderer<Panel>
      Parameters:
      graphics - Graphics object to use for drawing
      panel - Component to draw