diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index 0e23bbe1c..4e5ef01b6 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -421,9 +421,11 @@ public class ContributionListing { } + /* protected boolean listDownloadSuccessful() { return !listDownloadFailed; } + */ private List parseContribList(File file) { diff --git a/app/src/processing/app/contrib/ContributionTab.java b/app/src/processing/app/contrib/ContributionTab.java index 7c1317e20..a37a42fe4 100644 --- a/app/src/processing/app/contrib/ContributionTab.java +++ b/app/src/processing/app/contrib/ContributionTab.java @@ -37,12 +37,11 @@ import processing.app.ui.Toolkit; public class ContributionTab extends JPanel { - //static final String ANY_CATEGORY = Language.text("contrib.all"); static final int FILTER_WIDTH = Toolkit.zoom(180); Base base; ContributionType contribType; - ManagerFrame contribDialog; + ManagerFrame managerFrame; Contribution.Filter filter; JComboBox categoryChooser; @@ -64,12 +63,14 @@ public class ContributionTab extends JPanel { JProgressBar progressBar; - public ContributionTab() { } + public ContributionTab(ManagerFrame dialog) { + this.managerFrame = dialog; + this.base = dialog.base; + } public ContributionTab(ManagerFrame dialog, ContributionType type) { - this.base = dialog.base; - this.contribDialog = dialog; + this(dialog); this.contribType = type; // long t1 = System.currentTimeMillis(); @@ -89,6 +90,7 @@ public class ContributionTab extends JPanel { // System.out.println("ContributionTab. " + (t4-t1) + " " + (t5-t4) + " " + (t6-t5)); } + public void showFrame(boolean error, boolean loading) { setLayout(error, loading); contributionListPanel.setVisible(!loading); @@ -189,31 +191,24 @@ public class ContributionTab extends JPanel { errorMessage = new JTextPane(); errorMessage.setEditable(false); errorMessage.setContentType("text/html"); - errorMessage.setText("
Could not connect to the Processing server.
" - + "Contributions cannot be installed or updated without an Internet connection.
" - + "Please verify your network connection again, then try connecting again.
"); - //DetailPanel.setTextStyle(errorMessage, "1em"); - //errorMessage.addStyle(DetailPanel.getBodyStyle()); + errorMessage.setText("
" + + "Could not connect to the Processing server.
" + + "Contributions cannot be installed or updated without an Internet connection.
" + + "Please verify your network connection again, then try connecting again." + + "
"); Dimension dim = new Dimension(550, 60); errorMessage.setMaximumSize(dim); errorMessage.setMinimumSize(dim); errorMessage.setOpaque(false); - /* - StyledDocument doc = errorMessage.getStyledDocument(); - SimpleAttributeSet center = new SimpleAttributeSet(); - StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER); - doc.setParagraphAttributes(0, doc.getLength(), center, false); - */ - closeButton = Toolkit.createIconButton("manager/close"); closeButton.setContentAreaFilled(false); - closeButton.addActionListener(e -> contribDialog.makeAndShowTab(false, false)); + closeButton.addActionListener(e -> managerFrame.makeAndShowTab(false, false)); tryAgainButton = new JButton("Try Again"); tryAgainButton.setFont(ManagerFrame.NORMAL_PLAIN); tryAgainButton.addActionListener(e -> { - contribDialog.makeAndShowTab(false, true); - contribDialog.downloadAndUpdateContributionListing(base); + managerFrame.makeAndShowTab(false, true); + managerFrame.downloadAndUpdateContributionListing(base); }); layout.setHorizontalGroup(layout.createSequentialGroup() .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, diff --git a/app/src/processing/app/contrib/UpdateContributionTab.java b/app/src/processing/app/contrib/UpdateContributionTab.java index 1db4e3ce5..f569a9211 100644 --- a/app/src/processing/app/contrib/UpdateContributionTab.java +++ b/app/src/processing/app/contrib/UpdateContributionTab.java @@ -12,8 +12,7 @@ import processing.app.ui.Toolkit; public class UpdateContributionTab extends ContributionTab { public UpdateContributionTab(ManagerFrame dialog) { - super(); - this.contribDialog = dialog; + super(dialog); filter = contrib -> { if (contrib instanceof ListPanel.SectionHeaderContribution) { @@ -25,7 +24,6 @@ public class UpdateContributionTab extends ContributionTab { return false; }; contributionListPanel = new UpdateListPanel(this, filter); -// contributionListPanel.setBorder(new EmptyBorder(8, 8, 8, 8)); statusPanel = new UpdateStatusPanel(this); contribListing = ContributionListing.getInstance(); @@ -43,7 +41,6 @@ public class UpdateContributionTab extends ContributionTab { loaderLabel = new JLabel(Toolkit.getLibIcon("manager/loader.gif")); loaderLabel.setOpaque(false); -// loaderLabel.setBackground(Color.WHITE); } GroupLayout layout = new GroupLayout(this); diff --git a/todo.txt b/todo.txt index 397ff1765..180f4717d 100755 --- a/todo.txt +++ b/todo.txt @@ -22,17 +22,14 @@ X remove extra ContribProgressMonitor class X removing the current Mode (with no windows open) will cause an exception X when next opening a sketch, nextMode is set to the old guy _ allow update of the current Mode +_ lots of rewriting to use SwingWorker +_ https://docs.oracle.com/javase/tutorial/uiswing/concurrency/worker.html + +unzip -d ~/coconut/sketchbook4/modes/ ~/Desktop/p5jsMode.zip _ an incompatible Mode prevents the PDE from quitting after last window is closed _ https://github.com/processing/processing/issues/5112 - -_ remove checkbox for detaching sketch name -_ just do this manually, and Save As will reset the name - -_ update wiki with recent changes (i.e. separating sketch folder) -_ https://github.com/processing/processing4/wiki/Processing-4 - _ clicking "Update All" on the Updates tab throws NPE _ https://github.com/processing/processing4/issues/440 Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "javax.swing.JProgressBar.setVisible(boolean)" because "this.progressBar" is null @@ -45,6 +42,12 @@ Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot in _ on release: submit to Microsoft _ https://www.microsoft.com/en-us/wdsi/filesubmission +_ remove checkbox for detaching sketch name +_ just do this manually, and Save As will reset the name + +_ update wiki with recent changes (i.e. separating sketch folder) +_ https://github.com/processing/processing4/wiki/Processing-4 + python X add JavaFX handler X opening an example throws an NPE