< prev index next >

modules/web/src/main/java/javafx/scene/web/WebEngine.java

Print this page




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.web;
  27 
  28 import com.sun.javafx.geom.BaseBounds;
  29 import com.sun.javafx.geom.transform.BaseTransform;
  30 import com.sun.javafx.jmx.MXNodeAlgorithm;
  31 import com.sun.javafx.jmx.MXNodeAlgorithmContext;
  32 import com.sun.javafx.scene.web.Debugger;
  33 import com.sun.javafx.scene.web.Printable;
  34 import com.sun.javafx.sg.prism.NGNode;
  35 import com.sun.javafx.tk.TKPulseListener;
  36 import com.sun.javafx.tk.Toolkit;
  37 import com.sun.javafx.webkit.*;
  38 import com.sun.javafx.webkit.prism.PrismGraphicsManager;
  39 import com.sun.javafx.webkit.prism.PrismInvoker;
  40 import com.sun.javafx.webkit.prism.theme.PrismRenderer;
  41 import com.sun.javafx.webkit.theme.RenderThemeImpl;
  42 import com.sun.javafx.webkit.theme.Renderer;
  43 import com.sun.prism.Graphics;
  44 import com.sun.webkit.*;
  45 import com.sun.webkit.graphics.WCGraphicsContext;
  46 import com.sun.webkit.graphics.WCGraphicsManager;
  47 import com.sun.webkit.network.URLs;
  48 import com.sun.webkit.network.Util;
  49 import javafx.animation.AnimationTimer;
  50 import javafx.beans.InvalidationListener;
  51 import javafx.beans.property.*;
  52 import javafx.concurrent.Worker;
  53 import javafx.event.EventHandler;
  54 import javafx.event.EventType;
  55 import javafx.geometry.Rectangle2D;
  56 import javafx.print.PageLayout;
  57 import javafx.print.PrinterJob;
  58 import javafx.scene.Node;
  59 import javafx.util.Callback;
  60 import org.w3c.dom.Document;
  61 
  62 import java.io.BufferedInputStream;
  63 import java.io.File;
  64 import java.io.IOException;
  65 import static java.lang.String.format;


1459             }
1460             if (this.document == null) {
1461                 this.document = page.getDocument(page.getMainFrame());
1462                 if (this.document == null) {
1463                     this.available = false;
1464                 }
1465             }
1466             return this.document;
1467         }
1468 
1469         public Object getBean() {
1470             return WebEngine.this;
1471         }
1472 
1473         public String getName() {
1474             return "document";
1475         }
1476     }
1477 
1478 
1479     /**
1480      * Returns the debugger associated with this web engine.
1481      * The debugger is an object that can be used to debug
1482      * the web page currently loaded into the web engine.
1483      * <p>
1484      * All methods of the debugger must be called on
1485      * the JavaFX Application Thread.
1486      * The message callback object registered with the debugger
1487      * is always called on the JavaFX Application Thread.
1488      * @return the debugger associated with this web engine.
1489      *         The return value cannot be {@code null}.
1490      * @treatAsPrivate This is an internal API that can be changed or
1491      *                 removed in the future.
1492      * @deprecated This is an internal API that can be changed or
1493      *             removed in the future.
1494      */
1495     @Deprecated
1496     public Debugger impl_getDebugger() {
1497         return debugger;
1498     }
1499 
1500     /**
1501      * The debugger implementation.
1502      */
1503     private final class DebuggerImpl implements Debugger {
1504 
1505         private boolean enabled;
1506         private Callback<String,Void> messageCallback;
1507 
1508 
1509         @Override
1510         public boolean isEnabled() {
1511             checkThread();
1512             return enabled;
1513         }
1514 
1515         @Override
1516         public void setEnabled(boolean enabled) {




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.web;
  27 




  28 import com.sun.javafx.scene.web.Debugger;
  29 import com.sun.javafx.scene.web.Printable;

  30 import com.sun.javafx.tk.TKPulseListener;
  31 import com.sun.javafx.tk.Toolkit;
  32 import com.sun.javafx.webkit.*;
  33 import com.sun.javafx.webkit.prism.PrismGraphicsManager;
  34 import com.sun.javafx.webkit.prism.PrismInvoker;
  35 import com.sun.javafx.webkit.prism.theme.PrismRenderer;
  36 import com.sun.javafx.webkit.theme.RenderThemeImpl;
  37 import com.sun.javafx.webkit.theme.Renderer;

  38 import com.sun.webkit.*;

  39 import com.sun.webkit.graphics.WCGraphicsManager;
  40 import com.sun.webkit.network.URLs;
  41 import com.sun.webkit.network.Util;
  42 import javafx.animation.AnimationTimer;
  43 import javafx.beans.InvalidationListener;
  44 import javafx.beans.property.*;
  45 import javafx.concurrent.Worker;
  46 import javafx.event.EventHandler;
  47 import javafx.event.EventType;
  48 import javafx.geometry.Rectangle2D;
  49 import javafx.print.PageLayout;
  50 import javafx.print.PrinterJob;
  51 import javafx.scene.Node;
  52 import javafx.util.Callback;
  53 import org.w3c.dom.Document;
  54 
  55 import java.io.BufferedInputStream;
  56 import java.io.File;
  57 import java.io.IOException;
  58 import static java.lang.String.format;


1452             }
1453             if (this.document == null) {
1454                 this.document = page.getDocument(page.getMainFrame());
1455                 if (this.document == null) {
1456                     this.available = false;
1457                 }
1458             }
1459             return this.document;
1460         }
1461 
1462         public Object getBean() {
1463             return WebEngine.this;
1464         }
1465 
1466         public String getName() {
1467             return "document";
1468         }
1469     }
1470 
1471 
1472     /*
1473      * Returns the debugger associated with this web engine.
1474      * The debugger is an object that can be used to debug
1475      * the web page currently loaded into the web engine.
1476      * <p>
1477      * All methods of the debugger must be called on
1478      * the JavaFX Application Thread.
1479      * The message callback object registered with the debugger
1480      * is always called on the JavaFX Application Thread.
1481      * @return the debugger associated with this web engine.
1482      *         The return value cannot be {@code null}.




1483      */
1484     Debugger getDebugger() {

1485         return debugger;
1486     }
1487 
1488     /**
1489      * The debugger implementation.
1490      */
1491     private final class DebuggerImpl implements Debugger {
1492 
1493         private boolean enabled;
1494         private Callback<String,Void> messageCallback;
1495 
1496 
1497         @Override
1498         public boolean isEnabled() {
1499             checkThread();
1500             return enabled;
1501         }
1502 
1503         @Override
1504         public void setEnabled(boolean enabled) {


< prev index next >