Performance problem with multiple displays

Hi all,

I have two different displays, a DisplayImplJ3D with a DefaultRendererJ3D
and a DisplayImplJ3D with a TwoDDisplayRendererJ3D. My application switches
between these displays as needed. We discussed this issue in a former thread
some weeks ago. The code switching the displays looks like this:

private void setProjection(int policy) {
  if (displayPanel != null) remove(displayPanel);
  if (display != null) display.removeAllReferences();
  if (policy == this.FLAT_PROJECTION) {
    display = flatDisplay;
  } else if ((policy == this.GLOBAL_PROJECTION) || (policy =
this.NORTH_PROJECTION) || (policy == this.SOUTH_PROJECTION)) {
    display = geoDisplay;
  displayPanel = (JPanel)display.getComponent();
  add(displayPanel, BorderLayout.CENTER);

This code is called by the ActionListeners of four different JButtons (FLAT,
GLOBAL, NORTH and SOUTH_PROJECTION). The mapReference is a FlatField
representing a worldmap with elevation data which is mapped to Display.RGB. The
first time the code is called everything looks fine. The second time I only get 
grey plane/sphere instead of the coloured worldmap. The third time I get the
coloured worldmap but the visualization is extremely slow. From there on
every further call causes a furter slowdown of the visualization. This behaviour
is independent of the order the two displays are used, e.g. the behaviour is
the same if I only use the flat display or if I use the displays in
alternating order. I can't see a memory leek or something else which could be 
cause of this. Are there any comments?

Many thanks in advance, Mathias

GMX - Die Kommunikationsplattform im Internet.

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