Skip to content

Commit df8ce9f

Browse files
committed
checking on experimental mode
1 parent e9d87b7 commit df8ce9f

12 files changed

Lines changed: 15 additions & 83 deletions

File tree

app/src/processing/app/Mode.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ public void setupGUI() {
172172
try {
173173
//theme = new Settings(new File(folder, "theme/theme.txt"));
174174
theme = new Settings(Base.getContentFile("lib/theme.txt"));
175+
176+
File modeTheme = new File(folder, "theme/theme.txt");
177+
if (modeTheme.exists()) {
178+
// Override the built-in settings with what the theme provides
179+
theme.load(modeTheme);
180+
}
175181

176182
// other things that have to be set explicitly for the defaults
177183
theme.setColor("run.window.bgcolor", SystemColor.control);

app/src/processing/app/Settings.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ public Settings(File file) throws IOException {
6767

6868

6969
public void load() {
70-
String[] lines = PApplet.loadStrings(file);
70+
load(file);
71+
}
72+
73+
74+
public void load(File additions) {
75+
String[] lines = PApplet.loadStrings(additions);
7176
for (String line : lines) {
7277
if ((line.length() == 0) ||
7378
(line.charAt(0) == '#')) continue;

experimental/src/processing/mode/experimental/ExperimentalMode.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.logging.Level;
3030
import java.util.logging.Logger;
3131
import processing.app.Base;
32+
import processing.app.Editor;
3233
import processing.app.EditorState;
3334
import processing.app.Mode;
3435
import processing.mode.java.JavaMode;
@@ -115,7 +116,7 @@ public File[] getKeywordFiles() {
115116
* Create a new editor associated with this mode.
116117
*/
117118
@Override
118-
public processing.app.Editor createEditor(Base base, String path, EditorState state) {
119+
public Editor createEditor(Base base, String path, EditorState state) {
119120
return new DebugEditor(base, path, state, this);
120121
}
121122

@@ -133,7 +134,7 @@ public String loadThemeString(String attribute, String defaultValue) {
133134
if (newString != null) {
134135
return newString;
135136
}
136-
Logger.getLogger(ExperimentalMode.class.getName()).log(Level.WARNING, "Error loading String: {0}", attribute);
137+
Logger.getLogger(getClass().getName()).log(Level.WARNING, "Error loading String: {0}", attribute);
137138
return defaultValue;
138139
}
139140

-62 Bytes
Binary file not shown.
-104 Bytes
Binary file not shown.

experimental/theme/tab-sel-mid.gif

-54 Bytes
Binary file not shown.
-839 Bytes
Binary file not shown.
-62 Bytes
Binary file not shown.
-104 Bytes
Binary file not shown.
-54 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)