Introduction
The purpose of this page is to provide some help to Java developers for the Mac platform; in particular libraries and tips for Java Macintosh programmers. Any contribution to the page is welcome (send an e-mail to the mantainer of the page) and the site is intended as a cooperative effort by more Mac developers (from the MRJ-dev list) who want to share part of their work to others.
The first part is new and contain a java library to submit jobs to an XGrid network: XGridClient. It connects directly with the controller without using the XGrid command line. So in principle it can be used also from a non Mac. But you need a controller and a Mac XGrid network.
The second part is devoted to high speed computation in Java. The first contribution is a Java Native Library to use the Altivec or Velocity Engine acceleration in Java. Actually the library may need a check as I wrote it some years ago. Not sure it still work as it is.
The third part is devoted to the Macintosh Look and Feel development (actually with Mac OS X this is not anymore needed). The Mac Look & Feel is a sort of plug-in to be used with the Swing (or JFC) that implements a Macintosh Look and Feel. In this page you will find an alternative L&F to the Mac L&F distributed by the Swing team. It was called MacOS L&F; also some hack to the official Mac L&F are availables here.
XGridClient (all platforms, need a Mac OS X >= 10.4 XGrid controller and network)
Java library to submit jobs to an XGrid network. An XGridHello example is provided to show how the library work. Actually the library don't make use of any password or kerberos authentication, but it can be easily included, just let me know what you think of it and if it is useful. The package has been developed using as a template the java XGridAgent you can find here
- Version 1.01 (30/03/2006):
- The license agreement, source code and compiled jar files as well as little documentation is included in the distribution package. For any question contact the author.
- For more information about the XGrid network see the XGrid.
Download (library recompiled with java 1.4.2 as the previous was not running on 1.4):
xgridclient.zip Zip archive. XGridClient library version 1.0, Mars 2006 (sources included)
JNIAltivec (all platforms, precompiled for Mac OS X >= 10.2)
Java native library and interface for more mathematical functions and to use Altivec (G4 velocity engine) vector processor if available
- Version 0.5 (02/06/2003):
- Only mathematical functions of the vecLib framework have been implemented. In addition to the functions of java.lang.Math you have also: logb, scalb, nextafter, sinh, cosh, tanh, acosh, asinh, atanh, fmod, remainder, remquo
- For the Altivec you have in addition: tablelookup, fab, classify
- Some others custom functions added for Diffraction (my principal interest): PseudoVoigt, AnglesConversion.
- Simple usage, works only for array of floats, ints etc.. But could be as bigger as you want.
- There is a test function to check what size of array is best to accelerate your computation.
- Source code included, so you can write your function to gain more speed concatenating computation in the vector space. The bottleneck of the computation is the swap from scalar to vector space and to scalar again. The memory cache size of the Velocity Engine is important and should be coordinated with the size of your arrays for best results.
- For a complete listing and last nug (not a bug, or should be called fug, feature bug?) fixed see the README inside the package.
- The license agreement. If you donwload the library or package be sure to read the license. A copy is included in the distribution package. For any question contact the author.
- For more information about the Velicity Engine see the VE Apple developers pages.
Download:
JNIAltivec.sit Sit archive. JNIAltivec library version 0.5, February 2003 (sources included)
JNIAltivec.tar.gz tar.gz archive. JNIAltivec library version 0.5, February 2003 (sources included)
JNIAltivec.zip Zip archive. JNIAltivec library version 0.5, February 2003 (sources included)
MacOS Look and Feel (Compatible with Swing 1.1.1 final and Java 2)
New version 0.34 (0.33 skipped), February 2001 (attention, there was a problem with the first version of the 0.34 macos.jar of date prior to 2 February; if you download it not seeing this note, it may not work).
- Principal features:
- MenuBar on top of the screen like on a real Mac (not framed as in the original Mac L&F from JavaSoft)
- Appearance savvy (on a Mac the MacOS L&F load theme colors and settings from the System)
- Use by default the command button instead of the Alt for shortcut and cut & paste
- Many bugs corrected (JFileChooser, non US keyboards, icons etc.).
- For a complete listing and last nug fixed see the MacOSreadme.txt.
- The MacOS L&F include the modified Swing classes directly in the jar archive. So it is no more necessary to use a different patched swingall.jar (the original swingall.jar from Sun must be used). The only important requirement for it is that the macos.jar (containing the MacOS L&F) must be loaded by the JVM before the swingall.jar (see notes in the MacOSreadme.txt).
- To follow the Java naming convention, with version 0.30 the package name for the MacOS L&F has been changed from com.sun.java.swing.plaf.macos to it.unitn.ing.swing.plaf.macos; if you are using the swing.properties file, you need just to change the package name for MacOS inside the properties file (or take the new one inside the package distribution), otherwise you need to change the package name in the source where you are calling the MacOS L&F.
- There are two downloading packages in two compress forms (stuffed or zipped). The first contains the MacOS L&F complete package with readme and source codes and the second contains only the SwingSet example in friendly form for Mac and including the needed macos.jar and the standard swingall.jar from Javasoft (1.1.1) packaged to run directly without any install. After starting by double-clicking the SwingSet application, choose from the menu options the MacOS L&F to see it in action.
Downloading:
Version 0.28 (latest using swingall.jar patched version)
Here is the latest MacOS L&F for Swing 1.1.1 final. Added some more features. All source codes included.
Version 0.28 is out. Last bugs corrected: MacOSTreeUI behaviour, 'alt'+key characters, better icons for trees.
To reduce the downloading time I added the possibility to download only the MacOS L&F without the rest of the package. Also for non-Mac user the archives has been zipped and are availables as a separate download.
Download macos.jar v 0.28 (20 August 1999)
Download swingall.jar 1.1.1 (new for 0.28 version)
Download MacOS sources for 0.28
or
Download entire package (macos.jar v 0.28 + sources + swingall 1.1.1 + example)
It includes an example to use the swing.properties file to add more L&Fs to your program without modify your program. Check carefully the MacOSReadme file. The model has been included in the new SwingSet. It is distribuited under the Artistic License model. See the bottom of the page for more.
Here are the same files in ZIP format for non-Mac users (also for the macos.zip, it must be unzipped):
Download the entire zipped package (0.28)
or
Download macos.jar zipped (0.28)
Download MacOS source codes (0.28)
Download swingall.jar 1.1.1 zipped (new for 0.28 version)
Mac L&F (official)
The Mac L&F has been improved considerably from the first (not working release from the Swing team, February 98, who remember? Only source code were distribuited) and the first "working more or less" hacked release by the mantainer of this page on Mars, 6. The first good release come out with the Swing 1.1beta and was completely revised. Actually the Mac L&F is bounded with the Swing download for the Macintosh as a separated mac.jar archive.
The official Swing release containing the Mac L&F is available from JavaSoft with a Mac friendly download for the Swing package (no more separate mac.jar; it is included in the swingall.jar).
Unofficial Mac L&F
A couple of developers (we hope more in the future) are working to improve the Mac L&F distribuited by the Swing team. Here are available the Mac L&F modified jar files. What you have to do is to add the jar file to the classpath (on the Mac correspond to put the file in the System Folder:Extensions:MRJ Libraries:MRJClasses folder) or to add it to the JBindery path for a JBound application.
Notes:
- you need to remove the older mac.jar file before.
- mac.jar requires also the swingall.jar to work, download it with the official Swing release.
Actually a revised version for the Mac L&F is available from Bradley Smith. Quoting from his mail:
Just wanted to say that I have again modified the Mac L&F to support the proper setting of the hilite color in selections. That is, previously, the Mac L&F set the text to white and the hilite color to black. Now, the hilite color chosen by the user for his/her system is used as the selection background color.....The jar file ..... will feature the following:
- correct theme accent colors (watch your menus, scrollers, etc...)
- correct hilite colors (watch your text-selection etc...)
- correct default buttons and push buttons drawn exactly to Grayscale-specs
Bradley Smith
The latest jar archives are available here (it replaces the Mac l&f EA2 or beta-1 from Swing):
Download version b1 (3/3/1999)
Download version ea2 (3/3/1999)
Another modified mac.jar archive is available by Luca Lutterotti and Jason Giles with the following components modified:
- progressBar
- tabPanel
- textField
- comboBox
The jar archive is available here:
Download (3/3/1999)
For source codes download this archive.
May be you can ask why two different Mac L&F instead of putting all the modifications in only one. Well we are working on that, expect in the future to see an unified version available on this site. At the moment you can preview these availables.
Tips
The old example on building a JNI library on the Mac with MRJ is available:
Download AtomTest.
The Swing and the Mac L&F is licensed by Sun, see the Swing Connection about that.
For the MacOS L&F it is advised to follow also the Swing license (as it is derived from another L&F) and the Artistic License for the new additions and modifications.
Page maintained by Luca Lutterotti, last revision 29/03/2006.
|