> I am working through the design of a disp[lay for a CAD/GIS program
> written
> in Java.
You probably want to have a look at existing drawing frameworks for Java
like JHotDraw (based on Swing), instead of doing everything from scratch.
> Let's say for the sake of this discussion that the area I will use to
> display my map, or the canvas, will be 600 by 300 pixels. Would it be
> possible to render the shapes that would fall within an area 20% larger
> than
> this to allow for quicker panning and zooming?
You are mixing things up. Painting more than what is visible will hot
help for zooming, only for panning.
Regarding panning: Yes, with a trick. You could render to an off-screen
image, like a VolatileImage, which you made larger then the visible
portion of the drawing panel. A VolatileImage can be hardware
accelerated (depends on platform and VM), so later drawing portions of
the VolatileImage to the panel should be fast.
> Is this method possible? Any ideas or suggestions on how I can learn
> the
> techniques I need to implement it?
Sun's Java 2D tutorial. And a good book on computer graphics in general
will be a good idea. Plus, the GoF book is full of related patterns,
which is not surprising, since the authors were involved in the historic
InterViews GUI framework which also included a drawing framework called
Idraw (all written in C++).
Oh, and you might want to sort out your Java terminology. A canvas in
Java is associated with an AWT component (Canvas), which you don't want
to use if you use Swing for painting. There one uses a JPanel, or even a
JComponent.
> Also, my program will allow the user to select shapes on the display
> using
[quoted text clipped - 5 lines]
> entire
> canvas everytime a single shape is modified?
Yes, in Swing you would issue a repaint, specifying a bounding rectangle
which indicates the area of the screen which has changed. In the
paintComponent() method your code would have to observe that information
and only redraw the changed parts.
> Is this method of partial rendering possible? Any ideas or suggestions
> on
> how I can learn the techniques I need to implement it?
The API documentation, the Java 2D tutorial.
> I am interested in learning how this might be done in both Swing and
> SWT.
Keep in mind that SWT is reported to be slow like a dog on anything but
Windows. Which is ironic, because one justification for its existence
was that Swing is soooooo slow (which it never was).
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
sunburned.surveyor@gmail.com - 25 Aug 2006 16:52 GMT
Thank you so much for your help Thomas.
That is just what I needed to know. I will look at the information you
referenced in your e-mail.
Scott Huey
> > I am working through the design of a disp[lay for a CAD/GIS program
> > written
[quoted text clipped - 66 lines]
> ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
> http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/