|
3 | 3 | /* |
4 | 4 | Part of the Processing project - http://processing.org |
5 | 5 |
|
6 | | - Copyright (c) 2013 The Processing Foundation |
| 6 | + Copyright (c) 2013-15 The Processing Foundation |
7 | 7 | Copyright (c) 2011-12 Ben Fry and Casey Reas |
8 | 8 |
|
9 | 9 | This program is free software; you can redistribute it and/or modify |
@@ -32,28 +32,21 @@ abstract public class Contribution { |
32 | 32 | static final String SPECIAL_CATEGORY_NAME = "Starred"; |
33 | 33 | static final List validCategories = |
34 | 34 | Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware", |
35 | | - "I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography", |
36 | | - "Utilities", "Video & Vision", "Other"); |
| 35 | + "I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, |
| 36 | + "Typography", "Utilities", "Video & Vision", "Other"); |
37 | 37 |
|
38 | | - //protected String category; // "Sound" |
39 | 38 | protected List<String> categories; // "Sound", "Typography" |
40 | | - protected String name; // "pdf" or "PDF Export" |
41 | | - protected String authorList; // Ben Fry |
42 | | - protected String url; // http://processing.org |
43 | | - protected String sentence; // Write graphics to PDF files. |
44 | | - protected String paragraph; // <paragraph length description for site> |
45 | | - protected int version; // 102 |
46 | | - protected String prettyVersion; // "1.0.2" |
47 | | - protected long lastUpdated; // 1402805757 |
48 | | - protected int minRevision; // 0 |
49 | | - protected int maxRevision; // 227 |
50 | | - protected List<String> specifiedImports; // pdf.export.*,pdf.convert.common.* |
51 | | - |
52 | | - |
53 | | - // "Sound" |
54 | | -// public String getCategory() { |
55 | | -// return category; |
56 | | -// } |
| 39 | + protected String name; // "pdf" or "PDF Export" |
| 40 | + protected String authorList; // [Ben Fry](http://benfry.com) |
| 41 | + protected String url; // http://processing.org |
| 42 | + protected String sentence; // Write graphics to PDF files. |
| 43 | + protected String paragraph; // <paragraph length description for site> |
| 44 | + protected int version; // 102 |
| 45 | + protected String prettyVersion; // "1.0.2" |
| 46 | + protected long lastUpdated; // 1402805757 |
| 47 | + protected int minRevision; // 0 |
| 48 | + protected int maxRevision; // 227 |
| 49 | + protected List<String> imports; // pdf.export.*,pdf.convert.common.* |
57 | 50 |
|
58 | 51 |
|
59 | 52 | // "Sound", "Utilities"... see valid list in ContributionListing |
@@ -87,26 +80,27 @@ protected boolean hasCategory(String category) { |
87 | 80 |
|
88 | 81 | // pdf.export.*,pdf.convert.common.* |
89 | 82 | protected List<String> getImports() { |
90 | | - return specifiedImports; |
| 83 | + return imports; |
91 | 84 | } |
92 | 85 |
|
93 | 86 |
|
94 | 87 | protected String getImportStr() { |
95 | | - if (specifiedImports == null || specifiedImports.isEmpty()) { |
| 88 | + if (imports == null || imports.isEmpty()) { |
96 | 89 | return ""; |
97 | 90 | } |
98 | 91 | StringBuilder sb = new StringBuilder(); |
99 | | - for (String importName : specifiedImports) { |
| 92 | + for (String importName : imports) { |
100 | 93 | sb.append(importName); |
101 | 94 | sb.append(','); |
102 | 95 | } |
103 | 96 | sb.deleteCharAt(sb.length() - 1); // delete last comma |
104 | 97 | return sb.toString(); |
105 | 98 | } |
106 | 99 |
|
| 100 | + |
107 | 101 | protected boolean hasImport(String importName) { |
108 | | - if (specifiedImports != null && importName != null) { |
109 | | - for (String c : specifiedImports) { |
| 102 | + if (imports != null && importName != null) { |
| 103 | + for (String c : imports) { |
110 | 104 | if (importName.equalsIgnoreCase(c)) { |
111 | 105 | return true; |
112 | 106 | } |
|
0 commit comments