ActionManager
contains an ActionListener which redirects the calls
to specialized functions of the form
public void/whatever something(ActionEvent e)
only one redirection per component!
tries to make a class from its name, possibly incomplete (without package prefix)
returns all found classes with the given name (several packages) if the flag is true
we use directly the focus event mask to manage the focus,
it is simple and efficient
we overrides all the constructors of Label to
provide a flexible component
returns the argument of an option:
null if the option was not found, "" if no argument, "...something"
if the argument is found
the option should be complete, for example: "-o" for the option -o
returns a list of possible classes for this package
we say "possible", that means that the classes are not
checked! The names are relative to the package
returns the definition of an option:
-option=something : getDefinition("-option") returns "something"
returns null if the option is not defined and "" if the definition
string is empty
-option = something ; -option= something ; -option =something are not recognized
the dimension taken by the rendered image and triangle ;
updateDim() is assumed to be called before ; has to be done
explicitely if one changes one icon ; implements TNodeRenderer
the dimension taken by the rendered image and triangle ;
updateDim() is assumed to be called before ; has to be done
explicitely if one changes one icon
get an icon by its resource name (without .icon extension)
return null if not found
the default name is resourceName.gif
where the '.' in the resourceName have been replaced by '_'
returns the interval where the source of the constructor/method can
be found ; arguments are the name(short) and the arguments(long)
not supported: type / comment / []...
the shared instance of this class ; shared since its
only purpose is to draw an image ; I adopt here a weak
programming model, namely the icons are assumed not to
be modified by a process while the instance is rendering
them, or updating the size information.
invalidate the node given in arguments
if one node is not valid, then all its parents
are not valid, so we do not need to propagate when we
find one !valid, thus the test in the loop
JavaFinder
a java source finder: works on the class path and
the property java.source.path which contains
path to java source like CLASSPATH
The property is given to the program via the command line
with the option -Djava.source.path=...
syntax of the class passed in argument:
class Data {
### all members should be declared public, otherwise they may not be read or written
static String name1; => name1 is the resource name and the default value
static String name2="default"; => here the default value is given
static Icon name3; => name3 is the resource name for an icon object
default is name3.gif
### String resources are defined as: resourceName.name=...
JTextAreaOutputStream
output stream JTextArea (from JStringOutputStream)
as JTextArea is slow, it could be nice to use this class
inside a BufferedOutputStream to enhance performance
easy solution:
return new Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource(iconPath+name));
but java crashes sometimes:
Uncaught error fetching image:
java.lang.NullPointerException
at java.net.URLConnection.guessContentTypeFromStream(URLConnection.java)
at sun.net.www.URLConnection.getContentType(URLConnection.java:126)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:98)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:259)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:151)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:127)
so we do the job in another way: load the data and create an image from the data