<commit_before>class Panel extends PElement implements IElementParent  {
  static final core.Property<core.AffineTransform> _containerTransformProperty =
      const core.Property<core.AffineTransform>("panelTransform");
  final List<PElement> _children;

  Panel(int w, int h, [bool enableCache = false]) :
    _children = new List<PElement>(),
    super(w, h, enableCache);

  void addElement(PElement element){
    insertAt(element, _children.length);
  }

  void insertAt(PElement element, [int index=null]){
    index = (index == null) ? 0 : index;
    element.claim(this);
    _children.insertRange(index, 1, element);

    assert(!_containerTransformProperty.isSet(element));
    _containerTransformProperty.set(element, element.addTransform());
    onChildrenChanged();
  }

  void onChildrenChanged(){
    invalidateDraw();
  }

  PElement getVisualChild(index){
    return _children[index];
  }

  int get visualChildCount(){
    return _children.length;
  }

  void childInvalidated(PElement child){
    assert(hasVisualChild(child));
    invalidateDraw();
  }

  void update(){
    _children.forEach((e){e.update();});
    super.update();
  }

  void drawOverride(CanvasRenderingContext2D ctx){
    var length = visualChildCount;
    for(var i=0;i<length;i++){
      var element = getVisualChild(i);
      element.drawInternal(ctx);
    }
  }

  core.AffineTransform getChildTransform(child) {<commit_msg>Panel: using => syntax for fun<commit_after>class Panel extends PElement implements IElementParent  {
  static final core.Property<core.AffineTransform> _containerTransformProperty =
      const core.Property<core.AffineTransform>("panelTransform");
  final List<PElement> _children;

  Panel(int w, int h, [bool enableCache = false]) :
    _children = new List<PElement>(),
    super(w, h, enableCache);

  void addElement(PElement element){
    insertAt(element, _children.length);
  }

  void insertAt(PElement element, [int index=null]){
    index = (index == null) ? 0 : index;
    element.claim(this);
    _children.insertRange(index, 1, element);

    assert(!_containerTransformProperty.isSet(element));
    _containerTransformProperty.set(element, element.addTransform());
    onChildrenChanged();
  }

  void onChildrenChanged(){
    invalidateDraw();
  }

  PElement getVisualChild(index) => _children[index];

  int get visualChildCount() => _children.length;

  void childInvalidated(PElement child){
    assert(hasVisualChild(child));
    invalidateDraw();
  }

  void update(){
    _children.forEach((e){e.update();});
    super.update();
  }

  void drawOverride(CanvasRenderingContext2D ctx){
    var length = visualChildCount;
    for(var i=0;i<length;i++){
      var element = getVisualChild(i);
      element.drawInternal(ctx);
    }
  }

  core.AffineTransform getChildTransform(child) {
{'fraction_non_alphanumeric': 0.12353982300884955, 'fraction_numerical': 0.002831858407079646, 'mean_word_length': 4.3522727272727275, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4975667', 'n_tokens_mistral': 851, 'n_tokens_neox': 828, 'n_words': 174}