From c66ea38a94a6b6745da460fcb3db22ef6f861914 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 18 Sep 2015 15:27:29 -0400 Subject: [PATCH] fix more fake bold, version detection code that should not be there, other cleanups --- .../app/contrib/ContributionListPanel.java | 22 +-------- .../app/contrib/ContributionListing.java | 46 +------------------ .../app/contrib/ContributionPanel.java | 20 ++++---- todo.txt | 38 +++++++++------ 4 files changed, 36 insertions(+), 90 deletions(-) diff --git a/app/src/processing/app/contrib/ContributionListPanel.java b/app/src/processing/app/contrib/ContributionListPanel.java index 1d2f9ea10..5cec52bfb 100644 --- a/app/src/processing/app/contrib/ContributionListPanel.java +++ b/app/src/processing/app/contrib/ContributionListPanel.java @@ -491,27 +491,9 @@ public class ContributionListPanel extends JPanel implements Scrollable, Contrib public void filterLibraries(List filteredContributions) { synchronized (panelByContribution) { - /*Set hiddenPanels = - new TreeSet(contribListing.getComparator()); - hiddenPanels.addAll(panelByContribution.keySet()); - - for (Contribution info : filteredContributions) { - ContributionPanel panel = panelByContribution.get(info); - if (panel != null) { - panel.setVisible(true); - hiddenPanels.remove(info); - } - } - - for (Contribution info : hiddenPanels) { - ContributionPanel panel = panelByContribution.get(info); - if (panel != null) { - panel.setVisible(false); - } - }*/ TreeSet panelInThisTab = new TreeSet(contribListing.getComparator()); for (Contribution contribution : filteredContributions) { - if(contribution.getType() == this.contributionTab.contributionType){ + if(contribution.getType() == this.contributionTab.contributionType) { panelInThisTab.add(contribution); } } @@ -522,11 +504,11 @@ public class ContributionListPanel extends JPanel implements Scrollable, Contrib protected void setSelectedPanel(ContributionPanel contributionPanel) { contributionTab.updateStatusPanel(contributionPanel); + if (selectedPanel == contributionPanel) { selectedPanel.setSelected(true); } else { - ContributionPanel lastSelected = selectedPanel; selectedPanel = contributionPanel; diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index 828272d06..dd329c62f 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -528,20 +528,6 @@ public class ContributionListing { return null; } return newestContrib.getPrettyVersion(); - /* - String latestVersion = newestContrib.getPrettyVersion(); - if (latestVersion != null && !latestVersion.isEmpty()) { - if (latestVersion.toLowerCase().startsWith("build")) // For Python mode - return ("v" + latestVersion.substring(5, latestVersion.indexOf(',')) - .trim()); - else if (latestVersion.toLowerCase().startsWith("v")) // For ketai library - return latestVersion; - else - return ("v" + latestVersion); - } - else - return null; - */ } @@ -556,36 +542,8 @@ public class ContributionListing { } -// /** -// * @return a lowercase string with all non-alphabetic characters removed -// */ -// static protected String normalize(String s) { -// 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. -// */ -// static public String getCategory(String category) { -// if (category == null) { -// return "Unknown"; -// } -// String normCatName = normalize(category); -// -// for (String validCatName : validCategories) { -// String normValidCatName = normalize(validCatName); -// if (normValidCatName.equals(normCatName)) { -// return validCatName; -// } -// } -// return category; -// } - - - ArrayList parseContribList(File file) { - ArrayList outgoing = new ArrayList(); + List parseContribList(File file) { + List outgoing = new ArrayList(); if (file != null && file.exists()) { String[] lines = PApplet.loadStrings(file); diff --git a/app/src/processing/app/contrib/ContributionPanel.java b/app/src/processing/app/contrib/ContributionPanel.java index c94aac4d2..b15b4f96e 100644 --- a/app/src/processing/app/contrib/ContributionPanel.java +++ b/app/src/processing/app/contrib/ContributionPanel.java @@ -454,26 +454,22 @@ class ContributionPanel extends JPanel { add(iconLabel, BorderLayout.WEST); } + // Avoid ugly synthesized bold + Font boldFont = Toolkit.getSansFont(12, Font.BOLD); + String fontFace = ""; + description = new StringBuilder(); - description.append(""); + description.append("" + fontFace); if (contrib.getUrl() == null) { description.append(contrib.getName()); } else { description.append("" + contrib.getName() + ""); } - description.append(" "); + description.append(" "); String version = contrib.getPrettyVersion(); - - // TODO this has no place here, we shouldn't be cleaning up contrib - // information in the f*king GUI. - if (version != null && !version.isEmpty()) { - if (version.toLowerCase().startsWith("build")) // For Python mode - description.append(version.substring(5, version.indexOf(',')).trim()); - else if (version.toLowerCase().startsWith("v")) // For ketai library - description.append(version); - else - description.append(version); + if (version != null) { + description.append(version); } description.append("
"); diff --git a/todo.txt b/todo.txt index 1a1227e54..dfb93eec3 100644 --- a/todo.txt +++ b/todo.txt @@ -7,6 +7,8 @@ o the AST checker has better error message handling for those cases o and hitting Run replaces the useful error with something weird X https://github.com/processing/processing/issues/3408 X not great because the error checker runs more slowly than your typing +X SVG not highlighting as a keyword +X https://github.com/processing/processing/issues/3752 manager X CM: Clicking item in Libraries list throws exception @@ -115,15 +117,20 @@ _ also change the revision in the "about processing" dialog _ https://github.com/processing/processing/issues/3665 -gui -_ different design of squiggly line? -_ build custom scroll bar since the OS versions are so ugly? -_ error/warning location is awkward when no scroll bar is in use +gui/3 final _ show hover text when the mouse is over the 'debug' button _ show number of updates available in the footer _ https://github.com/processing/processing/issues/3518 _ finish the gui _ https://github.com/processing/processing/issues/3072 + + +gui +_ different design of squiggly line? +_ build custom scroll bar since the OS versions are so ugly? +_ error/warning location is awkward when no scroll bar is in use +_ when only one screen-full, show ticks at exact location +_ simpler/less confusing to not show at all? _ see notes in the 'dialogs' section below, implement our own option panes? _ tiny trail of dots when moving the selection bar up/down on retina _ need 'actively pressed' version of 'play' and 'stop' @@ -141,27 +148,28 @@ _ rather than post-compile _ https://github.com/processing/processing/issues/136 -gui/low -_ welcome screen tweaks -_ click "show this welcome" text to check/uncheck the box -_ submit the form (as if 'get started' clicked) when closing the window -_ whether hitting ESC or the close box on the window - - manager -_ scrolling "past" top/bottom causes the screen to jiggle -_ total number of updates available is not correct _ implement 2x versions of icons _ https://github.com/processing/processing/issues/3478 _ foundation icon in list _ foundation icon below next to description when lib selected _ icons on the install/update/remove buttons _ search eyeglass icon -_ +_ fix bold version used in the description below, when an item is selected + +_ scrolling "past" top/bottom causes the screen to jiggle (OS X and Trackpad) +_ total number of updates available is not correct _ Examples window closes and re-opens during library install/remove _ https://github.com/processing/processing/issues/3304 +gui/low +_ welcome screen tweaks +_ click "show this welcome" text to check/uncheck the box +_ submit the form (as if 'get started' clicked) when closing the window +_ whether hitting ESC or the close box on the window + + fonts _ fonts are still really ugly (on non-retina) _ may need to drop use of Source Sans @@ -917,6 +925,8 @@ _ this may already work with SingleInstance stuff DIST / Mac OS X + +_ built-in images: http://nadeausoftware.com/articles/2008/12/mac_java_tip_how_access_mac_specific_nsimage_icons _ replace appbundler with the Java 8 packager _ https://github.com/processing/processing/issues/3071 _ fix appbundler problems due to rollback