Component
, TextGUIElement
GUIBackdrop
public class EmptySpace extends AbstractComponent<EmptySpace>
Constructor | Description |
---|---|
EmptySpace() |
Creates an EmptySpace with size 1x1 and a default color chosen from the theme
|
EmptySpace(TerminalSize size) |
Creates an EmptySpace with a specified preferred size (color will be chosen from the theme)
|
EmptySpace(TextColor color) |
Creates an EmptySpace with a specified color and preferred size of 1x1
|
EmptySpace(TextColor color,
TerminalSize size) |
Creates an EmptySpace with a specified color (null will make it use a color from the theme) and preferred size
|
Modifier and Type | Method | Description |
---|---|---|
protected ComponentRenderer<EmptySpace> |
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).
|
TextColor |
getColor() |
Returns the color this component is drawn with, or
null if this component uses whatever the default color
the theme is set to use |
void |
setColor(TextColor color) |
Changes the color this component will use when drawn
|
addTo, calculatePreferredSize, draw, getBasePane, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, isInvalid, onAdded, onAfterDrawing, onBeforeDrawing, onRemoved, runOnGUIThreadIfExistsOtherwiseRunDirect, self, setLayoutData, setPosition, setPreferredSize, setRenderer, setSize, setTheme, toBasePane, toGlobal, withBorder
public EmptySpace()
public EmptySpace(TextColor color)
color
- Color to use (null will make it use the theme)public EmptySpace(TerminalSize size)
size
- Preferred sizepublic EmptySpace(TextColor color, TerminalSize size)
color
- Color to use (null will make it use the theme)size
- Preferred sizepublic void setColor(TextColor color)
color
- New color to draw the component with, if null
then the component will use the theme's
default colorpublic TextColor getColor()
null
if this component uses whatever the default color
the theme is set to usenull
if it's using the themeprotected ComponentRenderer<EmptySpace> createDefaultRenderer()
AbstractComponent
createDefaultRenderer
in class AbstractComponent<EmptySpace>
Copyright © 2020. All rights reserved.