Main

January 16, 2010

64bit support is coming

Supporting 64bit is not very important when most of your code is in Java. But Teppefall does have around 300kb of C++ that needs to be ported. And the process is something like this.


  • Install crazy big Windows SDK and Visual Studio on Windows 7.

  • Realize that the Windows documentation is wrong when it comes to "vcvarsall.bat amd64".

  • Dig around for a while.

  • Find the correct BAT based configuration files and drag them into the application menu.

  • Create custom makefiles.

  • Scratch your head as Microsoft uses the suffix "32" in paths and library names everywhere.

  • More mind numbingly boring rewriting of makefiles.

  • Everything compiles, but Winsock related code is broken. Might be configuration. Might be worse.

  • Realize that 64bit JRE writes a registry JVM value that points to a non-existent file. My fault ?

  • But the code supports that, so just use TEPPEFALL_JVM variable.

  • Success!


Itanium support is probably not happening. The compiler can't find "Windows.h" under the IPF configuration and that's kind of a problem unless I want to dynamically load every method. 64bit Windows 7 also seems to crash some plug-in based systems. They keep changing the security model and developers are behind all the time for some reason. Although, the same problem exists on 64bit Linux. Which is stranger since 64bit compiler support is just a GCC parameter away.

December 11, 2009

Which one is Swing and which one is WPF ?

Teppefall Media Player (91).png

Teppefall Media Player (93).png

The volume component gives it away. But Silverlight 4 may change that.

December 10, 2009

Sun is missing out on a huge opportunity

Teppefall Media Player (85).png

By being hell bent on "finishing" JavaFX instead of augmenting Swing Sun has more or less destroyed their credibility as a desktop platform company. The reality is that Swing plus a scene graph, accelerated layers and a new media framework is more valuable than the entire JavaFX ecosystem. Adobe, Microsoft, Apple, Opera, Mozilla and Google all believe that XML is the future of layout and yet Sun believes a non-standard syntax based on Lisp and JSON is the way to go. And the fact that C#, Actionscript, Dalvik and Javascript are all Java clones seems to indicate that Java is just fine as a user interface language. Adobe even exports twine animation code as XML and vectors as SVG. I sit here working in Adobe Creative Suite and wonder what Sun is thinking.

Continue reading "Sun is missing out on a huge opportunity" »

November 05, 2009

This is why I still use Java Swing

This is the latest MP prototype. Since JmediaPane is nowhere, I'm experimenting with forms and other boring things. Everything is scalable and the application can be broken down into small visual parts without compromising usability.

I'm using MigLayout for forms, CardLayout BorderLayout FlowLayout GridLayout BoxLayout AssemblyBoxLayout for center panels and Teppefall Layout assemblies make up each individual panel. I then just update one panel at a time in TL. Most of the layout code was written almost two years ago, but TL makes reuse very simple.

The clue behind this application is that almost all the UI layout code is in XML. I just use TL for visual and i18n updates. The idea that JavaFX syntax will make layout easier sounds completely delusional to me. The reason people use XML is because XML is a data format. My TL assemblies are just like Apple's NIB/XIB. And Teppefall Hybrid is sort of my version of Cocoa NSApplication.

The text should probably be a little bigger though. Swing application text looks tiny compared to WPF.

Teppefall Media Player (63).png

Teppefall Media Player (66).png

Teppefall Media Player (67).png

Teppefall Media Player (68).png

October 19, 2009

Teppefall Hybrid released

Hybrid is a component API for developing Swing applications. Instead of writing Java code from the start, you simply write a layout file and an application manifest file. Both are XML files. You then export the user interface assembly in Teppefall Layout and start adding Java or Javascript code. The application manifest format is almost identical to Adobe AIR application.xml files.

You only need Java skills if you want to deploy in a web browser. Compiling Javascript is possible, but dependency problems might bite you in the ass later on. Rhino changed their threading model once and that really confused the heck out of me.

Teppefall SDK 20091019 (Windows, Mac OS X, Linux, Solaris)

Continue reading "Teppefall Hybrid released" »

August 31, 2009

Teppefall releases Hybrid JJHPlugin fix for 1.6r15 security update

