getDownloadItem() {
- // Determine download type
- boolean isJavaDownload = component.equalsIgnoreCase("jdk");
- isJavaDownload = isJavaDownload || component.equalsIgnoreCase("jre");
-
- boolean isJfxDownload = component.equalsIgnoreCase("jfx");
-
- DownloadUrlGenerator downloadUrlGenerator;
-
- // Determine url generator
- if (isJavaDownload) {
- downloadUrlGenerator = new AdoptOpenJdkDownloadUrlGenerator();
- } else if (isJfxDownload) {
- downloadUrlGenerator = new GluonHqDownloadUrlGenerator();
- } else {
- throw new RuntimeException("Do not know how to download: " + component);
- }
-
- // Build download item
- String path = downloadUrlGenerator.getLocalFilename(
- platform,
- component,
- train,
- version,
- update,
- build,
- flavor
- );
-
- String url = downloadUrlGenerator.buildUrl(
- platform,
- component,
- train,
- version,
- update,
- build,
- flavor
- );
-
- return Optional.of(new DownloadItem(url, path, downloadUrlGenerator.getCookie()));
- }
-
- /**
- * Print a line out to console if logging is enabled.
- *
- * @param message The message to be printed.
- */
- private static void println(String message) {
- if (PRINT_LOGGING) {
- System.out.println(message);
- }
- }
-
- /**
- * Print a line out to console if logging is enabled without a newline.
- *
- * @param message The message to be printed.
- */
- private static void print(String message) {
- if (PRINT_LOGGING) {
- System.out.print(message);
- }
- }
-
- /**
- * Print an empty line to the system.out.
- */
- private static void printEmptyLine() {
- println("");
- }
}
diff --git a/build/jre/src/GluonHqDownloadUrlGenerator.java b/build/jre/src/GluonHqDownloadUrlGenerator.java
deleted file mode 100644
index 77ef62677..000000000
--- a/build/jre/src/GluonHqDownloadUrlGenerator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2014-20 The Processing Foundation
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2, as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- 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 with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-/**
- * URL generator for downloading JFX directly from OpenJFX's sponsor Gluon.
- */
-public class GluonHqDownloadUrlGenerator extends DownloadUrlGenerator {
-
- private static final String TEMPLATE_URL = "http://gluonhq.com/download/javafx-%d-%d-%d-sdk-%s/";
-
- @Override
- public String buildUrl(String platform, String component, int train, int version, int update,
- int build, String flavor) {
-
- String platformLower = platform.toLowerCase();
-
- String platformShort;
- if (platformLower.contains("linux")) {
- platformShort = "linux";
- } else if (platformLower.contains("mac")) {
- platformShort = "mac";
- } else if (platformLower.contains("windows")) {
- platformShort = "windows";
- } else {
- throw new RuntimeException("Unsupported platform for JFX: " + platform);
- }
-
- return String.format(TEMPLATE_URL, train, version, update, platformShort);
- }
-
-}
diff --git a/build/jre/test/AdoptOpenJdkDownloadUrlGeneratorTest.java b/build/jre/test/AdoptOpenJdkDownloadUrlGeneratorTest.java
deleted file mode 100644
index 4a07fa990..000000000
--- a/build/jre/test/AdoptOpenJdkDownloadUrlGeneratorTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2012-19 The Processing Foundation
- Copyright (c) 2004-12 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2, as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- 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 with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class AdoptOpenJdkDownloadUrlGeneratorTest {
-
- private static final String EXPECTED_WIN64_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_windows_hotspot_11.0.1_13.zip";
- private static final String EXPECTED_MAC_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_mac_hotspot_11.0.1_13.tar.gz";
- private static final String EXPECTED_LINUX_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_linux_hotspot_11.0.1_13.tar.gz";
- private static final String EXPECTED_LINUX_URL_ARM = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.1_13.tar.gz";
-
- private static final String COMPONENT = "jdk";
- private static final int TRAIN = 11;
- private static final int VERSION = 0;
- private static final int UPDATE = 1;
- private static final int BUILD = 13;
- private static final String FLAVOR_SUFFIX = "-x64.tar.gz";
- private static final String HASH = "";
-
- private AdoptOpenJdkDownloadUrlGenerator urlGenerator;
-
- @Before
- public void setUp() throws Exception {
- urlGenerator = new AdoptOpenJdkDownloadUrlGenerator();
- }
-
- @Test
- public void testBuildUrlWindows() {
- String url = urlGenerator.buildUrl(
- "windows64",
- COMPONENT,
- TRAIN,
- VERSION,
- UPDATE,
- BUILD,
- "windows" + FLAVOR_SUFFIX,
- HASH
- );
-
- assertEquals(
- EXPECTED_WIN64_URL,
- url
- );
- }
-
- @Test
- public void testBuildUrlMac() {
- String url = urlGenerator.buildUrl(
- "macosx64",
- COMPONENT,
- TRAIN,
- VERSION,
- UPDATE,
- BUILD,
- "mac" + FLAVOR_SUFFIX,
- HASH
- );
-
- assertEquals(
- EXPECTED_MAC_URL,
- url
- );
- }
-
- @Test
- public void testBuildUrlLinux64() {
- String url = urlGenerator.buildUrl(
- "linux64",
- COMPONENT,
- TRAIN,
- VERSION,
- UPDATE,
- BUILD,
- "linux64" + FLAVOR_SUFFIX,
- HASH
- );
-
- assertEquals(
- EXPECTED_LINUX_URL,
- url
- );
- }
-
- @Test
- public void testBuildUrlLinuxArm() {
- String url = urlGenerator.buildUrl(
- "linuxArm",
- COMPONENT,
- TRAIN,
- VERSION,
- UPDATE,
- BUILD,
- "linuxArm" + FLAVOR_SUFFIX,
- HASH
- );
-
- assertEquals(
- EXPECTED_LINUX_URL_ARM,
- url
- );
- }
-
-}
diff --git a/build/jre/test/GluonHqDownloadUrlGeneratorTest.java b/build/jre/test/GluonHqDownloadUrlGeneratorTest.java
deleted file mode 100644
index 0f1ca2faa..000000000
--- a/build/jre/test/GluonHqDownloadUrlGeneratorTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2012-19 The Processing Foundation
- Copyright (c) 2004-12 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2, as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- 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 with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class GluonHqDownloadUrlGeneratorTest {
-
- private static final String EXPECTED_WIN64_URL = "http://gluonhq.com/download/javafx-11-0-2-sdk-windows/";
- private static final String EXPECTED_MAC_URL = "http://gluonhq.com/download/javafx-11-0-2-sdk-mac";
- private static final String EXPECTED_LINUX_URL = "http://gluonhq.com/download/javafx-11-0-2-sdk-linux/";
-
- private static final String COMPONENT = "jfx";
- private static final int TRAIN = 11;
- private static final int VERSION = 0;
- private static final int UPDATE = 2;
- private static final int BUILD = 0;
- private static final String FLAVOR_SUFFIX = ".zip";
- private static final String HASH = "";
-
- private AdoptOpenJdkDownloadUrlGenerator urlGenerator;
-
- @Before
- public void setUp() throws Exception {
- urlGenerator = new AdoptOpenJdkDownloadUrlGenerator();
- }
-
- @Test
- public void testBuildUrlWindows() {
- String url = urlGenerator.buildUrl(
- "windows64",
- COMPONENT,
- TRAIN,
- VERSION,
- UPDATE,
- BUILD,
- "windows" + FLAVOR_SUFFIX,
- HASH
- );
-
- assertEquals(
- EXPECTED_WIN64_URL,
- url
- );
- }
-
- @Test
- public void testBuildUrlMac() {
- String url = urlGenerator.buildUrl(
- "macosx64",
- COMPONENT,
- TRAIN,
- VERSION,
- UPDATE,
- BUILD,
- "mac" + FLAVOR_SUFFIX,
- HASH
- );
-
- assertEquals(
- EXPECTED_MAC_URL,
- url
- );
- }
-
- @Test
- public void testBuildUrlLinux() {
- String url = urlGenerator.buildUrl(
- "linux64",
- COMPONENT,
- TRAIN,
- VERSION,
- UPDATE,
- BUILD,
- "linux64" + FLAVOR_SUFFIX,
- HASH
- );
-
- assertEquals(
- EXPECTED_LINUX_URL,
- url
- );
- }
-
-}
diff --git a/build/jre/test/OracleDownloadUrlGeneratorTest.java b/build/jre/test/OracleDownloadUrlGeneratorTest.java
deleted file mode 100644
index 2124c210f..000000000
--- a/build/jre/test/OracleDownloadUrlGeneratorTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2012-19 The Processing Foundation
- Copyright (c) 2004-12 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2, as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- 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 with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.Ignore;
-import static org.junit.Assert.assertEquals;
-
-public class OracleDownloadUrlGeneratorTest {
-
- private static final String EXPECTED_URL = "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-macosx-x64.dmg";
-
- private OracleDownloadUrlGenerator urlGenerator;
-
- @Before
- public void setUp() throws Exception {
- urlGenerator = new OracleDownloadUrlGenerator();
- }
-
- @Test
- public void testBuildUrl() {
- String url = urlGenerator.buildUrl(
- "macos",
- "jdk",
- 1,
- 8,
- 131,
- 11,
- "macosx-x64.dmg",
- "d54c1d3a095b4ff2b6607d096fa80163"
- );
-
- assertEquals(
- EXPECTED_URL,
- url
- );
- }
-
-}
diff --git a/build/shared/lib/welcome/generic.html b/build/shared/lib/welcome/generic.html
index 50a4e8216..0946269b3 100644
--- a/build/shared/lib/welcome/generic.html
+++ b/build/shared/lib/welcome/generic.html
@@ -13,7 +13,7 @@
- Welcome to Processing 4 (alpha)
+ Processing 4 (alpha)
|
diff --git a/build/shared/lib/welcome/sketchbook.html b/build/shared/lib/welcome/sketchbook.html
index a45c02bdd..6d4cc8cfa 100644
--- a/build/shared/lib/welcome/sketchbook.html
+++ b/build/shared/lib/welcome/sketchbook.html
@@ -13,7 +13,7 @@
- Welcome to Processing 4 (alpha)
+ Processing 4 (alpha)
|
diff --git a/core/todo.txt b/core/todo.txt
index c60cd6721..ca2932a9c 100644
--- a/core/todo.txt
+++ b/core/todo.txt
@@ -22,8 +22,6 @@ _ removing AWT from core
_ https://github.com/codeanticode/processing-lwjgl/wiki#making-awt-optional-in-papplet
_ move loadImage() into surface
-_ size() issues on Mojave? (3.4 works, 3.5.3 does not)
-_ https://github.com/processing/processing/issues/5791
_ use exit event to set mouseY to 0 on macOS
_ https://github.com/processing/processing/pull/5796/files
@@ -31,6 +29,12 @@ _ possible fix for precision issues with PDF
_ https://github.com/processing/processing/issues/5801#issuecomment-466632459
+high
+_ size() issues on Mojave? (3.4 works, 3.5.3 does not)
+_ https://github.com/processing/processing/issues/5791
+_ closed for now; unable to confirm anything in the thread
+
+
high-ish
_ Update isAccessible() in Table to use JDK 11 reflection methods
_ https://github.com/processing/processing4/issues/3
diff --git a/java/src/processing/mode/java/pdex/Rename.java b/java/src/processing/mode/java/pdex/Rename.java
index 7c5c6bca2..1941f4135 100644
--- a/java/src/processing/mode/java/pdex/Rename.java
+++ b/java/src/processing/mode/java/pdex/Rename.java
@@ -129,8 +129,8 @@ class Rename {
final String newName = textField.getText().trim();
if (!newName.isEmpty()) {
if (newName.length() >= 1 &&
- newName.chars().limit(1).allMatch(Character::isUnicodeIdentifierStart) &&
- newName.chars().skip(1).allMatch(Character::isUnicodeIdentifierPart)) {
+ newName.chars().limit(1).allMatch(Character::isJavaIdentifierStart) &&
+ newName.chars().skip(1).allMatch(Character::isJavaIdentifierPart)) {
rename(ps, binding, newName);
window.setVisible(false);
} else {
diff --git a/todo.txt b/todo.txt
index 804bb9944..c9bef4630 100755
--- a/todo.txt
+++ b/todo.txt
@@ -12,6 +12,8 @@ X link to a wiki page for 4.x
X create wiki page for changes in 4.x
X selecting a sketch in the Sketch menu no longer opens its window
X https://github.com/processing/processing/issues/5882
+X streamlining the jdk downloader
+X https://github.com/processing/processing4/issues/47
cross-ported from 3.5.4
X don't remove entries from Recent menu on Save As
@@ -74,6 +76,9 @@ X https://github.com/processing/processing/issues/5805
X https://github.com/processing/processing/pull/5909
X updtes to Ukrainian translation
X https://github.com/processing/processing/pull/5944
+X rename-variable menu allows Java identifiers
+X https://github.com/processing/processing/issues/5828
+X https://github.com/processing/processing/pull/5906
sampottinger
X Fix JDK naming and cleanup in ant build
@@ -117,6 +122,8 @@ _ change help menu links to go to newer FAQ and the rest
open issues
+_ update the docs repo
+_ check with Casey re: shallow clone or approach
_ reliable getLibraryFolder() and getDocumentsFolder() methods in MacPlatform
_ https://github.com/processing/processing4/issues/9
_ further streamline the downloader
@@ -129,9 +136,6 @@ _ windows anti-malware leaves browser stuck at 100%
_ https://github.com/processing/processing/issues/5893
-quick fixes
-_ rename-variable menu allows Java identifiers
-_ https://github.com/processing/processing/pull/5906
from Casey
_ Math for BLEND incorrect in the reference?