public class TextCharacter extends Object
Modifier and Type | Field and Description |
---|---|
static TextCharacter |
DEFAULT_CHARACTER |
Constructor and Description |
---|
TextCharacter(char character)
Creates a
ScreenCharacter based on a supplied character, with default colors and no extra modifiers. |
TextCharacter(char character,
TextColor foregroundColor,
TextColor backgroundColor,
EnumSet<SGR> modifiers)
Creates a new
ScreenCharacter based on a physical character, color information and a set of modifiers. |
TextCharacter(char character,
TextColor foregroundColor,
TextColor backgroundColor,
SGR... styles)
Creates a new
ScreenCharacter based on a physical character, color information and optional modifiers. |
TextCharacter(TextCharacter character)
Copies another
ScreenCharacter |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
TextColor |
getBackgroundColor()
Background color specified for this TextCharacter
|
char |
getCharacter()
The actual character this TextCharacter represents
|
TextColor |
getForegroundColor()
Foreground color specified for this TextCharacter
|
EnumSet<SGR> |
getModifiers()
Returns a set of all active modifiers on this TextCharacter
|
int |
hashCode() |
boolean |
isBlinking()
Returns true if this TextCharacter has the blink modifier active
|
boolean |
isBold()
Returns true if this TextCharacter has the bold modifier active
|
boolean |
isBordered()
Returns true if this TextCharacter has the bordered modifier active
|
boolean |
isCrossedOut()
Returns true if this TextCharacter has the crossed-out modifier active
|
boolean |
isReversed()
Returns true if this TextCharacter has the reverse modifier active
|
boolean |
isUnderlined()
Returns true if this TextCharacter has the underline modifier active
|
String |
toString() |
TextCharacter |
withBackgroundColor(TextColor backgroundColor)
Returns a copy of this TextCharacter with a specified background color
|
TextCharacter |
withCharacter(char character)
Returns a new TextCharacter with the same colors and modifiers but a different underlying character
|
TextCharacter |
withForegroundColor(TextColor foregroundColor)
Returns a copy of this TextCharacter with a specified foreground color
|
TextCharacter |
withModifier(SGR modifier)
Returns a copy of this TextCharacter with an additional SGR modifier.
|
TextCharacter |
withModifiers(Collection<SGR> modifiers)
Returns a copy of this TextCharacter with specified list of SGR modifiers.
|
TextCharacter |
withoutModifier(SGR modifier)
Returns a copy of this TextCharacter with an SGR modifier removed.
|
public static final TextCharacter DEFAULT_CHARACTER
public TextCharacter(char character)
ScreenCharacter
based on a supplied character, with default colors and no extra modifiers.character
- Physical character to usepublic TextCharacter(TextCharacter character)
ScreenCharacter
character
- screenCharacter to copy frompublic TextCharacter(char character, TextColor foregroundColor, TextColor backgroundColor, SGR... styles)
ScreenCharacter
based on a physical character, color information and optional modifiers.character
- Physical character to refer toforegroundColor
- Foreground color the character hasbackgroundColor
- Background color the character hasstyles
- Optional list of modifiers to apply when drawing the characterpublic TextCharacter(char character, TextColor foregroundColor, TextColor backgroundColor, EnumSet<SGR> modifiers)
ScreenCharacter
based on a physical character, color information and a set of modifiers.character
- Physical character to refer toforegroundColor
- Foreground color the character hasbackgroundColor
- Background color the character hasmodifiers
- Set of modifiers to apply when drawing the characterpublic char getCharacter()
public TextColor getForegroundColor()
public TextColor getBackgroundColor()
public EnumSet<SGR> getModifiers()
public boolean isBold()
true
if this TextCharacter has the bold modifier activepublic boolean isReversed()
true
if this TextCharacter has the reverse modifier activepublic boolean isUnderlined()
true
if this TextCharacter has the underline modifier activepublic boolean isBlinking()
true
if this TextCharacter has the blink modifier activepublic boolean isBordered()
true
if this TextCharacter has the bordered modifier activepublic boolean isCrossedOut()
true
if this TextCharacter has the crossed-out modifier activepublic TextCharacter withCharacter(char character)
character
- Character the copy should havepublic TextCharacter withForegroundColor(TextColor foregroundColor)
foregroundColor
- Foreground color the copy should havepublic TextCharacter withBackgroundColor(TextColor backgroundColor)
backgroundColor
- Background color the copy should havepublic TextCharacter withModifiers(Collection<SGR> modifiers)
modifiers
- SGR modifiers the copy should havepublic TextCharacter withModifier(SGR modifier)
modifier
- SGR modifiers the copy should have in additional to all currently presentpublic TextCharacter withoutModifier(SGR modifier)
modifier
- SGR modifiers the copy should not haveCopyright © 2016. All rights reserved.