Changeset 2594


Ignore:
Timestamp:
04/10/07 16:14:31 (13 years ago)
Author:
curtis
Message:

Pass TransformLink to getData method as optional first parameter. This can be
used to determine qualities of the display, for more intelligently presenting
the data. For example, overlay data could render differently depending on the
zoom level of the display (e.g., using pixel coordinates instead of display
coordinates).

Location:
trunk/loci/visbio
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/data/ArbitrarySlice.java

    r1989 r2594  
    3131import loci.visbio.util.DataUtil; 
    3232import loci.visbio.util.XMLUtil; 
     33import loci.visbio.view.TransformLink; 
    3334import org.w3c.dom.Element; 
    3435import visad.*; 
     
    211212   * @return null if the transform does not provide data of that dimensionality 
    212213   */ 
    213   public synchronized Data getData(int[] pos, int dim, DataCache cache) { 
     214  public synchronized Data getData(TransformLink link, 
     215    int[] pos, int dim, DataCache cache) 
     216  { 
    214217    if (dim != 3) { 
    215218      System.err.println(name + ": invalid dimensionality (" + dim + ")"); 
     
    324327      for (int i=0; i<n; i++) { 
    325328        npos[axis] = i; 
    326         Data data = parent.getData(npos, 2, cache); 
     329        Data data = parent.getData(link, pos, 2, cache); 
    327330        if (data == null || !(data instanceof FlatField)) { 
    328331          System.err.println(name + 
  • trunk/loci/visbio/data/CollapseTransform.java

    r1989 r2594  
    3030import loci.visbio.state.SaveException; 
    3131import loci.visbio.util.XMLUtil; 
     32import loci.visbio.view.TransformLink; 
    3233import org.w3c.dom.Element; 
    3334import visad.*; 
     
    127128   * @return null if the transform does not provide data of that dimensionality 
    128129   */ 
    129   public Data getData(int[] pos, int dim, DataCache cache) { 
     130  public Data getData(TransformLink link, int[] pos, int dim, DataCache cache) { 
    130131    if (dim != 2) return null; 
    131132 
     
    135136    for (int i=0; i<len; i++) { 
    136137      npos[axis] = i; 
    137       Data data = parent.getData(npos, dim, cache); 
     138      Data data = parent.getData(link, npos, dim, cache); 
    138139      if (data == null || !(data instanceof FlatField)) return null; 
    139140      fields[i] = (FlatField) data; 
  • trunk/loci/visbio/data/DataCache.java

    r2555 r2594  
    5757      if (append == null || append.equals("")) { 
    5858        // compute automatically for null append string 
    59         d = trans.getData(pos, dim, null); 
     59        d = trans.getData(null, pos, dim, null); 
    6060        putCachedData(key, d); 
    6161      } 
  • trunk/loci/visbio/data/DataTransform.java

    r1989 r2594  
    3131import loci.visbio.util.FontChooserPane; 
    3232import loci.visbio.util.ObjectUtil; 
     33import loci.visbio.view.TransformLink; 
    3334import org.w3c.dom.Element; 
    3435import visad.*; 
     
    109110   * @return null if the transform does not provide data of that dimensionality 
    110111   */ 
    111   public abstract Data getData(int[] pos, int dim, DataCache cache); 
     112  public abstract Data getData(TransformLink link, 
     113    int[] pos, int dim, DataCache cache); 
    112114 
    113115  /** Gets whether this transform provides data of the given dimensionality. */ 
  • trunk/loci/visbio/data/ExportPane.java

    r2579 r2594  
    240240              task.setStatus(count++, max, 
    241241                "Reading #" + (i + 1) + "/" + numTotal); 
    242               FlatField ff = (FlatField) trans.getData(npos, 2, null); 
     242              FlatField ff = (FlatField) trans.getData(null, npos, 2, null); 
    243243              Image image = ff instanceof ImageFlatField ? 
    244244                ((ImageFlatField) ff).getImage() : 
     
    267267                  "Reading #" + img + "/" + numTotal); 
    268268                npos[excl] = j; 
    269                 FlatField ff = (FlatField) trans.getData(npos, 2, null); 
     269                FlatField ff = (FlatField) trans.getData(null, npos, 2, null); 
    270270                Image image = ff instanceof ImageFlatField ? 
    271271                  ((ImageFlatField) ff).getImage() : 
  • trunk/loci/visbio/data/ImageTransform.java

    r1989 r2594  
    2929import loci.visbio.state.SaveException; 
    3030import loci.visbio.util.*; 
     31import loci.visbio.view.TransformLink; 
    3132import org.w3c.dom.Element; 
    3233import visad.*; 
     
    195196   * for the given display dimensionality. 
    196197   */ 
    197   public Data getData(int[] pos, int dim, DataCache cache) { 
     198  public Data getData(TransformLink link, int[] pos, int dim, DataCache cache) { 
    198199    if (dim != 2) return null; 
    199200    if (cache != null) return cache.getData(this, pos, null, dim); 
  • trunk/loci/visbio/data/ProjectionTransform.java

    r1989 r2594  
    3030import loci.visbio.state.SaveException; 
    3131import loci.visbio.util.XMLUtil; 
     32import loci.visbio.view.TransformLink; 
    3233import org.w3c.dom.Element; 
    3334import visad.*; 
     
    129130   * @return null if the transform does not provide data of that dimensionality 
    130131   */ 
    131   public Data getData(int[] pos, int dim, DataCache cache) { 
     132  public Data getData(TransformLink link, int[] pos, int dim, DataCache cache) { 
    132133    if (dim != 2) return null; 
    133134 
     
    137138    for (int i=0; i<len; i++) { 
    138139      npos[axis] = i; 
    139       Data data = parent.getData(npos, dim, cache); 
     140      Data data = parent.getData(link, npos, dim, cache); 
    140141      if (data == null || !(data instanceof FlatField)) return null; 
    141142      fields[i] = (FlatField) data; 
  • trunk/loci/visbio/data/SendToIJPane.java

    r2555 r2594  
    9090            task.setStatus("Reading image"); 
    9191            data = new FlatField[1]; 
    92             data[0] = (FlatField) trans.getData(pos, 2, null); 
     92            data[0] = (FlatField) trans.getData(null, pos, 2, null); 
    9393            task.setStatus(1, 1); 
    9494          } 
     
    9999              task.setStatus(i, len, "Reading image #" + (i + 1) + "/" + len); 
    100100              pos[axis] = i; 
    101               data[i] = (FlatField) trans.getData(pos, 2, null); 
     101              data[i] = (FlatField) trans.getData(null, pos, 2, null); 
    102102            } 
    103103            task.setStatus(len, len); 
  • trunk/loci/visbio/data/SpectralTransform.java

    r1989 r2594  
    3232import loci.visbio.util.ObjectUtil; 
    3333import loci.visbio.util.XMLUtil; 
     34import loci.visbio.view.TransformLink; 
    3435import visad.*; 
    3536 
     
    152153   * @return null if the transform does not provide data of that dimensionality 
    153154   */ 
    154   public Data getData(int[] pos, int dim, DataCache cache) { 
     155  public Data getData(TransformLink link, int[] pos, int dim, DataCache cache) { 
    155156    if (dim != 2) return null; 
    156157 
    157     Data data = parent.getData(pos, dim, cache); 
     158    Data data = parent.getData(link, pos, dim, cache); 
    158159    if (data == null || !(data instanceof FlatField)) return null; 
    159160 
  • trunk/loci/visbio/data/ThumbnailHandler.java

    r2555 r2594  
    182182   */ 
    183183  protected FlatField computeThumb(int[] pos) { 
    184     Data d = data.getData(pos, 2, null); 
     184    Data d = data.getData(null, pos, 2, null); 
    185185    return makeThumb(d); 
    186186  } 
  • trunk/loci/visbio/ext/ExternalFunction.java

    r1989 r2594  
    2929import loci.visbio.state.SaveException; 
    3030import loci.visbio.util.XMLUtil; 
     31import loci.visbio.view.TransformLink; 
    3132import org.w3c.dom.Element; 
    3233import visad.*; 
     
    154155   * @return null if the transform does not provide data of that dimensionality 
    155156   */ 
    156   public Data getData(int[] pos, int dim, DataCache cache) { 
     157  public Data getData(TransformLink link, int[] pos, int dim, DataCache cache) { 
    157158    if (dim != 2) return null; 
    158159 
    159     Data data = parent.getData(pos, dim, cache); 
     160    Data data = parent.getData(link, pos, dim, cache); 
    160161    if (!(data instanceof FlatField)) return null; 
    161162 
  • trunk/loci/visbio/overlays/OverlayTransform.java

    r2555 r2594  
    3838import loci.visbio.util.ObjectUtil; 
    3939import loci.visbio.view.DisplayWindow; 
     40import loci.visbio.view.TransformLink; 
    4041import org.apache.poi.hssf.usermodel.HSSFWorkbook; 
    4142import visad.*; 
     
    538539   * @return null if the transform does not provide data of that dimensionality 
    539540   */ 
    540   public Data getData(int[] pos, int dim, DataCache cache) { 
     541  public Data getData(TransformLink link, int[] pos, int dim, DataCache cache) { 
    541542    if (dim != 2) { 
    542543      System.err.println(name + ": invalid dimensionality (" + dim + ")"); 
  • trunk/loci/visbio/view/TransformLink.java

    r1989 r2594  
    451451      cachedPos = pos; 
    452452      Data d = dim == 3 ? 
    453         trans.getData(pos, 3, handler.getCache()) : getImageData(pos); 
     453        trans.getData(this, pos, 3, handler.getCache()) : getImageData(pos); 
    454454      if (th != null && thumb == null) { 
    455455        // fill in missing thumbnail 
     
    465465  /** Gets the transform's data at the given dimensional position. */ 
    466466  protected Data getImageData(int[] pos) { 
    467     return trans.getData(pos, 2, handler.getCache()); 
     467    return trans.getData(this, pos, 2, handler.getCache()); 
    468468  } 
    469469 
Note: See TracChangeset for help on using the changeset viewer.