mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 10:30:44 +01:00
Added isSpecial() to check if contrib is to be highlighted
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user