RFR: JDK-8303443: IGV: Syntax highlighting and resizing for filter editor

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Thu Mar 2 14:01:11 UTC 2023


On Wed, 1 Mar 2023 12:14:07 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

> In the Filter window of the IdealGraphVisualizer (IGV) the user can double-click on a filter to edit the javascript code. 
> 
> - Previously, the code window was not resizable and had no syntax highlighting
> <img width="782" alt="editor_old" src="https://user-images.githubusercontent.com/71546117/222137737-1042b272-2c4f-4ae2-929d-2c5d285818e4.png">
> 
> - Now, the code window can be resized by the user and has basic syntax highlighting for `keywords`, `strings` and `comments`
> <img width="727" alt="editor_new" src="https://user-images.githubusercontent.com/71546117/222137687-892ba36d-4a76-4769-ada7-7982ea59a5ac.png">
> 
> - Further all filter are now  saved as .js files in `src/utils/IdealGraphVisualizer/application/target/userdir/config/Filters` and reloaded when opening a new IGV instance
> <img width="373" alt="js_ext" src="https://user-images.githubusercontent.com/71546117/222140304-7ab486a4-7c92-408c-9beb-10936a717fc4.png">

Thanks for improving this area of IGV!

I found a few issues in the changeset:

1. The proposed font ("Courier") is not very readable on my system (Ubuntu Linux):

![courier](https://user-images.githubusercontent.com/8792647/222445180-40f46bee-90e3-4b48-9d24-9571e1c4e5e8.png)

I suggest using the logical font "Monospaced" instead [for portability](https://docs.oracle.com/en/java/javase/19/docs/api/java.desktop/java/awt/Font.html):

 ![monospaced](https://user-images.githubusercontent.com/8792647/222446352-49633e0f-db7c-445d-b5ae-6335b11eb95c.png)

2. The changeset edits the generated code area of `EditFilterDialog.java`, making it out of sync with `EditFilterDialog.form`. Would it be possible to change that part of `EditFilterDialog.java` using NetBeans' GUI Builder instead? (so that `EditFilterDialog.form` stays on sync). 

3. When I run IGV, make some change in a filter, close IGV, then re-run it again, I end up with the same filters loaded multiple times:

![filters](https://user-images.githubusercontent.com/8792647/222448902-47a6999e-0b4a-4739-9863-3da0aaf41b86.png)

-------------

Changes requested by rcastanedalo (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12803


More information about the hotspot-compiler-dev mailing list