Lively Kernel canvas // general spec of location? if (submorph.isEpimorph) return; this.layout(supermorph); this.adjustShapeBoundsToSubmorphBounds(supermorph) }, afterRemoveMorph: function($super, supermorph, submorph) { if (submorph.isEpimorph) return; this.layout(supermorph); this.adjustShapeBoundsToSubmorphBounds(supermorph) supermorph.layoutChanged(); }, submorphExtentChanged: function(supermorph, submorph) { if (submorph.isEpimorph) return; var newExtent = submorph.getExtent(); var cachedExtent = this.getCachedExtent(supermorph, submorph) if (!cachedExtent || !(cachedExtent.eqPt(newExtent))) { this.setCachedExtent(supermorph, submorph, newExtent) this.layout(supermorph); this.adjustShapeBoundsToSubmorphBounds(supermorph); } }, layout: function($super, supermorph, submorph) { // console.log('full layout ' + supermorph.id()); // logStack(); $super(supermorph, submorph) } } VerticalLayout.subclass('VerticalShrinkLayout', ShrinkTrait); Object.extend(VerticalShrinkLayout, { fromLiteral: function(literal) { return new this() } }) HorizontalLayout.subclass('HorizontalShrinkLayout', ShrinkTrait) Object.extend(HorizontalShrinkLayout, { fromLiteral: function(literal) { return new this() } }) // splitArrayIntoPiecesOfLength([1,2,3,4,5,6,7], 3) -> [[1, 2, 3], [4, 5, 6], [7]] splitArrayIntoPiecesOfLength = function(array, n) { return array.inject([[]], function(a, ea) { var last = a.last() if(last.length == n) { last = []; a.push(last) } last.push(ea) return a }) } BoxMorph.subclass("ShrinkBoxMorph", { layoutManager: new HorizontalShrinkLayout(), style: {fill: Color.white, fillOpacity: 0}, layoutChanged: function($super) { $super(); if (this.owner && this.owner.submorphExtentChanged) this.owner.submorphExtentChanged(this); }, submorphExtentChanged: function(submorph) { if (this.layoutManager && this.layoutManager.submorphExtentChanged) this.layoutManager.submorphExtentChanged(this, submorph) }, }) ShrinkBoxMorph.subclass("ResourceNodeMorph", { defaultExtent: pt(120,40), padding: new Rectangle(5,5,0,0), margin: new Rectangle(5,3,0,0), style: {fill: Color.blue.darker(), borderColor: null, borderWidth: 0, fillOpacity: 0.3, borderRadius: 10}, dirsInRow: 4, filesInRow: 8, initialize: function($super, url, optPosition, optLevel) { var pos = optPosition || pt(0,0); $super(pos.extent(this.defaultExtent)) this.label = new TextMorph(new Rectangle(0,0,100,20)).beLabel(); this.addMorph(this.label) this.url = url this.setupConnections() this.layoutManager = new VerticalShrinkLayout(); this.helpText = url.toString() }, setupConnections: function() { connect(this, "url", this.label, 'setTextString', {converter: function(value) { if (value instanceof URL) return value.filename() else return "no valid url" }}).update(this.url) }, expand: function(depth, level) { if (depth === 0) return; if (depth === undefined) depth = 1; if (!this.url) return; var childDirs = new WebResource(this.url).getSubElements(1).subCollections splitArrayIntoPiecesOfLength(childDirs, this.dirsInRow).each(function(children) { var rowMorph = new ShrinkBoxMorph(); children.each(function(ea) { var m = new ResourceNodeMorph(ea.getURL(), undefined ,this.level + 1); m.expand(depth - 1) rowMorph.addMorph(m) }, this) this.addMorph(rowMorph) }, this) var leafChildren = new WebResource(this.url).getSubElements(1).subDocuments var leafChildrenRows = splitArrayIntoPiecesOfLength(leafChildren, this.filesInRow); leafChildrenRows.each(function(eaRow) { var rowMorph = new ShrinkBoxMorph(); eaRow.each(function(ea) { var m = new ResourceNodeMorph(ea.getURL(), undefined , this.level + 1); m.submorphExtentChanged(m.label) rowMorph.addMorph(m) }, this); this.addMorph(rowMorph) }, this); }, getHelpText: function() { return this.helpText } }) ]]>AlternativeWikiVisualizationWikicontrolwebwerkstatt/media/contextjs/papers/robert/fabrik/draft/LivelyHPImgzn/apps/lively/BWINF/demos/AgileSoftwareentwicklung/bin/benchmarks/cop/roadmap/ProjectSeminar2010/projects/swa/sandbox/jens/Tests/ometa/issues/webcollab-integration/MediaUpload.xhtmlwebwerkstatt.xhtmlrunTests.xhtmlblank.xhtmlmigration.xhtmlauthupdate.xhtmlMakefilediff.shchanges.xhtml//META:developedclassandexampleinoneplacetoincreasedevelopmentroundtripevenfurther//pressingalt+s,createsnewcodeandrecreatesexampleResourceNodeMorph.addMethods({padding:newRectangle(5,5,0,0),margin:newRectangle(5,3,0,0),style:{fill:Color.blue.darker(),borderColor:null,borderWidth:0,fillOpacity:0.3,borderRadius:10},dirsInRow:6,filesInRow:8,})if($morph('treeWikiViz'))$morph('treeWikiViz').remove()varurl=newURL('http://lively-kernel.org/repository/webwerkstatt/')m=newResourceNodeMorph(url,pt(50,100));m.name='treeWikiViz';m.expand(1);//depth....m.openInWorld()//andstartcoloring....m.withAllSubmorphsDo(function(){varea=this;if(!(ea.urlinstanceofURL))return;varr=newWebResource(ea.url).beAsync();connect(r,'versions',ea,'versions');connect(ea,'versions',ea,'helpText',{converter:function(value){varlast=value[0];if(!last)return"noversionsfor"+this.getTargetObj().url.toString();returnthis.getTargetObj().url.toString()+'\n'+value.length+"versions\n"+last.date+'\n'+last.author}});connect(ea,'versions',ea,'lastVersion',{converter:function(value){returnvalue[0]}});connect(ea,'lastVersion',ea,'setFill',{converter:function(value){vardays=(Date.now()-value.date)/1000/3600/24returnColor.rgb(155-(days*10),0,(days*10)-100)}});connect(ea,'versions',ea.label,'nothing',{updater:function($proceed,value){this.getTargetObj().setFontSize(3+(Math.log(value.length)*5))this.getSourceObj().submorphExtentChanged(this.getTargetObj())}});r.getVersions()})CodedismissallXserializing....
consoleclose
:1:42) at ResourceNodeMorph.transformChanged (https://lively-kernel.org/repository/webwerkstatt2011/lively/oldCore/Morphs.js?1736632669132:1065:29) at ResourceNodeMorph.translateBy (https://lively-kernel.org/repository/webwerkstatt2011/lively/oldCore/Morphs.js?1736632669132:1554:8) at ResourceNodeMorph.align (https://lively-kernel.org/repository/webwerkstatt2011/lively/oldCore/Morphs.js?1736632669132:1615:15) at HorizontalShrinkLayout.layout (https://lively-kernel.org/repository/webwerkstatt2011/lively/oldCore/Layout.js?1736632669134:173:13) at HorizontalShrinkLayout.callSuper (https://lively-kernel.org/repository/webwerkstatt2011/lively/Base.js?1736632668005:364:43) at bound (https://lively-kernel.org/repository/webwerkstatt2011/lively/bootstrap.js:760:37)]]>
An error occurred. If the world does not load you can visit the repair page for help.