Re: Adding a title to a 3D display

Despite my effort to enable you to extend VisADCanvasJ3D so you
can use J3DGraphics2D, I have to agree with Tom and Ugo that it
will be simpler to put your text on an ordinary Swing component
adjacent to your DisplayImpl.

Cheers, Bill

On Wed, 26 Jun 2002, Ugo Taddei wrote:

> Hi all,
>
>
> Tom Whittaker wrote:
> >
> > Perhaps a different approach would be to imbed the VisAD Display into your
> > own frame, leaving some room for a label inside the frame.  Using the same
> > background color would give the effect of being part of the Display, and
> > have the added benefit of not getting blocked out by any of the VisAD
> > 'box' contents.
>
> That's what exactly what I do and it looks fine.
>
> Use a BorderLayout, put, the display in the CENTER, put a JLabel or,
> even better, a JTextField (as it is editable) at NORTH. It saves one
> from having to deal with all that DataReference stuff and from having to
> use code to draw non-rotating text. Not to mention this trouble with
> drawString() onto some Canvas.
>
> As Tom says, the only drawback is the back/foreground color. When
> changing the display color, you have to remember to tell you computer to
> do the same for the JLabel/JTextField. Another little problem is when
> saving the display as a JPG. you can't "captureDisplay()" anymore, but
> have to write your own code do do so. Which isn't difficult. Let us know
> in case you want more details.
>
> Cheers,
>
> Ugo
>
>


  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: