[API REVIEW] RT-30171: 3D versions of localToScreen and screenToLocal
Pavel Safrata
pavel.safrata at oracle.com
Thu May 2 13:42:32 PDT 2013
Hello,
as part of the 3D effort we added localToScene/sceneToLocal methods
computing with 3D points. We need to do the same for (recently added)
localToScreen/screenToLocal. The first thought would be doing the same
we did for the scene methods:
public Point3D localToScreen(double localX, double localY, double localZ)
public Point3D localToScreen(Point3D localPoint)
public Point3D screenToLocal(double screenX, double screenY, double localZ)
public Point3D screenToLocal(Point3D screenPoint)
But 3D coordinates don't make much sense for screen. In particular, in
screenToLocal one would always have to pass 0.0 to the third argument.
So we want to use 2D coordinates for screen. But there is a problem
there, we cannot add
public Point3D screenToLocal(double screenX, double screenY)
because it would conflict with the existing 2D version:
public Point2D screenToLocal(double screenX, double screenY)
So we can either drop the 2D version of this method, or we need
different names. So I propose:
// these two already exist:
public Point2D localToScreen(double localX, double localY)
public Point2D localToScreen(Point2D localPoint)
// these two exist but without the 2D suffix, so rename them (they were
added in FX8 so no backward incompatibility):
public Point2D screenToLocal2D(double screenX, double screenY)
public Point2D screenToLocal2D(Point2D screenPoint)
// add these four for 3D
public Point2D localToScreen(double localX, double localY, double localZ)
public Point2D localToScreen(Point3D localPoint)
public Point3D screenToLocal3D(double screenX, double screenY)
public Point3D screenToLocal3D(Point2D screenPoint)
Thanks,
Pavel
More information about the openjfx-dev
mailing list