Commit Graph

678 Commits

Author SHA1 Message Date
A Pottinger
fdcaf7d932 Cleaned up RewriterCodeGen and added setDestinationPackage.
Allow client code to provide a destination package for generated code and removed some (now dead) code for RewriterCodeGenerator.
2019-10-13 11:47:35 -07:00
A Pottinger
96e4f0a203 Merged supporting classes into PdeParseTreeListener.
An explicit goal of @benfry is to reduce class count and this PR cleans up edits made within preproc to merge supporting classes and utility functions of PdeParseTreeListener into PdeParseTreeListener itself. This includes removal of ImportUtil per https://github.com/processing/processing4/issues/10.
2019-10-11 08:38:38 -07:00
A Pottinger
d08048eca9 Allow override of core and default imports for PdeParseTreeListener.
In support of modes, allow client code override of core and default imports for PdeParseTreeListener.
2019-10-11 07:56:24 -07:00
A Pottinger
9055e44e0c Allow for public instantiation of PdeParseTreeListener.
To support modes, allow for public instantiation of PdeParseTreeListener and for its public extension.
2019-10-10 21:07:53 -07:00
A Pottinger
b4042f7264 Merge branch 'tree_listener_parameter' of github.com:sampottinger/processing4 into tree_listener_parameter 2019-10-10 21:06:21 -07:00
A Pottinger
f47a0a26c2 Allow subclassing of RewriterCodeGenerator.
Some difficult to generate code is managed by the RewriterCodeGenerator and some modes may need to modify that logic. This commit makes it easier to extend parts of RewriterCodeGenerator without requiring client code to duplicate too much effort.
2019-10-10 21:05:07 -07:00
A Samuel Pottinger
e38515cc6b Allow access to PdePreprocessor constructor 2019-10-10 08:50:08 -07:00
A Pottinger
5faf2a10a6 Refactor within PdePreprocessor to allow for override of edits.
In response to https://github.com/processing/processing4/issues/11, allow client code to override preprocessing edit behabior by providing a subclass of PdeParseTreeListener. This does make the construction for PdePreprocessor.java a little bit messier but a builder may help and moving dependent types within enclosing classes can hopefully keep things coherent.
2019-10-10 08:36:34 -07:00
A Samuel Pottinger
404835f417 Merge pull request #8 from sampottinger/runtime_structural_refactor
Consolidate logic for runtime path generation into a single class.
2019-10-07 07:41:18 -07:00
A Samuel Pottinger
0dfa1253fc Merge pull request #9 from sampottinger/error_rewrite_restructure
Refactor ANTLR message simplification infrastructure.
2019-10-07 07:41:07 -07:00
A Pottinger
e46a957f78 Minor fix in PreprocessorResult dimension reporting.
Fix issue reported by @codeanticode within PreprocessorResult.java where the height was not being returned correctly.
2019-10-06 23:05:35 -07:00
A Pottinger
f846c7e82c Refactor ANTLR message simplification infrastructure.
Refactor ANTLR message simplification infrastructure to reduce class count within preproc given @benfy feedback within https://github.com/processing/processing4/pull/1. Note that some supporting are left out but those can be further refactored behind classes as desired but strategies are all made anon or inner.
2019-10-06 22:55:41 -07:00
A Pottinger
ceb9fedaa2 Add back in RuntimePathBuilder* under new location. 2019-10-06 21:17:40 -07:00
A Pottinger
a265b1ed14 Consolidate logic for runtime path generation into a single class.
In response to @benfry feedback within https://github.com/processing/processing4/pull/1, consolidated all of the runtime path calculation into a single class while still maintaining all of the tests and caching logic. This reduces the class count but still adapts to jmod and javafx path calculation requirements for java 11.
2019-10-06 21:10:16 -07:00
A Samuel Pottinger
2b05da132a Refactored TabLineFactory into ProblemFactory. (#7)
* Refactored TabLineFactory into ProblemFactory.

As part of https://github.com/processing/processing4/pull/1, refactored TabLineFactory into ProblemFactory, merging tests in the process.

* Fix imports on https://github.com/sampottinger/processing4/pull/7.
2019-10-06 18:24:20 -07:00
A Samuel Pottinger
ee299ef935 Move to ANTLR 4 with Java 11 lang features and localization. (#5)
* Move to ANTLR 4 with Java 11 lang features and localization.

Introduces ANTLR4 and Java 8 language feature support within IDE while also adding additional hooks for localization of syntax error messages, addressing https://github.com/processing/processing/issues/3054 and https://github.com/processing/processing/issues/3055.

The PR is broadly a continuation of https://github.com/processing/processing/issues/3055, bringing it up to speed with the latest Processing master plus the changes introduced at https://github.com/processing/processing/pull/5753. **Requires https://github.com/processing/processing/pull/5753 as pre-requisite.** This introduces a number of edits beyond https://github.com/processing/processing/issues/3055 beyond compatibility with current Processing master and https://github.com/processing/processing/pull/5753 including:

 - Update to the grammar itself
 - Change ANTLR listeners to emit `TextTransform.Edit` to unify JDT-based `PreprocessingService` and `JavaBuild`, removing code with duplicate purpose.
 - Introduction of syntax error rewriting with support for localization.
 - Addition of complete localized strings set for English and Spanish.
 - Addition of partial localized strings set for other languages.
 - Refactor of ANTLR-related code for testability and readability
 - Expansion of tests including full parse tests for new Java features (type inference, lambdas).

* Ask travis for ant upgrade prior to run.

* Ask Travis for java11 update.

* Add openjdk ppa

* Travis no confirmation on add ppa.

* Force newer ant on travis.

* Swtich ant download to www-us mirror.

* Switch ant to 1.10.7

* Start x for unit tests in travis.

* More complete start x in travis.

* Revert x in travis.

* Try x in services.
2019-10-05 23:34:38 -07:00
A Pottinger
c14695476e Moves to Java11 and OpenJDK via AdoptOpenJDK within the processing4 train.
Moves to Java11 and OpenJDK via AdoptOpenJDK within the processing4 train using a squash of sampottinger processing fork's java11 branch.

**Primary required changes:**
Some changes directly support OpenJFX / OpenJDK 11:

 - Response to image loading changes caused by [JEP 320](https://openjdk.java.net/jeps/320)
 - Use of jmodules as necessitated by [JEP 261](https://openjdk.java.net/jeps/261)
 - Reponse to largely changed file paths caused by [JEP 220](https://openjdk.java.net/jeps/220).
 - Modifications in build system related to AdoptOpenJDK and Java 11 which have a different naming structure for downloads.
 - Allowing use of non-Oracle Java within internal Processing checks.

**Secondary required changes:**
There were some secondary required changes that impacted the usability of Processing after having moved to OpenJFX / OpenJDK 11:

 - Removal of com.apple.eawt calls related to [JEP 272](http://openjdk.java.net/jeps/272)
 - Response to HiDPI support on Windows and Linux in [JEP 263](https://openjdk.java.net/jeps/263)
- Removal of `java.ext.dirs`. Would be forced by [JEP 220](http://openjdk.java.net/jeps/220).
 - Due to bugs on Windows, updated the JNA jars.
 - Changes in downloader build tasks to support AdoptOpenJDK and OpenJFX.
 - Updated org.eclipse.* / equinox jars.
 - Some optimization around size of distribution.
 - Update of AppBundler.
 - Some changes in formulation of classpath and modifications in PreprocessingService given [JEP 261](https://openjdk.java.net/jeps/261).

**Incidental changes:**
This was (ahem) a bit of a larger PR with the above modifications. So, I wanted to introduce automated tests when possible and convenient along with a few changes for platform sustainability in order to support development:

 - Addition of cross-building capability (!) made possible by AdoptOpenJDK.
 - Addition of mockito for testing.
 - Upgrade of junit.
 - Addition of ant-contrib.
 - Standardized nomenclature around JRE / JDK in `build/build.xml`
 - Deduplication of code in `jre/build.xml`.
 - Addition of JavaDoc in a few places.
 - Some refactoring of PImage / Shape to support increased testing and readability in image manipulation code.
2019-10-05 20:49:33 -07:00
Ben Fry
4cb3bc5d29 clean up some formatting and ordering issues 2019-03-02 17:57:42 -05:00
Ben Fry
cab7828902 update copyright years in processing.app.ui package 2019-01-22 19:06:09 -05:00
Ben Fry
1964bf65cb rewrite key stroke handling; now multi-platform, overridable by prefs 2019-01-22 18:28:43 -05:00
Ben Fry
98d5835f70 repair size() regression in 3.5 (fixes #5759) 2019-01-21 08:59:40 -05:00
Ben Fry
0b76e397e9 fixing #4703 reveals another bug 2019-01-20 10:28:14 -08:00
Ben Fry
5c339aafd0 don't remove settings() methods if settings() is present in code (fixes #4703) 2019-01-20 07:59:14 -08:00
Ben Fry
73cd701091 move problematic shortcuts out to the language files (fixes #2199) 2019-01-18 17:23:02 -08:00
Ben Fry
3380239e68 Merge pull request #5486 from JakubValtar/fix-status-exception
Fix sketch exception getting hidden by warning
2019-01-18 08:28:52 -08:00
Ben Fry
c3c2dbb4c2 resolve ambiguous import 2019-01-17 08:53:45 -08:00
Jakub Valtar
8f37ebcb18 Fix freeze when restarting sketch with variables in size
While sketch is running, rewriting sketch size to variables and trying to restart the sketch by pressing the play button causes PDE to freeze. Fixed by moving AWT call to EDT.
2018-11-17 15:11:06 +01:00
Ben Fry
9015177fb2 todo notes and clean up a few warnings 2018-05-05 09:54:44 -04:00
Jakub Valtar
d29366d34b Change Editor status message only from EDT
This adapter invokes all status changes on the EDT instead of worker thread of the Runner. Modifying AWT components from the worker threads may introduce strange bugs and in this case caused UI changes to run out of order, hiding runtime exceptions under problems displayed when cursor moves to the offending line.
2018-04-24 11:31:27 +02:00
Ben Fry
f4bfffc5a9 remove preproc.substitute_unicode (fixes #5456) 2018-04-05 10:45:46 -04:00
gohai
7b273c83b3 Update java.lang.UnsupportedClassVersionError message
This came up in #5457
2018-03-31 14:20:18 -04:00
Ben Fry
b28139a035 notes about completion work 2018-03-26 17:43:36 -04:00
Ben Fry
6cc0791fad more cleanup in completions code 2018-03-26 17:26:11 -04:00
Ben Fry
acacaf5225 more cleanup, time to merge these functions 2018-03-26 17:14:33 -04:00
Ben Fry
196a367449 more cleaning; switching to elementName instead of html parse (needs test) 2018-03-26 16:59:45 -04:00
Ben Fry
47a44983aa cleaning up CompletionCandidate... hoo boy 2018-03-26 16:39:42 -04:00
Ben Fry
e1d3d56b87 set default button in the Rename dialog (fixes #5400) 2018-03-26 14:06:22 -04:00
Ben Fry
8692c146a4 redo the dreadful layout for the Rename dialog 2018-03-26 14:02:56 -04:00
Ben Fry
5722b5323b close Rename (refactor) dialog on ESC (fixes #5391) 2018-03-26 12:02:21 -04:00
Ben Fry
bf29921140 moving more classes out, yech 2018-03-26 11:56:41 -04:00
Ben Fry
fcc6550960 breaking out these static classes to be on their own 2018-03-26 11:51:39 -04:00
Ben Fry
273b0d8b42 gonna move the rename dialog out 2018-03-26 11:42:14 -04:00
Ben Fry
e294030e47 major work on the Welcome screen (fixes #3911, #3912) 2018-03-18 16:31:48 -04:00
Ben Fry
24c1266e5b adding the Swing-based Welcome dialog from @whetfire (#5210) 2018-03-18 08:34:11 -04:00
Ben Fry
ca9262213d add another try/catch for createWriter() call 2018-03-13 20:53:11 -04:00
Ben Fry
e77da8db9f fix rename dialog scaling for high density (fixes #5368) 2018-03-13 19:36:48 -04:00
Ben Fry
532860cd9a erase types and make this if() a little less confusing 2018-03-13 13:08:18 -04:00
Ben Fry
3e495b33a5 do the same thing with less code 2018-03-13 12:37:41 -04:00
Jakub Valtar
728cb75494 Output java files in UTF-8 and force compiler to use UTF-8 2018-03-13 15:35:26 +01:00
Tobias Pristupin
bb48d84766 Updated comment
Comment said function throws RunnerException, but function throws SketchException which isn't related to RunnerException
2018-02-20 08:30:45 -05:00