Changeset 2633


Ignore:
Timestamp:
04/17/07 17:16:36 (13 years ago)
Author:
curtis
Message:

Filter out mappings inappropriate to the display.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/view/TransformHandler.java

    r2612 r2633  
    4242import org.w3c.dom.Element; 
    4343import visad.*; 
     44import visad.java2d.DisplayImplJ2D; 
    4445 
    4546/** Provides logic for linking data transforms to a display. */ 
     
    427428        for (int i=0; i<mapList.size(); i++) { 
    428429          ScalarMap map = (ScalarMap) mapList.elementAt(i); 
    429           display.addMap((ScalarMap) mapList.elementAt(i)); 
     430          DisplayRealType drt = map.getDisplayScalar(); 
     431          boolean mappingOk = true; 
     432          if (!window.is3D()) { 
     433            // 2D displays do not support every type of mapping 
     434            if (drt.equals(Display.ZAxis)) mappingOk = false; 
     435          } 
     436          if (display instanceof DisplayImplJ2D) { 
     437            // Java2D does not support every type of mapping 
     438            if (drt.equals(Display.Alpha)) mappingOk = false; 
     439            // NB: Display.RGBA not currently handled 
     440          } 
     441          if (mappingOk) display.addMap(map); 
    430442 
    431443          // configure map's controls according to transform settings; 
Note: See TracChangeset for help on using the changeset viewer.