I would like to know if there is any Java Framework or resource to draw and/or manipulate a Cartesian Plane. Obviously, it can be done using just Java 2d, but implement some resources like "zoom in" a开发者_JS百科nd "zoom out" are not so trivial to develop
Thanks a lot!
Java 2D contains the AffineTransform
class, which makes it easy to use a matrix to specify a transformation on the Cartesian Plane. It's also easy to apply this transform to your Graphics2D
object through its setTransform
method.
You can use a standard transform to apply your own coordinate system onto screen coordinates. Then you can manipulate this transform to account for panning and zooming. This will allow you to use your own coordinate system for laying out your content while completely abstracting away all of the panning and zooming functionality into one place.
精彩评论