/// Evolver Copyright 2000, Morgan McGuire
/// matrix@alum.mit.edu   http://graphics3d.com/matrix
import javax.swing.*;

class BehaviorChunkDisplay extends ChunkDisplay implements BehaviorDisplayListener
{
  BehaviorDisplay behaviorDisplay;
  Behavior behavior;

  public BehaviorChunkDisplay(int index, AnimationEditor editor) 
  {
    this.index = index;
    behavior = new Behavior(editor.animation.getExpression(index), frameWidth/2, frameHeight/2, 0);
    behaviorDisplay = new BehaviorDisplay(behavior, 2.0);
    behaviorDisplay.setBehaviorDisplayListener(this);
    init(behaviorDisplay, editor);
  }

  public void behaviorDisplayChange(BehaviorDisplay b)
  {
    animation.setExpression(index, behavior.expression);
  }
}
