⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@JoachimRohde
Copy link

@JoachimRohde JoachimRohde commented Jan 25, 2026

Also added keybindings and mouse wheel listener to zoom in (CTRL + +) and zoom out (CTRL + -).


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

Also added keybindings and mouse wheel listener to zoom in (CTRL + +) 
and zoom out (CTRL + -).
@mbien mbien added Maven [ci] enable "build tools" tests UI User Interface ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Jan 27, 2026
@mbien mbien added this to the NB30 milestone Jan 29, 2026
@apache apache locked and limited conversation to collaborators Jan 29, 2026
@apache apache unlocked this conversation Jan 29, 2026
@mbien mbien removed this from the NB30 milestone Jan 29, 2026
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

this is probably an area which can be improved but the current PR has a few problems and overwrites existing functionality you might not be aware of.

zoom:

Mouse wheel zoom is already implemented (ctrl+wheel). It is zooms to the mouse pointer location commonly seen on maps/graphs etc. This PR overwrites this functionality and makes it worse since it doesn't take the mouse pointer as zoom point into account.

navigation:

Once a tree component had focus, arrow keys will move the item selection around, I couldn't get the focus back to the graph to move it with arrow keys.

Middle mouse drag is also already implemented btw

UI:

The tool tips should use the same format used for other actions. They usually follow the Name [hotkey] pattern like:
image
instead of
image

There is also a utility which can generate the hotkey text, it might work here too, example:

String hotkey = ""; // NOI18N
Action action = org.openide.awt.Actions.forID("Window/SelectDocumentNode", "org.netbeans.modules.favorites.Select"); // NOI18N
if (action != null && action.getValue(Action.ACCELERATOR_KEY) instanceof KeyStroke ks) {
hotkey = org.openide.awt.Actions.keyStrokeToString(ks);
}
setToolTipText(NbBundle.getMessage(Tab.class, "TT_Favorites", hotkey)); //NOI18N

Copy link
Member

@neilcsmith-net neilcsmith-net left a comment

Choose a reason for hiding this comment

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

Agree with @mbien that there are a number of issues that need addressing here.

Moving the scene by arrow keys should work using the bindings in the scroll pane UI, as long as the scene view has focus. The request focus call here is probably all that is needed for that to work. At least, it's working in a platform application.

Should add the wheel pan action too - https://bits.netbeans.org/29/javadoc/org-netbeans-api-visual/org/netbeans/api/visual/action/ActionFactory.html#createWheelPanAction()

Zoom actions are better registered globally somewhere IMO using callback action registrations. This would allow better integration with the shortcuts system, and we can look to migrate other internal uses (eg. image viewer). I did this recently in a platform application - see praxis-live/praxis-live@ded66c8

Also, CTRL should never be hardcoded as a shortcut trigger due to macOS.

for keyboard navigation and changed the tooltips.
@JoachimRohde
Copy link
Author

I was indeed neither aware of mouse wheel zoom nor middle mouse dragging.
I removed the mouse listener and also the cursor key shortcuts because, as Neil mentioned, the request focus call was all that was needed.

The shortcut for zooming in and out was changed from CTRL+[+/-] to Alt+[+/-]. My question is: is this okay or should I use another shortcut (or should I also remove this part)?
Another question: I added in the tooltip a hint that CTRL+mousewheel is an alternative to the provided shortcuts. Is this okay or is it cumbersome and should be removed?

"Once a tree component had focus, arrow keys will move the item selection around, I couldn't get the focus back to the graph to move it with arrow keys."

I could not reproduce this behavior. Even though I select a node and press then a cursor key the whole graph is moved, not a single node.

@JoachimRohde JoachimRohde requested a review from mbien January 30, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Maven [ci] enable "build tools" tests UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants