Jesktop Developer Documentation |
First of allMaking an application compatible with Jesktop does not mean it has to only be runnable on Jesktop. It can still have the ability to run from the command line and a full "mainable" application. What we outline here is a way of coding the application so that it can run in both ways from one code base. There are a number of things you should not do, but they are easy to adjust to. Just look at how many pre-existing applications we have ported to Jesktop - it can't be that hard. ConstraintsTake a look at the constraints page, to see tricks and tips for coding an application to be Jesktop compatible. Frimble (or not)If you need to interact with the Frame for the app, then you should inplement Frimble functionalily (still compatible with the standalone runtime environment). The the Frimble documentation. If you don't need a title, menu, close event consciousness, then JPanel is enough to extend. applications.xml - a config file for a jar.The app must be distibuted in a jar that contains all that is needed for the application to run inside Jesktop. This includes classes and resources. For GPL applications for legal reasons you should include the source too (as opposed to making it available on a website). The final thing that Jesktop needs is an applications.xml file that contains packaging instructions for Jesktop to pick up on as it installs applications. That file should exist inside a directory called JESKTOP-INF. This is insiped by Sun's specified standard for WAR files, with the exception that we have avoided attibutes and elements called name as they are confusing. Here is the example: <?xml version="1.0"?> <applications> <application> <display-name>Julia Set Animation</display-name> <launchable-target-name>Demos/Julia3</launchable-target-name> <class>org.jesktop.demos.julia3.Julia3Wrapper</class> </application> <application> <display-name>Mondrian Art Thingy</display-name> <launchable-target-name>Demos/Mondrian</launchable-target-name> <class>org.jesktop.demos.mondrian.Mondrian</class> </application> <application> <display-name>Warped Image Manipulator</display-name> <launchable-target-name>Demos/AlexWarp</launchable-target-name> <class>org.jesktop.demos.alexwarp.AlexWarpWrapper</class> </application> </applications> Shown here is the packaging for the demos that we ship with Jesktop. A display-name that will be used for presentation (TODO-internationalisation). A target-name that is used as a unique name for the app and a class to instantiate. As you can see here, it is possible to have many apps in one jar. This is as simple as it gets for the applications.xml file. applications.xml - A more complex exampleBelow is the applications.xml file used for Horstscape. <?xml version="1.0"?> <applications> <!-- <default-application target-name="Tools/Browsers/Commercial/HorstScape" icon32="horstscape/earth32.gif" icon16="horstscape/earth16.gif"/> --> <application> <display-name>HorstScape</display-name> <launchable-target-name>Tools/Browsers/Commercial/HorstScape</launchable-target-name> <class>horstscape.Browser</class> <application-config-file>horstscape/HorstScape.xml</application-config-file> </application> <additional-jars> <!-- <jar where="remote">jar:http://home.earthlink.net/~hheister/htmlwindow/ HTMLWindowDemo_Java2.zip!/HTMLWindow.jar</jar> --> <jar where="contained">lib/HTMLWindow.jar</jar> </additional-jars> </applications> This intorduces three things:
Application specific config fileBelow is the Horstscape.xml for the application of the same name: <?xml version="1.0"?> <application> <icons icon32="horstscape/earth32.gif" icon16="horstscape/earth16.gif" /> </application> It shows the gifs that can be used as icons for the app. There is no set loacation for this file within the jar. |
Copyright (c) 2004 The Jesktop Project Committers. All rights reserved.
Hosting provided by : | Jesktop API SourceForge project page |