{
  "draw2d": [
    {
      "type": "shape_designer.figure.PolyRect",
      "id": "c55dd135-15db-7c71-5efa-f6761c073e66",
      "x": 7980,
      "y": 7968.561199999999,
      "width": 40,
      "height": 63,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "baseClass": "draw2d.SetFigure",
        "code": "/**\n * by 'Draw2D Shape Designer'\n *\n * Custom JS code to tweak the standard behaviour of the generated\n * shape. add your custome code and event handler here.\n *\n *\n */\ntestShape = testShape.extend({\n\n    init: function(attr, setter, getter){\n         this._super(attr, setter, getter);\n\n        this.attr({resizeable:false});\n        this.installEditPolicy(new draw2d.policy.figure.AntSelectionFeedbackPolicy());\n    },\n    \n    calculate:function()\n    {\n        var s = !!this.getInputPort(\"input_s\").getValue();\n        var r = !!this.getInputPort(\"input_r\").getValue();\n\n        var q = this.getOutputPort(\"output_q\");\n        var q_ = this.getOutputPort(\"output_q_not\");\n        console.log(s,r);\n        // do nothing\n        if(s===false && r===false){\n           \n        }\n        // reset\n        else if(s===false && r===true){\n            q.setValue(false);\n            q_.setValue(true);\n        }\n        // set\n        else if(s===true && r===false){\n            q.setValue(true);\n            q_.setValue(false);\n        }\n        // invalid\n        else if(s===true && r===true){\n            q.setValue( false);\n            q_.setValue( false);\n        }\n    }\n});",
        "name": "Rectangle",
        "markdown": "# SR-FlipFlop\n\n\n\nThe SR flip-flop can be considered as a\n1-bit memory, since it stores the input pulse even after it has passed. \nFlip-flops (or bi-stables) of different types can be made from logic\ngates and, as with other combinations of logic gates, the NAND and\nNOR gates are the most versatile, the NAND being most widely used. \nThis is because, as well as being universal, i.e. it can be made \nto mimic any of the other standard logic functions, it is also \ncheaper to construct. Other, more widely used types of flip-flop \nare the JK, the D type and T type, which are developments of the \nSR flip-flop\n\n\n\n![](data:image/gif;base64, )\n"
      },
      "cssClass": "shape_designer_figure_PolyRect",
      "ports": [],
      "bgColor": "#FFFFFF",
      "color": "#303030",
      "stroke": 1,
      "radius": 1,
      "dasharray": null,
      "vertices": [
        {
          "x": 7980,
          "y": 7968.561199999999
        },
        {
          "x": 8020,
          "y": 7968.561199999999
        },
        {
          "x": 8020,
          "y": 8031.561199999999
        },
        {
          "x": 7980,
          "y": 8031.561199999999
        }
      ],
      "blur": 0,
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.SizeFilter"
        },
        {
          "name": "shape_designer.filter.StrokeFilter"
        },
        {
          "name": "shape_designer.filter.FillColorFilter"
        },
        {
          "name": "shape_designer.filter.RadiusFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtLabel",
      "id": "eada3849-d35d-7391-47aa-888a2469513d",
      "x": 8002.28125,
      "y": 8009.1896799999995,
      "width": 28.328125,
      "height": 21.359375,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "Label"
      },
      "cssClass": "shape_designer_figure_ExtLabel",
      "ports": [],
      "bgColor": "none",
      "color": "#1B1B1B",
      "stroke": 0,
      "radius": 0,
      "dasharray": null,
      "text": "Q",
      "outlineStroke": 0,
      "outlineColor": "none",
      "fontSize": 10,
      "fontColor": "#080808",
      "fontFamily": null,
      "editor": "LabelInplaceEditor",
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FontSizeFilter"
        },
        {
          "name": "shape_designer.filter.FontColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtPort",
      "id": "7c8a6215-ce17-6a10-c85b-b97fd0de466c",
      "x": 8016.008125,
      "y": 7974.118487500001,
      "width": 10,
      "height": 10,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "output_q",
        "type": "Output",
        "direction": 1
      },
      "cssClass": "shape_designer_figure_ExtPort",
      "ports": [],
      "bgColor": "#1C9BAB",
      "color": "#1B1B1B",
      "stroke": 1,
      "dasharray": null,
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FanoutFilter"
        },
        {
          "name": "shape_designer.filter.PortDirectionFilter"
        },
        {
          "name": "shape_designer.filter.PortTypeFilter"
        },
        {
          "name": "shape_designer.filter.FillColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtPort",
      "id": "078497de-04ae-57d8-a141-a3d4afacfe39",
      "x": 8016.008125,
      "y": 8014.931767499998,
      "width": 10,
      "height": 10,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "output_q_not",
        "type": "Output",
        "direction": 1
      },
      "cssClass": "shape_designer_figure_ExtPort",
      "ports": [],
      "bgColor": "#1C9BAB",
      "color": "#1B1B1B",
      "stroke": 1,
      "dasharray": null,
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FanoutFilter"
        },
        {
          "name": "shape_designer.filter.PortDirectionFilter"
        },
        {
          "name": "shape_designer.filter.PortTypeFilter"
        },
        {
          "name": "shape_designer.filter.FillColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtLabel",
      "id": "e7b9ebe8-3f2a-b126-49ce-dae5447c5010",
      "x": 8002.28125,
      "y": 7968.496079999999,
      "width": 28.328125,
      "height": 21.359375,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "Label"
      },
      "cssClass": "shape_designer_figure_ExtLabel",
      "ports": [],
      "bgColor": "none",
      "color": "#1B1B1B",
      "stroke": 0,
      "radius": 0,
      "dasharray": null,
      "text": "Q",
      "outlineStroke": 0,
      "outlineColor": "none",
      "fontSize": 10,
      "fontColor": "#080808",
      "fontFamily": null,
      "editor": "LabelInplaceEditor",
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FontSizeFilter"
        },
        {
          "name": "shape_designer.filter.FontColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtPort",
      "id": "5d090264-9572-d0a8-61be-b62664ed1ca6",
      "x": 7973.512800000001,
      "y": 7974.118487500001,
      "width": 10,
      "height": 10,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "input_s",
        "type": "Input",
        "direction": 3,
        "fanout": 1
      },
      "cssClass": "shape_designer_figure_ExtPort",
      "ports": [],
      "bgColor": "#1C9BAB",
      "color": "#1B1B1B",
      "stroke": 1,
      "dasharray": null,
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FanoutFilter"
        },
        {
          "name": "shape_designer.filter.PortDirectionFilter"
        },
        {
          "name": "shape_designer.filter.PortTypeFilter"
        },
        {
          "name": "shape_designer.filter.FillColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtPort",
      "id": "0a965270-f177-032a-013c-38bd8ca7ddae",
      "x": 7972.9788800000015,
      "y": 8014.931767499998,
      "width": 10,
      "height": 10,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "input_r",
        "type": "Input",
        "direction": 3,
        "fanout": 1
      },
      "cssClass": "shape_designer_figure_ExtPort",
      "ports": [],
      "bgColor": "#1C9BAB",
      "color": "#1B1B1B",
      "stroke": 1,
      "dasharray": null,
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FanoutFilter"
        },
        {
          "name": "shape_designer.filter.PortDirectionFilter"
        },
        {
          "name": "shape_designer.filter.PortTypeFilter"
        },
        {
          "name": "shape_designer.filter.FillColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtLabel",
      "id": "65ab38d3-1bc2-1a52-0748-3cfd06b1e05d",
      "x": 7984.0078125,
      "y": 7968.438800000001,
      "width": 28.328125,
      "height": 21.359375,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "Label"
      },
      "cssClass": "shape_designer_figure_ExtLabel",
      "ports": [],
      "bgColor": "none",
      "color": "#1B1B1B",
      "stroke": 0,
      "radius": 0,
      "dasharray": null,
      "text": "S",
      "outlineStroke": 0,
      "outlineColor": "none",
      "fontSize": 10,
      "fontColor": "#080808",
      "fontFamily": null,
      "editor": "LabelInplaceEditor",
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FontSizeFilter"
        },
        {
          "name": "shape_designer.filter.FontColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtLabel",
      "id": "d3932694-11f2-f623-4928-efaee06136ce",
      "x": 7983.9788800000015,
      "y": 8009.1896799999995,
      "width": 28.328125,
      "height": 21.359375,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "Label"
      },
      "cssClass": "shape_designer_figure_ExtLabel",
      "ports": [],
      "bgColor": "none",
      "color": "#1B1B1B",
      "stroke": 0,
      "radius": 0,
      "dasharray": null,
      "text": "R",
      "outlineStroke": 0,
      "outlineColor": "none",
      "fontSize": 10,
      "fontColor": "#080808",
      "fontFamily": null,
      "editor": "LabelInplaceEditor",
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.FontSizeFilter"
        },
        {
          "name": "shape_designer.filter.FontColorFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtLine",
      "id": "75ad5ac1-3b3f-7d01-8f6b-95e175688076",
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "Line"
      },
      "cssClass": "shape_designer_figure_ExtLine",
      "stroke": 1,
      "color": "#000000",
      "outlineStroke": 0,
      "outlineColor": "none",
      "policy": "draw2d.policy.line.VertexSelectionFeedbackPolicy",
      "vertex": [
        {
          "x": 8006.348,
          "y": 8013.994479999997
        },
        {
          "x": 8013.8748,
          "y": 8013.994479999997
        }
      ],
      "router": "draw2d.layout.connection.VertexRouter",
      "radius": "",
      "filters": [
        {
          "name": "shape_designer.filter.StrokeFilter"
        }
      ]
    }
  ],
  "image": "data:image/png;base64, "
}
