Changeset 3053 for trunk


Ignore:
Timestamp:
08/07/07 13:22:44 (13 years ago)
Author:
curtis
Message:

Fix color reset bug when adding transforms to a display.
Temporary fix; will be replaced with new color logic later.

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

Legend:

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

    r3015 r3053  
    8080    else link = new TransformLink(this, trans); 
    8181    links.add(link); 
    82     rebuild(); 
     82    rebuild(links.size() == 1); 
    8383    panel.addTransform(trans); 
    8484  } 
  • trunk/loci/visbio/view/TransformHandler.java

    r3015 r3053  
    126126  public void addTransform(DataTransform trans) { 
    127127    links.add(new TransformLink(this, trans)); 
    128     rebuild(); 
     128    rebuild(links.size() == 1); 
    129129    panel.addTransform(trans); 
    130130  } 
     
    138138    } 
    139139    panel.removeTransform(trans); 
    140     rebuild(); 
     140    rebuild(false); 
    141141  } 
    142142 
     
    145145    links.removeAllElements(); 
    146146    panel.removeAllTransforms(); 
    147     rebuild(); 
     147    rebuild(false); 
    148148  } 
    149149 
     
    346346    } 
    347347 
    348     rebuild(); 
     348    rebuild(false); 
    349349    if (animating) startAnimation(); 
    350350  } 
     
    384384 
    385385  /** Rebuilds sliders and display mappings for all linked transforms. */ 
    386   protected void rebuild() { 
     386  protected void rebuild(boolean resetColors) { 
    387387    synchronized (animSync) { 
    388388      TransformLink[] lnk = new TransformLink[links.size()]; 
    389389      links.copyInto(lnk); 
     390 
     391      // HACK - temporary code to fix color refresh bug 
     392      for (int i=0; i<lnk.length; i++) { 
     393        ColorHandler colorHandler = lnk[i].getColorHandler(); 
     394        if (colorHandler != null) { 
     395          colorHandler.colorTables = colorHandler.getTables(); 
     396        } 
     397      } 
    390398 
    391399      // clear old transforms 
     
    510518      StateManager sm = (StateManager) 
    511519        window.getVisBio().getManager(StateManager.class); 
    512       boolean reset = !sm.isRestoring(); 
     520      boolean reset = resetColors && !sm.isRestoring(); 
    513521      for (int i=0; i<lnk.length; i++) { 
    514522        ColorHandler colorHandler = lnk[i].getColorHandler(); 
Note: See TracChangeset for help on using the changeset viewer.