Skip to content

Commit bb98916

Browse files
committed
fixing up #3197, other notes
1 parent be6ebdb commit bb98916

6 files changed

Lines changed: 59 additions & 88 deletions

File tree

app/src/processing/app/contrib/Contribution.java

Lines changed: 41 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
GNU General Public License for more details.
1717
18-
You should have received a copy of the GNU General Public License along
18+
You should have received a copy of the GNU General Public License along
1919
with this program; if not, write to the Free Software Foundation, Inc.
2020
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121
*/
@@ -30,9 +30,9 @@
3030

3131
abstract public class Contribution {
3232
static final String SPECIAL_CATEGORY_NAME = "Starred";
33-
static final List validCategories =
34-
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
35-
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
33+
static final List validCategories =
34+
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
35+
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
3636
"Utilities", "Video & Vision", "Other");
3737

3838
//protected String category; // "Sound"
@@ -48,20 +48,20 @@ abstract public class Contribution {
4848
protected int minRevision; // 0
4949
protected int maxRevision; // 227
5050
protected List<String> specifiedImports; // pdf.export.*,pdf.convert.common.*
51-
52-
51+
52+
5353
// "Sound"
5454
// public String getCategory() {
5555
// return category;
5656
// }
5757

58-
58+
5959
// "Sound", "Utilities"... see valid list in ContributionListing
6060
protected List<String> getCategories() {
6161
return categories;
6262
}
63-
64-
63+
64+
6565
protected String getCategoryStr() {
6666
StringBuilder sb = new StringBuilder();
6767
for (String category : categories) {
@@ -71,8 +71,8 @@ protected String getCategoryStr() {
7171
sb.deleteCharAt(sb.length()-1); // delete last comma
7272
return sb.toString();
7373
}
74-
75-
74+
75+
7676
protected boolean hasCategory(String category) {
7777
if (category != null) {
7878
for (String c : categories) {
@@ -82,15 +82,15 @@ protected boolean hasCategory(String category) {
8282
}
8383
}
8484
return false;
85-
}
86-
87-
85+
}
86+
87+
8888
// pdf.export.*,pdf.convert.common.*
8989
protected List<String> getImports() {
9090
return specifiedImports;
9191
}
92-
93-
92+
93+
9494
protected String getImportStr() {
9595
if (specifiedImports == null || specifiedImports.isEmpty()) {
9696
return "";
@@ -156,7 +156,7 @@ public int getVersion() {
156156
public String getPrettyVersion() {
157157
return prettyVersion;
158158
}
159-
159+
160160
// 1402805757
161161
public long getLastUpdated() {
162162
return lastUpdated;
@@ -179,36 +179,36 @@ public boolean isCompatible(int versionNum) {
179179

180180

181181
abstract public ContributionType getType();
182-
183-
182+
183+
184184
public String getTypeName() {
185185
return getType().toString();
186186
}
187-
188-
187+
188+
189189
abstract public boolean isInstalled();
190-
191-
192-
// /**
190+
191+
192+
// /**
193193
// * Returns true if the type of contribution requires the PDE to restart
194-
// * when being added or removed.
194+
// * when being added or removed.
195195
// */
196196
// public boolean requiresRestart() {
197197
// return getType() == ContributionType.TOOL || getType() == ContributionType.MODE;
198198
// }
199-
199+
200200

201201
boolean isRestartFlagged() {
202202
return false;
203203
}
204-
205-
204+
205+
206206
/** Overridden by LocalContribution. */
207207
boolean isDeletionFlagged() {
208208
return false;
209209
}
210210

211-
211+
212212
boolean isUpdateFlagged() {
213213
return false;
214214
}
@@ -217,36 +217,36 @@ boolean isUpdateFlagged() {
217217
/**
218218
* Returns true if the contribution is a starred/recommended contribution, or
219219
* is by the Processing Foundation.
220-
*
220+
*
221221
* @return
222222
*/
223223
boolean isSpecial() {
224224
try {
225-
return (authorList.indexOf("The Processing Foundation") != -1 ||
225+
return (authorList.indexOf("The Processing Foundation") != -1 ||
226226
categories.contains(SPECIAL_CATEGORY_NAME));
227227
} catch (NullPointerException npe) {
228228
return false;
229229
}
230230
}
231231

232232

233-
/**
233+
/**
234234
* @return a single element list with "Unknown" as the category.
235235
*/
236236
static List<String> defaultCategory() {
237237
List<String> outgoing = new ArrayList<String>();
238238
outgoing.add("Unknown");
239239
return outgoing;
240240
}
241-
242-
241+
242+
243243
/**
244244
* @return the list of categories that this contribution is part of
245245
* (e.g. "Typography / Geometry"). "Unknown" if the category null.
246246
*/
247247
static List<String> parseCategories(String categoryStr) {
248248
List<String> outgoing = new ArrayList<String>();
249-
249+
250250
if (categoryStr != null) {
251251
String[] listing = PApplet.trim(PApplet.split(categoryStr, ','));
252252
for (String category : listing) {
@@ -261,8 +261,8 @@ static List<String> parseCategories(String categoryStr) {
261261
}
262262
return outgoing;
263263
}
264-
265-
264+
265+
266266
/**
267267
* @return the list of imports that this contribution (library) contains.
268268
*/
@@ -278,54 +278,10 @@ static List<String> parseImports(String importStr) {
278278
return (outgoing.size() > 0) ? outgoing : null;
279279
}
280280

281+
281282
static private String translateCategory(String cat) {
282-
String translated = "";
283-
284-
switch (cat) {
285-
case "3D":
286-
translated = Language.text("contrib.category.3d");
287-
break;
288-
case "Animation":
289-
translated = Language.text("contrib.category.animation");
290-
break;
291-
case "Data":
292-
translated = Language.text("contrib.category.data");
293-
break;
294-
case "Geometry":
295-
translated = Language.text("contrib.category.geometry");
296-
break;
297-
case "GUI":
298-
translated = Language.text("contrib.category.gui");
299-
break;
300-
case "Hardware":
301-
translated = Language.text("contrib.category.hardware");
302-
break;
303-
case "I/O":
304-
translated = Language.text("contrib.category.io");
305-
break;
306-
case "Math":
307-
translated = Language.text("contrib.category.math");
308-
break;
309-
case "Simulation":
310-
translated = Language.text("contrib.category.simulation");
311-
break;
312-
case "Sound":
313-
translated = Language.text("contrib.category.sound");
314-
break;
315-
case "Typography":
316-
translated = Language.text("contrib.category.typography");
317-
break;
318-
case "Utilities":
319-
translated = Language.text("contrib.category.utilities");
320-
break;
321-
case "Video & Vision":
322-
translated = Language.text("contrib.category.video_vision");
323-
break;
324-
case "Other":
325-
translated = Language.text("contrib.category.other");
326-
break;
327-
}
328-
return translated;
283+
// Converts Other to other, I/O to i_o, Video & Vision to video_vision
284+
String cleaned = cat.replaceAll("[\\W]+", "_").toLowerCase();
285+
return Language.text("contrib.category." + cleaned);
329286
}
330-
331287
}

build/shared/lib/languages/PDE.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ contrib.category.data = Data
444444
contrib.category.geometry = Geometry
445445
contrib.category.gui = GUI
446446
contrib.category.hardware = Hardware
447-
contrib.category.io = I/O
447+
contrib.category.i_o = I/O
448448
contrib.category.math = Math
449449
contrib.category.simulation = Simulation
450450
contrib.category.sound = Sound

build/shared/lib/languages/PDE_el.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ contrib.category.data = Δεδομένα
454454
contrib.category.geometry = Γεωμετρία
455455
contrib.category.gui = GUI
456456
contrib.category.hardware = Υλικό
457-
contrib.category.io = Ε/Ε
457+
contrib.category.i_o = Ε/Ε
458458
contrib.category.math = Μαθηματικά
459459
contrib.category.simulation = Προσομοίωση
460460
contrib.category.sound = Ήχος

core/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ The rest of this document are my notes while I'm making changes.
4040
4. full screen (sketch same as screen size)
4141
5. all screens (sketch spans all screens)
4242

43+
#### alternate version
44+
1. pde sketch
45+
2. standalone sketch (exported)
46+
3. running from Eclipse
47+
4. size command?
48+
5. renderer change?
49+
6. renderer that draws to screen (Java2D) or not (PDF)
50+
7. OpenGL or not
51+
4352
resize events:
4453
Frame > Canvas > PGraphics > PApplet
4554
user-driven Frame resize events follow that order

core/todo.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ _ remove requestImage() and friends
171171
_ callback for requestImage()
172172
_ https://github.com/processing/processing/issues/680
173173
_ remove/update requestImage example
174+
_ check into promise api
175+
_ http://www.html5rocks.com/en/tutorials/es6/promises/
176+
_ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
174177
_ fix the registered methods doc, stop/dispose working
175178
_ Casey needs to nudge people about libraries, so we need to fix this
176179
_ pause(), resume(), start(), stop() clarifications

todo.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ X Fix ColorChooser cursor
190190
X https://github.com/processing/processing/pull/3186
191191
X Improve Spanish localization
192192
X https://github.com/processing/processing/pull/3185
193-
193+
X internationalization of editor error messages and greek translations
194+
X https://github.com/processing/processing/pull/3189
195+
X improve internationalization and localization in greek
196+
X https://github.com/processing/processing/pull/3197
194197

195198
3.0a7
196199
_ finish adding 'examples' contribs

0 commit comments

Comments
 (0)