本文整理汇总了Java中com.teamdev.jxbrowser.chromium.swing.BrowserView类的典型用法代码示例。如果您正苦于以下问题:Java BrowserView类的具体用法?Java BrowserView怎么用?Java BrowserView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BrowserView类属于com.teamdev.jxbrowser.chromium.swing包,在下文中一共展示了BrowserView类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleMouseClick
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public void handleMouseClick(int xPosition, int yPosition, int mouseX, int mouseY, int mouseButton) {
if (mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + this.width && mouseY < yPosition + this.height) {
Point p = new Point(Math.round(SwingUtils.map(mouseX-xPosition, 0, width, 0, c.getWidth())), Math.round(SwingUtils.map(mouseY-yPosition, 0, height, 0, c.getHeight())));
Point globalP = p.getLocation();
SwingUtilities.convertPointToScreen(globalP, c);
if (!(c instanceof BrowserView)) {
SwingUtils.click(c, p.x, p.y, mouseButton);
} else {
BrowserView view = (BrowserView) c;
MouseButtonType buttonType = MouseButtonType.PRIMARY;
switch (mouseButton) {
case 1:
buttonType = MouseButtonType.SECONDARY;
break;
case 2:
buttonType = MouseButtonType.MIDDLE;
break;
}
SwingUtils.forwardMouseClickEvent(view.getBrowser(), buttonType, p.x, p.y, globalP.x, globalP.y);
}
}
}
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:23,代码来源:SwingWrapper.java
示例2: handleMouseDrag
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public void handleMouseDrag(int xPosition, int yPosition, int mouseX, int mouseY, int mouseButton) {
if (mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + this.width && mouseY < yPosition + this.height) {
Point p = new Point(Math.round(SwingUtils.map(mouseX-xPosition, 0, width, 0, c.getWidth())), Math.round(SwingUtils.map(mouseY-yPosition, 0, height, 0, c.getHeight())));
Point globalP = p.getLocation();
SwingUtilities.convertPointToScreen(globalP, c);
if (!(c instanceof BrowserView)) {
SwingUtils.click(c, p.x, p.y, mouseButton);
} else {
BrowserView view = (BrowserView) c;
MouseButtonType buttonType = MouseButtonType.PRIMARY;
switch (mouseButton) {
case 1:
buttonType = MouseButtonType.SECONDARY;
break;
case 2:
buttonType = MouseButtonType.MIDDLE;
break;
}
SwingUtils.forwardMouseDragEvent(view.getBrowser(), buttonType, p.x, p.y, globalP.x, globalP.y);
}
}
}
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:23,代码来源:SwingWrapper.java
示例3: handleMouseRelease
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public void handleMouseRelease(int xPosition, int yPosition, int mouseX, int mouseY, int mouseButton) {
if (mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + this.width && mouseY < yPosition + this.height) {
Point p = new Point(Math.round(SwingUtils.map(mouseX-xPosition, 0, width, 0, c.getWidth())), Math.round(SwingUtils.map(mouseY-yPosition, 0, height, 0, c.getHeight())));
Point globalP = p.getLocation();
SwingUtilities.convertPointToScreen(globalP, c);
if (!(c instanceof BrowserView)) {
SwingUtils.click(c, p.x, p.y, mouseButton);
} else {
BrowserView view = (BrowserView) c;
MouseButtonType buttonType = MouseButtonType.PRIMARY;
switch (mouseButton) {
case 1:
buttonType = MouseButtonType.SECONDARY;
break;
case 2:
buttonType = MouseButtonType.MIDDLE;
break;
}
SwingUtils.forwardMouseReleaseEvent(view.getBrowser(), buttonType, p.x, p.y, globalP.x, globalP.y);
}
}
}
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:23,代码来源:SwingWrapper.java
示例4: render
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public void render(int x, int y, int mouseX, int mouseY) {
rc = txt.getDynamicTextureLocation(c.toString(), new DynamicTexture(img));
if (!frame.isVisible()) frame.setVisible(true);
if (rc != null) {
mc.getRenderManager().renderEngine.bindTexture(rc);
drawRectWithFullTexture(x, y, width, height);
txt.deleteTexture(rc);
}
if (mouseX >= x && mouseY >= y && mouseX < x + this.width && mouseY < y + this.height) {
if (mouseX != lastMouseX && mouseY != lastMouseY) {
if (c instanceof BrowserView) {
Point p = new Point(Math.round(SwingUtils.map(mouseX - x, 0, width, 0, c.getWidth())), Math.round(SwingUtils.map(mouseY - y, 0, height, 0, c.getHeight())));
Point globalP = p.getLocation();
SwingUtilities.convertPointToScreen(globalP, c);
BrowserView view = (BrowserView) c;
SwingUtils.forwardMouseMoveEvent(view.getBrowser(), p.x, p.y, globalP.x, globalP.y);
}
}
}
lastMouseX = mouseX;
lastMouseY = mouseY;
}
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:27,代码来源:SwingWrapper.java
示例5: init
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
private void init(Composite parent, BrowserContext browserContext) {
browserView = new BrowserView(new Browser(browserContext));
Frame frame = SWT_AWT.new_Frame(this);
frame.add(browserView);
threadSwt = parent.getDisplay().getThread();
parent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
dispose();
}
});
}
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:14,代码来源:C8oBrowser.java
示例6: handleMouseScroll
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public void handleMouseScroll(int xPosition, int yPosition, int mouseX, int mouseY, boolean direction) {
if (mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + this.width && mouseY < yPosition + this.height) {
Point p = new Point(Math.round(SwingUtils.map(mouseX-xPosition, 0, width, 0, c.getWidth())), Math.round(SwingUtils.map(mouseY-yPosition, 0, height, 0, c.getHeight())));
if (c instanceof BrowserView) {
BrowserView view = (BrowserView) c;
SwingUtils.forwardMouseScrollEvent(view.getBrowser(), direction ? 5 : -5, p.x, p.y);
}
}
}
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:10,代码来源:SwingWrapper.java
示例7: handleKeyTyped
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public void handleKeyTyped(char key, int code) {
if (c instanceof BrowserView) {
BrowserView view = (BrowserView) c;
switch (code) {
case(Keyboard.KEY_BACK):
SwingUtils.forwardKeyTypedEvent(view.getBrowser(), KeyCode.VK_BACK);
break;
default:
SwingUtils.forwardKeyTypedEvent(view.getBrowser(), key);
break;
}
}
}
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:14,代码来源:SwingWrapper.java
示例8: getBrowserView
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public BrowserView getBrowserView() {
return browserView;
}
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:4,代码来源:C8oBrowser.java
示例9: getArticleView
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public BrowserView getArticleView(){
Browser b = new Browser();
BrowserView bv = new BrowserView(b);
b.loadURL(link.toString());
return bv;
}
开发者ID:beesenpai,项目名称:EVE,代码行数:7,代码来源:Story.java
示例10: SubEngine
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public SubEngine(BrowserWindow bw) {
this.bw = bw;
this.browser = new Browser();
this.view = new BrowserView(browser);
}
开发者ID:anti-electron,项目名称:positron,代码行数:6,代码来源:SubEngine.java
示例11: getBrowserView
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public BrowserView getBrowserView() {
return view;
}
开发者ID:anti-electron,项目名称:positron,代码行数:4,代码来源:SubEngine.java
示例12: WebBrowserComponent
import com.teamdev.jxbrowser.chromium.swing.BrowserView; //导入依赖的package包/类
public WebBrowserComponent(int x, int y, int width, int height, Browser b) {
super(x, y);
BrowserView view = new BrowserView(b);
this.wrapper = new SwingWrapper(width, height, 1000, 450, view);
}
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:8,代码来源:WebBrowserComponent.java
注:本文中的com.teamdev.jxbrowser.chromium.swing.BrowserView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论