Changeset 4195


Ignore:
Timestamp:
07/11/08 15:19:58 (12 years ago)
Author:
curtis
Message:

Invert manual caching flag.

Location:
trunk/loci/formats/cache
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/cache/Cache.java

    r4048 r4195  
    6464  protected Vector listeners; 
    6565 
    66   /** Whether or not we want to manually update the cache. */ 
    67   protected boolean manualUpdate; 
     66  /** Whether the cache should automatically update when a parameter changes. */ 
     67  protected boolean autoUpdate; 
    6868 
    6969  // -- Constructors -- 
     
    7171  /** Constructs an object cache with the given cache strategy and source. */ 
    7272  public Cache(ICacheStrategy strategy, ICacheSource source, 
    73     boolean manualUpdate) throws CacheException 
     73    boolean autoUpdate) throws CacheException 
    7474  { 
    7575    if (strategy == null) throw new CacheException("strategy is null"); 
     
    7777    this.strategy = strategy; 
    7878    this.source = source; 
    79     this.manualUpdate = manualUpdate; 
     79    this.autoUpdate = autoUpdate; 
    8080    listeners = new Vector(); 
    8181    reset(); 
    82     recache(); 
     82    if (autoUpdate) recache(); 
    8383  } 
    8484 
     
    138138    notifyListeners(new CacheEvent(this, CacheEvent.STRATEGY_CHANGED)); 
    139139    reset(); 
    140     if (!manualUpdate) recache(); 
     140    if (autoUpdate) recache(); 
    141141  } 
    142142 
     
    147147    notifyListeners(new CacheEvent(this, CacheEvent.SOURCE_CHANGED)); 
    148148    reset(); 
    149     if (!manualUpdate) recache(); 
     149    if (autoUpdate) recache(); 
    150150  } 
    151151 
     
    167167    int ndx = FormatTools.positionToRaster(len, pos); 
    168168    notifyListeners(new CacheEvent(this, CacheEvent.POSITION_CHANGED, ndx)); 
    169     if (!manualUpdate) recache(); 
     169    if (autoUpdate) recache(); 
    170170  } 
    171171 
  • trunk/loci/formats/cache/CacheConsole.java

    r4048 r4195  
    5656    final Cache cache = new Cache( 
    5757      new CrosshairStrategy(getLengths(reader)), 
    58       new BufferedImageSource(reader), false); 
     58      new BufferedImageSource(reader), true); 
    5959    CacheListener l = new CacheListener() { 
    6060      public void cacheUpdated(CacheEvent e) { 
Note: See TracChangeset for help on using the changeset viewer.