NCSAHabanero

[ Previous ] [ Index ] [ Next ]

-------------------------------------------------------------------
How to install a new hablet into a Habanero environment
-------------------------------------------------------------------

Installing New Hablets

Background Information

This pattern assumes you have completed all the code changes detailed in Change superclass, imports, and initialization, Transfer State to Other Instances, Simple Event Handling, and Specifying the Default Window Parameters.

You may also want an icon to represent your hablet in the form of a 32 pixel by 32 pixel GIF to display in the Tools Palette.

How does this work?

If you have trouble completing this section, check to see if you made a common mistake or error.
  1. If you haven't already, create a directory habaneroDir/apps/YourPackageName where habaneroDir is the directory you installed Habanero in, and YourPackageName is the name you gave the package back in Change superclass, imports, and initialization.

  2.  
  3. Place all the .java files for your applet in habaneroDir/apps/YourPackageName.

  4.  
  5. Compile [Outside link] the hablet into a class. (Make sure that your Habanero installation directory and the apps directory are in the CLASSPATH.)

  6.  
  7. Copy the GIF into habaneroDir/rsc/env/co_images your Habanero installation directory. The GIF must have a size of 32x32 pixels.
  8.  
    NOTE 

    If you don't specify a GIF, Habanero will use a no icon. If you do have a GIF but it is of a different size, Habanero will scale it for you. 
  9. Create a new file in habanero.rsc/toolsDir that tells Habanero:
  10. tool.name The name the Habanero client will display for this hablet.
    tool.picture The name of the GIF in rsc/env/co_images to use as an icon for this hablet. You can leave out this line if you do not want an icon.
    tool.classname The main hablet class. Normally the package name, a period, and the hablet class' name.
    tool.version The version number you assign to this hablet.
    tool.useOwnStream Whether or not the tool should use its own stream for communicaton.
    Below is an example of such a file. (Incidentally, Habanero does not care what name you call this file. Habanero reads all the files in the habanero.rsc/toolsDir/ directory.)
 
Running Example from the example of habanerizing TextDemo.java
 
Place TextBoxIcon.gif into rsc/env/co_images in your Habanero installation's directory and create the file habanero.rsc/toolsDir/HabTextDemo which contains: 
# The Text Demo hablet properties file
tool.name=Text Demo
tool.picture=TextBoxIcon.gif
tool.classname=TextDemo.HabTextDemo
tool.version=v0.1
tool.useOwnStream=true
 
You can now run Habanero and your new tool should be available. 

If you are using UNIX or Windows, 
  java Habanero -debug 
and 
  java HabaneroServer -debug 
will turn debugging on. Then debugging messages will be displayed on the terminal windows. On a Mac, enter "-debug" in the command-line options. 

Screen shot of using single-user mode 
 
 
TIP 

If you want to use another habanero.rsc directory for testing, you can use the -local command line switch when invoking the client. For example: 
java Habanero -local habanero2.rsc

If you want to run Habanero twice from the same machine, specify a differerent port using the -listen command line switch. For example:
java Habanero -listen 3001 -local habanero2.rsc


If you start a tools file line with #, the line will be taken as a comment. 
If you have a web page documenting your hablet, you can add to the tool file: 
tool.help="http://url.for.the.help.pages" 
There are various other attributes which you do not need for a simple hablet. They are discussed in these advanced section patterns: Arbitrators, ColObjects not yet written, Defining new toolsDir attributes not yet written, there might be others. 

What next?

The advanced topics.


Habanero® is a registered trademark owned by The Board of Trustees of the University of Illinois. Copyright 1996-1998. All rights reserved.   Java(TM) is a proprietary trademark owned by Sun Microsystems, Inc.
NCSA
The National Center for Supercomputing Applications

University of Illinois at Urbana-Champaign

Contacts page