use of com.teamdev.jxbrowser.chromium.javafx.BrowserView in project TeachingInSimulation by ScOrPiOzzy.
the class TestJxBrowserJfx method start.
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.initStyle(StageStyle.DECORATED);
Browser browser = new Browser(BrowserType.LIGHTWEIGHT);
BrowserView view = new BrowserView(browser);
primaryStage.setScene(new Scene(view));
browser.loadURL("http://file.keking.cn/");
// browser.loadURL("http://58.214.15.134:8945/DigitalCampus_v3.0_nj/loginInit!init.action");
// browser.setContextMenuHandler(new ContextMenuHandler() {
// @Override
// public void showContextMenu(ContextMenuParams params) {
// System.out.println(params.getPageURL());
// }
// });
primaryStage.show();
}
use of com.teamdev.jxbrowser.chromium.javafx.BrowserView in project TeachingInSimulation by ScOrPiOzzy.
the class TestJxBrowserPdf method start.
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.initStyle(StageStyle.TRANSPARENT);
Browser browser = new Browser(BrowserType.LIGHTWEIGHT);
BrowserView view = new BrowserView(browser);
primaryStage.setScene(new Scene(view));
browser.loadURL("http://192.168.1.19:8082/Test/Fanuc0i参数说明书.pdf");
// browser.executeJavaScript("var child=document.getElementById(\\\"download\\\");child.parentNode.removeChild(child);");
// browser.executeJavaScript("alert(document.getElementById('download'))");
browser.setDownloadHandler(new DownloadHandler() {
@Override
public boolean allowDownload(DownloadItem download) {
System.out.println(download.getURL());
return false;
}
});
primaryStage.show();
}
use of com.teamdev.jxbrowser.chromium.javafx.BrowserView in project TeachingInSimulation by ScOrPiOzzy.
the class TestJxBrowserSwf method start.
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.initStyle(StageStyle.DECORATED);
Browser browser = new Browser();
BrowserView view = new BrowserView(browser);
primaryStage.setScene(new Scene(view));
browser.loadHTML(HTML_SWF_HEAD + "http://192.168.1.19:8082/Test/teachResources.swf" + HTML_SWF_END);
primaryStage.show();
}
use of com.teamdev.jxbrowser.chromium.javafx.BrowserView in project TeachingInSimulation by ScOrPiOzzy.
the class ResourceViewer method createPDFViewer.
/**
* 创建PDF查看器
*/
private void createPDFViewer() {
HTTPUtils utils = SpringUtil.getBean(HTTPUtils.class);
String url = utils.getFullPath(ResourceConsts.FTP_RES_PATH + resource.getPath());
if (url == null) {
return;
}
Browser browser = new Browser(BrowserType.LIGHTWEIGHT);
browser.loadURL(url);
BrowserView view = new BrowserView(browser);
viewer.getChildren().add(view);
}
use of com.teamdev.jxbrowser.chromium.javafx.BrowserView in project TeachingInSimulation by ScOrPiOzzy.
the class ResourceViewer method createSWFViewer.
/**
* 创建FLASH查看器
*/
private void createSWFViewer() {
HTTPUtils utils = SpringUtil.getBean(HTTPUtils.class);
String url = utils.getFullPath(ResourceConsts.FTP_RES_PATH + resource.getPath());
if (url == null) {
return;
}
SWFBrowser browser = new SWFBrowser(BrowserType.LIGHTWEIGHT);
browser.loadHTML(url);
BrowserView view = new BrowserView(browser);
viewer.getChildren().add(view);
}
Aggregations