{
  "draw2d": [
    {
      "type": "shape_designer.figure.PolyRect",
      "id": "c55dd135-15db-7c71-5efa-f6761c073e66",
      "x": 7980.75,
      "y": 7974.4735125,
      "width": 40,
      "height": 50,
      "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        this.last_t = false;\n    },\n    \n    calculate:function()\n    {\n        var d = this.getInputPort(\"input_d\").getValue();\n        var t = this.getInputPort(\"input_t\").getValue();\n        \n        var q = this.getOutputPort(\"output_q\");\n        var q_ = this.getOutputPort(\"output_q_not\");\n        \n        var rising = this.last_t===false && t===true; \n        \n        if(rising===true){\n            q.setValue(d);\n            q_.setValue(!d)\n        }\n        this.last_t = t;\n    }\n});",
        "name": "Rectangle",
        "markdown": "# D-FlipFlop\n\n## Description\n\nThe D FlipFLop is widely used. It is also known as a \n*data* or *delay* flip-flop.\n\nThe D flip-flop captures the value of the `D` input \nat a definite portion of the clock cycle (such \nas the rising edge of the clock). That captured \nvalue becomes the `Q` output. At other times, the \noutput Q does not change. The `D flip-flop` \ncan be viewed as a memory cell, a zero-order hold, \nor a delay line.\n\n\n## Logic table\n\n| Clock        | D       |  **Q***next*   |\n|:------------:|:-------:|:----------:|\n| Rising edge  | Low     |  **Low**       |\n| Rising edge  | High    |  **High**      |\n| non rising   | *       |  **Q***last*   |\n\n"
      },
      "cssClass": "shape_designer_figure_PolyRect",
      "ports": [],
      "bgColor": "#FFFFFF",
      "color": "#303030",
      "stroke": 1,
      "radius": 1,
      "dasharray": null,
      "vertices": [
        {
          "x": 7980.75,
          "y": 7974.4735125
        },
        {
          "x": 8020.75,
          "y": 7974.4735125
        },
        {
          "x": 8020.75,
          "y": 8024.4735125
        },
        {
          "x": 7980.75,
          "y": 8024.4735125
        }
      ],
      "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": "68aac6da-04da-9eea-260f-ab29020fcf6f",
      "x": 7979.25,
      "y": 7973.4735125,
      "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": "D",
      "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": "08459b5e-14e9-38d5-14dc-4b24f166cd2d",
      "x": 8003.53125,
      "y": 7973.9735125,
      "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.ExtLabel",
      "id": "eada3849-d35d-7391-47aa-888a2469513d",
      "x": 8003.03125,
      "y": 8005.167112499999,
      "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.PolyRect",
      "id": "0b5993de-527b-2309-20d4-4519d5414943",
      "x": 7980.75,
      "y": 8010.600512499999,
      "width": 12.041999999999462,
      "height": 10.25799999999981,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "Rectangle"
      },
      "cssClass": "shape_designer_figure_PolyRect",
      "ports": [],
      "bgColor": "none",
      "color": "#303030",
      "stroke": 1,
      "radius": 0,
      "dasharray": null,
      "vertices": [
        {
          "x": 7980.75,
          "y": 8010.600512499999
        },
        {
          "x": 7992.7919999999995,
          "y": 8015.506512499998
        },
        {
          "x": 7980.75,
          "y": 8020.858512499999
        }
      ],
      "blur": 0,
      "filters": [
        {
          "name": "shape_designer.filter.PositionFilter"
        },
        {
          "name": "shape_designer.filter.SizeFilter"
        },
        {
          "name": "shape_designer.filter.StrokeFilter"
        }
      ]
    },
    {
      "type": "shape_designer.figure.ExtPort",
      "id": "7c8a6215-ce17-6a10-c85b-b97fd0de466c",
      "x": 8016.758125,
      "y": 7979.3635125,
      "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.758125,
      "y": 8010.9092,
      "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.ExtPort",
      "id": "592a8604-e0a9-8913-445d-621078e5ae97",
      "x": 7974.25,
      "y": 7979.3635125,
      "width": 10,
      "height": 10,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "input_d",
        "type": "Input",
        "direction": 3
      },
      "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": "5fc48f01-fecb-0d5f-ed4f-81a4bc26ae63",
      "x": 7974.25,
      "y": 8010.9092,
      "width": 10,
      "height": 10,
      "alpha": 1,
      "angle": 0,
      "userData": {
        "name": "input_t",
        "type": "Input",
        "direction": 3
      },
      "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.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": 8007.098,
          "y": 8009.971912499997
        },
        {
          "x": 8014.6248,
          "y": 8009.971912499997
        }
      ],
      "router": "draw2d.layout.connection.VertexRouter",
      "radius": "",
      "filters": [
        {
          "name": "shape_designer.filter.StrokeFilter"
        }
      ]
    }
  ],
  "image": "data:image/png;base64, "
}
