- java.lang.Object
-
- com.googlecode.lanterna.gui2.AbstractComponent<Separator>
-
- com.googlecode.lanterna.gui2.Separator
-
- All Implemented Interfaces:
Component
,TextGUIElement
public class Separator extends AbstractComponent<Separator>
Static non-interactive component that is typically rendered as a single line. Normally this component is used to separate component from each other in situations where a bordered panel isn't ideal. By default the separator will ask for a size of 1x1 so you'll need to make it bigger, either through the layout manager or by overriding the preferred size.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Separator.DefaultSeparatorRenderer
This is the default separator renderer that is used if you don't override anything.static class
Separator.SeparatorRenderer
Helper interface that doesn't add any new methods but makes coding new button renderers a little bit more clear
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Separator.DefaultSeparatorRenderer
createDefaultRenderer()
When you create a custom component, you need to implement this method and return a Renderer which is responsible for taking care of sizing the component, rendering it and choosing where to place the cursor (if Interactable).Direction
getDirection()
Returns the direction of the line drawn for this separator-
Methods inherited from class com.googlecode.lanterna.gui2.AbstractComponent
addTo, calculatePreferredSize, draw, getBasePane, getGlobalPosition, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, isInvalid, isVisible, onAdded, onAfterDrawing, onBeforeDrawing, onRemoved, runOnGUIThreadIfExistsOtherwiseRunDirect, self, setLayoutData, setPosition, setPreferredSize, setRenderer, setSize, setTheme, setVisible, toBasePane, toGlobal, withBorder
-
-
-
-
Field Detail
-
direction
private final Direction direction
-
-
Constructor Detail
-
Separator
public Separator(Direction direction)
Creates a newSeparator
for a specific direction, which will decide whether to draw a horizontal line or a vertical line- Parameters:
direction
- Direction of the line to draw within the separator
-
-
Method Detail
-
getDirection
public Direction getDirection()
Returns the direction of the line drawn for this separator- Returns:
- Direction of the line drawn for this separator
-
createDefaultRenderer
protected Separator.DefaultSeparatorRenderer createDefaultRenderer()
Description copied from class:AbstractComponent
When you create a custom component, you need to implement this method and return a Renderer which is responsible for taking care of sizing the component, rendering it and choosing where to place the cursor (if Interactable). This value is intended to be overridden by custom themes.- Specified by:
createDefaultRenderer
in classAbstractComponent<Separator>
- Returns:
- Renderer to use when sizing and drawing this component
-
-