< prev index next >
modules/web/src/ios/java/javafx/scene/web/WebView.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 40,49 ****
--- 40,51 ----
import com.sun.javafx.geom.transform.BaseTransform;
import com.sun.javafx.scene.DirtyBits;
import com.sun.javafx.scene.NodeHelper;
import com.sun.javafx.scene.input.PickResultChooser;
import com.sun.java.scene.web.WebViewHelper;
+ import com.sun.javafx.scene.SceneHelper;
+ import com.sun.javafx.sg.prism.NGNode;
import com.sun.javafx.tk.TKPulseListener;
import com.sun.javafx.tk.Toolkit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
*** 53,63 ****
import javafx.collections.ObservableList;
import javafx.css.Styleable;
import javafx.geometry.Bounds;
import javafx.scene.Node;
import javafx.scene.Parent;
- import javafx.scene.Scene;
import javafx.scene.text.FontSmoothingType;
/**
* {@code WebView} is a {@link javafx.scene.Node} that manages a
* {@link WebEngine} and displays its content. The associated {@code WebEngine}
--- 55,64 ----
*** 80,89 ****
--- 81,111 ----
@Override
public void doUpdatePeer(Node node) {
((WebView) node).doUpdatePeer();
}
+
+ @Override
+ public void doTransformsChanged(Node node) {
+ ((WebView) node).doTransformsChanged();
+ }
+
+ @Override
+ public BaseBounds doComputeGeomBounds(Node node,
+ BaseBounds bounds, BaseTransform tx) {
+ return ((WebView) node).doComputeGeomBounds(bounds, tx);
+ }
+
+ @Override
+ public boolean doComputeContains(Node node, double localX, double localY) {
+ return ((WebView) node).doComputeContains(localX, localY);
+ }
+
+ @Override
+ public void doPickNodeLocal(Node node, PickRay localPickRay, PickResultChooser result) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
});
}
private static final boolean DEFAULT_CONTEXT_MENU_ENABLED = true;
private static final FontSmoothingType DEFAULT_FONT_SMOOTHING_TYPE = FontSmoothingType.LCD;
*** 266,276 ****
final ChangeListener<Bounds> chListener = new ChangeListener<Bounds>() {
@Override
public void changed(ObservableValue<? extends Bounds> observable, Bounds oldValue, Bounds newValue) {
! WebView.this.impl_transformsChanged();
}
};
parentProperty().addListener(new ChangeListener<Parent>(){
--- 288,298 ----
final ChangeListener<Bounds> chListener = new ChangeListener<Bounds>() {
@Override
public void changed(ObservableValue<? extends Bounds> observable, Bounds oldValue, Bounds newValue) {
! NodeHelper.transformsChanged(WebView.this);
}
};
parentProperty().addListener(new ChangeListener<Parent>(){
*** 330,340 ****
@Override public void resize(double width, double height) {
this.width.set(width);
this.height.set(height);
NodeHelper.markDirty(this, DirtyBits.NODE_GEOMETRY);
! impl_geomChanged();
_setWidth(handle, width);
_setHeight(handle, height);
}
/**
--- 352,362 ----
@Override public void resize(double width, double height) {
this.width.set(width);
this.height.set(height);
NodeHelper.markDirty(this, DirtyBits.NODE_GEOMETRY);
! NodeHelper.geomChanged(this);
_setWidth(handle, width);
_setHeight(handle, height);
}
/**
*** 1003,1030 ****
&& getScene().getWindow() != null
&& getScene().getWindow().isShowing();
if (reallyVisible) {
if (NodeHelper.isDirty(this, DirtyBits.WEBVIEW_VIEW)) {
! Scene.impl_setAllowPGAccess(true);
//getPGWebView().update(); // creates new render queues
! Scene.impl_setAllowPGAccess(false);
}
} else {
_setVisible(handle, false);
}
}
- /**
- * @treatAsPrivate implementation detail
- * @deprecated This is an internal API that is not intended for use and will be removed in the next version
- */
- @Deprecated
- @Override protected void impl_pickNodeLocal(PickRay pickRay, PickResultChooser result) {
- impl_intersects(pickRay, result);
- }
-
@Override protected ObservableList<Node> getChildren() {
return super.getChildren();
}
// Node stuff
--- 1025,1043 ----
&& getScene().getWindow() != null
&& getScene().getWindow().isShowing();
if (reallyVisible) {
if (NodeHelper.isDirty(this, DirtyBits.WEBVIEW_VIEW)) {
! SceneHelper.setAllowPGAccess(true);
//getPGWebView().update(); // creates new render queues
! SceneHelper.setAllowPGAccess(false);
}
} else {
_setVisible(handle, false);
}
}
@Override protected ObservableList<Node> getChildren() {
return super.getChildren();
}
// Node stuff
*** 1035,1061 ****
private NGNode doCreatePeer() {
// return new NGWebView();
return null; // iOS doesn't need this method.
}
! /**
! * @treatAsPrivate implementation detail
! * @deprecated This is an internal API that is not intended for use and will be removed in the next version
*/
! @Deprecated
! @Override public BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx) {
bounds.deriveWithNewBounds(0, 0, 0, (float) getWidth(), (float)getHeight(), 0);
tx.transform(bounds, bounds);
return bounds;
}
! /**
! * @treatAsPrivate implementation detail
! * @deprecated This is an internal API that is not intended for use and will be removed in the next version
*/
! @Deprecated
! @Override protected boolean impl_computeContains(double localX, double localY) {
// Note: Local bounds contain test is already done by the caller. (Node.contains()).
return true;
}
/*
--- 1048,1070 ----
private NGNode doCreatePeer() {
// return new NGWebView();
return null; // iOS doesn't need this method.
}
! /*
! * Note: This method MUST only be called via its accessor method.
*/
! private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx) {
bounds.deriveWithNewBounds(0, 0, 0, (float) getWidth(), (float)getHeight(), 0);
tx.transform(bounds, bounds);
return bounds;
}
! /*
! * Note: This method MUST only be called via its accessor method.
*/
! private boolean doComputeContains(double localX, double localY) {
// Note: Local bounds contain test is already done by the caller. (Node.contains()).
return true;
}
/*
*** 1073,1093 ****
}
private static Affine3D calculateNodeToSceneTransform(Node node) {
final Affine3D transform = new Affine3D();
do {
! transform.preConcatenate(node.impl_getLeafTransform());
node = node.getParent();
} while (node != null);
return transform;
}
! @Deprecated
! @Override public void impl_transformsChanged() {
! super.impl_transformsChanged();
!
Affine3D trans = calculateNodeToSceneTransform(this);
_setTransform(handle,
trans.getMxx(), trans.getMxy(), trans.getMxz(), trans.getMxt(),
trans.getMyx(), trans.getMyy(), trans.getMyz(), trans.getMyt(),
trans.getMzx(), trans.getMzy(), trans.getMzz(), trans.getMzt());
--- 1082,1102 ----
}
private static Affine3D calculateNodeToSceneTransform(Node node) {
final Affine3D transform = new Affine3D();
do {
! transform.preConcatenate(NodeHelper.getLeafTransform(node));
node = node.getParent();
} while (node != null);
return transform;
}
! /*
! * Note: This method MUST only be called via its accessor method.
! */
! private void doTransformsChanged() {
Affine3D trans = calculateNodeToSceneTransform(this);
_setTransform(handle,
trans.getMxx(), trans.getMxy(), trans.getMxz(), trans.getMxt(),
trans.getMyx(), trans.getMyy(), trans.getMyz(), trans.getMyt(),
trans.getMzx(), trans.getMzy(), trans.getMzz(), trans.getMzt());
< prev index next >