Module com.googlecode.lanterna
Package com.googlecode.lanterna.gui2
Class ProgressBar.DefaultProgressBarRenderer
java.lang.Object
com.googlecode.lanterna.gui2.ProgressBar.DefaultProgressBarRenderer
- All Implemented Interfaces:
ComponentRenderer<ProgressBar>
- Enclosing class:
ProgressBar
public static class ProgressBar.DefaultProgressBarRenderer
extends Object
implements ComponentRenderer<ProgressBar>
Default implementation of the progress bar GUI component renderer. This renderer will draw the progress bar
on a single line and gradually fill up the space with a different color as the progress is increasing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
drawComponent
(TextGUIGraphics graphics, ProgressBar component) Using the supplied graphics object, draws the component passed in.getPreferredSize
(ProgressBar 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.
-
Constructor Details
-
DefaultProgressBarRenderer
public DefaultProgressBarRenderer()
-
-
Method Details
-
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<ProgressBar>
- 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<ProgressBar>
- Parameters:
graphics
- Graphics object to use for drawingcomponent
- Component to draw
-