This system is proprietary and only the infrastructure bits (layout + hybrid interfaces) are available under a BSD license. You must use Teppefall Layout 4 or the JJHC console tool to create JXML from JFC. This system is highly experimental and might contain serious flaws.
Try it now at app.teppefall.com/installer
Author: Jan Erik Paulsen
Teppefall
Hello world
<component class="javax.swing.JLabel" text="Hello World !"/>

Porting a Swing component to Teppefall Hybrid
<component class="com.teppefall.hybrid.test.MyComponentApp" text="Static text" id="hello"/>
import java.awt.EventQueue;
import javax.swing.JTextArea;
import javax.swing.text.JTextComponent;
import com.teppefall.ds.console.Console;
import com.teppefall.hybrid.AssemblyComponent;
import com.teppefall.hybrid.AssemblyContext;
public class MyComponentApp extends JTextArea implements AssemblyComponent {
public void initialize(AssemblyContext context) {
JTextComponent hello = context.getTextComponentById("hello");
Console.info(this, "edt="+EventQueue.isDispatchThread());
// This runs after createUI, but before setVisible(true).
// If you have a strickter EDT profile you can use Hybrid.text(hello, "this instead");
if (context.isRunningAsApplet()) {
hello.setText("Hello from browser! - " + getText());
} else {
hello.setText("Hello from desktop! - " + getText());
}
}
public void start() {}
public void stop() {}
public void destroy() {}
}
Application runtimes
com.teppefall.hybrid.app.JJHMain [example.jxml] [application.xml]
com.teppefall.hybrid.browser.JJHPlugin
@assembly - [example.jxml]
@verbose - true | false
@delayed - true | false
@dka - [string]
@dkb - [string]
com.teppefall.hybrid.browser.JJHPluginLAF
@lookandfeel - [string]
com.teppefall.hybrid.browser.JJHPluginLAFDT (experimental support for Substance 5, will not work properly in Opera when using JNLP extensions)
@lookandfeel - [string]
Javascript support
Both runtimes will provide Javascript access. JSObject or Rhino.
JJH-10 Installer - http://app.teppefall.com/installer
A very advanced, URL aware, Javascript installer has been developed to improve the user experience. This system alone is 600 lines of Javascript. It modifies the DOM directly and does not require a page refresh. You can also hide and show the website navigation by pressing Escape and Enter. The animation code is powered by jQuery. Firefox, Safari, Chrome, Opera and Internet Explorer is supported.






