Skip to content

Commit 17f5364

Browse files
committed
Merge branch 'master' of github.com:processing/processing4
2 parents 59aa860 + 4c2f6d2 commit 17f5364

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

java/src/processing/mode/java/preproc/PdeParseTreeListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ public PreprocessorResult getResult(List<PdePreprocessIssue> issues) {
290290
allEdits,
291291
sketchWidth,
292292
sketchHeight,
293+
sketchRenderer,
293294
issues
294295
);
295296
}

java/src/processing/mode/java/preproc/PreprocessorResult.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class PreprocessorResult {
4242
private final List<PdePreprocessIssue> preprocessIssues;
4343
private final String sketchWidth;
4444
private final String sketchHeight;
45+
private final String sketchRenderer;
4546

4647
/**
4748
* Create a new PreprocessorResult indicating that there were issues in preprocessing.
@@ -67,10 +68,11 @@ public static PreprocessorResult reportPreprocessIssues(
6768
* @param newEdits The edits made during preprocessing.
6869
* @param newSketchWidth The width of the sketch in pixels or special value like displayWidth;
6970
* @param newSketchHeight The height of the sketch in pixels or special value like displayWidth;
71+
* @param newSketchRenderer The renderer of the sketch.
7072
*/
7173
public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset,
7274
String newClassName, List<ImportStatement> newImportStatements,
73-
List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight) {
75+
List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer) {
7476

7577
if (newClassName == null) {
7678
throw new RuntimeException("Could not find main class");
@@ -85,6 +87,7 @@ public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffs
8587

8688
sketchWidth = newSketchWidth;
8789
sketchHeight = newSketchHeight;
90+
sketchRenderer = newSketchRenderer;
8891
}
8992

9093
/**
@@ -98,10 +101,11 @@ public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffs
98101
* @param newEdits The edits made during preprocessing.
99102
* @param newSketchWidth The width of the sketch in pixels or special value like displayWidth;
100103
* @param newSketchHeight The height of the sketch in pixels or special value like displayWidth;
104+
* @param newSketchRenderer The renderer of the sketch.
101105
*/
102106
public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset,
103107
String newClassName, List<ImportStatement> newImportStatements,
104-
List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight,
108+
List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer,
105109
List<PdePreprocessIssue> newPreprocessIssues) {
106110

107111
if (newClassName == null) {
@@ -117,6 +121,7 @@ public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffs
117121

118122
sketchWidth = newSketchWidth;
119123
sketchHeight = newSketchHeight;
124+
sketchRenderer = newSketchRenderer;
120125
}
121126

122127
/**
@@ -134,6 +139,7 @@ private PreprocessorResult(List<PdePreprocessIssue> newPreprocessIssues) {
134139

135140
sketchWidth = null;
136141
sketchHeight = null;
142+
sketchRenderer = null;
137143
}
138144

139145
/**
@@ -210,4 +216,14 @@ public String getSketchWidth() {
210216
public String getSketchHeight() {
211217
return sketchHeight;
212218
}
219+
220+
/**
221+
* Get the user provided renderer of this sketch.
222+
*
223+
* @return The renderer of the sketch or null if none
224+
* given.
225+
*/
226+
public String getSketchRenderer() {
227+
return sketchRenderer;
228+
}
213229
}

0 commit comments

Comments
 (0)