@@ -42,6 +42,7 @@ public class PreprocessorResult {
42
42
private final List <PdePreprocessIssue > preprocessIssues ;
43
43
private final String sketchWidth ;
44
44
private final String sketchHeight ;
45
+ private final String sketchRenderer ;
45
46
46
47
/**
47
48
* Create a new PreprocessorResult indicating that there were issues in preprocessing.
@@ -67,10 +68,11 @@ public static PreprocessorResult reportPreprocessIssues(
67
68
* @param newEdits The edits made during preprocessing.
68
69
* @param newSketchWidth The width of the sketch in pixels or special value like displayWidth;
69
70
* @param newSketchHeight The height of the sketch in pixels or special value like displayWidth;
71
+ * @param newSketchRenderer The renderer of the sketch.
70
72
*/
71
73
public PreprocessorResult (PdePreprocessor .Mode newProgramType , int newHeaderOffset ,
72
74
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 ) {
74
76
75
77
if (newClassName == null ) {
76
78
throw new RuntimeException ("Could not find main class" );
@@ -85,6 +87,7 @@ public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffs
85
87
86
88
sketchWidth = newSketchWidth ;
87
89
sketchHeight = newSketchHeight ;
90
+ sketchRenderer = newSketchRenderer ;
88
91
}
89
92
90
93
/**
@@ -98,10 +101,11 @@ public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffs
98
101
* @param newEdits The edits made during preprocessing.
99
102
* @param newSketchWidth The width of the sketch in pixels or special value like displayWidth;
100
103
* @param newSketchHeight The height of the sketch in pixels or special value like displayWidth;
104
+ * @param newSketchRenderer The renderer of the sketch.
101
105
*/
102
106
public PreprocessorResult (PdePreprocessor .Mode newProgramType , int newHeaderOffset ,
103
107
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 ,
105
109
List <PdePreprocessIssue > newPreprocessIssues ) {
106
110
107
111
if (newClassName == null ) {
@@ -117,6 +121,7 @@ public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffs
117
121
118
122
sketchWidth = newSketchWidth ;
119
123
sketchHeight = newSketchHeight ;
124
+ sketchRenderer = newSketchRenderer ;
120
125
}
121
126
122
127
/**
@@ -134,6 +139,7 @@ private PreprocessorResult(List<PdePreprocessIssue> newPreprocessIssues) {
134
139
135
140
sketchWidth = null ;
136
141
sketchHeight = null ;
142
+ sketchRenderer = null ;
137
143
}
138
144
139
145
/**
@@ -210,4 +216,14 @@ public String getSketchWidth() {
210
216
public String getSketchHeight () {
211
217
return sketchHeight ;
212
218
}
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
+ }
213
229
}
0 commit comments