fixing up #3197, other notes

This commit is contained in:
Ben Fry
2015-04-17 14:19:16 -04:00
parent fc5bb196e0
commit 05ec0ebc40
6 changed files with 59 additions and 88 deletions
@@ -15,7 +15,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -30,9 +30,9 @@ import processing.app.Language;
abstract public class Contribution {
static final String SPECIAL_CATEGORY_NAME = "Starred";
static final List validCategories =
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
static final List validCategories =
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
"Utilities", "Video & Vision", "Other");
//protected String category; // "Sound"
@@ -48,20 +48,20 @@ abstract public class Contribution {
protected int minRevision; // 0
protected int maxRevision; // 227
protected List<String> specifiedImports; // pdf.export.*,pdf.convert.common.*
// "Sound"
// public String getCategory() {
// return category;
// }
// "Sound", "Utilities"... see valid list in ContributionListing
protected List<String> getCategories() {
return categories;
}
protected String getCategoryStr() {
StringBuilder sb = new StringBuilder();
for (String category : categories) {
@@ -71,8 +71,8 @@ abstract public class Contribution {
sb.deleteCharAt(sb.length()-1); // delete last comma
return sb.toString();
}
protected boolean hasCategory(String category) {
if (category != null) {
for (String c : categories) {
@@ -82,15 +82,15 @@ abstract public class Contribution {
}
}
return false;
}
}
// pdf.export.*,pdf.convert.common.*
protected List<String> getImports() {
return specifiedImports;
}
protected String getImportStr() {
if (specifiedImports == null || specifiedImports.isEmpty()) {
return "";
@@ -156,7 +156,7 @@ abstract public class Contribution {
public String getPrettyVersion() {
return prettyVersion;
}
// 1402805757
public long getLastUpdated() {
return lastUpdated;
@@ -179,36 +179,36 @@ abstract public class Contribution {
abstract public ContributionType getType();
public String getTypeName() {
return getType().toString();
}
abstract public boolean isInstalled();
// /**
// /**
// * Returns true if the type of contribution requires the PDE to restart
// * when being added or removed.
// * when being added or removed.
// */
// public boolean requiresRestart() {
// return getType() == ContributionType.TOOL || getType() == ContributionType.MODE;
// }
boolean isRestartFlagged() {
return false;
}
/** Overridden by LocalContribution. */
boolean isDeletionFlagged() {
return false;
}
boolean isUpdateFlagged() {
return false;
}
@@ -217,12 +217,12 @@ abstract public class Contribution {
/**
* Returns true if the contribution is a starred/recommended contribution, or
* is by the Processing Foundation.
*
*
* @return
*/
boolean isSpecial() {
try {
return (authorList.indexOf("The Processing Foundation") != -1 ||
return (authorList.indexOf("The Processing Foundation") != -1 ||
categories.contains(SPECIAL_CATEGORY_NAME));
} catch (NullPointerException npe) {
return false;
@@ -230,7 +230,7 @@ abstract public class Contribution {
}
/**
/**
* @return a single element list with "Unknown" as the category.
*/
static List<String> defaultCategory() {
@@ -238,15 +238,15 @@ abstract public class Contribution {
outgoing.add("Unknown");
return outgoing;
}
/**
* @return the list of categories that this contribution is part of
* (e.g. "Typography / Geometry"). "Unknown" if the category null.
*/
static List<String> parseCategories(String categoryStr) {
List<String> outgoing = new ArrayList<String>();
if (categoryStr != null) {
String[] listing = PApplet.trim(PApplet.split(categoryStr, ','));
for (String category : listing) {
@@ -261,8 +261,8 @@ abstract public class Contribution {
}
return outgoing;
}
/**
* @return the list of imports that this contribution (library) contains.
*/
@@ -278,54 +278,10 @@ abstract public class Contribution {
return (outgoing.size() > 0) ? outgoing : null;
}
static private String translateCategory(String cat) {
String translated = "";
switch (cat) {
case "3D":
translated = Language.text("contrib.category.3d");
break;
case "Animation":
translated = Language.text("contrib.category.animation");
break;
case "Data":
translated = Language.text("contrib.category.data");
break;
case "Geometry":
translated = Language.text("contrib.category.geometry");
break;
case "GUI":
translated = Language.text("contrib.category.gui");
break;
case "Hardware":
translated = Language.text("contrib.category.hardware");
break;
case "I/O":
translated = Language.text("contrib.category.io");
break;
case "Math":
translated = Language.text("contrib.category.math");
break;
case "Simulation":
translated = Language.text("contrib.category.simulation");
break;
case "Sound":
translated = Language.text("contrib.category.sound");
break;
case "Typography":
translated = Language.text("contrib.category.typography");
break;
case "Utilities":
translated = Language.text("contrib.category.utilities");
break;
case "Video & Vision":
translated = Language.text("contrib.category.video_vision");
break;
case "Other":
translated = Language.text("contrib.category.other");
break;
}
return translated;
// Converts Other to other, I/O to i_o, Video & Vision to video_vision
String cleaned = cat.replaceAll("[\\W]+", "_").toLowerCase();
return Language.text("contrib.category." + cleaned);
}
}
+1 -1
View File
@@ -444,7 +444,7 @@ contrib.category.data = Data
contrib.category.geometry = Geometry
contrib.category.gui = GUI
contrib.category.hardware = Hardware
contrib.category.io = I/O
contrib.category.i_o = I/O
contrib.category.math = Math
contrib.category.simulation = Simulation
contrib.category.sound = Sound
+1 -1
View File
@@ -454,7 +454,7 @@ contrib.category.data = Δεδομένα
contrib.category.geometry = Γεωμετρία
contrib.category.gui = GUI
contrib.category.hardware = Υλικό
contrib.category.io = Ε/Ε
contrib.category.i_o = Ε/Ε
contrib.category.math = Μαθηματικά
contrib.category.simulation = Προσομοίωση
contrib.category.sound = Ήχος
+9
View File
@@ -40,6 +40,15 @@ The rest of this document are my notes while I'm making changes.
4. full screen (sketch same as screen size)
5. all screens (sketch spans all screens)
#### alternate version
1. pde sketch
2. standalone sketch (exported)
3. running from Eclipse
4. size command?
5. renderer change?
6. renderer that draws to screen (Java2D) or not (PDF)
7. OpenGL or not
resize events:
Frame > Canvas > PGraphics > PApplet
user-driven Frame resize events follow that order
+3
View File
@@ -171,6 +171,9 @@ _ remove requestImage() and friends
_ callback for requestImage()
_ https://github.com/processing/processing/issues/680
_ remove/update requestImage example
_ check into promise api
_ http://www.html5rocks.com/en/tutorials/es6/promises/
_ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
_ fix the registered methods doc, stop/dispose working
_ Casey needs to nudge people about libraries, so we need to fix this
_ pause(), resume(), start(), stop() clarifications
+4 -1
View File
@@ -190,7 +190,10 @@ X Fix ColorChooser cursor
X https://github.com/processing/processing/pull/3186
X Improve Spanish localization
X https://github.com/processing/processing/pull/3185
X internationalization of editor error messages and greek translations
X https://github.com/processing/processing/pull/3189
X improve internationalization and localization in greek
X https://github.com/processing/processing/pull/3197
3.0a7
_ finish adding 'examples' contribs