有谁知道如何放大场景
(包含多个小部件
),保持可见区域的中心(或任何给定点,例如鼠标位置)常数?
使用仅 Swing 的组件做这种事情并不是很困难,但是使用 NB 7.4 Visual 库,我没有成功......
最佳答案
ActionFactory
工厂类提供了多个内置操作。
对于缩放,它提供,
- createCenteredZoomAction(双倍缩放乘数)
- createMouseCenteredZoomAction(双缩放乘数)
- createZoomAction()
- createZoomAction(双zoomMultiplier, boolean 动画)
用法: 在您的场景中添加以下内容:
getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
关于java - (缩放中心)如何将 Netbeans RCP 场景滚动到给定位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20696154/