Skip to content

Commit 765bdae

Browse files
committed
and more cleanups...
1 parent faa62f5 commit 765bdae

24 files changed

+937
-1133
lines changed

app/src/processing/app/Base.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static private void createAndShowGUI(String[] args) {
189189
} catch (Exception e) {
190190
// String mess = e.getMessage();
191191
// if (!mess.contains("ch.randelshofer.quaqua.QuaquaLookAndFeel")) {
192-
log("Could not set the Look & Feel", e); //$NON-NLS-1$
192+
loge("Could not set the Look & Feel", e); //$NON-NLS-1$
193193
// }
194194
}
195195

@@ -2970,10 +2970,17 @@ static public void logf(String message, Object... args) {
29702970
}
29712971

29722972

2973-
static public void log(String message, Throwable e) {
2973+
static public void loge(String message, Throwable e) {
29742974
if (DEBUG) {
2975-
System.out.println(message);
2975+
System.err.println(message);
29762976
e.printStackTrace();
29772977
}
29782978
}
2979+
2980+
2981+
static public void loge(String message) {
2982+
if (DEBUG) {
2983+
System.out.println(message);
2984+
}
2985+
}
29792986
}

app/src/processing/app/Editor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ public void actionPerformed(ActionEvent e) {
11181118
statusError("\"" + tool.getMenuTitle() + "\" is not" +
11191119
"compatible with this version of Processing");
11201120
//nsme.printStackTrace();
1121-
Base.log("Incompatible tool found during tool.run()", nsme);
1121+
Base.loge("Incompatible tool found during tool.run()", nsme);
11221122
item.setEnabled(false);
11231123

11241124
} catch (Exception ex) {
@@ -1156,13 +1156,13 @@ protected void addTools(JMenu menu, ArrayList<ToolContribution> tools) {
11561156
System.err.println("\"" + tool.getMenuTitle() + "\" is not " +
11571157
"compatible with this version of Processing");
11581158
System.err.println("The " + nsme.getMessage() + " method no longer exists.");
1159-
Base.log("Incompatible Tool found during tool.init()", nsme);
1159+
Base.loge("Incompatible Tool found during tool.init()", nsme);
11601160

11611161
} catch (NoClassDefFoundError ncdfe) {
11621162
System.err.println("\"" + tool.getMenuTitle() + "\" is not " +
11631163
"compatible with this version of Processing");
11641164
System.err.println("The " + ncdfe.getMessage() + " class is no longer available.");
1165-
Base.log("Incompatible Tool found during tool.init()", ncdfe);
1165+
Base.loge("Incompatible Tool found during tool.init()", ncdfe);
11661166

11671167
} catch (Error err) {
11681168
System.err.println("An error occurred inside \"" + tool.getMenuTitle() + "\"");

app/src/processing/app/Mode.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,10 +1230,15 @@ protected TokenMarker createTokenMarker() {
12301230

12311231
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12321232

1233+
// Get attributes/values from the theme.txt file. To discourage burying this
1234+
// kind of information in code where it doesn't belong (and is difficult to
1235+
// track down), these don't have a "default" option as a second parameter.
12331236

1234-
//public String get(String attribute) {
1235-
// return theme.get(attribute);
1236-
//}
1237+
1238+
/** @since 3.0a6 */
1239+
public String getString(String attribute) {
1240+
return theme.get(attribute);
1241+
}
12371242

12381243

12391244
public boolean getBoolean(String attribute) {
@@ -1252,7 +1257,6 @@ public Color getColor(String attribute) {
12521257

12531258

12541259
public Font getFont(String attribute) {
1255-
// System.out.println("getFont(" + attribute + ") -> " + theme.getFont(attribute));
12561260
return theme.getFont(attribute);
12571261
}
12581262

app/src/processing/app/SingleInstance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ public void run() {
111111
}
112112
// }
113113
} catch (IOException e) {
114-
Base.log("SingleInstance error while listening", e);
114+
Base.loge("SingleInstance error while listening", e);
115115
}
116116
}
117117
}
118118
}, "SingleInstance Server").start();
119119

120120
} catch (IOException e) {
121-
Base.log("Could not create single instance server.", e);
121+
Base.loge("Could not create single instance server.", e);
122122
}
123123
}
124124

app/src/processing/app/Toolkit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static public Font getMonoFont(int size, int style) {
665665
//monoBoldFont = createFont("SourceCodePro-Semibold.ttf", size);
666666
monoBoldFont = createFont("SourceCodePro-Bold.ttf", size);
667667
} catch (Exception e) {
668-
Base.log("Could not load mono font", e);
668+
Base.loge("Could not load mono font", e);
669669
monoFont = new Font("Monospaced", Font.PLAIN, size);
670670
monoBoldFont = new Font("Monospaced", Font.BOLD, size);
671671
}
@@ -692,7 +692,7 @@ static public Font getSansFont(int size, int style) {
692692
sansFont = createFont("SourceSansPro-Regular.ttf", size);
693693
sansBoldFont = createFont("SourceSansPro-Semibold.ttf", size);
694694
} catch (Exception e) {
695-
Base.log("Could not load sans font", e);
695+
Base.loge("Could not load sans font", e);
696696
sansFont = new Font("SansSerif", Font.PLAIN, size);
697697
sansBoldFont = new Font("SansSerif", Font.BOLD, size);
698698
}

app/src/processing/app/contrib/ModeContribution.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static public ModeContribution load(Base base, File folder,
5656
// For the built-in modes, don't print the exception, just log it
5757
// for debugging. This should be impossible for most users to reach,
5858
// but it helps us load experimental mode when it's available.
59-
Base.log("ModeContribution.load() failed for " + searchName, err);
59+
Base.loge("ModeContribution.load() failed for " + searchName, err);
6060
}
6161
}
6262
return null;

app/src/processing/app/syntax/JEditTextArea.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,7 @@ public void mouseDragged(MouseEvent evt) {
23692369
try {
23702370
select(getMarkPosition(), xyToOffset(evt.getX(), evt.getY()));
23712371
} catch (ArrayIndexOutOfBoundsException e) {
2372-
Base.log("xToOffset problem", e);
2372+
Base.loge("xToOffset problem", e);
23732373
}
23742374
} else {
23752375
int line = yToLine(evt.getY());

java/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
33
<classpathentry kind="src" path="generated"/>
4-
<classpathentry kind="src" path="src"/>
4+
<classpathentry excluding="processing/mode/java/PresentMode.java" kind="src" path="src"/>
55
<classpathentry kind="lib" path="mode/antlr.jar"/>
66
<classpathentry kind="lib" path="mode/classpath-explorer-1.0.jar"/>
77
<classpathentry kind="lib" path="mode/com.ibm.icu.jar"/>

0 commit comments

Comments
 (0)