I've been trying to support a few older platforms and Java versions, but this latest security update from Sun forces me to focus on Plugin2. I still don't have a clue how to support 1.5/Mozilla/Tiger or 1.6+JNLP/Opera/Vista. Opera rolled their own Java applet launcher and this makes Web Start JNLP extensions a royal pain in the ass. On the positive side.. what can't run is neither deadlocking !

The Teppefall SDK will be released later this year, but you can test the new JJHPlugin code here. Note that the 1.6r15 update is only two days old, so some people might not be experience the problem yet. Sun simply blacklisted the old JNLPAppletLauncher because of a serious security problem.

About Teppefall Hybrid
Teppefall Hybrid is a single user interface component API for Java based desktop and browser development. Hybrid uses the Teppefall Layout JFC format for layout and Adobe AIR application.xml for application launch scripts.

May 07, 2009

Two new Hybrid examples

Two new Hybrid examples added to the Preview section. The URL base resolver code is currently wrong, so you will be asked to download some data from app.teppefall.com.

March 03, 2009

Tweaking application.xml files for Hybrid

Then Teppefall branding in the primary JFrame can be removed by adding an application.xml @grabber attribute and setting it to false. You can also remove the tray icon by setting @traymenu to false.

The script attribute is relative to the application.xml, just like the content element.

Hybrid specific application.xml attributes(may change in the future)
@script
@traymenu
@grabber

February 21, 2009

Hybrid tutorial - Taskbar icon, messages and menus

About
Taskbar icon, messages and menus.

Dependencies
You must create an ext/ folder and add bsf.jar, js.jar and commons-logging.jar into this folder. Add Substance 5 (substance.jar) in the same folder for EDT checking. The application and taskbar icon is defined in the application XML file.

taskbar.js
importPackage(Packages.java.awt)
importPackage(Packages.java.awt.event)
importPackage(Packages.javax.swing)
importPackage(Packages.com.teppefall.hybrid)

context.info("I am " + context.getApplication().getApplicationName())
app = context.getApplication()

awtMenu = new MenuItem("Hello")
awtMenu.addActionListener(function(e) {
JOptionPane.showMessageDialog(app.getApplicationFrame(), "Hello taskbar !")
})
app.getTrayMenu().insertSeparator(0)
app.getTrayMenu().insert(awtMenu, 0)
app.displayTrayMessage("Added a menu item to the taskbar icon popup", JApplication.INFORMATION)

Read more about JApplication here

run.cmd
java -cp teppefall-runtime.jar com.teppefall.hybrid.app.JJHMain taskbar.xml

WindowClipping (13).png

February 17, 2009

Hybrid tutorial - Using SharedVM with JJHMain

Before doing anything it is important that the developer understands the limitations of SharedVM. The SharedVM system uses the same class loader as the parent caller and the same event system. So one crashing application or blocking dialog box will affect all running applications. Also, the shutdown system is different and might cause problems with shutdown hooks.

Starting one Hybrid application within another Hybrid application can be done in one line of Javascript code. Just point JJHMain to the Adobe AIR descriptor file.

new SharedVM("com.teppefall.hybrid.app.JJHMain", ["../other/stuff.xml"]).start()

Hybrid documentation

Component context:
AssemblyContext.

Browser plugin:
JJHPlugin

Desktop runtime:
JJHMain

Teppefall JJHMain uses the Adobe AIR application property format:
Setting AIR application properties (Adobe website).

February 15, 2009

Hybrid tutorial - Teppefall Frame Extensions and the JJHMain parameter -XrunScriptOnOwnThread

About
This showcases Teppefall Frame Extensions and the JJHMain parameter -XrunScriptOnOwnThread.

Dependencies
You must create an ext/ folder and add bsf.jar, js.jar and commons-logging.jar into this folder. Add Substance 5 (substance.jar) in the same folder for EDT checking.

frames.js
importPackage(Packages.java.awt.event)
importPackage(Packages.javax.swing)
importPackage(Packages.java.awt)
importPackage(Packages.com.teppefall.ds)
importPackage(Packages.com.teppefall.ds.console)

