Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有任何 Java 框架或资源来绘制和/或操作笛卡尔平面。显然,它可以只使用 Java 2d 来完成,但是实现一些资源,如“放大”和“缩小”并不是那么容易开发
非常感谢!
Java 2D 包含AffineTransform该类,这使得使用矩阵在笛卡尔平面上指定变换变得容易。通过它的方法将这个变换应用到你的Graphics2D对象也很容易setTransform。
AffineTransform
Graphics2D
setTransform
您可以使用标准变换将您自己的坐标系应用到屏幕坐标上。然后,您可以操纵此变换以考虑平移和缩放。这将允许您使用自己的坐标系来布置内容,同时将所有平移和缩放功能完全抽象到一个位置。