Lively Kernel canvas
// this script is evaluated on world load
MyConsole = WorldMorph.current().submorphs.detect(function(ea){return ea.name == "MyConsole"});
if(!MyConsole) return;
MyConsole = MyConsole.component;
MyConsole.setText("-- start --");
MyConsole.log = function(s) {
this.setText(this.formalModel.getText() + "\n" + s);
};
MyConsole.log("My Console initialized!");
MyConsole.morph.resetScrollPane = function() {
var sp = this.enclosingScrollPane();
if (sp) sp.scrollToBottom();
};
// console.consumers seems to be broken... so we go the hard waz
console.log = console.log.wrap(function(proceed, s) {
MyConsole.log(s)
proceed(s)})
console.log("wrapped console for MyConsole successfully")
DraftMarkerMorphStage240
BUG:markermorphinterceptsstillmousedownandmousemove
10000.16812827430678248Wikicontroltrue
sincetheMarkerMorphshowedsomebugsweswitchtoautomatictesting...butIdidnotfoundtheBUGbutonlyaasulution....182null
10001.1741632864897916e-17Wikicontroltrue
Benchmarking26null
Documententing26null
Deploying26null
Evolving26null
10000.13508517176729928Wikicontroltrue
10003.613592635791883e-33Wikicontroltrue
10005.71601790820865e-10Wikicontroltrue
10000.000007501723576108304Wikicontroltrue
10000.00069619860913095Wikicontroltrue
10000.01478098017070016Wikicontroltrue
Testing26null
Developing26null
-----falsetruefalse0
worldis1:WorldMorph([0,0,1548,1056])falsetruefalse0
Errorevaluatinginitializer:SyntaxError:Invalidreturnstatement.falsetruefalse0
startingWikiNavigatorfalsetruefalse0
status207onPROPFINDhttp://lively-kernel.org/repository/webwerkstatt/DraftMarkerMorphStage2.xhtmlfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_2loadedin29msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/anonymous_module_1loadedin412msfalsetruefalse0
fontHelvetica40:spacewidth11from51xWidth20falsetruefalse0
fontHelvetica12:spacewidth3from15xWidth6falsetruefalse0
fontHelvetica18:spacewidth5from23xWidth9falsetruefalse0
fontHelvetica26:spacewidth7from33xWidth13falsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
ResizingSVGcanvasfalsetruefalse0
Moduleloadcheckdone.28modulesloaded.falsetruefalse0
fontCourier12:spacewidth7from21xWidth7falsetruefalse0
status:SyntaxError:Parseerrorfalsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([0,0,1548,1056])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/DraftMarkerMorphStage2.xhtml?1265980333959falsetruefalse0
extendForSerializationundefinedfalsetruefalse0871-1nulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
truetrue100false
truefalse050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Coding26null
Drafting26null
createLayer("DebugPasteUpMorphLayer");enableLayer(DebugPasteUpMorphLayer);//disableLayer(DebugPasteUpMorphLayer);layerClass(DebugPasteUpMorphLayer,PasteUpMorph,{onMouseDown:function(proceed,evt){varm=this.morphToReceiveEvent(evt);varresult=proceed(evt)//console.log("worldmousedown:"+(m==true)+"mouseFocus:"+evt.hand.mouseFocus+"->"+result);returnresult},})layerClass(DebugPasteUpMorphLayer,MouseHandlerForDragging,{handleMouseEvent:function(proceed,evt,targetMorph){//if(evt.mousePoint.x>1100)//console.log("draggerhandleevent:"+evt+"morph:"+targetMorph);returnproceed(evt,targetMorph)}})HandMorph.addMethods({setMouseFocus:function(morphOrNull){if(morphOrNull){console.log('setMouseFocus:'+morphOrNull);logStack();}this.mouseFocus=morphOrNull;this.setFill(this.mouseFocus?Color.primary.blue.lighter(2):Color.primary.blue);this.mouseFocusChanges_++;},}) \" + result );\n\t\treturn result \n\n\t},\n})\n\n\n\nlayerClass(DebugPasteUpMorphLayer, MouseHandlerForDragging, {\n\thandleMouseEvent: function(proceed, evt, targetMorph) {\n\t\t// if (evt.mousePoint.x > 1100)\n\t\t// \tconsole.log(\"dragger handle event: \" + evt + \" morph:\" + targetMorph);\n\t\treturn proceed(evt, targetMorph)\n\t}\n})\n\nHandMorph.addMethods({\n setMouseFocus: function(morphOrNull) {\n\t\tif (morphOrNull) {\n \tconsole.log('setMouseFocus: ' + morphOrNull);\n\t\t\tlogStack();\n\t\t} \n\n\t\tthis.mouseFocus = morphOrNull;\n\t\tthis.setFill(this.mouseFocus ? Color.primary.blue.lighter(2) : Color.primary.blue);\n\t\tthis.mouseFocusChanges_ ++;\n },\n \n\n})\n"]]>5truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
10000.00007840305409053445Wikicontroltrue
10008.009719347833565Wikicontroltrue
Refactoring26null
MouseHandlerForDragging.subclass('MarkerMorphMouseHandler',{handleMouseEvent:function($super,evt,targetMorph){//console.log("handleevent"+evt+","+targetMorph)if(targetMorph&&(!targetMorph.containsWorldPoint(evt.mousePoint)))returnfalse;return$super(evt,targetMorph);},});MarkerMorph.addMethods({initialize:function($super,rectangle){$super(newlively.scene.Rectangle(rectangle))this.applyStyle({borderWidth:2,borderColor:Color.rgb(223,70,0),fill:null});this.shape.setStrokeDashArray(String([9,7]));},containsPoint:function($super,point){varresult=$super(point)if(result){varinnerRect=this.shape.bounds().insetBy(5);return!innerRect.containsPoint(this.localize(point));}else{returnfalse;}},mouseHandler:MarkerMorphMouseHandler.prototype})TestCase.subclass("MarkerMorphTest",{setUp:function(){varworld=Morph.makeRectangle(newRectangle(0,0,500,500));world.world=function(){returnworld};this.morph=newMarkerMorph(pt(50,50).extent(pt(100,100)));world.addMorph(this.morph);},testContainsPoint:function(){this.assert(this.morph.containsPoint(pt(50,50)),"markerdoesnotcontainpointonborder")this.assert(!this.morph.containsPoint(pt(60,60)),"markerdoescontaininnerpoint")},testContainsPoint:function(){this.assert(this.morph.containsPoint(pt(50,50)),"markerdoesnotcontainpointonborder")this.assert(!this.morph.containsPoint(pt(60,60)),"markerdoescontaininnerpoint")},})56truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
null66