Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2e9db0e
Update README.md
Stefterv Mar 25, 2025
9e241c7
added the image comparator which is the pixel matching algorithm
Vaivaswat2244 Sep 16, 2025
a5ded6a
added build.gradle file
Vaivaswat2244 Sep 16, 2025
8e7f7d0
added the test runner
Vaivaswat2244 Sep 16, 2025
2f18f21
added the simple test
Vaivaswat2244 Sep 16, 2025
c51a8e4
Revise README for Jetpack Compose migration strategy
Stefterv Sep 24, 2025
4e7183f
fixing the build issues
Vaivaswat2244 Oct 6, 2025
5934138
added junit as dependency
Vaivaswat2244 Oct 6, 2025
c4915dd
removing custom class implementation
Vaivaswat2244 Oct 6, 2025
d549a18
inclding visual-tests in settings
Vaivaswat2244 Oct 6, 2025
cac895a
fixed the overlapping cmd
Vaivaswat2244 Oct 6, 2025
803516f
cleaning
Vaivaswat2244 Oct 6, 2025
ace6f7b
adding packages
Vaivaswat2244 Oct 6, 2025
5e7f798
added updated screenshot structure
Vaivaswat2244 Oct 6, 2025
25a80ce
refactoring
Vaivaswat2244 Oct 6, 2025
4fcd95b
added tests in suits
Vaivaswat2244 Oct 6, 2025
f778c99
removed simple test
Vaivaswat2244 Oct 7, 2025
6224f8c
deleting earlier files
Vaivaswat2244 Oct 16, 2025
bf21131
updated the core/gradle file
Vaivaswat2244 Oct 16, 2025
86f8847
added the infrastructure
Vaivaswat2244 Oct 16, 2025
5a0b5e7
added some tests ported by p5js
Vaivaswat2244 Oct 16, 2025
fa72d2d
removing test rendering suite and its test file
Vaivaswat2244 Oct 16, 2025
d435e62
added screenshots
Vaivaswat2244 Oct 16, 2025
0d91001
config files
Vaivaswat2244 Oct 16, 2025
66071ac
fixed the pixeldensity to 1
Vaivaswat2244 Oct 21, 2025
fd72f79
Revert "fixed the pixeldensity to 1"
Vaivaswat2244 Oct 21, 2025
a342a77
fixed pixeldensity to 1
Vaivaswat2244 Oct 21, 2025
c080196
Merge branch 'visual-testing' into pr05-visualtests
Vaivaswat2244 Oct 21, 2025
4c190b3
Configure dependencyUpdates task in build.gradle.kts
Vaivaswat2244 Oct 22, 2025
60af862
removing rendering gradient screenshot
Vaivaswat2244 Oct 23, 2025
64c213f
Merge pull request #1012 from processing/textarea-research
SableRaf Oct 24, 2025
e03c099
Merge branch 'processing:main' into pr05-visualtests
Vaivaswat2244 Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/src/processing/app/syntax/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# 🐉 Fixing this code: here be dragons. 🐉
# Replacing our custom version of JEditTextArea

Since 2025 we have started a migration of Swing to Jetpack Compose and we will eventually need to replace the JEditTextArea as well.

I think a good current strategy would be to start using `RSyntaxTextArea` for an upcoming p5.js mode. `RSyntaxTextArea` is a better maintained and well rounded library. As noted below, a lot of the current state management of the PDE is interetwined with the JEditTextArea implementation. This will force us to decouple the state management out of the `JEditTextArea` whilst also trying to keep backwards compatibility alive for Tweak Mode and the current implementation of autocomplete.

