- java.lang.Object
-
- com.googlecode.lanterna.graphics.StyleSet.Set
-
- All Implemented Interfaces:
StyleSet<StyleSet.Set>
- Direct Known Subclasses:
TextGraphicsWriter.WordPart
public static class StyleSet.Set extends java.lang.Object implements StyleSet<StyleSet.Set>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.googlecode.lanterna.graphics.StyleSet
StyleSet.Set
-
-
Field Summary
Fields Modifier and Type Field Description private TextColor
backgroundColor
private TextColor
foregroundColor
private java.util.EnumSet<SGR>
style
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StyleSet.Set
clearModifiers()
Removes all active modifiersStyleSet.Set
disableModifiers(SGR... modifiers)
Removes zero or more modifiers from the set of currently active modifiersStyleSet.Set
enableModifiers(SGR... modifiers)
Adds zero or more modifiers to the set of currently active modifiersjava.util.EnumSet<SGR>
getActiveModifiers()
Returns all the SGR codes that are currently activeTextColor
getBackgroundColor()
Returns the current background colorTextColor
getForegroundColor()
Returns the current foreground colorStyleSet.Set
setBackgroundColor(TextColor backgroundColor)
Updates the current background colorStyleSet.Set
setForegroundColor(TextColor foregroundColor)
Updates the current foreground colorStyleSet.Set
setModifiers(java.util.EnumSet<SGR> modifiers)
Sets the active modifiers to exactly the set passed in to this method.StyleSet.Set
setStyleFrom(StyleSet<?> source)
copy colors and set of SGR codes
-
-
-
Constructor Detail
-
Set
public Set()
-
Set
public Set(StyleSet<?> source)
-
-
Method Detail
-
getBackgroundColor
public TextColor getBackgroundColor()
Description copied from interface:StyleSet
Returns the current background color- Specified by:
getBackgroundColor
in interfaceStyleSet<StyleSet.Set>
- Returns:
- Current background color
-
setBackgroundColor
public StyleSet.Set setBackgroundColor(TextColor backgroundColor)
Description copied from interface:StyleSet
Updates the current background color- Specified by:
setBackgroundColor
in interfaceStyleSet<StyleSet.Set>
- Parameters:
backgroundColor
- New background color- Returns:
- Itself
-
getForegroundColor
public TextColor getForegroundColor()
Description copied from interface:StyleSet
Returns the current foreground color- Specified by:
getForegroundColor
in interfaceStyleSet<StyleSet.Set>
- Returns:
- Current foreground color
-
setForegroundColor
public StyleSet.Set setForegroundColor(TextColor foregroundColor)
Description copied from interface:StyleSet
Updates the current foreground color- Specified by:
setForegroundColor
in interfaceStyleSet<StyleSet.Set>
- Parameters:
foregroundColor
- New foreground color- Returns:
- Itself
-
enableModifiers
public StyleSet.Set enableModifiers(SGR... modifiers)
Description copied from interface:StyleSet
Adds zero or more modifiers to the set of currently active modifiers- Specified by:
enableModifiers
in interfaceStyleSet<StyleSet.Set>
- Parameters:
modifiers
- Modifiers to add to the set of currently active modifiers- Returns:
- Itself
-
disableModifiers
public StyleSet.Set disableModifiers(SGR... modifiers)
Description copied from interface:StyleSet
Removes zero or more modifiers from the set of currently active modifiers- Specified by:
disableModifiers
in interfaceStyleSet<StyleSet.Set>
- Parameters:
modifiers
- Modifiers to remove from the set of currently active modifiers- Returns:
- Itself
-
setModifiers
public StyleSet.Set setModifiers(java.util.EnumSet<SGR> modifiers)
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<StyleSet.Set>
- Parameters:
modifiers
- Modifiers to set as active- Returns:
- Itself
-
clearModifiers
public StyleSet.Set clearModifiers()
Description copied from interface:StyleSet
Removes all active modifiers- Specified by:
clearModifiers
in interfaceStyleSet<StyleSet.Set>
- Returns:
- Itself
-
getActiveModifiers
public java.util.EnumSet<SGR> getActiveModifiers()
Description copied from interface:StyleSet
Returns all the SGR codes that are currently active- Specified by:
getActiveModifiers
in interfaceStyleSet<StyleSet.Set>
- Returns:
- Currently active SGR modifiers
-
setStyleFrom
public StyleSet.Set setStyleFrom(StyleSet<?> source)
Description copied from interface:StyleSet
copy colors and set of SGR codes- Specified by:
setStyleFrom
in interfaceStyleSet<StyleSet.Set>
- Parameters:
source
- Modifiers to set as active- Returns:
- Itself
-
-