// ** This class was generated with DemFGen (vers:04/27/2009)

import edu.neu.ccs.demeterf.control.Fields;

public class InlineToSVG{
   private ToSVG func;
   public InlineToSVG(ToSVG f){ func = f; }

   public String traverse(Pict _h, Ctx _targ_){ return traversePict(_h, _targ_); }

   public String traverseSquare(Square _h, Ctx _targ_){
      int _size = func.combine(_h.size);
      return func.combine((Square)_h, (int)_size, (Ctx)_targ_);
   }
   public String traversePict(Pict _h, Ctx _targ_){
      if(_h instanceof Overlay) return this.traverseOverlay((Overlay)_h, _targ_);
      if(_h instanceof Offset) return this.traverseOffset((Offset)_h, _targ_);
      if(_h instanceof Circle) return this.traverseCircle((Circle)_h, _targ_);
      if(_h instanceof Square) return this.traverseSquare((Square)_h, _targ_);
      else throw new RuntimeException("Unknown Pict Variant");
   }
   public String traverseOverlay(Overlay _h, Ctx _targ_){
      String _top = traversePict(_h.top, _targ_);
      String _bot = traversePict(_h.bot, _targ_);
      return func.combine((Overlay)_h, (String)_top, (String)_bot);
   }
   public String traverseOffset(Offset _h, Ctx _targ_){
      int _dx = func.combine(_h.dx);
      int _dy = func.combine(_h.dy);
      String _inner = traversePict(_h.inner, func.update(_h,new Fields.any(),_targ_));
      return func.combine((Offset)_h, (int)_dx, (int)_dy, (String)_inner);
   }
   public String traverseCircle(Circle _h, Ctx _targ_){
      int _rad = func.combine(_h.rad);
      return func.combine((Circle)_h, (int)_rad, (Ctx)_targ_);
   }

}