Class Panel.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 to false (default is true), the Panel will not reset it's drawable area with the space character ' ' before drawing all the components.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fillAreaBeforeDrawingComponents

        private boolean fillAreaBeforeDrawingComponents
    • Constructor Detail

      • DefaultPanelRenderer

        public DefaultPanelRenderer()
    • Method Detail

      • 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