From 2523eaf4da6efa48d191bfcd0f02a09e45d3a583 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 1 Jul 2013 10:14:17 -0400 Subject: [PATCH] change download location for contribs listing --- .../app/contrib/ContributionListing.java | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index aa05a72c5..a9f73f01e 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -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 */ @@ -31,11 +31,11 @@ import processing.core.PApplet; public class ContributionListing { - static final String LISTING_URL = - "https://raw.github.com/processing/processing-web/master/contrib_generate/contributions.txt"; + static final String LISTING_URL = + "http://processing.org/contrib_generate/contributions.txt" static ContributionListing singleInstance; - + File listingFile; ArrayList listeners; ArrayList advertisedContributions; @@ -45,9 +45,9 @@ public class ContributionListing { ReentrantLock downloadingListingLock; static final String[] validCategories = { - "3D", "Animation", "Compilations", "Data", "Geometry", "GUI", + "3D", "Animation", "Compilations", "Data", "Geometry", "GUI", "Hardware", "I/O", "Math", "Simulation", "Sound", "Typography", - "Utilities", "Video & Vision" + "Utilities", "Video & Vision" }; @@ -85,7 +85,7 @@ public class ContributionListing { Collections.sort(allContributions, nameComparator); } - + /** * Adds the installed libraries to the listing of libraries, replacing any * pre-existing libraries by the same name as one in the list. @@ -132,7 +132,7 @@ public class ContributionListing { List list = librariesByCategory.get(contribution.getCategory()); list.add(contribution); Collections.sort(list, nameComparator); - + } else { ArrayList list = new ArrayList(); list.add(contribution); @@ -155,7 +155,7 @@ public class ContributionListing { private Contribution getContribution(Contribution contribution) { for (Contribution c : allContributions) { - if (c.getName().equals(contribution.getName()) && + if (c.getName().equals(contribution.getName()) && c.getType() == contribution.getType()) { return c; } @@ -166,7 +166,7 @@ public class ContributionListing { protected AvailableContribution getAvailableContribution(Contribution info) { for (AvailableContribution advertised : advertisedContributions) { - if (advertised.getType() == info.getType() && + if (advertised.getType() == info.getType() && advertised.getName().equals(info.getName())) { return advertised; } @@ -174,7 +174,7 @@ public class ContributionListing { return null; } - + protected Set getCategories(ContributionFilter filter) { Set outgoing = new HashSet(); @@ -194,12 +194,12 @@ public class ContributionListing { return outgoing; } - + // public List getAllContributions() { // return new ArrayList(allContributions); // } - + // public List getLibararies(String category) { // ArrayList libinfos = // new ArrayList(librariesByCategory.get(category)); @@ -207,7 +207,7 @@ public class ContributionListing { // return libinfos; // } - + protected List getFilteredLibraryList(String category, List filters) { ArrayList filteredList = new ArrayList(allContributions); @@ -267,9 +267,9 @@ public class ContributionListing { } - /** + /** * Returns true if the contribution fits the given property, false otherwise. - * If the property is invalid, returns false. + * If the property is invalid, returns false. */ private boolean hasProperty(Contribution contrib, String property) { // update, updates, updatable, upgrade @@ -318,7 +318,7 @@ public class ContributionListing { } } - + protected void addContributionListener(ContributionChangeListener listener) { for (Contribution contrib : allContributions) { listener.contributionAdded(contrib); @@ -326,21 +326,21 @@ public class ContributionListing { listeners.add(listener); } - + /* private void removeContributionListener(ContributionChangeListener listener) { listeners.remove(listener); } - + private ArrayList getContributionListeners() { return new ArrayList(listeners); } */ - + /** - * Starts a new thread to download the advertised list of contributions. + * Starts a new thread to download the advertised list of contributions. * Only one instance will run at a time. */ protected void downloadAvailableList(final ProgressMonitor progress) { @@ -367,8 +367,8 @@ public class ContributionListing { } }).start(); } - - + + boolean hasUpdates() { for (Contribution info : allContributions) { if (hasUpdates(info)) { @@ -390,12 +390,12 @@ public class ContributionListing { return false; } - + boolean hasDownloadedLatestList() { return hasDownloadedLatestList; } - + /** * @return a lowercase string with all non-alphabetic characters removed */ @@ -403,7 +403,7 @@ public class ContributionListing { return s.toLowerCase().replaceAll("^\\p{Lower}", ""); } - + /** * @return the proper, valid name of this category to be displayed in the UI * (e.g. "Typography / Geometry"). "Unknown" if the category null. @@ -423,7 +423,7 @@ public class ContributionListing { return category; } - + ArrayList parseContribList(File file) { ArrayList outgoing = new ArrayList(); @@ -454,7 +454,7 @@ public class ContributionListing { HashMap contribParams = new HashMap(); Base.readSettings(file.getName(), contribLines, contribParams); - + outgoing.add(new AvailableContribution(contribType, contribParams)); start = end + 1; // } else { @@ -465,17 +465,17 @@ public class ContributionListing { return outgoing; } - + // boolean isDownloadingListing() { // return downloadingListingLock.isLocked(); // } - + public Comparator getComparator() { return nameComparator; } - + static Comparator nameComparator = new Comparator() { public int compare(Contribution o1, Contribution o2) { return o1.getName().toLowerCase().compareTo(o2.getName().toLowerCase());