*
* The MIT License (MIT)
*
- * Copyright (C) 2016 Kevin Lamonte
+ * Copyright (C) 2017 Kevin Lamonte
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
* @throws IOException if the I/O fails
*/
public void load(final String filename) throws IOException {
- BufferedReader reader = new BufferedReader(new FileReader(filename));
- String line = reader.readLine();
- for (; line != null; line = reader.readLine()) {
+ load(new FileReader(filename));
+ }
+
+ /**
+ * Read color theme mappings from a Reader. The reader is closed at the
+ * end.
+ *
+ * @param reader the reader to read from
+ * @throws IOException if the I/O fails
+ */
+ public void load(final Reader reader) throws IOException {
+ BufferedReader bufferedReader = new BufferedReader(reader);
+ String line = bufferedReader.readLine();
+ for (; line != null; line = bufferedReader.readLine()) {
String key;
String bold;
String foreColor;
colors.put(key, color);
}
// All done.
- reader.close();
+ bufferedReader.close();
}
/**
color.setBold(false);
colors.put("twindow.background.windowmove", color);
- // TApplication background
+ // TDesktop background
color = new CellAttributes();
color.setForeColor(Color.BLUE);
color.setBackColor(Color.WHITE);
color.setBold(false);
- colors.put("tapplication.background", color);
+ colors.put("tdesktop.background", color);
// TButton text
color = new CellAttributes();
// TText text
color = new CellAttributes();
color.setForeColor(Color.WHITE);
- color.setBackColor(Color.BLACK);
+ color.setBackColor(Color.BLUE);
color.setBold(false);
colors.put("ttext", color);
color.setBold(true);
colors.put("tlist.inactive", color);
+ // TStatusBar
+ color = new CellAttributes();
+ color.setForeColor(Color.BLACK);
+ color.setBackColor(Color.WHITE);
+ color.setBold(false);
+ colors.put("tstatusbar.text", color);
+ color = new CellAttributes();
+ color.setForeColor(Color.RED);
+ color.setBackColor(Color.WHITE);
+ color.setBold(false);
+ colors.put("tstatusbar.button", color);
+ color = new CellAttributes();
+ color.setForeColor(Color.WHITE);
+ color.setBackColor(Color.BLUE);
+ color.setBold(false);
+ colors.put("tstatusbar.selected", color);
+
// TEditor
color = new CellAttributes();
color.setForeColor(Color.WHITE);
- color.setBackColor(Color.BLACK);
+ color.setBackColor(Color.BLUE);
color.setBold(false);
colors.put("teditor", color);