We use Java Swing for our GUI development. It's a lot more powerful
than the original AWT, and the price is right. In particular, we
try to use the "Bean format" of setting and getting members, call-backs to
notify of changes, etc, to make it easier to build applications from JMRI components.
The Java communications toolbox (javax.comm) has worked fine on
Macintosh, OS/2 and Linux for serial I/O. We hope it works fine on other platforms.
For Windows, we had to move to
the Serialio package from
Serialio.com
to be able to use the MS100 baud rate. To do this, the
jmri.jmrix.loconet.ms100.MS100Adapter class was converted to use
Java reflection to decide which whether the Serialio package is
available; on other systems, it uses javax.comm.
Note that our license for Serialio limits it to this use only;
we are not permitted to distribute the libraries for other purposes.
The Java collections (List, etc) are available in JMRI, because
we need them for various other packages. Use them if you'd like; there
are often better approaches than to make everything a Vector.
Originally we used the Java 1.1 version of this, but that restriction
no longer applies; use the complete API if you'd like.
If you need to use comma-separated variable (CSV) files,
please use the
javacsv API
if possible. We are already using that in a number of places,
and will probably use it in more. If that doesn't provide
enough functionality, we might eventually move to the
opencsv API, but since we only want to use one,
the conversion will be a lot of work.
Code Format
The
Java recommendations
for names, formatting, etc are really useful.
If you find that you can't read a piece of code, these will help
make it better.