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, 8558👍, 1💬
Popular Posts:
What JAR files are required to run sax\Writer.java provided in the Apache Xerces package? 1 JAR file...
How to display types defined in an XML Schema file with the xs\QueryXS.java provided in the Apache X...
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers. Both...
How to download and install Apache ZooKeeper Source Package? Apache ZooKeeper is an open-source serv...
Xalan-Java, Version 2.7.1, is an XSLT processor for transforming XML documents into HTML, text, or o...