< prev index next >
modules/web/src/ios/java/javafx/scene/web/WebView.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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,10 +40,12 @@
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,11 +55,10 @@
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}
@@ -80,10 +81,31 @@
@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,11 +288,11 @@
final ChangeListener<Bounds> chListener = new ChangeListener<Bounds>() {
@Override
public void changed(ObservableValue<? extends Bounds> observable, Bounds oldValue, Bounds newValue) {
- WebView.this.impl_transformsChanged();
+ NodeHelper.transformsChanged(WebView.this);
}
};
parentProperty().addListener(new ChangeListener<Parent>(){
@@ -330,11 +352,11 @@
@Override public void resize(double width, double height) {
this.width.set(width);
this.height.set(height);
NodeHelper.markDirty(this, DirtyBits.NODE_GEOMETRY);
- impl_geomChanged();
+ NodeHelper.geomChanged(this);
_setWidth(handle, width);
_setHeight(handle, height);
}
/**
@@ -1003,28 +1025,19 @@
&& getScene().getWindow() != null
&& getScene().getWindow().isShowing();
if (reallyVisible) {
if (NodeHelper.isDirty(this, DirtyBits.WEBVIEW_VIEW)) {
- Scene.impl_setAllowPGAccess(true);
+ SceneHelper.setAllowPGAccess(true);
//getPGWebView().update(); // creates new render queues
- Scene.impl_setAllowPGAccess(false);
+ SceneHelper.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
@@ -1035,27 +1048,23 @@
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
+ /*
+ * Note: This method MUST only be called via its accessor method.
*/
- @Deprecated
- @Override public BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx) {
+ private BaseBounds doComputeGeomBounds(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
+ /*
+ * Note: This method MUST only be called via its accessor method.
*/
- @Deprecated
- @Override protected boolean impl_computeContains(double localX, double localY) {
+ private boolean doComputeContains(double localX, double localY) {
// Note: Local bounds contain test is already done by the caller. (Node.contains()).
return true;
}
/*
@@ -1073,21 +1082,21 @@
}
private static Affine3D calculateNodeToSceneTransform(Node node) {
final Affine3D transform = new Affine3D();
do {
- transform.preConcatenate(node.impl_getLeafTransform());
+ transform.preConcatenate(NodeHelper.getLeafTransform(node));
node = node.getParent();
} while (node != null);
return transform;
}
- @Deprecated
- @Override public void impl_transformsChanged() {
- super.impl_transformsChanged();
-
+ /*
+ * 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 >