Re: Colors in Gridded 2d set

Hi Karan,

> 1. I have created a 2D grid using UnionSet. I also
> worked on changing the colors of the gridded sets. We
> want the boundary gridded sets to be of different
> colors. Is there any way to change the colors of
> particular gridded sets?
> Please suggest in this.

Add one or three RealTypes to your data that you
ScalarMap to color (i.e., to RGB, or to Red, Green
and Blue), and give them different values for each
GriddedSet.

> 2. I am using Direct Manipuilation renderer for
> drawing the geometry and then drawing the grid.
> Everything works fine. I want to stop the direct
> manipulation renderer after the grid is drawn. How can
> i stop this? Please help me out in this matter.

There are two ways to stop direct manipulation:

1. call removeReference(), then addReference() without
   a direct manipulation DataRenderer.

2. Extend a direct manipulation DataRenderer and override
   its drag_direct() method to alow you to disable, as:

  class YourRenderer extends DirectManipulationRendererJ3D {
    private boolean enable = true;

    public void disable() {
      enable = false;
    }

    public void drag_direct(VisADRay ray, boolean first,
                                          int mouseModifiers) {
      if (enable) {
        super.drag_direct(ray, first, mouseModifiers);
      }
    }
  }

> 3. I want to add JPopUp menu on JPanel where grid is
> coming. I am trying to add it but, it is giving some
> problem. How can i achive this.

I don't know what problem you are having, and I don't
know much about JPopUp menus anyways.

Cheers,
Bill

> public void popAdd(){
>          display.addDisplayListener(new
> DisplayListener() {
>              public void displayChanged(DisplayEvent
> e) {
>                  if(e.getId() =
> DisplayEvent.MOUSE_RELEASED_RIGHT ) {
>                      addPopupMenu();
>                  }
>              }
>          }
>          );
>     }
> 
> 
>     public void addPopupMenu() {
>         popupMenu = new JPopupMenu();
>         item = new JMenuItem("Show Grid");
>         popupMenu.add(item);
>         popupMenu.show();
> 
>         item.addActionListener(new ActionListener() {
>             public void actionPerformed(ActionEvent
> avt) {
>                  // checkPopup(avt);
>             }
>         });
>     }
> 
>     public void checkPopup(MouseEvent mv) {
>         if(mv.isPopupTrigger()) {
>             popupMenu.show(this, mv.getX(),
> mv.getY());
>             System.out.println("x = " + mv.getX() + "
>   y = " + mv.getY());
>         }
>     }
> 
> with regards.
> Karan Kapoor
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com

-- 
----------------------------------------------------------
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


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