Skip to content

Implement live preview#22

Merged
stoecker merged 16 commits intoJOSM:masterfrom
gabortim:master
Mar 14, 2026
Merged

Implement live preview#22
stoecker merged 16 commits intoJOSM:masterfrom
gabortim:master

Conversation

@gabortim
Copy link
Copy Markdown
Contributor

In this PR, I implemented a live preview functionality. This temporarily alters the dataset and, when the grid size is changed, it reverts and regenerates the grid. Fixes: https://josm.openstreetmap.de/ticket/21644

Also, someone requested cell size information, which has been added. Fixes: #20

Changes in action:

2026-03-12.20-42-44.mp4

Now that there is an actual change in the data, the preview on the right seems redundant. I have left it there for now.

Plus minor maintenance fixes, like png->svg transition, readme fixes, GH action update etc.

Copy link
Copy Markdown
Collaborator

@jdhoek jdhoek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The video showcasing the preview looks convincing. Nice work.

I don't know if the live preview can have negative side-effects. History and the undo-stack are unaffected?

* Constructs a GridifyException with a message.
*
* @param message The error message.
*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if these JavaDoc blocks add anything meaningful. Personally, I tend to avoid these when they don't really document anything, because you read the same thing twice (increasing cognitive load); once in the comment ('Constructs a GridifyException with a message.') and then in the method signature, which says exactly the same.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving out javadoc comments is worse as that produces warnings. If there is not much to say that's fine, because when JavaDoc is compiled people also see "there isn't much more to say :-)".

flipButton.setMaximumSize(flipButton.getPreferredSize());

// Increase the font size so the glyph is actually visible
flipButton.setFont(flipButton.getFont().deriveFont(18f));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

It's no longer needed and probably helps with performance
@stoecker stoecker merged commit fc53fa4 into JOSM:master Mar 14, 2026
@thomas-shares
Copy link
Copy Markdown

looks very good on the video!!!! Thank you!!!

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.

Feature: Display size of resulting grid boxes

4 participants