The AreaX class is a replacement for the java.awt.geom.Area class. Since the good folks at Sun (now Oracle) released the source code for the Area class under the GNU General Public License, I basically branched off of their code to create this project. To avoid naming conflicts I appended an "X" to every relevant class name, and put them in the com.bric.geom package.
Here are three possible downloads for the AreaX project:
Source Code Only Binary Only Source Code And Binary
I explored the original code in depth, and I found several optimizations that could be performed. I did not change the underlying algorithm: all I did was add a few well-placed shortcuts.
In the interest of keeping this an open discussion: I documented many (but not all) of my changes. The links above (see "Round 1", "Round 2", etc.) roughly describe what I did and why. If you only read one other page, I strongly recommend reading "Round 5": it discusses an architecture you're encouraged to subclass and customize based on your needs.
The image to the right is a piece of vector clip art we use in one of our products at work. If my goal is to calculate the outline of this graphic: the Area class takes 3079 ms, and the AreaX class takes 117 ms.
Those numbers are the best (non-contrived) showcase for the AreaX project. On average (in a group of 18 different pieces of clip art) the AreaX class took 42% of the time the Area class required. (These 18 pieces of clip art are in a test case mentioned in Round 5.)
I reached a nice stopping place to wrap up this project, but there's probably room for more improvement yet. If you successfully implement any improvements, or come up with alternative AreaXRules, please let me know and I can incorporate them here. You can contact me at mickleness@dev.java.net.
I'd like to mention a special thanks to Werner for his encouraging words (and ideas), and Flor for helping with a frustrating piece of code.