[
  {
    "type": "shape_designer.figure.PolyRect",
    "id": "c55dd135-15db-7c71-5efa-f6761c073e66",
    "x": 3980,
    "y": 3964.2886325,
    "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        this.last_t = false;\n    },\n    \n    calculate:function()\n    {\n        var j = this.getInputPort(\"input_j\").getValue();\n        var k = this.getInputPort(\"input_k\").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            // do nothing\n            if(j===false && k ===false){\n               \n            }\n            // reset\n            else if(j===false && k===true){\n                q.setValue(false);\n                q_.setValue(true);\n            }\n            // set\n            else if(j===true && k===false){\n                q.setValue(true);\n                q_.setValue(false);\n            }\n            // toggle\n            else if(j===true && k===true){\n                q.setValue( !q.getValue());\n                q_.setValue( q.getValue());\n            }\n        }\n        this.last_t = t;\n    }\n});",
      "name": "Rectangle",
      "markdown": "# JK-FlipFlop\n\n## Description\n\nThe `JK flip-flop` is a simple enhancement of the SR flip-flop \nwhere the state J=K=1 is not forbidden. It works just like a \nSR flip-flop where J is serving as set input and K serving \nas reset. The only difference is that for the formerly \n*forbidden* combination **J=K=1** this flip-flop now performs \nan action: it inverts its state. As the behavior of the \nJK flip-flop is completely predictable under all conditions,\nthis is the preferred type of flip-flop for most logic\ncircuit designs. But there is still a problem i.e. both \nthe outputs are same when one tests the circuit practically.\n\nThis is because of the internal toggling on every propagation\nelapse completion. The main remedy is going for master-slave\njk flip-flop,this flip-flop overrides the self(internal) \nrecurring toggling through the pulsed clocking feature \nincorporated."
    },
    "cssClass": "shape_designer_figure_PolyRect",
    "ports": [],
    "bgColor": "#FFFFFF",
    "color": "#303030",
    "stroke": 1,
    "radius": 1,
    "dasharray": null,
    "vertices": [
      {
        "x": 3980,
        "y": 3964.2886325
      },
      {
        "x": 4020,
        "y": 3964.2886325
      },
      {
        "x": 4020,
        "y": 4027.2886325
      },
      {
        "x": 3980,
        "y": 4027.2886325
      }
    ],
    "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": 4002.28125,
    "y": 4004.9171125,
    "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": 3980,
    "y": 3989.8596875,
    "width": 12.041999999999916,
    "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": 3980,
        "y": 3989.8596875
      },
      {
        "x": 3992.042,
        "y": 3994.7656874999984
      },
      {
        "x": 3980,
        "y": 4000.1176874999996
      }
    ],
    "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": 4016.008125,
    "y": 3969.8459200000016,
    "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": 4016.008125,
    "y": 4010.6591999999996,
    "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": "5fc48f01-fecb-0d5f-ed4f-81a4bc26ae63",
    "x": 3972.9788800000015,
    "y": 3989.9886874999997,
    "width": 10,
    "height": 10,
    "alpha": 1,
    "angle": 0,
    "userData": {
      "name": "input_t",
      "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": "e7b9ebe8-3f2a-b126-49ce-dae5447c5010",
    "x": 4002.28125,
    "y": 3964.2235124999997,
    "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": 3973.5128000000013,
    "y": 3969.8459200000016,
    "width": 10,
    "height": 10,
    "alpha": 1,
    "angle": 0,
    "userData": {
      "name": "input_j",
      "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": 3972.9788800000015,
    "y": 4010.6591999999996,
    "width": 10,
    "height": 10,
    "alpha": 1,
    "angle": 0,
    "userData": {
      "name": "input_k",
      "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": 3984.0078125,
    "y": 3964.1662325000016,
    "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": "J",
    "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": 3983.9788800000015,
    "y": 4004.9171125,
    "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": "K",
    "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": 4006.3479999999995,
        "y": 4009.7219124999974
      },
      {
        "x": 4013.8747999999996,
        "y": 4009.7219124999974
      }
    ],
    "router": "draw2d.layout.connection.VertexRouter",
    "radius": "",
    "filters": [
      {
        "name": "shape_designer.filter.StrokeFilter"
      }
    ]
  }
]
