/** * Rotate the 3D view based on the changes on mouse position. * @param x changes of mouse position on the x axis. * @param y changes on mouse position on the y axis. */ public void rotate(double x, double y) { if (!(projection instanceof Projection3D)) { throw new UnsupportedOperationException("Only 3D graphics supports rotation."); } ((Projection3D) projection).rotate(x, y); } }