A JUnit-like assertion method that uses reflection to
ensure that no properties have default values; useful for
testing (possibly large) Constructors to ensure that all
properties are being set (and set correctly, e.g., gotta
love those copy-and-paste errors in legacy constructors
that are set by hand...).
A simple class for looking up Java AWT Color Names; I got tired
of including this code in every program that needed it!
(yes, this IS a hint to JavaSoft.).
Classes for dealing with Swing GUIs slightly differently
under MacOS X, needed in part since Apple didn't quite get the portability
issues just right (like where the MenuBar appears).
A few miscellaneous utility classes (note that in May 2003, this package
was split into several com/darwinsys/* packages), and many classes
"moved out" to adjacent packages.
The rather involved pattern used to match CSV's consists of three
alternations: the first matches a quoted field, the second unquoted,
the third a null field.
Save the file to disk, in such a way as to map the UNIX
line-endings used inside JTextArea to the correct
platform-specific line endings as generated by println().
A GOF Adapter to make instances of old Enumeration interface
behave like new Iterator interface, so we only have to deal
with one well-defined implementation of the Iterator pattern.
Handle Apple's continuing failure to make their Java implementation's version
of Runtime.exec() match normal users' behaviour, that is, make Runtime.exec("Foo.app")
actually run "Foo".
FilterGUI implements a back-and-forth list, ie, two columns of items, in
which items can be moved back and forth between them with "Add" and "Del"
buttons.
The intention is that you put this as Main-class: in a Jar
along with everything else - your installer and its data classes
and it unpacks the Jar into a temp directory then starts
the "real" installer.
The only os-dependant part of com.darwinsys, this is the
adapter class to handle MacOS's "different" way of doing About Box,
Quit item in App menu, Preferences, and so on.
Track a Window's position across application restarts; location is saved
in a Preferences node that you pass in; we attach a ComponentListener to the Window.
MultipartResponse lets a servlet generate "server push" responses,
such as simple SHORT animations (if too long you run the server
out of open files/sockets!).
A MutableInteger is like an Integer but mutable, to avoid the
excess object creation involved in
c = new Integer(c.getInt()+1)
which can get expensive if done a lot.
StreamServer packages up all the network handling goo for a stream socket-based server;
clients need only provide a StreamServerHandlerFactory and a port number.
Simple way to "print" to a JTextArea; just say
PrintStream out = new PrintStream(new TextAreaOutputStream(myTextArea));
Then out.println() et all will all appear in the TextArea.
Simple way to "print" to a JTextArea; just say
PrintWriter out = new PrintWriter(new TextAreaWriter(myTextArea));
Then out.println() et all will all appear in the TextArea.
TextImageServlet - draw text as a graphic, so spam twerps can't robotically
harvest it, and can also be used in web forms to prevent robots from submitting
the form.