{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1}],"scripts":[],"id":"757A3989-696E-436B-B185-0273D700D400","shape":{"__isSmartRef__":true,"id":22},"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"eventHandler":{"__isSmartRef__":true,"id":23},"showsHalos":false,"name":"Ground","partsBinMetaInfo":{"__isSmartRef__":true,"id":24},"derivationIds":[707,"7925D377-502A-4FBD-9531-F9106FD8E4DD"],"_ClipMode":"visible","magnets":[],"isBeingDragged":false,"isLockOwner":true,"component":{"__isSmartRef__":true,"id":28},"__serializedExpressions__":["_Position","distanceToDragEvent"],"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":29},"__LivelyClassName__":"lively.morphic.Image","__SourceModuleName__":"Global.lively.morphic.Widgets","withoutLayers":["Global.lively.morphic.GrabbingLayer"],"_Position":"lively.pt(0.0,0.0)","distanceToDragEvent":"lively.pt(57.0,-33.0)"},"1":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":2},"id":"ED0B707E-7214-442B-AD0C-4645156B97C1","eventHandler":{"__isSmartRef__":true,"id":3},"droppingEnabled":true,"halosEnabled":true,"showsHalos":false,"layout":{"__isSmartRef__":true,"id":4},"name":"Lead","partsBinMetaInfo":{"__isSmartRef__":true,"id":5},"derivationIds":[113,"07BC3F00-A1CC-4E18-8B69-527B6067A724","13233823-1113-464C-ADCF-071B43D6AEF6","2F1DBF66-E53D-4B13-9793-53EBDA946EEB","F49C7C64-4EBB-4A68-B85D-A0ABB3E1487D","479A60D3-2E4A-4ED9-A639-D4C58D4C51EA","9B2971CD-EF21-4C3D-9F5A-EE33F0718998"],"_ClipMode":"visible","isBeingDragged":false,"grabbingEnabled":false,"magnets":[],"owner":{"__isSmartRef__":true,"id":0},"lead":{"__isSmartRef__":true,"id":10},"isLockOwner":false,"__serializedExpressions__":["_Position","distanceToDragEvent"],"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11},"__LivelyClassName__":"lively.morphic.Morph","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(0.0,-40.0)","distanceToDragEvent":"lively.pt(34.5,-18.3)"},"2":{"_ClipMode":"visible","_BorderWidth":3.184,"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_AppearanceStylingMode":false,"_BorderStylingMode":false,"__serializedExpressions__":["_Position","_Extent","_Padding","_BorderColor","_Fill"],"__LivelyClassName__":"lively.morphic.Shapes.Ellipse","__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":"lively.pt(-15.5,-15.8)","_Extent":"lively.pt(31.0,31.5)","_Padding":"lively.rect(0,0,0,0)","_BorderColor":"Color.rgb(0,0,0)","_Fill":"Color.rgb(204,204,204)"},"3":{"morph":{"__isSmartRef__":true,"id":1},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"4":{},"5":{"partName":"Lead","requiredModules":[],"migrationLevel":8,"partsSpaceName":"PartsBin/Babelsberg/","comment":"A pin for an electric component","changes":[{"__isSmartRef__":true,"id":6},{"__isSmartRef__":true,"id":7},{"__isSmartRef__":true,"id":8},{"__isSmartRef__":true,"id":9}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Fri Nov 15 2013 13:29:34 GMT-0800 (PST)\")"},"6":{"author":"robertkrahn","message":"no comment","id":"EE799F0E-9E4A-4AF8-98F7-DAEF09F6A8DC","__serializedExpressions__":["date"],"date":"new Date(\"Fri Feb 15 2013 11:22:02 GMT-0800 (PST)\")"},"7":{"author":"undefined","message":"reverted changes - was there any description of this morph?","id":"C3C03411-9523-4F35-89EC-B20E24B3C287","__serializedExpressions__":["date"],"date":"new Date(\"Tue Apr 03 2012 00:08:08 GMT-0700 (PDT)\")"},"8":{"author":null,"message":"no comment","id":"8081E212-F627-4DBF-A925-E884B7F401F7","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jul 12 2013 12:14:02 GMT-0700 (PDT)\")"},"9":{"author":null,"message":"no comment","id":"5011462C-F3D3-4806-A629-C6A0FADEC868","__serializedExpressions__":["date"],"date":"new Date(\"Fri Nov 15 2013 13:29:34 GMT-0800 (PST)\")"},"10":{"voltage":0,"current":0,"$1$1voltage":0,"$1$1current":0,"__LivelyClassName__":"users.ohshima.ElectricalComponents.Lead","__SourceModuleName__":"Global.users.ohshima.ElectricalComponents"},"11":{"onMouseDown":{"__isSmartRef__":true,"id":12},"connectElectricLead":{"__isSmartRef__":true,"id":19}},"12":{"varMapping":{"__isSmartRef__":true,"id":13},"source":"function onMouseDown(evt) {\n    if (evt.isLeftMouseButtonDown()) {\n        evt.stop();\n        this.setFill(Color.green);\n        var self = this,\n            pos = this.globalBounds().center(),\n            wire = lively.morphic.Morph.makeLine([pos, pos], 4, Color.green);\n        wire.openInWorld();\n        var tracker = lively.morphic.Morph.makeEllipse(rect(-5,-5,10,10));\n        tracker.openInHand();\n        tracker.wantsToBeDroppedInto = function(target) {\n            return !!target.connectElectricLead;\n        }\n        tracker.onDropOn = function(target) {\n            tracker.remove();\n            wire.remove();\n            self.setFill(Color.gray);\n            if (target.connectElectricLead)\n                target.connectElectricLead(self);\n        }\n        tracker.step = function() {\n            var pos = tracker.getPositionInWorld();\n            wire.getControlPoint(1).setGlobalPos(pos);\n        }\n        tracker.startStepping(50, \"step\");\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":18},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"13":{"this":{"__isSmartRef__":true,"id":1},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14}},"14":{"$super":{"__isSmartRef__":true,"id":15}},"15":{"varMapping":{"__isSmartRef__":true,"id":16},"source":"function () {\n                    try {\n                        return obj.constructor.prototype[name].apply(obj, arguments)\n                    } catch (e) {\n                        if ($world)\n                            $world.logError(e, 'Error in $super call')\n                        else\n                            alert('Error in $super call: ' + e + '\\n' + e.stack);\n                        return null;\n                    }\n                }","funcProperties":{"__isSmartRef__":true,"id":17},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"16":{"obj":{"__isSmartRef__":true,"id":1},"name":"onMouseDown"},"17":{},"18":{"user":"AlanBorning","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Fri Nov 15 2013 13:47:02 GMT-0800 (PST)\")"},"19":{"varMapping":{"__isSmartRef__":true,"id":20},"source":"function connectElectricLead(lead) {\n        if (lead === this) return;\n        this.ownerChain().detect(function(o) { return o.onLeadConnected; });\n        var component = this.ownerChain().filterByKey('onLeadConnected')[0];\n        if (!component) {\n            show('Cannot connect lead, it seems not to be inside an electrical component!')\n            return;\n        }\n        component.onLeadConnected(this, lead);\n    }","funcProperties":{"__isSmartRef__":true,"id":21},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"20":{"this":{"__isSmartRef__":true,"id":1}},"21":{},"22":{"_ImageURL":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMCI+CiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDApIHNjYWxlKDYgNikiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIxIiB2aWV3Qm94PSIwIDAgMTIuODczIDE2Ljc4NyIgZmlsbD0ibm9uZSI+CiAgICAgIDxwYXRoIGlkPSJwYXRoMSIgZD0ibTAgOC4zOGgxMi4yNCI+PC9wYXRoPgogICAgICA8cGF0aCBpZD0icGF0aDIiIGQ9Im0yIDExLjkxaDcuNTgiPjwvcGF0aD4KICAgICAgPHBhdGggaWQ9InBhdGgzIiBkPSJtNCAxNS41N2gzLjU0Ij48L3BhdGg+CiAgICAgIDxwYXRoIGlkPSJwYXRoNCIgZD0ibTYgOC41di05LjA5Ij48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==","isLoaded":true,"__serializedExpressions__":["position","_Extent","_Padding","_Position"],"__LivelyClassName__":"lively.morphic.Shapes.Image","__SourceModuleName__":"Global.lively.morphic.Shapes","position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(75.0,97.0)","_Padding":"lively.rect(0,0,0,0)","_Position":"lively.pt(-36.0,-40.0)"},"23":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"24":{"partsSpaceName":"PartsBin/ElectricalComponents/","partName":"Ground","migrationLevel":8,"comment":"an pixmap image morph","requiredModules":["users.ohshima.ElectricalComponents"],"__serializedExpressions__":["lastModifiedDate"],"changes":[{"__isSmartRef__":true,"id":25},{"__isSmartRef__":true,"id":26},{"__isSmartRef__":true,"id":27}],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Mon Dec 09 2013 14:01:21 GMT-0800 (PST)\")"},"25":{"__serializedExpressions__":["date"],"author":"robertkrahn","message":"no comment","id":"E5ADA8AC-4E90-4C26-A838-B312BC9DC85E","date":"new Date(\"Mon Dec 09 2013 13:51:50 GMT-0800 (PST)\")"},"26":{"__serializedExpressions__":["date"],"author":"robertkrahn","message":"no comment","id":"3BAF9042-40A4-4B58-961E-BC0AD1AF9A66","date":"new Date(\"Mon Dec 09 2013 14:01:21 GMT-0800 (PST)\")"},"27":{"__serializedExpressions__":["date"],"author":"robertkrahn","message":"no comment","id":"2BF2E980-D817-4A1B-96B2-B32F5634C2FA","date":"new Date(\"Mon Dec 09 2013 16:40:34 GMT-0800 (PST)\")"},"28":{"lead":{"__isSmartRef__":true,"id":10},"$1$1lead":{"__isSmartRef__":true,"id":10},"__LivelyClassName__":"users.ohshima.ElectricalComponents.Ground","__SourceModuleName__":"Global.users.ohshima.ElectricalComponents"},"29":{"onLeadConnected":{"__isSmartRef__":true,"id":30},"setupComponent":{"__isSmartRef__":true,"id":33},"reset":{"__isSmartRef__":true,"id":36}},"30":{"varMapping":{"__isSmartRef__":true,"id":31},"source":"function onLeadConnected(myLead,otherLead) {\n    this.owner.connectLeads(myLead, otherLead);\n}","funcProperties":{"__isSmartRef__":true,"id":32},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"31":{"this":{"__isSmartRef__":true,"id":0}},"32":{"user":"robertkrahn","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Dec 04 2013 11:32:10 GMT-0800 (PST)\")"},"33":{"varMapping":{"__isSmartRef__":true,"id":34},"source":"function setupComponent() {\n    this.component = new users.ohshima.ElectricalComponents.Ground();\n    this.get(\"Lead\").lead = this.component.lead;\n}","funcProperties":{"__isSmartRef__":true,"id":35},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"34":{"this":{"__isSmartRef__":true,"id":0}},"35":{"user":"robertkrahn","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Dec 04 2013 11:32:10 GMT-0800 (PST)\")"},"36":{"varMapping":{"__isSmartRef__":true,"id":37},"source":"function reset() {\n        this.getPartsBinMetaInfo().addRequiredModule('users.ohshima.ElectricalComponents');\n    }","funcProperties":{"__isSmartRef__":true,"id":38},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"37":{"this":{"__isSmartRef__":true,"id":0}},"38":{},"isSimplifiedRegistry":true}}