Technology overview
Teppefall Hybrid uses the Teppefall Layout assembly system to load user interfaces. This technology is four years old and is built on top of Swing. It is Java 1.5 compatible, but is pretty much Java 1.4.2 code upgraded to 1.5. So any "stupid" API choices are results of legacy requirements rather than design decisions. A Teppefall Assembly is basically a Java XML file (jxml) generated by Teppefall Layout. This is then loaded by XMLDecoder and cast into an Assembly object. You should simply use text/xml as the JXML mime type. The most common assembly object is JFCAssembly, which is based on the JFC layout format. Teppefall uses JFC/JXML as Apple Interface Builder uses NIB and XIB. The same rules apply for JFC as for XIB. Do not dump the entire user interface inside one JXML document. Use the Importer class instead and run it in parallel or on-demand.
Properties
<component class="javax.swing.JScrollPane">
<property name="viewportView" type="Component">
<component class="javax.swing.JList">
<property name="listData" type="Vector">
<vector>
<item>Just</item>
<item>Testing</item>
</vector>
</property>
</component>
</property>
</component>
Layout
<layout class="java.awt.BorderLayout">
<component class="com.teppefall.ds.render2d.Darkstar" constraint="Center"/>
<component class="javax.swing.JLabel" constraint="South">
<property name="preferredSize" value="100,100" type="Dimension"/>
<property name="text" value="This is a 100px high JLabel at BorderLayout.SOUTH"/>
</component>
</layout>
Client properties
<component class="javax.swing.JToggleButton" id="left" name="left">
<clientproperty name="JButton.buttonType" value="segmentedTextured"/>
<clientproperty name="JButton.segmentPosition" value="first"/>
<property name="text" value="Left"/>
<property name="selected" value="true" type="boolean"/>
</component>
Grouping
<component class="javax.swing.JPanel">
<component id="one" class="javax.swing.JRadioButton" text="One">
<property name="selected" value="true" type="boolean"/>
</component>
<component id="two" class="javax.swing.JRadioButton" text="Two"/>
</component>
<group>
<idref id="one"/>
<idref id="two"/>
</group>
Actions
<action name="wrapAction" class="com.teppefall.ds.WordWrapAction" text=""/>
<component class="javax.swing.JToggleButton" action="wrapAction"/>
Type system
<component class="com.teppefall.ds.layout.jxml.TextLabel" text="Hex colors!">
<property name="foreground" type="color" value="#ffffff"/>
<property name="background" type="color" value="#ff0000"/>
<property name="opaque" type="boolean" value="true"/>
</component>
Types (see /transformers/jfc.xslt in Teppefall Layout)
boolean, byte, char, short, double, float, int, long, string, hashtable, object, class, idref, component, color, font, insets, dimension, point, icon, tree.
![]()
Interface AssemblyComponent
void initialize(AssemblyContext context);
void start();
void stop();
void destroy();
Interface AssemblyContext (might change)
boolean isRunningAsApplet();
void setRunningAsApplet(boolean runningAsApplet);
void setApplet(JApplet applet);
JApplet getApplet();
void setApplication(JApplication application);
JApplication getApplication();
void setScripting(JScripting scripting);
JScripting getScripting();
URL getAsset(String path);
InputStream getAssetAsStream(String path);
void setAssembly(Assembly assembly);
Assembly getAssembly();
JComponent getComponentById(String name);
JTextComponent getTextComponentById(String name);
JLabel getLabelById(String name);
void addPropertyChangeListener(String property, PropertyChangeListener listener);
void addPropertyChangeListener(PropertyChangeListener listener);
void removePropertyChangeListener(String property, PropertyChangeListener listener);
void removePropertyChangeListener(PropertyChangeListener listener);
Interface JApplication (JJHMain only, JApplet is used in JJHPlugin)
public static final int INFORMATION = 1, ERROR = 2, WARNING = 3;
JFrame getApplicationFrame();
PopupMenu getTrayMenu();
Properties getState();
String[] getArguments();
org.w3c.dom.Document getApplicationDescriptor();
void setIcon(ImageIcon icon);
void setOpacity(float alpha);
void setOpacity(Window window, float alpha);
void setShape(Shape shape);
void setDefaultShape();
void setDefaultRoundShape();
void setShapedBorder(Color mix, int radius, int insets);
void setDefaultRoundShapedBorder();
void setDefaultRoundShapedBorder(Color mix);
void createFrameMover(JComponent component);
void displayTrayMessage(String message, int type);
Adobe AIR application descriptor support
Teppefall Hybrid supports the Adobe AIR descriptor format right out of the box. Here is a sample that works with JJHMain. In the future this system will provide HTML canvas support through JWebPane. Hybrid also has built in support for updating the software, but there is no patching.
application.xml
<?xml version="1.0" encoding="utf-8"?>
<application>
<id>com.teppefall.Hello</id>
<name>Hello World! in Teppefall Hybrid</name>
<version>1.0</version>
<filename>HelloApp</filename>
<description>This is a sample application</description>
<copyright>Teppefall 2009</copyright>
<initialWindow>
<title>Console</title>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
<content>console.jxml</content>
<visible>true</visible>
<width>600</width>
<height>600</height>
<minimizable>true</minimizable>
<maximizable>true</maximizable>
<resizable>true</resizable>
<x>150</x>
<y>150</y>
</initialWindow>
<icon>
<image16x16>icons/appname-16.png</image16x16>
<image32x32>icons/appname-32.png</image32x32>
<image48x48>icons/appname-48.png</image48x48>
<image128x128>icons/appname-128.png</image128x128>
</icon>
</application>
Media support - JMC ON2 FLV opened through URL
Teppefall Hybrid comes with a MediaComponent for audio and video playback. This is just a thin wrapper around the Java Media Components pack from Sun and only runs on the desktop for now. Getting JOGL and JMC to work together in a JNLP file is borderline impossible. Or.. maybe Sun's own JNLP extension code is just wrong. I have no clue. Another bonus is that JNLP extensions can crash or hang pretty much all browsers on the OS X platform. Safari and Chrome on Windows are also affected by these problems.

Media support - JMC WMV 1080p local. This only works on Windows. The scaling algorithm is causing the low-resolution feel. My CPU is probably too slow. Also worth mentioning is that the harddrive reads for 10 seconds before playing anything.

Tutorial 1 - Hello world !
Tutorial 2 - Writing a desktop application in Javascript.
Tutorial 3 - The anti-social image viewer.
Tutorial 4 - Hybrid tutorial - Teppefall Frame Extensions and the JJHMain parameter -XrunScriptOnOwnThread.
Tutorial 5 - Hybrid documentation.
Tutorial 6 - Hybrid tutorial - Using SharedVM with JJHMain.
© Teppefall 2009