“图像拉伸”慢速 Swing 组件的代理?
我有一个使用 JFreeChart 显示绘图的应用程序。碰巧的是,这些图很大,而 JFreeChart 的速度并不是非常快,导致重绘时间过长,特别是在调整图大小时。
我所追求的是一种在调整大小时拉伸表示绘图的图像的方法(有点像 iPhone 在再次启动时会显示已停止的应用程序的屏幕截图),并仅在用户释放鼠标后才执行完全重绘(即一旦知道地块的最终大小)。
图表的交互功能应保持完整(显然,在不调整大小时)。
有没有通用的解决方案/Swing 包装器? (没有理由说它应该是 JFreeChart 特定的)。
干杯
I have an application that displays plots using JFreeChart. As it happens, these plots are big and JFreeChart is not terribly fast, resulting in atrocious redraw times, particularly when resizing the plot.
What I am after is a way to stretch an image representing the plot while resizing (a bit like the iPhone will present a screenshot of a stopped application while it gets started again), and perform a full redraw only after the user has released the mouse (i.e. once the final size of the plot is known).
The interaction features of the chart sould stay intact (when not resizing, obviously).
Is there a generic solution / Swing wrapper for this? (there is no reason why it should be JFreeChart-specific).
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有具体的答案,只是开始调整大小的可能策略
,您可以使用 JLayer图像/操作。
编辑
或者(对于 JLayer),您可以使用 CardLayout:在调整大小时显示一张带有图像的卡片,在不调整大小时显示另一张带有绘图的卡片。 SwingX ImagePainter 可以在调整大小时进行图像缩放
No concrete answer, just a possible strategy
in JDK 7, you can use a JLayer for the image/manipulation.
Edit
Alternatively (for JLayer), you could use a CardLayout: showing one card with the image while resizing and the another card with the plot while not resizing. SwingX ImagePainter can do the image scaling during the resize