context.info("I am " + context.getApplication().getApplicationName())
frame = context.getApplication().getApplicationFrame()

var r = {
run : function() {
new FrameExtension(frame, new JLabel("inside top right"), FrameMovementTracker.INSIDE_TOP_RIGHT)
new FrameExtension(frame, new JLabel("bottom"), FrameMovementTracker.BOTTOM)
new FrameExtension(frame, new JLabel("left"), FrameMovementTracker.LEFT)
new FrameExtension(frame, new JLabel("inside left"), FrameMovementTracker.INSIDE_LEFT)
}
}

if(EventQueue.isDispatchThread()) {
Console.info(this, "Running on EDT") // You can change this with -XrunScriptOnOwnThread - Default is to run on the EDT
r.run()
}
else {
Console.info(this, "Not running on EDT, developer must do the work")
EventQueue.invokeLater(new Runnable(r))
}

run.cmd
java -cp teppefall-runtime.jar com.teppefall.hybrid.app.JJHMain frames.xml

WindowClipping (12).png

February 12, 2009

Hybrid tutorial - The anti-social image viewer

About
This application displays one image from your own desktop. It is cutting edge anti-social-ware.

Dependencies
You must create an ext/ folder and add bsf.jar, js.jar and commons-logging.jar into this folder.

antisocial.xml
<application script="antisocial.js">
<id>com.teppefall.example</id>
<name>The Anti-Social Image Viewer</name>
<version>1.0</version>
<initialWindow>
<title>The Anti-Social Image Viewer</title>
<content>anti_social_gui.jxml</content>
<systemChrome>normal</systemChrome>
</initialWindow>

<icon>
<image64x64>teppefall-stort-ikon.png</image64x64>
</icon>
</application>

anti_social_gui.jfc (Warning: dropping a Effects2D script into the Effects2D panel runs the code without a security sandbox!)
<component class="com.teppefall.ds.render2d.Effects2D" id="effects">
<property name="foreground" type="color" value="#ffffff"/>
<property name="background" type="color" value="#0000ff"/>
<property name="opaque" type="boolean" value="true"/>
</component>

antisocial.js
importPackage(Packages.java.lang)
importPackage(Packages.java.awt.event)
importPackage(Packages.java.io)
importPackage(Packages.java.awt)
importPackage(Packages.java.awt.image)
importPackage(Packages.javax.imageio)
importPackage(Packages.com.teppefall.ds.render2d)
importPackage(Packages.com.teppefall.ds.render2d.compositing)

context.info("I am " + context.getApplication().getApplicationName())
effects = context.getApplication().getAssembly().getComponentById("effects")
context.info(effects)

var ds, img, bg, desktop, file, files, cachedFilename, cachedFileSize, cachedDate
var transHeight = 40
var r = {
destroy : function() {
shutdown = true
},
initialize : function(ds, fgColor, bgColor) {
bg = ColorLogic.deriveTransparent(Color.BLACK, 200)
desktop = new File(System.getProperty("user.home") + "/Desktop")
context.info(desktop)
if(desktop != null && desktop.isDirectory()) {
context.info("find files")
files = desktop.listFiles(new FileFilter({
accept: function (file) {
if(file.getName().endsWith(".jpg") || file.getName().endsWith(".png"))
return true
return false
}
}))
if(files.length != 0) {
index = Math.floor(Math.random()*files.length)
context.info("index=" + index)
file = files[index]
context.info("file=" + file)
}
}
else {
file = new File("teppefall-stort-ikon.png")
}
if(file != null) {
img = ImageIO.read(file)
cachedFilename = file.getName()
cachedFileSize = Math.round(file.length() / 1024) + "KB"
cachedDate = new Date(file.lastModified())
}
logo = ImageIO.read(new File("teppefall-stort-ikon.png"))
},
render : function(g, size) {
g.setColor(Color.WHITE)
g.fillRect(0, 0, size.width, size.height)
g.setColor(Color.WHITE)
g.setClip(0,0,size.width, size.height)
if(img != null) {
g.drawImage(
img,
size.width/2-img.getWidth()/2,
size.height/2-img.getHeight()/2,
img.getWidth(), img.getHeight(), null
)
g.setColor(bg)
g.fillRect(
0,
size.height - transHeight,
size.width+1, // huh?
transHeight+1 // huh?
)
g.setColor(Color.WHITE)
g.drawString(
"Filename: " + cachedFilename +" Size: "+ cachedFileSize +" Modified: "+ cachedDate +" Pixel size: "+ img.getWidth() +"x"+ img.getHeight(),
20,
size.height - (transHeight/2) + (g.getFont().getSize() /2)
);
}
else {
g.setColor(Color.BLACK)
g.drawString("No picture", 20, 40);
}
}
}

