Skip to content

Conversation

Edouard2laire
Copy link
Contributor

@Edouard2laire Edouard2laire commented Sep 4, 2025

The objective of this PR is to remove the Java component (that will be removed from MATLAB in a coming release -- #820) from the panel that displays the filter information.

The PR also has as objective to see how you would like to proceed with the coming depreciation of some Java components. Do we only keep the MATLAB version, or do we keep both?

This was also an occasion for me to try Copilot in VS Code. It seems to be doing ok.
The functions used here (uifigure and uilabels) were introduced in MATLAB 2016b.

Before:

image

After:

image

Note: if we want to keep more backward compatibility, then uicontrol can be used to display the text (see
c38a0b0). However, the information cannot be easily displayed in BOLD:

image

Regards
Edouard

- Rewrote the HFilterDisplay function to use only native MATLAB UI components (uicontrol, axes) for displaying filter specs and responses.
- Removed all Java-based UI code.
- Added strip_tags helper to clean HTML from info strings for display.
- Maintained dynamic resizing and layout of info panels and plots.

Co-authored-by: GitHub Copilot [email protected]

fix text display
@tmedani
Copy link
Member

tmedani commented Oct 1, 2025

Thanks @Edouard2laire for testing this and your feedback on Copilot :)

I think it is something that we need to do.

Have you noticed any time difference while using the uifigure versus the Brainstorm version?

@Edouard2laire
Copy link
Contributor Author

Have you noticed any time difference while using the uifigure versus the Brainstorm version?

I have not measured the time. But I have not felt any measurable difference when using it in comparison to the Java version.

I added the use of uigridlayout so MATLAB is handling all the resizing automatically and it looks quite fine to me:
image

@rcassani
Copy link
Member

rcassani commented Oct 6, 2025

Maybe an impertinent questions, buy why do we need uifigure for this figure?
This figure does not have interaction nor controls. Would not be simpler a vanilla figure?

@Edouard2laire
Copy link
Contributor Author

Edouard2laire commented Oct 6, 2025

i don't think that is impertinent :)

I guess it could be working with figure; but MATLAB seems to now recommend uifigure for apps: https://www.mathworks.com/help/matlab/creating_guis/modern-programmatic-app-building.html

I choose uifigure here as we can use uilabels to easily display the html content. it seemed hard when using figure but there might have been ways.

but since we are moving away from java, i guess it's better to move to the most modern way of doing UI.

@rcassani
Copy link
Member

rcassani commented Oct 6, 2025

By App, I understand an interactive user interface, but this is static figure

I agree in the uilabels and easy HTML formatting. Though we could use old fashio LaTeX for it:
text(x, y,'\bf Bold \it Italic \color{red} Red','Interpreter','tex','FontSize',14);

@Edouard2laire
Copy link
Contributor Author

i guess both could work, but i like UIFigure :)
I consider it an app since it's basically a pop-up from the button 'View filter property'.

As you said, text could work, but you need to tune the x,y coordinates manually. Here, uigridlayout does it for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants