Hi Gary,
VisAD can offer you help with your application. Use the
visad/bom/RubberBandBoxRendererJ3D.java class in your
application to let users draw rectangles. See the main()
method in this class to see how it can trigger your code
in a doAction() method of a CellImpl. Your code would
construct a rectangle and perhaps other shapes as a
Gridded2DSet with manifold dimension = 1 or a UnionSet
of Gridded2DSets with manifold dimension = 1 (typically
used for drawing map outlines and other shapes using
lines). It could also create Text objects for plotting
text in your display. Run:
java visad.bom.RubberBandBoxRendererJ3D
to see how it works. Your code in a CellImpl.doAction()
method can also check consistency conditions among a set
of rectangles. You'll need to use Java3D, but to see your
graphics in a 2-D box, construct your Display with:
new DisplayImplJ3D("display", new TwoDDisplayRendererJ3D());
Good luck and let us know if you have other questions,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706
hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html
On 20 Aug 2001, Gary Hennigan wrote:
> I'm new to the Java graphics world and I'm trying to decide on the
> right approach to take for my application. It's fairly simple. I have
> some 2D cross sections that I'd like to allow the user to
> layout in relation to each other. The display will be very much like a
> blueprint. Here's sort of a rough picture using boxes:
>
>
> -------------------------------------------------
> | |
> | |
> | ----------------- |
> | | | |
> | | #3 | |
> | | | |
> | ----------------- |
> | | | |
> | |<----- d3 ---->| |
> | |
> | |
> | --------------------------------- |
> | | | |
> | | #2 | |
> | | | |
> | --------------------------------- |
> | | | |
> | |<------------- d2 ------------>| |
> | |
> | #1 |
> | |
> -------------------------------------------------
> | |
> |<---------------------- d1 ------------------->|
>
>
> The idea is to annotate the drawing with dimensions and let the user
> click on those annotations to modify them and, of course, check that
> some simple rules aren't violated given the input value. In the above
> example each of #1, 2, 3 would have a width annotation, examples of
> which are the d1, d2, and d3 shown above, as well as other annotations
> not shown above such as height and separation of the objects from each
> other, etc.
>
> At first I thought this would be pretty simple to do with just Java2D
> but then I found VisAD with things like zooming, cursor tracking, and
> 3D capabilities that are pretty much ready for prime time. While I
> don't have an immediate need for 3D that is in the plans for the
> future.
>
> Is VisAD overkill for this application? Should I just start with
> Java2D and go from there? Any opinons welcome.
>
> Thanks,
> Gary Hennigan
>
>