I also did some more research into the potential of using a JS + LSP based editor within Jetpack Compose but as of writing (early 2025) the only way to do so would be to embed chromium into the PDE through something like [Java-CEF]([url](https://github.com/chromiumembedded/java-cef)) and it looks like a PoC for Jetpack Compose Desktop exists [here](https://github.com/JetBrains/compose-multiplatform/blob/9cd413a4ed125bee5b624550fbd40a05061e912a/experimental/cef/src/main/kotlin/org/jetbrains/compose/desktop/browser/BrowserView.kt). Moving the entire PDE into an electron app would be essentially a rewrite which currrently is not the target.

Considering the current direction of the build-in LSP within Processing, I would say that creating a LSP based editor would be a good strategy going forward.

Research needs to be done on how much the Tweak Mode and autocompletion are _actually_ being used. Currently both these features are quite hidden and I suspect that most users actually move on to more advanced use-cases before they even discover such things. I would like to make both of these features much more prominent within the PDE to test if they are a good value add.

### Ben Fry's notes

Every few years, we've looked at replacing this package with [RSyntaxArea](https://github.com/bobbylight/RSyntaxTextArea), most recently with two attempts during the course of developing [Processing 4](https://github.com/processing/processing4/wiki/Processing-4), but probably dating back to the mid-2000s.

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {

// Set the build directory to not /build to prevent accidental deletion through the clean action
// Can be deleted after the migration to Gradle is complete

layout.buildDirectory = file(".build")

// Configure the dependencyUpdates task
Expand Down
42 changes: 28 additions & 14 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ repositories {
maven { url = uri("https://jogamp.org/deployment/maven") }
}

sourceSets{
main{
java{
sourceSets {
main {
java {
srcDirs("src")
}
resources{
resources {
srcDirs("src")
exclude("**/*.java")
}
}
test{
java{
test {
java {
srcDirs("test")
}
}
Expand All @@ -33,13 +33,31 @@ dependencies {
implementation(libs.gluegen)

testImplementation(libs.junit)
testImplementation(libs.junitJupiter)
testImplementation(libs.junitJupiterParams)
testImplementation(libs.junitPlatformSuite)
testImplementation(libs.assertjCore)
}

// Simple JUnit 5 configuration - let JUnit handle everything
tasks.test {
useJUnitPlatform() // JUnit discovers and runs all tests

// Only configuration, not orchestration
outputs.upToDateWhen { false }
maxParallelForks = 1

testLogging {
events("passed", "skipped", "failed", "started")
showStandardStreams = true
}
}

mavenPublishing{
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
signAllPublications()

pom{
pom {
name.set("Processing Core")
description.set("Processing Core")
url.set("https://processing.org")
Expand All @@ -59,21 +77,17 @@ mavenPublishing{
name.set("Ben Fry")
}
}
scm{
scm {
url.set("https://github.com/processing/processing4")
connection.set("scm:git:git://github.com/processing/processing4.git")
developerConnection.set("scm:git:ssh://git@github.com/processing/processing4.git")
}
}
}


tasks.test {
useJUnit()
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.compileJava{
tasks.compileJava {
options.encoding = "UTF-8"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions core/test/processing/visual/src/core/BaselineManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package processing.visual.src.core;

import processing.core.PImage;

import java.util.List;

// Baseline manager for updating reference images
public class BaselineManager {
private VisualTestRunner tester;

public BaselineManager(VisualTestRunner tester) {
this.tester = tester;
}

public void updateBaseline(String testName, ProcessingSketch sketch, TestConfig config) {
System.out.println("Updating baseline for: " + testName);

// Capture new image
SketchRunner runner = new SketchRunner(sketch, config);
runner.run();
PImage newImage = runner.getImage();

// Save as baseline
String baselinePath = "__screenshots__/" +
testName.replaceAll("[^a-zA-Z0-9-_]", "-") +
"-" + detectPlatform() + ".png";
newImage.save(baselinePath);

System.out.println("Baseline updated: " + baselinePath);
}

private String detectPlatform() {
String os = System.getProperty("os.name").toLowerCase();
if (os.contains("mac")) return "darwin";
if (os.contains("win")) return "win32";
return "linux";
}
}
Loading