Changeset 40


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

Automatically update display when linked transform changes.

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

Legend:

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

    r24 r40  
    158158    bio.generateEvent(bio.getManager(DisplayManager.class), 
    159159      "color adjustment for " + window.getName(), true); 
     160  } 
     161 
     162  /** Recomputes autoscaled color range bounds. */ 
     163  public void reAutoScale() { 
     164    DisplayImpl display = window.getDisplay(); 
     165    ScalarMap[] maps = getMaps(); 
     166    for (int i=0; i<maps.length; i++) { 
     167      if (fixed[i]) continue; 
     168      ColorUtil.reAutoScale(display, maps[i]); 
     169    } 
    160170  } 
    161171 
  • trunk/loci/visbio/view/StackHandler.java

    r24 r40  
    4343 
    4444  // -- Constants -- 
     45 
     46  /** Starting FPS for animation for image stacks. */ 
     47  public static final int STACK_ANIMATION_RATE = 2; 
    4548 
    4649  public static final RealType ZBOX = RealType.getRealType("zbox"); 
     
    104107 
    105108  /** Constructs GUI controls for the stack handler. */ 
    106   protected void makePanel() { panel = new StackPanel(this); } 
     109  protected void makePanel() { 
     110    fps = STACK_ANIMATION_RATE; 
     111    panel = new StackPanel(this); 
     112  } 
    107113 
    108114  /** Adds any required custom mappings to the display. */ 
  • trunk/loci/visbio/view/TransformHandler.java

    r37 r40  
    5656 
    5757  /** Starting FPS for animation. */ 
    58   public static final int DEFAULT_ANIMATION_RATE = 5; 
     58  public static final int DEFAULT_ANIMATION_RATE = 10; 
    5959 
    6060 
  • trunk/loci/visbio/view/TransformLink.java

    r24 r40  
    3131import loci.visbio.data.ImageTransform; 
    3232import loci.visbio.data.ThumbnailHandler; 
     33import loci.visbio.data.TransformEvent; 
     34import loci.visbio.data.TransformListener; 
    3335 
    3436import loci.visbio.util.VisUtil; 
     
    3941 
    4042/** Represents a link between a data transform and a display. */ 
    41 public class TransformLink implements DisplayListener, Runnable { 
     43public class TransformLink 
     44  implements DisplayListener, Runnable, TransformListener 
     45{ 
    4246 
    4347  // -- Constants -- 
     
    97101    } 
    98102    catch (VisADException exc) { exc.printStackTrace(); } 
     103 
     104    // listen for changes to this transform 
     105    t.addTransformListener(this); 
    99106 
    100107    // initialize thread for handling full-resolution burn-in operations 
     
    198205 
    199206 
     207  // -- TransformListener API methods -- 
     208 
     209  /** Called when a data transform's parameters are updated. */ 
     210  public void transformChanged(TransformEvent e) { doTransform(100); } 
     211 
     212 
    200213  // -- Internal TransformLink API methods -- 
    201214 
    202215  /** Updates displayed data based on current dimensional position. */ 
    203   protected void doTransform() { 
    204     // request a new burn-in in BURN_DELAY milliseconds 
    205     burnTime = System.currentTimeMillis() + BURN_DELAY; 
     216  protected void doTransform() { doTransform(BURN_DELAY); } 
     217 
     218  /** Updates displayed data based on current dimensional position. */ 
     219  protected void doTransform(long delay) { 
     220    // request a new burn-in in delay milliseconds 
     221    burnTime = System.currentTimeMillis() + delay; 
    206222    computeData(true); 
    207223  } 
     
    232248      catch (VisADException exc) { exc.printStackTrace(); } 
    233249      catch (RemoteException exc) { exc.printStackTrace(); } 
     250      handler.getWindow().getColorHandler().reAutoScale(); 
    234251    } 
    235252  } 
Note: See TracChangeset for help on using the changeset viewer.