Package jexer.bits
Class ColorTheme
- java.lang.Object
-
- jexer.bits.ColorTheme
-
public class ColorTheme extends java.lang.ObjectColorTheme is a collection of colors keyed by string. A default theme is also provided that matches the blue-and-white theme used by Turbo Vision.
-
-
Constructor Summary
Constructors Constructor Description ColorTheme()Public constructor sets the theme to the default.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CellAttributesgetColor(java.lang.String name)Retrieve the CellAttributes for a named theme color.java.util.List<java.lang.String>getColorNames()Retrieve all the names in the theme.voidload(java.io.Reader reader)Read color theme mappings from a Reader.voidload(java.lang.String filename)Read color theme mappings from an ASCII file.voidsave(java.lang.String filename)Save the color theme mappings to an ASCII file.voidsetColor(java.lang.String name, CellAttributes color)Set the color for a named theme color.voidsetColorFromString(java.lang.String key, java.lang.String text)Set a color based on a text string.voidsetDefaultTheme()Sets to defaults that resemble the Borland IDE colors.voidsetFemme()Set the theme to femme.voidsetQmodem5()Sets to colors that resemble the "Custom" colors of Qmodem 5.0.java.lang.StringtoString()Make human-readable description of this Cell.
-
-
-
Method Detail
-
getColor
public CellAttributes getColor(java.lang.String name)
Retrieve the CellAttributes for a named theme color.- Parameters:
name- theme color name, e.g. "twindow.border"- Returns:
- color associated with name, e.g. bold yellow on blue
-
getColorNames
public java.util.List<java.lang.String> getColorNames()
Retrieve all the names in the theme.- Returns:
- a list of names
-
setColor
public void setColor(java.lang.String name, CellAttributes color)Set the color for a named theme color.- Parameters:
name- theme color name, e.g. "twindow.border"color- the new color to associate with name, e.g. bold yellow on blue
-
save
public void save(java.lang.String filename) throws java.io.IOExceptionSave the color theme mappings to an ASCII file.- Parameters:
filename- file to write to- Throws:
java.io.IOException- if the I/O fails
-
load
public void load(java.lang.String filename) throws java.io.IOExceptionRead color theme mappings from an ASCII file.- Parameters:
filename- file to read from- Throws:
java.io.IOException- if the I/O fails
-
setColorFromString
public void setColorFromString(java.lang.String key, java.lang.String text)Set a color based on a text string. Color text string is of the form:[ bold ] [ blink ] { foreground on background }- Parameters:
key- the color key stringtext- the text string
-
load
public void load(java.io.Reader reader) throws java.io.IOExceptionRead color theme mappings from a Reader. The reader is closed at the end.- Parameters:
reader- the reader to read from- Throws:
java.io.IOException- if the I/O fails
-
setDefaultTheme
public void setDefaultTheme()
Sets to defaults that resemble the Borland IDE colors.
-
setFemme
public void setFemme()
Set the theme to femme. I love pink. You can too! 💗
-
setQmodem5
public void setQmodem5()
Sets to colors that resemble the "Custom" colors of Qmodem 5.0.
-
toString
public java.lang.String toString()
Make human-readable description of this Cell.- Overrides:
toStringin classjava.lang.Object- Returns:
- displayable String
-
-