Changeset 381 for trunk/loci/visbio/view


Ignore:
Timestamp:
05/10/05 15:14:04 (15 years ago)
Author:
curtis
Message:

Some work on color state restoration (still broken).

Location:
trunk/loci/visbio/view
Files:
3 edited

Legend:

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

    r373 r381  
    7171  protected RealType red, green, blue; 
    7272 
    73   /** 
    74    * Minimum and maximum color range values 
    75    * (for uninitialized color handlers only). 
    76   */ 
     73 
     74  // -- Fields - initial state -- 
     75 
     76  /** Minimum and maximum color range values. */ 
    7777  protected double[] lo, hi; 
    7878 
    79   /** 
    80    * Flags indicating color ranges should not be auto-scaled 
    81    * (for uninitialized color handlers only). 
    82    */ 
     79  /** Flags indicating color ranges should not be auto-scaled. */ 
    8380  protected boolean[] fixed; 
    8481 
    85   /** Color tables (for uninitialized color handlers only). */ 
     82  /** Color tables. */ 
    8683  protected float[][][] colorTables; 
    8784 
     
    345342    } 
    346343 
     344    // CTR TODO set stuff according to initial state variables 
     345 
    347346    if (colorPane == null) colorPane = new ColorPane(this); 
    348347  } 
  • trunk/loci/visbio/view/ColorPane.java

    r256 r381  
    279279  } 
    280280 
     281 
    281282  // -- ColorPane API methods - accessors -- 
    282283 
     
    311312  public RealType getBlue() { return (RealType) blue.getSelectedItem(); } 
    312313 
    313   /** Gets current color table range minimums. */ 
     314  /** Gets color table range minimums. */ 
    314315  public double[] getLo() { 
    315316    double[] lo = new double[maps.length]; 
    316     int ndx = selector.getSelectedIndex(); 
    317317    for (int i=0; i<maps.length; i++) lo[i] = maps[i].getRange()[0]; 
    318318    return lo; 
    319319  } 
    320320 
    321   /** Gets current color table range maximums. */ 
     321  /** Gets color table range maximums. */ 
    322322  public double[] getHi() { 
    323323    double[] hi = new double[maps.length]; 
    324     int ndx = selector.getSelectedIndex(); 
    325324    for (int i=0; i<maps.length; i++) hi[i] = maps[i].getRange()[1]; 
    326325    return hi; 
     
    335334  } 
    336335 
    337   /** Gets current color table values. */ 
     336  /** Gets color table values. */ 
    338337  public float[][][] getTables() { 
    339338    float[][][] tables = new float[maps.length][][]; 
  • trunk/loci/visbio/view/TransformLink.java

    r373 r381  
    225225      if (trans != null) trans.removeTransformListener(this); 
    226226      trans = link.getTransform(); 
     227      if (trans instanceof ImageTransform && colorHandler == null) { 
     228        colorHandler = new ColorHandler(this); 
     229      } 
    227230      if (colorHandler != null) colorHandler.initState(link.getColorHandler()); 
    228231      visible = link.isVisible(); 
     
    320323    DataManager dm = (DataManager) bio.getManager(DataManager.class); 
    321324    trans = dm.getDataById(Integer.parseInt(el.getAttribute("id"))); 
     325    if (trans instanceof ImageTransform && colorHandler == null) { 
     326      colorHandler = new ColorHandler(this); 
     327    } 
    322328    if (colorHandler != null) colorHandler.restoreState(el); 
    323329    visible = el.getAttribute("visible").equalsIgnoreCase("true"); 
Note: See TracChangeset for help on using the changeset viewer.