Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JBrowser Source Code Files
JBrowser Source Code Files are provided in the
source package file.
You can download JBrowser source package as described in the previous tutorial and go to the "src" sub-folder to view Source Code files.
You can also browse JBrowser Source Code files below:
✍: FYIcenter
⏎ ru/atomation/jbrowser/impl/JComponentFactory.java
package ru.atomation.jbrowser.impl; import static org.mozilla.browser.MozillaExecutor.mozAsyncExec; import java.awt.Component; import java.awt.Dimension; import java.awt.Toolkit; import java.lang.reflect.Constructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import ru.atomation.jbrowser.abstracts.AbstractComponentFactory; import ru.atomation.jbrowser.interfaces.BrowserManager; import ru.atomation.jbrowser.interfaces.ComponentFacotry; /** * Фактори создает браузер встроенный в canvas // Factory create browser embedded in canvas * @author caiiiycuk */ public class JComponentFactory<T extends Component> extends AbstractComponentFactory<T> implements ComponentFacotry<T> { private static Log logger = LogFactory.getLog(JBrowserCanvas.class); protected final Class<? extends JBrowserComponent<? extends T>> prototype; public JComponentFactory(Class<? extends JBrowserComponent<? extends T>> prototype) { this(null, prototype); } public JComponentFactory(BrowserManager browserManager, Class<? extends JBrowserComponent<? extends T>> prototype) { setBrowserManager(browserManager); this.prototype = prototype; } @Override public JBrowserComponent<? extends T> createBrowser(JBrowserComponent<?> parent, boolean attachOnCreation, final long flags, boolean displayable) { final JBrowserComponent<? extends T> instance; try { Constructor<? extends JBrowserComponent<? extends T>> constructor = prototype.getConstructor(BrowserManager.class); instance = constructor.newInstance(browserManager); } catch (Throwable e) { logger.error(e.getMessage(), e); return null; } if (attachOnCreation) { instance.onCreatePeer(new Runnable() { @Override public void run() { if (browserManager.isInitialized()) { Runnable r = new Runnable() { @Override public void run() { browserManager.getWindowCreator().attachBrowser(instance, flags); } }; mozAsyncExec(r); } } }); } instance.onDestroyPeer(new Runnable() { @Override public void run() { if (browserManager.isInitialized()) { Runnable r = new Runnable() { @Override public void run() { browserManager.getWindowCreator().detachBrowser(instance); } }; mozAsyncExec(r); } } }); if (displayable) { instance.getComponent().setSize(320, 240); instance.getComponent().setVisible(true); // if (instance.getComponent() instanceof Window) { // ((Window) instance.getComponent()).setLocationRelativeTo(null); // } } return instance; } protected Dimension getPrefferedSize() { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); return new Dimension( (int) (screenSize.getWidth() * 0.75f), (int) (screenSize.getHeight() * 0.75f)); } }
⏎ ru/atomation/jbrowser/impl/JComponentFactory.java
Or download all of them as a single archive file:
File name: jbrowser-1.9-fyi.zip File size: 625318 bytes Release date: 2022-11-10 Download
⇐ Download and Install JBrowser Source Package
2017-07-17, 9304👍, 1💬
Popular Posts:
JDK 11 jdk.javadoc.jmod is the JMOD file for JDK 11 Java Document tool, which can be invoked by the ...
commons-lang-2.6.jar is the JAR file for Apache Commons Lang 2.6, which provides a host of helper ut...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...
JRE 8 deploy.jar is the JAR file for JRE 8 Java Control Panel and other deploy tools. JRE (Java Runt...