{"id":0,"registry":{"0":{"submorphs":[],"scripts":[{"__isSmartRef__":true,"id":1}],"id":"E91D9448-97BB-42C9-BC43-85217C9AB067","shape":{"__isSmartRef__":true,"id":2},"__layered_droppingEnabled__":true,"halosEnabled":true,"registeredForMouseEvents":true,"showsHalos":false,"name":"CheapWorldLayout","partsBinMetaInfo":{"__isSmartRef__":true,"id":3},"eventHandler":{"__isSmartRef__":true,"id":21},"derivationIds":[127,"F0291F62-F100-480C-AEBF-0230398F7983","AE8B5ED7-E305-45BC-BE4A-1C28A49EE12B","39BA345C-17FA-45A0-BAC2-F0CF5654ACF8","FE91EA31-D8AE-461B-8A49-95DA5FBAE5B4","F38439A3-2F4E-4AC2-BF73-2633C00B1393","6748F5B5-2284-4748-A6EE-F1A261CBAD0B","BBAFB862-93AE-4F89-BCFF-9F1C67B7FE4C","7EC17E78-593A-4CC8-B7E3-859BCBBFE785","BAE1478B-CB11-41E8-A432-8728CEA1E8B9","2EF4FF97-F02E-411E-AF1A-7151C9D582FA","3BDF678D-D961-43BA-939C-471EB892052F","00EA2971-F34B-4A4A-9862-9E232C36D082","208CB01E-E1F6-4F05-9D28-FA2C18DC1347","57AFF9A8-76B6-45A0-8582-329FD27C90C5","3AB13E2C-FA1C-49FF-B9E0-105037BD7EC9","4339E88D-5CE2-4555-A739-2E2289C39984","761C5788-93C6-4F2E-AFBD-484F80E8C625"],"partTests":{"__isSmartRef__":true,"id":22},"_ClipMode":"visible","moved":true,"isBeingDragged":false,"isLayouting":true,"prevScroll":[0,0],"grabbingEnabled":false,"isMetaTool":true,"#startLetters":"regis","draggingEnabled":true,"eventsAreDisabled":false,"_HandStyle":"default","_PointerEvents":"auto","morphsToMove":null,"_Rotation":0,"_Scale":1,"__serializedExpressions__":["_Position","distanceToDragEvent","prevDragPos"],"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":27},"__LivelyClassName__":"lively.morphic.Box","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(0.0,0.0)","distanceToDragEvent":"lively.pt(269.0,-13.0)","prevDragPos":"lively.pt(320.0,14.0)"},"1":{"target":{"__isSmartRef__":true,"id":0},"selector":"layoutWorld","args":[],"stopped":false,"tickTime":500,"suspended":false,"__LivelyClassName__":"lively.morphic.TargetScript","__SourceModuleName__":"Global.lively.morphic.Core"},"2":{"_BorderWidth":0,"_ClipMode":"visible","_BorderRadius":0,"_Opacity":0.4523,"_BorderStyle":"solid","_AppearanceStylingMode":false,"_BorderStylingMode":false,"__serializedExpressions__":["position","_Extent","_BorderColor","_Fill","_Padding"],"__LivelyClassName__":"lively.morphic.Shapes.Rectangle","__SourceModuleName__":"Global.lively.morphic.Shapes","position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(397.0,12.0)","_BorderColor":"Color.rgb(159,159,159)","_Fill":"Color.rgb(204,204,204)","_Padding":"lively.rect(0,0,0,0)"},"3":{"comment":"A very direct and cheap world layouting:\n\n- layouts all the morphs on the left ( < 100px) in vertical order\n","migrationLevel":9,"partName":"CheapWorldLayout","changes":[{"__isSmartRef__":true,"id":4},{"__isSmartRef__":true,"id":5},{"__isSmartRef__":true,"id":6},{"__isSmartRef__":true,"id":7},{"__isSmartRef__":true,"id":8},{"__isSmartRef__":true,"id":9},{"__isSmartRef__":true,"id":10},{"__isSmartRef__":true,"id":11},{"__isSmartRef__":true,"id":12},{"__isSmartRef__":true,"id":13},{"__isSmartRef__":true,"id":14},{"__isSmartRef__":true,"id":15},{"__isSmartRef__":true,"id":16},{"__isSmartRef__":true,"id":17},{"__isSmartRef__":true,"id":18},{"__isSmartRef__":true,"id":19},{"__isSmartRef__":true,"id":20}],"revisionOnLoad":200894,"partsSpaceName":"PartsBin/Jens/","__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Wed Oct 02 2013 10:33:09 GMT+0200 (Central Europe Daylight Time)\")"},"4":{"author":"jenslincke","message":"fixes origin bug","id":"6D65B2EB-4222-4AC5-8244-5D3581FCE017","__serializedExpressions__":["date"],"date":"new Date(\"Thu Mar 14 2013 23:03:58 GMT+0100 (Central Europe Standard Time)\")"},"5":{"author":"jenslincke","message":"no comment","id":"2EDE0A52-4B4A-4971-8005-F20EBD8737F7","__serializedExpressions__":["date"],"date":"new Date(\"Wed Dec 12 2012 11:09:39 GMT+0100 (Central Europe Standard Time)\")"},"6":{"author":"jenslincke","message":"no comment","id":"BC03E03B-5F5A-4955-8F8E-A6CC8426C612","__serializedExpressions__":["date"],"date":"new Date(\"Wed Dec 12 2012 11:05:45 GMT+0100 (Central Europe Standard Time)\")"},"7":{"author":"jenslincke","message":"no comment","id":"6AD89AC6-0BAE-4B1C-8C60-664562056C10","__serializedExpressions__":["date"],"date":"new Date(\"Thu Dec 06 2012 13:53:14 GMT+0100 (Central Europe Standard Time)\")"},"8":{"author":"jenslincke","message":"no comment","id":"EA1B8910-1E9A-4884-A9B5-44DAE3DC4178","__serializedExpressions__":["date"],"date":"new Date(\"Thu Dec 06 2012 13:28:30 GMT+0100 (Central Europe Standard Time)\")"},"9":{"author":"undefined","message":"whoopsie","id":"3F17A2D2-3C24-424B-B0FA-E43112267D23","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 15:51:36 GMT+0200 (Central Europe Daylight Time)\")"},"10":{"author":"undefined","message":"whoopsie","id":"CEA5DCD5-2DB7-40AD-A776-262A7A0666FC","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 15:51:30 GMT+0200 (Central Europe Daylight Time)\")"},"11":{"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 10:53:45 GMT+0100 (Central Europe Standard Time)\")"},"12":{"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B","__serializedExpressions__":["date"],"date":"new Date(\"Sat Feb 25 2012 02:59:09 GMT+0100 (Central Europe Standard Time)\")"},"13":{"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 10:42:26 GMT+0100 (Central Europe Standard Time)\")"},"14":{"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350","__serializedExpressions__":["date"],"date":"new Date(\"Mon Apr 09 2012 13:42:07 GMT+0200 (Central Europe Daylight Time)\")"},"15":{"author":"bgnauk","message":"no comment","id":"0124E570-50B7-4CE3-83A1-6E7BA89B5CD8","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jun 18 2012 19:35:08 GMT+0200 (Central Europe Daylight Time)\")"},"16":{"author":"jenslincke","message":"I want my blue rectangle back!","id":"5AA9291A-869F-4D36-8095-4721B5A5B205","__serializedExpressions__":["date"],"date":"new Date(\"Thu Nov 22 2012 10:35:51 GMT+0100 (Central Europe Standard Time)\")"},"17":{"author":"jenslincke","message":"no comment","id":"BDAAAA01-CAD5-49DE-8600-140BED885FE1","__serializedExpressions__":["date"],"date":"new Date(\"Wed Dec 05 2012 17:59:50 GMT+0100 (Central Europe Standard Time)\")"},"18":{"author":"jenslincke","message":"no comment","id":"D84CC710-005C-4B1F-AD64-DCD4DF6B563E","__serializedExpressions__":["date"],"date":"new Date(\"Thu Mar 14 2013 23:12:02 GMT+0100 (Central Europe Standard Time)\")"},"19":{"author":"jenslincke","message":"no comment","id":"94090062-9157-4AA9-96F2-492EAD3602BE","__serializedExpressions__":["date"],"date":"new Date(\"Wed Oct 02 2013 10:35:55 GMT+0200 (Central Europe Daylight Time)\")"},"20":{"__serializedExpressions__":["date"],"author":"jenslincke","message":"no comment","id":"14FEA377-3FD7-4C03-A4B5-40516F7EB0A0","date":"new Date(\"Thu Jul 09 2015 16:27:07 GMT+0200 (Central Europe Daylight Time)\")"},"21":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"22":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":23}},"23":{"test01IsMorph":{"__isSmartRef__":true,"id":24}},"24":{"varMapping":{"__isSmartRef__":true,"id":25},"source":"function test01IsMorph(aPart) {\n    this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":26},"__LivelyClassName__":"lively.Closure"},"25":{"this":{"__isSmartRef__":true,"id":22}},"26":{},"27":{"layoutWorld":{"__isSmartRef__":true,"id":28},"startLayouting":{"__isSmartRef__":true,"id":31},"stopLayouting":{"__isSmartRef__":true,"id":34},"reset":{"__isSmartRef__":true,"id":37},"onDragStart":{"__isSmartRef__":true,"id":40},"onDrag":{"__isSmartRef__":true,"id":47},"onDragEnd":{"__isSmartRef__":true,"id":54},"findMorphsToLayout":{"__isSmartRef__":true,"id":61},"toggleLayouting":{"__isSmartRef__":true,"id":64},"onDoubleClick":{"__isSmartRef__":true,"id":67}},"28":{"varMapping":{"__isSmartRef__":true,"id":29},"source":"function layoutWorld() {\n    var space = pt(0,this.getExtent().y);\n    this.findMorphsToLayout().inject(this.bounds().bottomLeft().addPt(space),\n        function(lastPos, ea) {\n            ea.align(ea.bounds().topLeft(), lastPos);\n            return ea.bounds().bottomLeft().addPt(space)\n        }, this)\n    var halos = this.world().currentHaloTarget &&\n        this.world().currentHaloTarget.halos;\n    if (halos)\n        halos.invoke('alignAtTarget')\n}","funcProperties":{"__isSmartRef__":true,"id":30},"__LivelyClassName__":"lively.Closure"},"29":{"this":{"__isSmartRef__":true,"id":0}},"30":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Tue Mar 05 2013 18:13:04 GMT+0100 (Central Europe Standard Time)\")"},"31":{"varMapping":{"__isSmartRef__":true,"id":32},"source":"function startLayouting() {\n    this.isLayouting = true;\n    this.startStepping(500, \"layoutWorld\")\n}","funcProperties":{"__isSmartRef__":true,"id":33},"__LivelyClassName__":"lively.Closure"},"32":{"this":{"__isSmartRef__":true,"id":0}},"33":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Dec 06 2012 12:02:28 GMT+0100 (Central Europe Standard Time)\")"},"34":{"varMapping":{"__isSmartRef__":true,"id":35},"source":"function stopLayouting() {\n    this.isLayouting = false;\n    this.stopStepping()\n}","funcProperties":{"__isSmartRef__":true,"id":36},"__LivelyClassName__":"lively.Closure"},"35":{"this":{"__isSmartRef__":true,"id":0}},"36":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Dec 06 2012 12:01:10 GMT+0100 (Central Europe Standard Time)\")"},"37":{"varMapping":{"__isSmartRef__":true,"id":38},"source":"function reset() {\n    this.isMetaTool = true\n    this.enableDragging();\n\n\n    // this.registerForMouseEvents()\n    \n}","funcProperties":{"__isSmartRef__":true,"id":39},"__LivelyClassName__":"lively.Closure"},"38":{"this":{"__isSmartRef__":true,"id":0}},"39":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Dec 12 2012 10:41:59 GMT+0100 (Central Europe Standard Time)\")"},"40":{"varMapping":{"__isSmartRef__":true,"id":41},"source":"function onDragStart(evt) {\n    this.prevDragPos = evt.getPosition();\n    this.morphsToMove = this.findMorphsToLayout();\n}","funcProperties":{"__isSmartRef__":true,"id":46},"__LivelyClassName__":"lively.Closure"},"41":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":42}},"42":{"$super":{"__isSmartRef__":true,"id":43}},"43":{"varMapping":{"__isSmartRef__":true,"id":44},"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":45},"__LivelyClassName__":"lively.Closure"},"44":{"obj":{"__isSmartRef__":true,"id":0},"name":"onDragStart"},"45":{},"46":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Dec 12 2012 10:44:54 GMT+0100 (Central Europe Standard Time)\")"},"47":{"varMapping":{"__isSmartRef__":true,"id":48},"source":"function onDrag(evt) {\n    var delta =  evt.getPosition().subPt(this.prevDragPos)\n    this.moveBy(delta)\n    this.prevDragPos = evt.getPosition();\n    this.morphsToMove.forEach(function(ea) {\n        ea.moveBy(delta)\n    })\n}","funcProperties":{"__isSmartRef__":true,"id":53},"__LivelyClassName__":"lively.Closure"},"48":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":49}},"49":{"$super":{"__isSmartRef__":true,"id":50}},"50":{"varMapping":{"__isSmartRef__":true,"id":51},"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":52},"__LivelyClassName__":"lively.Closure"},"51":{"obj":{"__isSmartRef__":true,"id":0},"name":"onDrag"},"52":{},"53":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Dec 12 2012 10:45:21 GMT+0100 (Central Europe Standard Time)\")"},"54":{"varMapping":{"__isSmartRef__":true,"id":55},"source":"function onDragEnd() {\n     this.morphsToMove = null;\n}","funcProperties":{"__isSmartRef__":true,"id":60},"__LivelyClassName__":"lively.Closure"},"55":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":56}},"56":{"$super":{"__isSmartRef__":true,"id":57}},"57":{"varMapping":{"__isSmartRef__":true,"id":58},"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":59},"__LivelyClassName__":"lively.Closure"},"58":{"obj":{"__isSmartRef__":true,"id":0},"name":"onDragEnd"},"59":{},"60":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Dec 12 2012 10:44:37 GMT+0100 (Central Europe Standard Time)\")"},"61":{"varMapping":{"__isSmartRef__":true,"id":62},"source":"function findMorphsToLayout() {\n    var target = this.owner;\n    var halos = this.world().currentHaloTarget && this.world().currentHaloTarget.halos;\n    // check if dragging etc...\n    if (halos && halos.detect(function(ea) {\n            return ea.infoLabel && ea.infoLabel.owner\n        })){\n        return [];\n    }\n    return target.submorphs.select(function(ea) {\n        return (ea.bounds().topLeft().x <= this.bounds().right()) &&\n            (this.bounds().left() - 100 <= ea.bounds().left()) &&\n            (this.bounds().top() <= ea.bounds().top()) \n    }, this).reject(function(ea) {\n        return ea.isEpiMorph || (ea instanceof lively.morphic.HandMorph) \n        || ea == this\n        || ea.isMetaTool\n        || ea instanceof lively.morphic.Window\n    }, this).sortBy(function(ea) {\n        return ea.bounds().topLeft().y\n    })\n}","funcProperties":{"__isSmartRef__":true,"id":63},"__LivelyClassName__":"lively.Closure"},"62":{"this":{"__isSmartRef__":true,"id":0}},"63":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Mar 14 2013 23:11:41 GMT+0100 (Central Europe Standard Time)\")"},"64":{"varMapping":{"__isSmartRef__":true,"id":65},"source":"function toggleLayouting() {\n    if (this.isLayouting) {\n        this.stopLayouting()\n        this.setFill(Color.red)\n    } else {\n        this.startLayouting()\n        this.setFill(Color.gray)\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":66},"__LivelyClassName__":"lively.Closure"},"65":{"this":{"__isSmartRef__":true,"id":0}},"66":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Dec 12 2012 11:04:24 GMT+0100 (Central Europe Standard Time)\")"},"67":{"varMapping":{"__isSmartRef__":true,"id":68},"source":"function onDoubleClick(evt) {\n    \n    if (evt.isLeftMouseButtonDown()) {\n       this.toggleLayouting()\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":69},"__LivelyClassName__":"lively.Closure"},"68":{"this":{"__isSmartRef__":true,"id":0}},"69":{"user":"jenslincke","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Oct 02 2013 10:35:20 GMT+0200 (Central Europe Daylight Time)\")"},"isSimplifiedRegistry":true}}