public Mapper createMapper()

in svg/src/main/java/jetbrains/jetpad/projectional/svg/toDom/SvgNodeMapperFactory.java [33:65]


  public Mapper<? extends SvgNode, ? extends Node> createMapper(SvgNode source) {
    Mapper<? extends SvgNode, ? extends Node> result;
    if (source instanceof SvgEllipseElement) {
      result = new SvgElementMapper<>((SvgEllipseElement) source, createSVGElement("ellipse"), myPeer);
    } else if (source instanceof SvgCircleElement) {
      result = new SvgElementMapper<>((SvgCircleElement) source, createSVGElement("circle"), myPeer);
    } else if (source instanceof SvgRectElement) {
      result = new SvgElementMapper<>((SvgRectElement) source, createSVGElement("rect"), myPeer);
    } else if (source instanceof SvgTextElement) {
      result = new SvgElementMapper<>((SvgTextElement) source, createSVGElement("text"), myPeer);
    } else if (source instanceof SvgPathElement) {
      result = new SvgElementMapper<>((SvgPathElement) source, createSVGElement("path"), myPeer);
    } else if (source instanceof SvgLineElement) {
      result = new SvgElementMapper<>((SvgLineElement) source, createSVGElement("line"), myPeer);
    } else if (source instanceof SvgSvgElement) {
      result = new SvgElementMapper<>((SvgSvgElement) source, createSVGElement("svg"), myPeer);
    } else if (source instanceof SvgGElement) {
      result = new SvgElementMapper<>((SvgGElement) source, createSVGElement("g"), myPeer);
    } else if (source instanceof SvgStyleElement) {
      result = new SvgElementMapper<>((SvgStyleElement) source, createSVGElement("style"), myPeer);
    } else if (source instanceof SvgTextNode) {
      result = new SvgTextNodeMapper((SvgTextNode) source, Document.get().createTextNode(null), myPeer);
    } else if (source instanceof SvgTSpanElement) {
      result = new SvgElementMapper<>((SvgTSpanElement) source, createSVGElement("tspan"), myPeer);
    } else if (source instanceof SvgDefsElement) {
      result = new SvgElementMapper<>((SvgDefsElement) source, createSVGElement("defs"), myPeer);
    } else if (source instanceof SvgClipPathElement) {
      result = new SvgElementMapper<>((SvgClipPathElement) source, createSVGElement("clipPath"), myPeer);
    } else {
      throw new IllegalStateException("Unsupported SvgNode");
    }
    return result;
  }