Changeset 39


Ignore:
Timestamp:
09/14/04 11:28:51 (15 years ago)
Author:
curtis
Message:

Add method to recompute autoscaling bounds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/util/ColorUtil.java

    r2 r39  
    181181      } 
    182182    } 
    183     else if (!map.isAutoScale()) { 
    184       map.resetAutoScale(); 
    185       display.reAutoScale(); 
    186  
    187       // HACK - stupid trick to force immediate rescale 
    188       BaseColorControl cc = (BaseColorControl) map.getControl(); 
    189       try { cc.setTable(cc.getTable()); } 
    190       catch (VisADException exc) { exc.printStackTrace(); } 
    191       catch (RemoteException exc) { exc.printStackTrace(); } 
    192     } 
     183    else if (!map.isAutoScale()) reAutoScale(display, map); 
    193184  } 
    194185 
     
    205196      setColorRange(display, maps[i], lo[i], hi[i], fixed[i]); 
    206197    } 
     198  } 
     199 
     200  /** Recomputes autoscaled color bounds for the given color map. */ 
     201  public static void reAutoScale(DisplayImpl display, ScalarMap map) { 
     202    map.resetAutoScale(); 
     203    display.reAutoScale(); 
     204 
     205    // HACK - stupid trick to force immediate rescale 
     206    BaseColorControl cc = (BaseColorControl) map.getControl(); 
     207    try { cc.setTable(cc.getTable()); } 
     208    catch (VisADException exc) { exc.printStackTrace(); } 
     209    catch (RemoteException exc) { exc.printStackTrace(); } 
    207210  } 
    208211 
Note: See TracChangeset for help on using the changeset viewer.