@Override
    public Point2D getScenePosition() {
      Scene scene;

      if (source instanceof Node) {
        scene = ((Node) source).getScene();
      } else if (source instanceof Scene) {
        scene = (Scene) source;
      } else {
        return null;
      }

      return screenPos.subtract(
          scene.getX() + scene.getWindow().getX(), scene.getY() + scene.getWindow().getY());
    }
 /*     */ public WCPoint windowToScreen(WCPoint paramWCPoint) /*     */ {
   /* 125 */ WebView localWebView = this.accessor.getView();
   /* 126 */ Scene localScene = localWebView.getScene();
   /* 127 */ Window localWindow = null;
   /*     */
   /* 129 */ if ((localScene != null) && ((localWindow = localScene.getWindow()) != null))
   /*     */ {
     /* 132 */ Point2D localPoint2D =
         localWebView.localToScene(paramWCPoint.getX(), paramWCPoint.getY());
     /* 133 */ return new WCPoint(
         (float) (localPoint2D.getX() + localScene.getX() + localWindow.getX()),
         (float) (localPoint2D.getY() + localScene.getY() + localWindow.getY()));
     /*     */ }
   /*     */
   /* 136 */ return new WCPoint(0.0F, 0.0F);
   /*     */ }
 /*     */ public WCPoint screenToWindow(WCPoint paramWCPoint) {
   /* 108 */ WebView localWebView = this.accessor.getView();
   /* 109 */ Scene localScene = localWebView.getScene();
   /* 110 */ Window localWindow = null;
   /*     */
   /* 112 */ if ((localScene != null) && ((localWindow = localScene.getWindow()) != null))
   /*     */ {
     /* 115 */ Point2D localPoint2D =
         localWebView.sceneToLocal(
             paramWCPoint.getX() - localWindow.getX() - localScene.getX(),
             paramWCPoint.getY() - localWindow.getY() - localScene.getY());
     /*     */
     /* 118 */ return new WCPoint((float) localPoint2D.getX(), (float) localPoint2D.getY());
     /*     */ }
   /* 120 */ return new WCPoint(0.0F, 0.0F);
   /*     */ }
Example #4
0
 /** Bounds of Scene in Window. */
 public static Bounds bounds(Scene scene) {
   return bounds(scene.getX(), scene.getY(), scene.getWidth(), scene.getHeight());
 }