Re: mouse pointer

Hi Ricardo,

> I wrote before asking about how to change the shape of the mouse
> pointer.  I get a helpful hint to do it extending DisplayRendererJ2D and
> using the code of DefaultDisplayRendererJ2D.  However using this I can get
> the mouse to change its appearance only once at the beginning (I can
> change it for example into a box or anything and it will remain like
> that).  What I want is to change mouse pointer's appearance as I move over
> the display, e.g. I want it to look as a square when I move
> the mouse over a given region of the display and as a cross when I am out 
> of such region.
> 
> Is this possible?  I will appreciate your help.

I'd over-ride:

    public void setCursorStringVector()

in your extension of DefaultDisplayRendererJ3D (method
actually implemented in DisplayRenderer), call getCursor()
to get the cursor location, and call:

  cursor_geometry.setCoordinates(0, cursor_verts);

with a new array of cursor vertices based on location. You may
need to set an appropriate capability in cursor_geometry to
be able to call its setCoordinates() method (see the Java3D
JavaDocs for more info). Also, remember to call:

  super.setCursorStringVector();

in your over-ride of setCursorStringVector().

Good luck,
Bill


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