Most read:
Popular archives:
Java Q&A Forums - Let the great migration begin
We're pleased to announce the first phase of the integration of the Java Q&A Forums with our community platform, JavaWorld's
Daily Brew. Whether you're one of our longtime forum users or a brand newbie, we hope you'll visit the Java Q&A Forums in their new home alongside JW Blogs.
| Enterprise AJAX - Transcend the Hype |
| Oracle Compatibility Developer's Guide |
Note that although Java 2D has been developed somewhat independently of the other parts of the JFC, it is nonetheless a core part of the 1.2 AWT. We will make the distinction and point out 2D-specific features for discussion, but you should remember that this functionality is just as central to 1.2 graphics as the old 1.0 and 1.1 AWT support.
Java 2D extends the previous AWT mechanisms for drawing 2D graphics, manipulating text and fonts, loading and using images, and defining and dealing with colors and color spaces. We will be exploring these new mechanisms in this and future columns.
For this column, my primary development platform will be a PC running Windows 95 or Windows NT. I hope to provide other platform-specific tips and tricks where possible, but I will focus on Windows since that's where I will be spending most of my time.
When I write a method name, it should always be of the form methodname(). The trailing parentheses are meant to set this apart as a method. The method may or may not take parameters. In practice,
the context should always make this clear.
Source code listings will be given with line numbers included. I plan to use the line numbers to cross-reference the article text and the code listings as appropriate. This should also make it much easier for you to annotate the column, should you chose to print a copy. Please note, however, that the source files linked from the column will be regular *.java files (sans line numbers) so that you can download and develop with them.
Because I will be writing about many of the Media and Communications APIs in the coming months, I want to make sure that all of the sample code makes sense as a whole as well as in its individual parts. I will attempt to consistently name my examples and place them into sensical packages.
The top of my package hierarchy will be:
com.javaworld.media
Each API or topic that I write about will have at least one subpackage under this top level. For instance, all of the code for this Java 2D article will be in:
com.javaworld.media.j2d
So, to invoke the first example application on Java 2D, you would download the code, put it in your classpath, then use:
java com.javaworld.media.j2d.Example01
(If the namespace is too long for your liking or for some other reason you want to use the example code without having to use the fully qualified name, simply comment out the package line at the beginning of each source code file.)
I will generate a Java Archive (jar) file for each article's example code and class files. This archive will be made available in the Resources of each column, should you wish to download it and execute the examples from within the archive.
Graphics class. http://www.javaworld.com/javaworld/jw-11-1996/jw-11-howto.html
AffineTransforms and GeneralPaths, so I would encourage you to read through it if you need to know more about them. http://www.developer.com/news/techworkshop/020598_java2d.html
PathIterators and gives a little bit more information on how control points are used to generate curves in Java 2D. http://java.oreilly.com/news/knudsen/java_0398.html