{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1}],"scripts":[],"id":"9A0ECEE0-722C-474F-8211-9A1943D19179","shape":{"__isSmartRef__":true,"id":30},"__layered_droppingEnabled__":true,"halosEnabled":true,"registeredForMouseEvents":true,"showsHalos":false,"name":"ScreenContainer","partsBinMetaInfo":{"__isSmartRef__":true,"id":31},"eventHandler":{"__isSmartRef__":true,"id":52},"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","BD8BECDB-A9A1-4009-B433-C925F0AFCCFC","F2677A9D-5855-4DF2-B248-94545B34B762","D52188B3-7DC0-410E-96B1-50892AC00A37","1C17567C-751A-447E-A93C-0CE8CAEEF262","C31986AF-AB07-427F-BD76-E0F3859AC975","CBDDB177-615A-4B52-85D1-2CCAD979ECBF","CFB3B845-E82A-4912-94BA-D59ED7F935B0","780A2425-5533-4BFA-91FB-E9758F1E0445","FA26261A-6C45-4663-B506-0F208331BEBE","0F0326A6-FFFA-4FB8-897F-3EEE6D3A96D5","370F2319-F838-4CB6-BE78-172630E9270E","BEF1F615-03DB-42E2-BE93-F18E57CD9302","00BB4C26-F379-41B3-8BBD-8349DB996A3F","610C23AB-7D23-46B4-8271-FBEC64CE2ED7","B2F5B6DF-93F5-4429-957D-28F3798B2E9A","B6B4474B-B28D-425B-B658-9E6C79426997","613AE811-6532-4EDF-BA56-55B0B638EE52","3BBE3237-01B0-4119-A0F7-13C7E4263690","16CDAE59-162A-4835-9F63-01DD8BC4103E","B7E0D35D-8FA0-4D55-BB42-23C4D18EC6F1","0999237E-292A-425B-9213-D3E683085139","876060E4-3209-4AA9-AF91-7D055B68D324","D822AD75-6869-47B0-AC99-0A9C4210F357","10E3E026-9AED-464A-81DF-637E2C672279","67864F97-C81A-4AF6-B456-A0062CC95C6D","B787EA5C-30EA-4482-A982-CB794B030846","41952FD7-F36C-4C58-B86A-22AEF6CE1124","7C98C1FB-863B-4A61-BF9B-1574775BD627","43345AF8-FCA9-4B44-97A2-DC3F8384E1E1","4FF354D7-B2A6-4835-9855-13BB4B21A0E7","437BE827-E884-40C4-B341-BB4E3AB0447C","CAB93923-7744-4543-A789-5DD403EE0018","DBB08B15-0D86-4E9B-ADE9-89FCA4A2BBB9","D1BDDE86-D650-4348-A54A-A34A53FBAEEB","32E95D9A-B1BA-449B-A513-9873ACF6EF00","C84A334F-AC15-4903-B017-0C10942AD80A","0D2A5E1B-F938-4362-ADC5-05ABBB517C23"],"partTests":{"__isSmartRef__":true,"id":53},"_ClipMode":"hidden","moved":true,"droppingEnabled":true,"isBeingDragged":false,"prevScroll":[347,321],"videoStreams":0,"layout":{"__isSmartRef__":true,"id":58},"screenMappings":{"__isSmartRef__":true,"id":59},"mainScreen":null,"__serializedExpressions__":["_Position","distanceToDragEvent"],"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":60},"__LivelyClassName__":"lively.morphic.Box","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(0.0,0.0)","distanceToDragEvent":"lively.pt(422.0,-17.0)"},"1":{"submorphs":[],"scripts":[],"id":"49E98FFE-04A2-48B3-ACC3-AD88E660F84A","shape":{"__isSmartRef__":true,"id":2},"__layered_droppingEnabled__":true,"halosEnabled":true,"registeredForMouseEvents":true,"showsHalos":false,"name":"SmallScreensContainer","partsBinMetaInfo":{"__isSmartRef__":true,"id":3},"eventHandler":{"__isSmartRef__":true,"id":23},"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","BD8BECDB-A9A1-4009-B433-C925F0AFCCFC","F2677A9D-5855-4DF2-B248-94545B34B762","D52188B3-7DC0-410E-96B1-50892AC00A37","1C17567C-751A-447E-A93C-0CE8CAEEF262","C31986AF-AB07-427F-BD76-E0F3859AC975","16DB7548-D858-45CC-896C-34484A398F7C","F599A934-2921-4567-A420-A5AF1BA61442","90F316FC-B02C-445C-9C37-D52ACFFBFF49","00FDF7E0-C389-4AEA-B874-744D43FBACBB","CE4FD44A-2797-4707-9A02-5A5A63B9F59F","0CC59334-0D8F-406D-B563-CEA376113D46","2EB498E7-3A60-43D8-9597-77B83269494B","B47E5E11-1D85-4D24-A6C5-FF529A213320","F8301D93-A928-4F88-8C6D-14A76E7D33C4","01BB4CF7-5546-4DC6-BD66-B65B495C32E7","5D55AB1E-2098-40EB-A55B-67DB7321B3EF","8FD237A3-39B2-4353-8018-6C10CB426DEB","F327FD48-4851-47BD-A0C9-93C872CBBE5D","F0930C95-FC47-4D5D-AF1D-82B3845B4DEB","2702FD3C-6AD9-4964-905E-D499B864BBB1","FBA0967F-FEF3-412E-8B42-A85B12ED5CBC","413678D6-154C-472F-BF96-57A5BB761976","6597805A-D8E9-4958-82EC-AFF62794DF24","79B9BD1A-E53B-42E9-91FD-1F20664A76A6","F3515646-B3FA-4468-9808-E93710EAA434","4E103A5C-8254-42E9-B180-91E5439F7923","8C0D44CF-2DC4-4376-8A5E-4A480DD93DC4","9A06495D-911A-4D13-AE1D-CB61D421CDAF","2F67F26B-A6F0-4DD5-B51D-DDAF055B9D79","65A3884D-BE52-43F1-878A-4B3AE8DE7197","B7AD2997-017B-4FBB-888B-51FD76A3094E","35D846D0-AAE3-4AB8-8948-E666B00D6C8A","A73C6949-A56B-4B57-A9FD-C9F37C1F88C0","528A71B3-340D-4FDB-8C7F-32EB19536E0D","505881D1-AF63-4E5C-98D1-4507C0DE4D29","EF0F23AA-7200-424E-BFB3-653CC03B93A5","6ECD52E5-6563-42C0-A80A-E12568BEFF27"],"partTests":{"__isSmartRef__":true,"id":24},"_ClipMode":"auto","moved":true,"droppingEnabled":true,"owner":{"__isSmartRef__":true,"id":0},"isBeingDragged":false,"prevScroll":[0,0],"layout":{"__isSmartRef__":true,"id":29},"__serializedExpressions__":["_Position"],"_Rotation":0,"_Scale":1,"__LivelyClassName__":"lively.morphic.Box","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(0.0,384.0)"},"2":{"_BorderWidth":1,"_ClipMode":"visible","_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__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(678.0,149.0)","_BorderColor":"Color.rgb(0,0,0)","_Fill":"Color.rgb(255,255,255)","_Padding":"lively.rect(0,0,0,0)"},"3":{"partsSpaceName":"PartsBin/Basic","comment":"A plain simple rectangle","migrationLevel":8,"partName":"Rectangle","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},{"__isSmartRef__":true,"id":21},{"__isSmartRef__":true,"id":22}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Wed Mar 12 2014 07:00:28 GMT-0700 (PDT)\")"},"4":{"author":"jenslincke","message":"no comment","id":"ADFBF069-513C-4DE6-95A9-8AD4985C6508","__serializedExpressions__":["date"],"date":"new Date(\"Tue Feb 04 2014 01:23:53 GMT-0800 (PST)\")"},"5":{"author":"robertkrahn","message":"no comment","id":"A452871F-4EB9-45D1-94B8-6065CBA7B8FD","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jul 29 2013 23:20:51 GMT-0700 (PDT)\")"},"6":{"author":"SAPLivelyScreen","message":"no comment","id":"7A44D8CA-6D5F-42A3-A4B4-4D7F51EECA52","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jun 18 2013 11:49:27 GMT-0700 (PDT)\")"},"7":{"author":"SAPLivelyScreen","message":"no comment","id":"EF145198-0649-41BD-A92E-521D98FEC49D","__serializedExpressions__":["date"],"date":"new Date(\"Wed May 29 2013 15:36:50 GMT-0700 (PDT)\")"},"8":{"author":"jenslincke","message":"added legend","id":"7ADA3049-56C1-4D32-874B-F664A79DDB20","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 07:47:05 GMT-0800 (PST)\")"},"9":{"author":"jenslincke","message":"no comment","id":"A4B86A7E-A398-4C29-BEE0-4AA045ABABD2","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 07:42:31 GMT-0800 (PST)\")"},"10":{"author":"jenslincke","message":"I want my blue rectangle back!","id":"5AA9291A-869F-4D36-8095-4721B5A5B205","__serializedExpressions__":["date"],"date":"new Date(\"Thu Nov 22 2012 01:35:51 GMT-0800 (PST)\")"},"11":{"author":"bgnauk","message":"no comment","id":"0124E570-50B7-4CE3-83A1-6E7BA89B5CD8","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jun 18 2012 10:35:08 GMT-0700 (PDT)\")"},"12":{"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350","__serializedExpressions__":["date"],"date":"new Date(\"Mon Apr 09 2012 04:42:07 GMT-0700 (PDT)\")"},"13":{"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 02:42:26 GMT-0700 (PDT)\")"},"14":{"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B","__serializedExpressions__":["date"],"date":"new Date(\"Fri Feb 24 2012 17:59:09 GMT-0800 (PST)\")"},"15":{"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 02:53:45 GMT-0700 (PDT)\")"},"16":{"author":"undefined","message":"whoopsie","id":"CEA5DCD5-2DB7-40AD-A776-262A7A0666FC","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 06:51:30 GMT-0700 (PDT)\")"},"17":{"author":"undefined","message":"whoopsie","id":"3F17A2D2-3C24-424B-B0FA-E43112267D23","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 06:51:36 GMT-0700 (PDT)\")"},"18":{"author":"jenslincke","message":"no comment","id":"AEB2F41B-2C88-4BBA-8875-93CD17CBA1C8","__serializedExpressions__":["date"],"date":"new Date(\"Wed Jan 23 2013 03:57:18 GMT-0800 (PST)\")"},"19":{"author":"robertkrahn","message":"no comment","id":"67FD74CD-7AE4-4050-ADC7-4DF73804258D","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 30 2013 00:18:06 GMT-0700 (PDT)\")"},"20":{"author":"robertkrahn","message":"no comment","id":"FBBB9C99-B61C-4D5F-8750-6E2987DF0C9C","__serializedExpressions__":["date"],"date":"new Date(\"Thu Jun 20 2013 15:16:24 GMT-0700 (PDT)\")"},"21":{"author":"jenslincke","message":"no comment","id":"ECD12BFF-E872-4918-8341-C6571E72F36D","__serializedExpressions__":["date"],"date":"new Date(\"Tue Feb 04 2014 01:24:27 GMT-0800 (PST)\")"},"22":{"author":"lauritz","message":"dropping enabled for the blue rectangle","id":"81D350CB-D926-491F-8FF3-A6C9C831BDF2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 12 2014 07:00:28 GMT-0700 (PDT)\")"},"23":{"morph":{"__isSmartRef__":true,"id":1},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"24":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":25}},"25":{"test01IsMorph":{"__isSmartRef__":true,"id":26}},"26":{"varMapping":{"__isSmartRef__":true,"id":27},"source":"function test01IsMorph(aPart) {\n    this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":28},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"27":{"this":{"__isSmartRef__":true,"id":24}},"28":{},"29":{"moveVertical":true,"resizeWidth":true},"30":{"_BorderWidth":1.056,"_ClipMode":"visible","_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__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(678.0,533.0)","_BorderColor":"Color.rgb(0,0,0)","_Fill":"Color.rgb(255,255,255)","_Padding":"lively.rect(0,0,0,0)"},"31":{"partsSpaceName":"PartsBin/Felix/","comment":"Screen container for video element screens","migrationLevel":8,"partName":"ScreenContainer","changes":[{"__isSmartRef__":true,"id":32},{"__isSmartRef__":true,"id":33},{"__isSmartRef__":true,"id":34},{"__isSmartRef__":true,"id":35},{"__isSmartRef__":true,"id":36},{"__isSmartRef__":true,"id":37},{"__isSmartRef__":true,"id":38},{"__isSmartRef__":true,"id":39},{"__isSmartRef__":true,"id":40},{"__isSmartRef__":true,"id":41},{"__isSmartRef__":true,"id":42},{"__isSmartRef__":true,"id":43},{"__isSmartRef__":true,"id":44},{"__isSmartRef__":true,"id":45},{"__isSmartRef__":true,"id":46},{"__isSmartRef__":true,"id":47},{"__isSmartRef__":true,"id":48},{"__isSmartRef__":true,"id":49},{"__isSmartRef__":true,"id":50},{"__isSmartRef__":true,"id":51}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Wed Mar 12 2014 07:00:28 GMT-0700 (PDT)\")"},"32":{"author":"lauritz","message":"dropping enabled for the blue rectangle","id":"81D350CB-D926-491F-8FF3-A6C9C831BDF2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 12 2014 07:00:28 GMT-0700 (PDT)\")"},"33":{"author":"jenslincke","message":"no comment","id":"ECD12BFF-E872-4918-8341-C6571E72F36D","__serializedExpressions__":["date"],"date":"new Date(\"Tue Feb 04 2014 01:24:27 GMT-0800 (PST)\")"},"34":{"author":"robertkrahn","message":"no comment","id":"FBBB9C99-B61C-4D5F-8750-6E2987DF0C9C","__serializedExpressions__":["date"],"date":"new Date(\"Thu Jun 20 2013 15:16:24 GMT-0700 (PDT)\")"},"35":{"author":"robertkrahn","message":"no comment","id":"67FD74CD-7AE4-4050-ADC7-4DF73804258D","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 30 2013 00:18:06 GMT-0700 (PDT)\")"},"36":{"author":"jenslincke","message":"no comment","id":"AEB2F41B-2C88-4BBA-8875-93CD17CBA1C8","__serializedExpressions__":["date"],"date":"new Date(\"Wed Jan 23 2013 03:57:18 GMT-0800 (PST)\")"},"37":{"author":"undefined","message":"whoopsie","id":"3F17A2D2-3C24-424B-B0FA-E43112267D23","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 06:51:36 GMT-0700 (PDT)\")"},"38":{"author":"undefined","message":"whoopsie","id":"CEA5DCD5-2DB7-40AD-A776-262A7A0666FC","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 06:51:30 GMT-0700 (PDT)\")"},"39":{"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 02:53:45 GMT-0700 (PDT)\")"},"40":{"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B","__serializedExpressions__":["date"],"date":"new Date(\"Fri Feb 24 2012 17:59:09 GMT-0800 (PST)\")"},"41":{"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 02:42:26 GMT-0700 (PDT)\")"},"42":{"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350","__serializedExpressions__":["date"],"date":"new Date(\"Mon Apr 09 2012 04:42:07 GMT-0700 (PDT)\")"},"43":{"author":"bgnauk","message":"no comment","id":"0124E570-50B7-4CE3-83A1-6E7BA89B5CD8","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jun 18 2012 10:35:08 GMT-0700 (PDT)\")"},"44":{"author":"jenslincke","message":"I want my blue rectangle back!","id":"5AA9291A-869F-4D36-8095-4721B5A5B205","__serializedExpressions__":["date"],"date":"new Date(\"Thu Nov 22 2012 01:35:51 GMT-0800 (PST)\")"},"45":{"author":"jenslincke","message":"no comment","id":"A4B86A7E-A398-4C29-BEE0-4AA045ABABD2","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 07:42:31 GMT-0800 (PST)\")"},"46":{"author":"jenslincke","message":"added legend","id":"7ADA3049-56C1-4D32-874B-F664A79DDB20","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 07:47:05 GMT-0800 (PST)\")"},"47":{"author":"SAPLivelyScreen","message":"no comment","id":"EF145198-0649-41BD-A92E-521D98FEC49D","__serializedExpressions__":["date"],"date":"new Date(\"Wed May 29 2013 15:36:50 GMT-0700 (PDT)\")"},"48":{"author":"SAPLivelyScreen","message":"no comment","id":"7A44D8CA-6D5F-42A3-A4B4-4D7F51EECA52","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jun 18 2013 11:49:27 GMT-0700 (PDT)\")"},"49":{"author":"robertkrahn","message":"no comment","id":"A452871F-4EB9-45D1-94B8-6065CBA7B8FD","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jul 29 2013 23:20:51 GMT-0700 (PDT)\")"},"50":{"author":"jenslincke","message":"no comment","id":"ADFBF069-513C-4DE6-95A9-8AD4985C6508","__serializedExpressions__":["date"],"date":"new Date(\"Tue Feb 04 2014 01:23:53 GMT-0800 (PST)\")"},"51":{"__serializedExpressions__":["date"],"author":"Felix","message":"no comment","id":"9AF7CDB5-8465-4133-84E3-B254E82135AD","date":"new Date(\"Wed Oct 22 2014 10:18:27 GMT-0700 (PDT)\")"},"52":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"53":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":54}},"54":{"test01IsMorph":{"__isSmartRef__":true,"id":55}},"55":{"varMapping":{"__isSmartRef__":true,"id":56},"source":"function test01IsMorph(aPart) {\n    this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":57},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"56":{"this":{"__isSmartRef__":true,"id":53}},"57":{},"58":{"adjustForNewBounds":true,"resizeWidth":true,"resizeHeight":true},"59":{},"60":{"addScreen":{"__isSmartRef__":true,"id":61},"removeScreen":{"__isSmartRef__":true,"id":64},"getFreePosition":{"__isSmartRef__":true,"id":67},"swapScreen":{"__isSmartRef__":true,"id":70},"requestScreen":{"__isSmartRef__":true,"id":73},"reorderScreens":{"__isSmartRef__":true,"id":76},"createScreen":{"__isSmartRef__":true,"id":79},"moveToMainScreen":{"__isSmartRef__":true,"id":82},"reset":{"__isSmartRef__":true,"id":85}},"61":{"varMapping":{"__isSmartRef__":true,"id":62},"source":"function addScreen(screen) {\n    var container = this.get('SmallScreensContainer');\n    screen.setPosition(this.getFreePosition());\n    var height = container.getExtent().y;\n    screen.setExtent(lively.pt(4/3 * height, height));\n    container.addMorph(screen);\n    \n    // if there is no main screen yet, move it there\n    if (!this.mainScreen) {\n        this.moveToMainScreen(screen);\n    }\n    \n    var _this = this;\n    screen.onMouseUp = function() {\n        _this.swapScreen(screen);\n    }\n    \n    \n    // var container = this.get('SmallScreensContainer');\n    // var index = container.submorphs.length;\n    \n    // screen.index = index;\n    // screen.setName('RemoteVideoScreen' + index);\n    // screen.setPosition(this.getFreePosition());\n    // container.addMorph(screen);\n    \n    // return screen;\n}","funcProperties":{"__isSmartRef__":true,"id":63},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"62":{"this":{"__isSmartRef__":true,"id":0}},"63":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Oct 01 2014 11:43:08 GMT-0700 (PDT)\")"},"64":{"varMapping":{"__isSmartRef__":true,"id":65},"source":"function removeScreen(screen) {\n    // if the removed screen was the main screen,\n    // check if there is a new candidate and swap it\n    if (this.mainScreen == screen) {\n        var container = this.get('SmallScreensContainer');\n        var newMain = container.submorphs.first();\n        if (newMain) {\n            this.moveToMainScreen(newMain);\n        } else {\n            this.mainScreen = null;\n        }\n        screen.remove();\n    } else {\n        // if it wasn't the main screen, just reorder the\n        // small screens after it was removed\n        screen.remove();\n        this.reorderScreens();\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":66},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"65":{"this":{"__isSmartRef__":true,"id":0}},"66":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Tue Sep 30 2014 18:20:50 GMT-0700 (PDT)\")"},"67":{"varMapping":{"__isSmartRef__":true,"id":68},"source":"function getFreePosition() {\n    var padding = 2;\n    var position = lively.pt(padding, padding);\n    var container = this.get('SmallScreensContainer');\n    \n    container.submorphs.forEach(function(ea) {\n        var pos = ea.getPosition();\n        if (pos.x >= position.x) {\n            position = pos.addPt(lively.pt(ea.getExtent().x + padding, 0));\n        }\n    });\n    \n    return position;\n}","funcProperties":{"__isSmartRef__":true,"id":69},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"68":{"this":{"__isSmartRef__":true,"id":0}},"69":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Sep 17 2014 15:15:11 GMT-0700 (PDT)\")"},"70":{"varMapping":{"__isSmartRef__":true,"id":71},"source":"function swapScreen(initiator) {\n    var mainScreen = this.get('MainRemoteVideoScreen');\n    this.moveToMainScreen(initiator);\n}","funcProperties":{"__isSmartRef__":true,"id":72},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"71":{"this":{"__isSmartRef__":true,"id":0}},"72":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Oct 01 2014 11:44:58 GMT-0700 (PDT)\")"},"73":{"varMapping":{"__isSmartRef__":true,"id":74},"source":"function requestScreen(remotePeerId) {\n    // create an empty list to map connections to screens, \n    // if it doesn't exist yet\n    if (!this.screenMappings) {\n        this.screenMappings = {};\n    }\n    \n    // if there is a screen for this peer already,\n    // just return the accossor\n    if (this.screenMappings[remotePeerId]) {\n        return this.screenMappings[remotePeerId].accessor;\n    }\n    \n    var container = this;\n    \n    var screen = this.createScreen();\n    \n    // The client accesses the screen just through the accessor.\n    // This has the benefit, that we can e.g. intercept adding\n    // two screens for one remote stream.\n    var screenAccessor = {\n        startVideo: function(stream) {\n            // if the screen has not been added so far, do it now\n            if (!container.screenMappings[remotePeerId].added) {\n                container.addScreen(screen);\n                container.screenMappings[remotePeerId].added = true;\n            }\n            // then start the video on the actual screen\n            screen.startVideo(stream);\n        },\n        stopVideo: function() {\n            screen.stopVideo();\n        },\n        registerEventOnScreen: function(event, callback) {\n            screen.registerEventOnScreen(event, callback);\n        },\n        getName: function() {\n            return screen.getName();\n        },\n        remove: function() {\n            container.removeScreen(screen);\n            delete container.screenMappings[remotePeerId];\n        },\n        reset: function() {\n            screen.reset();\n        },\n        getActualScreen: function() {\n            return screen;\n        }\n    }\n    \n    this.screenMappings[remotePeerId] = {\n        'screen': screen,\n        'accessor': screenAccessor,\n        'added': false\n    };\n\n    return screenAccessor;\n}","funcProperties":{"__isSmartRef__":true,"id":75},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"74":{"this":{"__isSmartRef__":true,"id":0}},"75":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Oct 01 2014 11:15:27 GMT-0700 (PDT)\")"},"76":{"varMapping":{"__isSmartRef__":true,"id":77},"source":"function reorderScreens() {\n    var padding = 2;\n    var container = this.get('SmallScreensContainer');\n    var screens = container.submorphs;\n    \n    var currentX = padding;\n    screens.forEach(function(screen) {\n        screen.setPosition(lively.pt(currentX, padding));\n        currentX += screen.getExtent().x;\n    });\n}","funcProperties":{"__isSmartRef__":true,"id":78},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"77":{"this":{"__isSmartRef__":true,"id":0}},"78":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Mon Sep 22 2014 11:43:18 GMT-0700 (PDT)\")"},"79":{"varMapping":{"__isSmartRef__":true,"id":80},"source":"function createScreen() {\n    var screen = $world.loadPartItem('RemoteVideoScreen', 'PartsBin/Felix');\n    screen.setName('RemoteVideoScreen');\n    \n    return screen;\n}","funcProperties":{"__isSmartRef__":true,"id":81},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"80":{"this":{"__isSmartRef__":true,"id":0}},"81":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Tue Sep 30 2014 16:29:44 GMT-0700 (PDT)\")"},"82":{"varMapping":{"__isSmartRef__":true,"id":83},"source":"function moveToMainScreen(screen) {\n    // add the previous main screen to the small screens and\n    // remove it as main screen\n    var container = this.get('SmallScreensContainer');\n    var smallHeight = container.getExtent().y;\n    if (this.mainScreen) {\n        this.mainScreen.remove();\n        this.mainScreen.setPosition(this.getFreePosition());\n        this.mainScreen.setExtent(lively.pt(4/3 * smallHeight, smallHeight));\n        \n        container.addMorph(this.mainScreen);\n    }\n    \n    // then set the screen as the new main screen\n    this.mainScreen = screen;\n    screen.remove();\n    this.reorderScreens();\n    var mainHeight = this.getExtent().y - smallHeight;\n    screen.setExtent(lively.pt(4/3 * mainHeight, mainHeight));\n    screen.setPosition(lively.pt(75, 0));\n    this.addMorph(screen);\n}","funcProperties":{"__isSmartRef__":true,"id":84},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"83":{"this":{"__isSmartRef__":true,"id":0}},"84":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Oct 01 2014 11:40:02 GMT-0700 (PDT)\")"},"85":{"varMapping":{"__isSmartRef__":true,"id":86},"source":"function reset() {\n    if (this.mainScreen) {\n        this.mainScreen.remove();\n        this.mainScreen = null;\n    }\n    var container = this.get('SmallScreensContainer');\n    container.submorphs.forEach(function(screen) {\n        screen.remove();\n    });\n    \n    this.screenMappings = {};\n}","funcProperties":{"__isSmartRef__":true,"id":87},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"86":{"this":{"__isSmartRef__":true,"id":0}},"87":{"user":"Felix","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Oct 01 2014 13:05:40 GMT-0700 (PDT)\")"},"isSimplifiedRegistry":true}}