Skip to content

Commit b89efed

Browse files
committed
Documentation
1 parent 2ee27a8 commit b89efed

File tree

7 files changed

+113
-6
lines changed

7 files changed

+113
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,4 @@ java/build/
109109
/java/preprocessor/build
110110
/java/lsp/build
111111
/.kotlin/sessions
112+
/core/examples/build

BUILD.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# How to Build Processing
2+
3+
Great to see you are interested in contributing to Processing. To get started you will need to have an IDE to build and develop Processing. Our recommendation and what we use ourselves is Intellij IDEA.
4+
5+
## IntelliJ IDEA
6+
7+
First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/). Make sure to select the "Community Edition", not "Ultimate". The Community Edition is free and built on open-source software. You may need to scroll down to find the download link. Then:
8+
9+
1. Clone the Processing4 repository to your machine locally
10+
1. Open the cloned repository in IntelliJ IDEA CE
11+
1. In the main menu, go to File > Project Structure > Project Settings > Project.
12+
1. In the SDK Dropdown option, select a JDK version 17 or Download the jdk
13+
1. Click the green Run Icon in the top right of the window. This is also where you can find the option to debug Processing.
14+
1. Logs can be found in the `Build` or `Debug` pane on the bottom left of the window
15+
16+
17+
## VSCode
18+
1. Clone the Processing4 repository to your machine locally
19+
1. Open the cloned repository in VScode
20+
1. Wait for Gradle to set up the repository
21+
1. (If you want debugging install [Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug) and [Java Extension Pack](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack))
22+
1. Go to the Gradle Tab and click app -> Tasks -> compose desktop -> run
23+
24+
Instructions for other editors are welcome and feel free to contribute the documentation for those [here](#other-editors)
25+
26+
27+
## Architecture
28+
Processing is build of three distinct parts, the `Core`, `Java` and the `App`. The `Core` currently stands alone and `Java` and `App` depend on it. `Java` and `App` are currently interdependent but we are working on decoupling those two.
29+
30+
`Core`: The part of the code that gets bundled with your sketches, so the functionality like `ellipse(25,25,50,50);` The inner workings of that function can be found here.
31+
32+
`Java`: This is the pipeline that will take your `.pde` file and compile and run it. The PDE understands different _modes_ with `Java` being the primary one.
33+
34+
`App`: This is the PDE, the visual part of the editor that you see and work within when you use Processing.
35+
36+
### Examples
37+
38+
- You want to fix a bug with one of the argument of a function that you use in a sketch. The `Core` is probably where you would find the implementation of the function that you would like to modify.
39+
- A feature/bug of the PDE editor has been driving you nuts, and you can no longer stand it. You would probably find your bug in the `App` section of this project.
40+
- You've written a large sketch and Processing has become slow to compile, a place to improve this code can probably be found in the `Java` section.
41+
42+
## User interface
43+
Traditionally Processing has been written in Java swing and Flatlaf (and some html & css). Since 2025 we have switched to include Jetpack Compose, for a variety of reasons but mostly for it's inter-compatibility. There were ideas to switch to a React based editor, but this approach allows us to slowly replace Java swing components to Jetpack Compose, Ship of Theseus style.
44+
45+
## Build system
46+
47+
We use `Gradle` as the build system for Processing. This used to be `Ant` but we have switched to be more in line with modern standards and to hopefully switch the internal build system in the `Java` mode to `Gradle` as well, unifying both systems for simplicity.
48+
49+
## Kotlin vs Java
50+
Since introducing the Gradle build system we also support Kotlin within the repository. Refactors from Java to Kotlin are not really necessary at this stage, but all new functionality should be written in Kotlin.
51+
52+
Any classes that end in `..Kt.Java` are there for backwards compatibility with the `Ant` build system and can be removed when that is no longer necessary.
53+
54+
### Running Processing
55+
56+
The main task to run or debug the PDE is `app:run` this run the application with `compose desktop`
57+
58+
If your main concern is with the `Core` you don't need to start the whole PDE to test your changes. In IntelliJ IDEA you can select any of the sketches in `core/examples/src/.../` to run by click on the green arrow next to their main functions. This will just compile core and the example sketch. Feel free to also new examples for your newly added functionality.
59+
60+
## Other editors

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ While we assume good intentions, and will give everyone a chance to learn, we ha
3030
Building Processing locally on your machine will let you troubleshoot and make sure your contributions work as intended before submitting them to this repository. It also gives you the flexibility to experiment and learn more about how Processing is structured.
3131

3232
For a quick start:
33-
1. Fork and clone the repository.
34-
1. Open it in IntelliJ IDEA.
35-
1. Install the required [Ant plugin](https://plugins.jetbrains.com/plugin/23025-ant).
36-
1. Hit Run.
33+
1. Fork and clone the repository
34+
1. Open it in IntelliJ IDEA
35+
1. Wait for Gradle to sync
36+
1. Hit Run
3737

38-
For more information and detailed instructions, follow our [How to Build Processing](build/README.md) guide.
38+
For more information and detailed instructions, follow our [How to Build Processing](BUILD.md) guide.
3939

4040
## Contact Information
4141
For technical support or troubleshooting with your project, please post on the [Processing Forum](https://discourse.processing.org/).

app/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Processing `App`
2+
3+
This is the PDE, the visual part of the editor that you see and work within when you use Processing.
4+
5+
## Important classes
6+
7+
The main class of this project is the `src/.../Base.java` this is where the PDE starts after the splash screen.
8+
9+
The `ui/Editor.java` class is the class that is instantiated to show an editor window of the PDE.
10+
11+
`Mode.java` is the class that any mode within Procesing inherits from.
12+

build/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# How to Build Processing
22

3+
This folder contains files for the legacy `Ant` build system. This build system will be removed in the future when we're sure we no longer need it.
4+
35
## IntelliJ IDEA CE
46

57
First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/). Make sure to select the "Community Edition", not "Ultimate". The Community Edition is free and built on open-source software. You may need to scroll down to find the download link. Then:

core/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Including the Processing Core library on your project
1+
# Processing Core
2+
3+
`Core` contains the implementations of all the functionality that you would use within a Processing sketch, e.g. `size()` and `ellipse()`
4+
5+
6+
## Including the Processing Core library on your project
27
Processing’s core libraries are available through [Maven Central](https://central.sonatype.com/artifact/org.processing/core).
38
This allows integration of Processing into Java-based projects using build tools like Maven or Gradle.
49

@@ -56,6 +61,13 @@ dependencies {
5661
implementation group: 'org.processing', name: 'core', version: '4.3.1'
5762
}
5863
```
64+
65+
## Developing for Core
66+
The easiest way to develop for core, without the need to build the whole project, is to use the `examples/src` sketches. In
67+
68+
## PGraphics Modes
69+
Documentation on how to develop graphics modes as a library should go here.
70+
5971
### Other
6072
Other example snippets on including the library are included in the [Maven Central repo](https://central.sonatype.com/artifact/org.processing/core).
6173
Please look up on how to add the custom https://jogamp.org/deployment/maven repository to your build system.

java/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Processing Java Mode
2+
3+
This the Java Mode in Processing. It compiles your sketches and runs them. It is the primary mode of Processing.
4+
5+
## Folders
6+
- `application` assets for exporting applications within the mode
7+
- `generated` generated antlr code for the mode, should be moved to a proper `antlr` plugin within gradle
8+
- `libraries` libraries that are available within the mode
9+
- `lsp` gradle build system for the language server protocol, in the future we should decouple the lsp from the java mode and pde and move all relevant code here. For now it can be found in `src/.../lsp`
10+
- `mode` legacy files for `Ant`
11+
- `preprocessor` the preprocessor for the mode, same deal as with the lsp, although the decoupling has mostly been done
12+
- `src` the main source code for the mode
13+
- `test` tests for the mode
14+
- `theme` assets for the mode, related to autocomplete and syntax highlighting
15+
16+
## Future plans
17+
- Decouple the `lsp` and `preprocessor` from the mode and move them to their own repositories
18+
- Move the `antlr` code to a proper plugin within gradle
19+
- Create a gradle plugin to convert `.pde` file to `.java` files
20+
- Create a gradle based version of Java mode.

0 commit comments

Comments
 (0)