effects.setRenderer(new D2DRenderer(r))

run.cmd
java -cp teppefall-runtime.jar com.teppefall.hybrid.app.JJHMain antisocial.xml

The Anti-Social Image Viewer (3).png

February 10, 2009

Hybrid tutorial - Writing a desktop application in Javascript

About
Teppefall Hybrid makes it possible to write Java desktop applications in just Javascript and XML. You simply add an attribute to the application.xml file.

Dependencies
You must create an ext/ folder and add bsf.jar, js.jar and commons-logging.jar into this folder.

hello.xml
<application script="sample.js">
<!-- Configuration code here-->
</application>

hello.jfc (notice the ID attribute)
<component class="javax.swing.JLabel" id="hello" text="Hello World !"/>

sample.js
context.info("Hallo verden !" + context.getApplication().getApplicationName())
context.info(context.getApplication().getAssembly().getComponentById("hello"))

run.cmd
java -cp teppefall-runtime.jar com.teppefall.hybrid.app.JJHMain hello.xml

CWindowssystem32cmd.exe.png

Hello World !.png

February 05, 2009

Hybrid tutorial - Hello world!

About
This tutorial shows you how to create a desktop application in Teppefall Hybrid.

Dependencies
You need the teppefall-runtime.jar file from the Teppefall SDK and the Teppefall Layout application.

hello.xml
<application>

<id>com.teppefall.example</id>
<name>Hello World</name>
<version>1.0</version>

<initialWindow>
<title>Hello World !</title>
<content>hello.jxml</content>
<systemChrome>none</systemChrome>
</initialWindow>

<icon>
<image32x32>icon.png</image32x32>
</icon>

</application>

hello.jfc (open this in Teppefall Layout)
<component class="javax.swing.JLabel" text="Hello World !"/>


hello.jxml (created by Teppefall Layout 4)
<?xml version="1.0" encoding="utf-8"?>
<!--Teppefall Layout 4.0-->
<java version="1.4.2" class="java.beans.XMLDecoder">
<object id="self" class="com.teppefall.ds.layout.jxml.jfc.JFCAssembly">
<void method="add">
<object class="javax.swing.JLabel">
<void property="text">
<string><![CDATA[Hello World !]]></string>
</void>
</object>
</void>
</object>
</java>

run.cmd
java -cp ../teppefall-runtime.jar com.teppefall.hybrid.app.JJHMain hello.xml

January 26, 2009

Teppefall Hybrid preview

This code is very experimental and can crash or hang your browser.

Teppefall Hybrid Technology Whitepaper.

Teppefall Hybrid Installer - JJH 10.


November 25, 2008

Teppefall Hybrid technology

Working on some new component technology. Nothing overly complex, but just an extension of my existing code base. Even made a logo.

Teppefall-Demo08.png

Also made all my code Substance 5 compliant last week, but I did use some ugly hacks so I must rewrite the threading code in the future. The code is EDT compliant, but still completely wrong :) So the user interface starts up very slowly.

Teppefall Hybrid will make EDT problems less invasive and make it easier to deploy user interface components on the desktop and in the web browser. But I'm not even sure I want to release this publicly. The last thing I want is to be the guy behind “yet another freaking framework”. So I'll only be using the technology on the Teppefall website for now.

I'm building this so that I can test the JavaFX platform faster. I don't want to waste six months of development only to find out that something doesn't scale or repaints incorrectly. There are huge differences between a desktop application and an unsigned applet, so I felt this was a necessary move on my part.

This website is all about alpha and beta software

Download non-beta software here