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.BorderStyle
borderStyle
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBorderRenderer(Borders.BorderStyle borderStyle)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
drawComponent(TextGUIGraphics graphics, Border component)
Using the supplied graphics object, draws the component passed in.protected abstract char
getBottomLeftCorner(Theme theme)
protected abstract char
getBottomRightCorner(Theme theme)
protected abstract char
getHorizontalLine(Theme theme)
TerminalSize
getPreferredSize(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 char
getTitleLeft(Theme theme)
protected abstract char
getTitleRight(Theme theme)
protected abstract char
getTopLeftCorner(Theme theme)
protected abstract char
getTopRightCorner(Theme theme)
protected abstract char
getVerticalLine(Theme theme)
TerminalSize
getWrappedComponentSize(TerminalSize borderSize)
Given a total size of the border composite and it's wrapped component, how large would the actual wrapped component be?TerminalPosition
getWrappedComponentTopLeftOffset()
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: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<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.BorderRenderer
How large is the offset from the top left corner of the border to the top left corner of the wrapped component?- Specified by:
getWrappedComponentTopLeftOffset
in 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.BorderRenderer
Given a total size of the border composite and it's wrapped component, how large would the actual wrapped component be?- Specified by:
getWrappedComponentSize
in 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:ComponentRenderer
Using the supplied graphics object, draws the component passed in.- Specified by:
drawComponent
in 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)
-
-