public class ColorTheme
extends java.lang.Object
Constructor and Description |
---|
ColorTheme()
Public constructor sets the theme to the default.
|
Modifier and Type | Method and Description |
---|---|
CellAttributes |
getColor(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.
|
void |
load(java.io.Reader reader)
Read color theme mappings from a Reader.
|
void |
load(java.lang.String filename)
Read color theme mappings from an ASCII file.
|
void |
save(java.lang.String filename)
Save the color theme mappings to an ASCII file.
|
void |
setColor(java.lang.String name,
CellAttributes color)
Set the color for a named theme color.
|
void |
setColorFromString(java.lang.String key,
java.lang.String text)
Set a color based on a text string.
|
void |
setDefaultTheme()
Sets to defaults that resemble the Borland IDE colors.
|
java.lang.String |
toString()
Make human-readable description of this Cell.
|
public CellAttributes getColor(java.lang.String name)
name
- theme color name, e.g. "twindow.border"public java.util.List<java.lang.String> getColorNames()
public void setColor(java.lang.String name, CellAttributes color)
name
- theme color name, e.g. "twindow.border"color
- the new color to associate with name, e.g. bold yellow on
bluepublic void save(java.lang.String filename) throws java.io.IOException
filename
- file to write tojava.io.IOException
- if the I/O failspublic void load(java.lang.String filename) throws java.io.IOException
filename
- file to read fromjava.io.IOException
- if the I/O failspublic void setColorFromString(java.lang.String key, java.lang.String text)
[ bold ] [ blink ] { foreground on background }
key
- the color key stringtext
- the text stringpublic void load(java.io.Reader reader) throws java.io.IOException
reader
- the reader to read fromjava.io.IOException
- if the I/O failspublic void setDefaultTheme()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2019 Kevin Lamonte. Licensed MIT.