Module com.googlecode.lanterna
Package com.googlecode.lanterna.gui2
Class Borders.AbstractBorderRenderer
- java.lang.Object
-
- com.googlecode.lanterna.gui2.Borders.AbstractBorderRenderer
-
- All Implemented Interfaces:
Border.BorderRenderer,ComponentRenderer<Border>
- Direct Known Subclasses:
Borders.DoubleLineRenderer,Borders.SingleLineRenderer
- Enclosing class:
- Borders
private abstract static class Borders.AbstractBorderRenderer extends java.lang.Object implements Border.BorderRenderer
-
-
Field Summary
Fields Modifier and Type Field Description private Borders.BorderStyleborderStyle
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBorderRenderer(Borders.BorderStyle borderStyle)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddrawComponent(TextGUIGraphics graphics, Border component)Using the supplied graphics object, draws the component passed in.protected abstract chargetBottomLeftCorner(Theme theme)protected abstract chargetBottomRightCorner(Theme theme)protected abstract chargetHorizontalLine(Theme theme)TerminalSizegetPreferredSize(Border 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.protected abstract chargetTitleLeft(Theme theme)protected abstract chargetTitleRight(Theme theme)protected abstract chargetTopLeftCorner(Theme theme)protected abstract chargetTopRightCorner(Theme theme)protected abstract chargetVerticalLine(Theme theme)TerminalSizegetWrappedComponentSize(TerminalSize borderSize)Given a total size of the border composite and it's wrapped component, how large would the actual wrapped component be?TerminalPositiongetWrappedComponentTopLeftOffset()How large is the offset from the top left corner of the border to the top left corner of the wrapped component?
-
-
-
Field Detail
-
borderStyle
private final Borders.BorderStyle borderStyle
-
-
Constructor Detail
-
AbstractBorderRenderer
protected AbstractBorderRenderer(Borders.BorderStyle borderStyle)
-
-
Method Detail
-
getPreferredSize
public TerminalSize getPreferredSize(Border component)
Description copied from interface:ComponentRendererGiven 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:
getPreferredSizein interfaceComponentRenderer<Border>- Parameters:
component- Component to calculate the preferred size of- Returns:
- The size this renderer would like the component to take up
-
getWrappedComponentTopLeftOffset
public TerminalPosition getWrappedComponentTopLeftOffset()
Description copied from interface:Border.BorderRendererHow large is the offset from the top left corner of the border to the top left corner of the wrapped component?- Specified by:
getWrappedComponentTopLeftOffsetin interfaceBorder.BorderRenderer- Returns:
- Position of the wrapped components top left position, relative to the top left corner of the border
-
getWrappedComponentSize
public TerminalSize getWrappedComponentSize(TerminalSize borderSize)
Description copied from interface:Border.BorderRendererGiven a total size of the border composite and it's wrapped component, how large would the actual wrapped component be?- Specified by:
getWrappedComponentSizein interfaceBorder.BorderRenderer- Parameters:
borderSize- Size to calculate for, this should be the total size of the border and the inner component- Returns:
- Size of the inner component if the total size of inner + border is borderSize
-
drawComponent
public void drawComponent(TextGUIGraphics graphics, Border component)
Description copied from interface:ComponentRendererUsing the supplied graphics object, draws the component passed in.- Specified by:
drawComponentin interfaceComponentRenderer<Border>- Parameters:
graphics- Graphics object to use for drawingcomponent- Component to draw
-
getHorizontalLine
protected abstract char getHorizontalLine(Theme theme)
-
getVerticalLine
protected abstract char getVerticalLine(Theme theme)
-
getBottomLeftCorner
protected abstract char getBottomLeftCorner(Theme theme)
-
getTopLeftCorner
protected abstract char getTopLeftCorner(Theme theme)
-
getBottomRightCorner
protected abstract char getBottomRightCorner(Theme theme)
-
getTopRightCorner
protected abstract char getTopRightCorner(Theme theme)
-
getTitleLeft
protected abstract char getTitleLeft(Theme theme)
-
getTitleRight
protected abstract char getTitleRight(Theme theme)
-
-