java.lang.Object
com.googlecode.lanterna.graphics.TextGraphicsWriter
- All Implemented Interfaces:
StyleSet<TextGraphicsWriter>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.googlecode.lanterna.graphics.StyleSet
StyleSet.Set
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TextGraphics
private TextColor
private final List
<TextGraphicsWriter.WordPart> private TerminalPosition
private TextColor
private boolean
private WrapBehaviour
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRemoves all active modifiersdisableModifiers
(SGR... modifiers) Removes zero or more modifiers from the set of currently active modifiersenableModifiers
(SGR... modifiers) Adds zero or more modifiers to the set of currently active modifiersprivate void
flush
(StringBuilder word, int wordlen) Returns all the SGR codes that are currently activeReturns the current background colorReturns the current foreground colorboolean
private void
linefeed
(int lenToFit) void
putControlChar
(char ch) setBackgroundColor
(TextColor background) Updates the current background colorvoid
setCursorPosition
(TerminalPosition cursorPosition) setForegroundColor
(TextColor foreground) Updates the current foreground colorsetModifiers
(EnumSet<SGR> modifiers) Sets the active modifiers to exactly the set passed in to this method.void
setStyleable
(boolean styleable) setStyleFrom
(StyleSet<?> source) copy colors and set of SGR codesvoid
setWrapBehaviour
(WrapBehaviour wrapBehaviour) private void
stash
(StringBuilder word, int wordlen)
-
Field Details
-
backend
-
cursorPosition
-
foregroundColor
-
backgroundColor
-
style
-
wrapBehaviour
-
styleable
private boolean styleable -
chunk_queue
-
-
Constructor Details
-
TextGraphicsWriter
-
-
Method Details
-
putString
-
linefeed
private void linefeed(int lenToFit) -
putControlChar
public void putControlChar(char ch) -
stash
-
flush
-
getCursorPosition
- Returns:
- the cursor position
-
setCursorPosition
- Parameters:
cursorPosition
- the cursor position to set
-
getForegroundColor
Description copied from interface:StyleSet
Returns the current foreground color- Specified by:
getForegroundColor
in interfaceStyleSet<TextGraphicsWriter>
- Returns:
- the foreground color
-
setForegroundColor
Description copied from interface:StyleSet
Updates the current foreground color- Specified by:
setForegroundColor
in interfaceStyleSet<TextGraphicsWriter>
- Parameters:
foreground
- the foreground color to set- Returns:
- Itself
-
getBackgroundColor
Description copied from interface:StyleSet
Returns the current background color- Specified by:
getBackgroundColor
in interfaceStyleSet<TextGraphicsWriter>
- Returns:
- the background color
-
setBackgroundColor
Description copied from interface:StyleSet
Updates the current background color- Specified by:
setBackgroundColor
in interfaceStyleSet<TextGraphicsWriter>
- Parameters:
background
- the background color to set- Returns:
- Itself
-
enableModifiers
Description copied from interface:StyleSet
Adds zero or more modifiers to the set of currently active modifiers- Specified by:
enableModifiers
in interfaceStyleSet<TextGraphicsWriter>
- Parameters:
modifiers
- Modifiers to add to the set of currently active modifiers- Returns:
- Itself
-
disableModifiers
Description copied from interface:StyleSet
Removes zero or more modifiers from the set of currently active modifiers- Specified by:
disableModifiers
in interfaceStyleSet<TextGraphicsWriter>
- Parameters:
modifiers
- Modifiers to remove from the set of currently active modifiers- Returns:
- Itself
-
setModifiers
Description copied from interface:StyleSet
Sets the active modifiers to exactly the set passed in to this method. Any previous state of which modifiers are enabled doesn't matter.- Specified by:
setModifiers
in interfaceStyleSet<TextGraphicsWriter>
- Parameters:
modifiers
- Modifiers to set as active- Returns:
- Itself
-
clearModifiers
Description copied from interface:StyleSet
Removes all active modifiers- Specified by:
clearModifiers
in interfaceStyleSet<TextGraphicsWriter>
- Returns:
- Itself
-
getActiveModifiers
Description copied from interface:StyleSet
Returns all the SGR codes that are currently active- Specified by:
getActiveModifiers
in interfaceStyleSet<TextGraphicsWriter>
- Returns:
- Currently active SGR modifiers
-
setStyleFrom
Description copied from interface:StyleSet
copy colors and set of SGR codes- Specified by:
setStyleFrom
in interfaceStyleSet<TextGraphicsWriter>
- Parameters:
source
- Modifiers to set as active- Returns:
- Itself
-
getWrapBehaviour
- Returns:
- the wrapBehaviour
-
setWrapBehaviour
- Parameters:
wrapBehaviour
- the wrapBehaviour to set
-
isStyleable
public boolean isStyleable()- Returns:
- whether styles in strings are handled.
-
setStyleable
public void setStyleable(boolean styleable) - Parameters:
styleable
- whether styles in strings should be handled.
-