Welcome to JAssistant
Current version is 1.6.1
|
The package
The package is named adavid and it has the following sub-packages:
- awt : classes that extend the java.awt, or simply new components like TNode, a tree node
- io : input/output package, just classes to use output to a string or a text component
- reflect : a big package on reflection, to get structured
information on classes, these classes use intensively the java.lang.reflect
package and they provide easier access and more complete access to class
information. A news is the capability to look for the packages so that
the user can see all the installed classes.
- swing : extensions of the swing components, notably
a BToolBar class which has a Toolbar with a BorderedLayout layout, which
does not work properly for JToolBar
- util : some tools to run like Assistant, JDefaultResource...
and useful classes like Sorter to sort whatever you want
Executable programs
- adavid.reflect.ClassReflect : gives information on
one class, which is constructors, fields, methods. Can find a class even
if the name is not complete. This class uses the PackageFinder class which
writes information on your home directory to avoid doing the exploration
each time. The package exploration is done only when the program notices
that the actual packages have changed.
- adavid.reflect.JavaFinder : finds source of a class
name, needs the complete name. The main() declaration is there just to
test the class.
- adavid.reflect.PackageFinder : finds all the packages
on your system and may give information on one in particular, with the
contained classes and extensions of a particular class within this package.
- adavid.util.Assistant : a program only. This is not
intended to be a class to be used as a module, it is a real tool, see the
section
on this tool. This is a class and package browser, it uses the decompiler
mocha
and is able to find sources on your system if you give their path.
- adavid.util.JDefaultResource : same as Assistant,
see the section on resources. This produces a
default configuration file by reflection on a class to be able to change
resource definitions.
- adavid.util.JMakefile : this is a simple tool which
creates Makefile files in a package.
- adavid.util.StatSource : this gives simple statistiques
on source code inside a package. It takes by default java files, but it
can do the same on C files.
JAssistant
Manual in pdf
or ps.gz.
The assistant is a class and a package browser. It
is divided into two parts: the main
class browser and the package
viewer. A third options
window may be opened to control the program behavior. The main goal
of this program is to be able to find very quickly a class, its source,
its methods, fields, constructors... and to be able to explore the packages.
Completion, and class homonyms may be enabled. Concerning the package viewer,
well, you have the package hierarchy and
the class hierarchy inside a selected package,
which is the inheritance hierarchy inside a package. The classes which
appear with an icon marked "i" are interface classes and the ones with
an "a" are abstract classes. The options window allows to put filters for
the lists which are given: definition with long or short names, filter
on the scope (public, package, protected, private), filter on the modifiers
(native, abstract, static...), the order for the search of the sources
(java, jj, decompile or disassemble), sorting options and an uptdate package
button to reread all your packages. The assistant was swing free.
At the beginning I was happy to use swing, which is very nice, and that's
why I have a swing package too. But as time passed I saw that swing had
bugs and that it was not usable in a real program because it is too slow!
This is the reason why I have my own tree classes in pure AWT java! It
seems now that swing has been improved, specially 1.1.1, so...
I came back to it for the code viewer. This explains that the code
is in majority pure AWT, and the viewer in Swing.
Using another decompiler
A plug-in interface has been created since version
1.3. To use another decompiler than mocha do:
- java adavid.util.JDefaultResource adavid.util.Assistant
This will produce the resource file Assistant.properties.
Edit it and change the fiels decompilerList by adding space separated class
names.
- the class names that you added are interface implementations
of the interface adavid.reflect.Decompiler. You have to implement
this plug-in interface and it will be used automatically. Have a look at
mocha.MochaGate to have an example of the interface of mocha (reflection
based). You may want to used some of its static methods, specially to open
the class file.
Resources
There is a whole support for automatic resource declaration
and use. The idea is: it is painfull to remember a list of 30 resources
for one program, which we have to do if we want to use the ResourceBundle
class of Sun. This class is powerfull, but not so usefull alone. Furthermore,
using resources in a java program gives always the same kind of code and
it is time consuming and error prone to do the job for each of the class
you want to write. Instead, I use reflection! Just define fields public
to allow access, or extend a special class or implement a special interface
to allow access to Bundle. There are three proposed levels:
- adavid.util.Bundle : raw managing of resource, you
can get manually a component by just its name, the resource is loaded and
used transparently.
- adavid.util.ResourceLoader : you get automatically
awt components.
- adavid.util.JResource : extension to swing components
(in com.sun.java.swing package).
By this way, you can produce automatically a configuration
file, by using adavid.util.JDefaultResource, modify it as you want and
then use it transparently if your program is using one of these three classes.
A zip-file is
provided to show simple examples on how to use some important classes.
API and download
This package is free, you can download it provided
that you agree on the license.
The package has been tested under JDK1.1.7, be carreful if you are using
some JDK1.2 beta versions or other JDK versions, the virtual machine may
crash. Changelog,
TODO and howto.
New: html/swing java source browser available, which is like
javadoc on-the-fly at the source level with simple syntax highlighting.
The package distribution file is dowloadable here
and the license is LGPL.
In case of update, remove your $HOME/.PackageFinder.info, run assistant
with option -update or click on Update Packages in the options dialog window,
bugs were fixed to find (hopefully) all the installed packages.
It contains installation instructions and the
java source files. The license of the package is LGPL.
I have produced the API with javadoc in JDK1.2.2,
the different produced links are
index,
tree ,
index-alll,
help.
I do not plan to put a manifest in the jar file since running
under Windows requires a script with several settings.
If anyone has a non broken link to a free decompiler other than mocha,
please let me know.
Known bugs
-
When initializing or updating the packages, the assistant
may go into infinite loop if you start it from a directory where you have
recursive links.
-
Depending on your version of motif, your window manager
or maybe java (I do not know), you may have to move the window of the Assistant
at the beginning in order to display the content of this window. Similarly
there is a problem with the scrollbars, this affects the motif awt (Linux+Solaris)
only.
-
Scrollbars are buggy under motif, seems to work well
under Windoze :( , bad under blackdown Linux, worse for IBM JDK.
-
This version works badly under Kaffe virtual machine.
All trademarks and copyrights on this page are properties of their respective owners. Forum comments are owned by the poster. The rest is copyright ©1999-2000 VA Linux Systems, Inc.
|