« Hybrid tutorial - The anti-social image viewer | Main | Hybrid documentation »

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


TrackBack

TrackBack URL for this entry:
http://www.installer.teppefall.com/movabletype/mt-tb.cgi/216

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

This website is all about alpha and beta software

Download non-beta software here