diff --git a/app/src/processing/app/contrib/Contribution.java b/app/src/processing/app/contrib/Contribution.java index 451ab7d4e..92f21d155 100644 --- a/app/src/processing/app/contrib/Contribution.java +++ b/app/src/processing/app/contrib/Contribution.java @@ -30,9 +30,10 @@ import processing.core.PApplet; 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", "Typography", + "I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography", "Utilities", "Video & Vision", "Other"); //protected String category; // "Sound" @@ -165,6 +166,19 @@ abstract public class Contribution { } + /** + * Returns true if the contribution is a starred/recommended contribution, or + * is by the Processing Foundation. + * + * @return + */ + boolean isSpecial() { + if (authorList.indexOf("The Processing Foundation") != -1 || categories.contains(SPECIAL_CATEGORY_NAME)) + return true; + return false; + } + + /** * @return a single element list with "Unknown" as the category. */