<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Staging</title>
		<link>http://kogics.wikidot.com/forum/t-230317/staging</link>
		<description>Posts in the discussion thread &quot;Staging&quot; - Peter Lewerin&#039;s clone of Kojo</description>
				<copyright></copyright>
		<lastBuildDate>Mon, 10 Aug 2026 10:31:03 +0000</lastBuildDate>
		
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-819350</guid>
				<title>Re: Staging Feedback - Round 2</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-819350</link>
				<description></description>
				<pubDate>Wed, 30 Jun 2010 12:06:03 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>I see an inconsistency in the naming conventions for style methods at the API and Shape levels. eg - strokeWidth(4) vs shape.strokeWidth = 4<br /> &gt; You mean it should be shape.strokeWidth(4)?</p> </blockquote> <p>I was referring to the consistency of the 'style' of the setter methods at the API and Shape levels.<br /> API.strokeWidth = 4 and shape.strokeWidth = 4 etc<br /> OR<br /> API.strokeWidth(4) and shape.strokeWidth(4) etc</p> <blockquote> <p>They obviously need to set colors and stroke widths, but maybe if they need to know what the colors etc are they should keep track of it themselves?</p> </blockquote> <p>That sounds reasonable. Attribute readers can always be added later if they seem justified based on actual usage.<br /> <em>Update</em> - and it seems like you can read style attributes at the Shape level anyway!</p> <blockquote> <p>Personally, I don't want anything that is provided by the standard Scala library inside the Staging API</p> </blockquote> <p>That also sounds reasonable. It also makes the API smaller, which is good.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-817033</guid>
				<title>Re: Staging Feedback - Round 2</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-817033</link>
				<description></description>
				<pubDate>Sun, 27 Jun 2010 10:08:26 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>programmer friendly code completion</p> </blockquote> <p>Certainly. I see that as a post-feature freeze, pre-release task.</p> <blockquote> <p>hand-cursor for the SpriteCanvas</p> </blockquote> <p>Yes. I didn't intend to hi-jack the mouse cursor for Staging, so I was going to make it a settable feature (still on my to-do list). If you want to make it the default cursor, go ahead.</p> <blockquote> <p>Stroked Shape Styles (this is maybe an area of work-in-progress?)</p> </blockquote> <p>Yes, it is. The trait wasn't exactly planned and is mostly the result of the Piccolo implementation leaking out, but I think I will keep it.</p> <blockquote> <p>fill is missing?</p> </blockquote> <p>It's inherited from Shape.</p> <blockquote> <p>strokeWidth(4) vs shape.strokeWidth = 4</p> </blockquote> <p>You mean it should be <tt>shape.strokeWidth(4)</tt>? I find that <em>more</em> confusing; <tt>(API.)strokeWidth</tt> changes the global state, and <tt>shape.strokeWidth</tt> changes the shape's state.</p> <p>I'm not 100% sure about the <tt>strokeWidth</tt> / <tt>strokeWidth_=</tt> shape methods, though. They might be taken out for 1.0 and later be replaced by some other kind of mechanism.</p> <blockquote> <p>There seem to be no style attribute read methods at the API level?</p> </blockquote> <p>I'm waffling a bit between making the API convenient for the programmer and forcing the programmer to pay attention. They obviously need to set colors and stroke widths, but maybe if they need to know what the colors etc are they should keep track of it themselves? Maybe not?</p> <blockquote> <p>Do we want to fill out the Calculation/Trig functions to match Processing API? Are there other areas of the API that we want to emulate?</p> </blockquote> <p>Personally, I don't want <strong>anything</strong> that is provided by the standard Scala library inside the Staging API, including sin, cos etc (PI, HALF_PI etc may be OK, though), but if you want it I'm flexible.</p> <p>Thread issues etc noted. I've been more busy than I thought I would during the Midsummer celebrations, but I hope to be working again soon.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-815841</guid>
				<title>Staging Feedback - Round 2</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-815841</link>
				<description></description>
				<pubDate>Fri, 25 Jun 2010 03:17:57 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Here's another quick round of feedback:</p> <ul> <li>We could provide programmer friendly code completion for the Staging API by adding templates for all the Staging methods to CodeCompletionUtils.MethodTemplates. How does that sound?</li> <li>I was thinking that we could maybe set the cursor to the hand-cursor for the SpriteCanvas as a whole (it seems to indicate better than the default arrow cursor that you can do stuff (pan/zoom) with the mouse inside the Canvas) . In that case we would not need to push and pop the cursor in the PBasicInputEventHandler inside Input. Thoughts?</li> <li>Here are some Issues with Stroked Shape Styles (this is maybe an area of work-in-progress?): <ul> <li>Setting of stroke does not repaint correctly</li> <li>Setting of strokeWidth does not work (plus Swing thread issue)</li> <li>fill is missing?</li> <li>I see an inconsistency in the naming conventions for style methods at the API and Shape levels. eg - strokeWidth(4) vs shape.strokeWidth = 4</li> <li>Swing thread issue in the Shape level stroke and strokeWidth methods</li> </ul> </li> <li>There seem to be no style attribute read methods at the API level?</li> <li>Do we want to fill out the Calculation/Trig functions to match Processing API? Are there other areas of the API that we want to emulate?</li> </ul> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-814955</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-814955</link>
				<description></description>
				<pubDate>Wed, 23 Jun 2010 18:54:11 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>In particular, the mouse handling: should I thread-capture the registering of the listener, or the insides of the callbacks, or all of it, or… hmm.</p> </blockquote> <p>My take on things:</p> <ul> <li>You should run Inputs.init() in the Swing Thread</li> <li>the PBasicInputEventHandler callbacks already run on the Swing thread, so you should be fine</li> <li>The Staging animation loop runs in the Swing thread, so calls to the mouseX() etc methods from within the animation loop (the most likely case) should be fine</li> <li>Calls to the mouseX etc from outside the animation loop would be on the interpreter thread. This should be fine if the vars in Inputs become @volatile vars (@volatile will ensure visibility of the latest mouse positions in the interpreter thread)</li> </ul> <blockquote> <p>I've many times been very grateful for having Kojo/Staging around during this ordeal.</p> </blockquote> <p>That's very good to hear.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-814622</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-814622</link>
				<description></description>
				<pubDate>Wed, 23 Jun 2010 10:02:40 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>My own GUI experience is mostly with Tcl/Tk, and I have to say that I find Swing a nightmare in comparison. I'll try to cope, though :)</p> <blockquote> <p>Is there anything else that seems off to you?</p> </blockquote> <p>Nothing in particular, just an uneasy feeling that there are probably areas that to my eyes are safe but in reality only work by coincidence. In particular, the mouse handling: should I thread-capture the registering of the listener, or the insides of the callbacks, or all of it, or&#8230; hmm.</p> <p>Also, an afterthought:</p> <blockquote> <p>The stuff that you have done in the past few weeks, despite this major event on the personal front</p> </blockquote> <p>Dealing with chemotherapy, especially when the outcome is as uncertain as this was initially, means that you really, really need something else to turn your mind to. It should be something that is complicated enough to require concentration, but not so complicated that it frustrates you. It should also be worthwhile but not all-important. If it gives you something to talk about in the hospital room it's a bonus. I've many times been very grateful for having Kojo/Staging around during this ordeal.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-814455</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-814455</link>
				<description></description>
				<pubDate>Wed, 23 Jun 2010 04:52:45 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>Do you have any good links/documents?</p> </blockquote> <p>Unfortunately no. I just look at the Source (mostly Piccolo, sometimes Swing) when in doubt, and rely on my knowledge of threading to deal with issues of this nature.</p> <p>I remember that the book: Swing, 2nd Edition by Matthew Robinson, Pavel Vorobiev - had a good explanation of Swing internals in the first or second chapter.</p> <blockquote> <p>There is of course also the 2.8 deadline to consider. If the transformations aren't done by then, at the very least the current features must be made safe and sound</p> </blockquote> <p>That sounds sensible.</p> <p>Once this gets done, basic transformations (translation of shapes, and rotation and scaling of shapes about their origin and the stage origin) seem to be low hanging fruit that could be quickly added without adversely impacting anything else - or so it seems to me.</p> <blockquote> <p>I'm beginning to suspect that some of it, e.g. the mouse handling, isn't.</p> </blockquote> <p>It looks fine to me, other than the fact that the vars that are accessible in multiple threads (the swing thread and the Kojo interpreter thread) need to be made volatile. Is there anything else that seems off to you?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-814216</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-814216</link>
				<description></description>
				<pubDate>Tue, 22 Jun 2010 21:42:51 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>Do you want to dig into this? Or do you want me to take an initial stab at identifying and resolving potential problems of this nature within Staging (I can't imagine that there'll be very many, but there could be a few).</p> </blockquote> <p>I need to understand how it works, so I should at least try to get it working myself. Still, I'll probably need some pointers. For one thing, there doesn't seem to be very much documentation on the web, apart from the Piccolo2d site. Do you have any good links/documents?</p> <p>There is of course also the 2.8 deadline to consider. If the transformations aren't done by then, at the very least the current features must be made safe and sound, and I'm beginning to suspect that some of it, e.g. the mouse handling, isn't.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-813775</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-813775</link>
				<description></description>
				<pubDate>Tue, 22 Jun 2010 12:20:28 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>I'm still a bit distracted as well. The week after I signed the agreement my father was diagnosed with acute leukemia</p> </blockquote> <p>I'm very sorry to hear that.<br /> The stuff that you have done in the past few weeks, despite this major event on the personal front, is pretty amazing!</p> <blockquote> <p>This week he's riding out the aftereffects of his third round of chemotherapy and the prognosis is really good</p> </blockquote> <p>That sounds great. All the best to him in this battle!</p> <blockquote> <p>but many times I catch aspects of modern stuff like concurrency and GUI lowlevels too far down the neck and they twist around and bite me.</p> </blockquote> <p>It happens to the best of us. That's why STM and Actors are all the rage these days!</p> <p>Do you want to dig into this? Or do you want me to take an initial stab at identifying and resolving potential problems of this nature within Staging (I can't imagine that there'll be very many, but there could be a few).</p> <p>Some things to take note of:<br /> - all Piccolo writes should be on the GUI thread<br /> - all reads of Piccolo attributes should also be on the GUI thread! Otherwise, if you write an attribute and then read it, you get a different value. Utils.runInSwingThreadAndWait() can be used for this (see Figure.apply() for an example).</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-813693</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-813693</link>
				<description></description>
				<pubDate>Tue, 22 Jun 2010 08:31:02 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>Hope you see what's going on here?</p> </blockquote> <p>Yes. This kind of thing still gets me.</p> <p>I'm quite intelligent, and an experienced, skilled programmer iissm, but many times I catch aspects of modern stuff like concurrency and GUI lowlevels too far down the neck and they twist around and bite me.</p> <p>Case in point, I had noticed occasional leaks from withStyle, but couldn't see anything wrong with the code inside Style and thought I'd eventually find the bug somewhere else. My line of reasoning was that I was just calling Figure methods (setFillColor, setPenThickness etc) and they <em>are</em> running in the swing thread, so that's OK. After some more careful testing I realize that yes, I really need to bundle the whole save/restore operation into the swing thread.</p> <p>I'm determined to learn, however. I wouldn't have minded much if programming had stayed with single-thread 7-bit text applications, but I'm going to follow where programming goes.</p> <p>(I'm still a bit distracted as well. The week after I signed the agreement my father was diagnosed with acute leukemia, which isn't good news at any age but really bad news if you're over 70 years old. This week he's riding out the aftereffects of his third round of chemotherapy and the prognosis is really good, so maybe I'll have more brain power available in the future :) )</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-813646</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-813646</link>
				<description></description>
				<pubDate>Tue, 22 Jun 2010 06:32:23 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>You've called π Pi; maybe for convenience and consistency (for Processing programmers) we should call it PI and also add HALF_PI, QUARTER_PI, and TWO_PI.<br /> Also, why not define radians as&#8230;</p> </blockquote> <p>Done</p> <blockquote> <p>Oops yes, style save/restore was a bit under-implemented. Should work now.</p> </blockquote> <p>I still see the problem I encountered yesterday. You can trigger the issue by changing the order of the lines:</p> <blockquote> <p>S.background(black)<br /> S.stroke(color(228, 228, 228))</p> </blockquote> <p>&#8230;in the Clock example. If the stroke is set before the background, the clock outline and hands are drawn in red instead of gray (on my system. There's a race condition here, so results could potentially be different on your machine).</p> <p>After digging into this, I discovered an old friend! Instead of trying to describe the problem in a lot of words, I'll just show some code that fixes the problem:</p> <blockquote> <p>object Style {<br /> var savedStyles =<br /> new scala.collection.mutable.Stack[(Color, Color, java.awt.Stroke)]()<br /> def save {<br /> Utils.runInSwingThread {<br /> savedStyles push Tuple3(<br /> Impl.figure0.fillColor,<br /> Impl.figure0.lineColor,<br /> Impl.figure0.lineStroke<br /> )<br /> }<br /> }<br /> def restore {<br /> Utils.runInSwingThread {<br /> if (savedStyles nonEmpty) {<br /> val (fc, sc, st) = savedStyles.pop<br /> Impl.figure0.setFillColor(fc)<br /> Impl.figure0.setPenColor(sc)<br /> Impl.figure0.lineStroke = st<br /> }<br /> }<br /> }</p> </blockquote> <p>The key is making this stuff run in the swing thread. Without that, in the following code:</p> <blockquote> <p>S.stroke(color(228, 228, 228))<br /> S.background(black)</p> </blockquote> <p>the background call saves the old (red) color before the stroke call is able to change the pen color in the swing thread.</p> <p>Hope you see what's going on here?</p> <p>I haven't checked in the (very local) fix because this general issue needs to be taken into account at potentially other places within Staging (any time a Swing/Piccolo controlled attribute is being read or written).</p> <p>Thoughts?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-813393</guid>
				<title>Re: Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-813393</link>
				<description></description>
				<pubDate>Mon, 21 Jun 2010 21:58:50 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>The line() method [&#8230;] start x and y and the end x and y [&#8230;]</p> </blockquote> <p>Sure, done. That way fits better with SVG elements, too. The only reason for the x, y, w, h format was similarity to rectangles et al, and that was a weak argument.</p> <p>I've also changed <tt>vector</tt> accordingly.</p> <blockquote> <p>background() - clobbers the current stroke</p> </blockquote> <p>Oops yes, style save/restore was a bit under-implemented. Should work now.</p> <blockquote> <p>minute() - works incorrectly in my timezone (GMT + 5:30). I have fixed this (and checked in the fix).</p> </blockquote> <p>Thanks, I had no idea.</p> <blockquote> <p>I added some trigonometry functions</p> </blockquote> <p>OK, I didn't bother with standard math functions since they can be used anyway, but maybe this is a good idea.</p> <p>You've called π <tt>Pi</tt>; maybe for convenience and consistency (for Processing programmers) we should call it <tt>PI</tt> and also add <tt>HALF_PI</tt>, <tt>QUARTER_PI</tt>, and <tt>TWO_PI</tt>.</p> <p>Also, why not define <tt>radians</tt> as</p> <div class="code"> <pre><code>def radians(deg: Double) = deg.toRadians</code></pre></div> <blockquote> <p>Transformations</p> </blockquote> <p>Yes, I haven't quite got the hang of them yet. I'm trying to come up with a simple API to use them, but they don't seem to work as they should even when I do it the standard way. Lack of repainting is probably just the tip of the iceberg of my misunderstandings. It would be good if you took a look at it.</p> <blockquote> <p>Wiki syntax. How do you process it? Scaladoc2</p> </blockquote> <p>Ah no, that's too advanced for me. I use an AWK script to collect lines starting with <tt>&quot;\s*\/\/W&quot;</tt> and dump them in a file, and then I use <tt>diff</tt> within gVim to patch in the changes. Documentation lines that I don't want on the wiki page get their &quot;W&quot; changed to &quot;M&quot;, or the &quot;//W&quot; comment changed to a Scaladoc comment.</p> <p>I've pushed the changes mentioned here now.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-813143</guid>
				<title>Staging Feedback - Round 1</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-813143</link>
				<description></description>
				<pubDate>Mon, 21 Jun 2010 13:54:45 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I have started to play with Staging. It looks pretty good.</p> <p>The first example that I have written is: <a href="http://code.google.com/p/kojo/wiki/StagingClockExample?ts=1277127014&amp;updated=StagingClockExample">http://code.google.com/p/kojo/wiki/StagingClockExample?ts=1277127014&amp;updated=StagingClockExample</a></p> <p>Here's some feedback based on my experience/work with Staging so far:</p> <ul> <li>The line() method takes a start x and y, and a width and height. This is different from the line() method in the Processing API, which takes the start x and y and the end x and y. To me the latter seems more natural. Plus if we stick with the latter, it makes it easier for Processing folks to migrate to Staging. Thoughts?</li> <li>background() - clobbers the current stroke and sets the stroke to the default stroke.</li> <li>minute() - works incorrectly in my timezone (GMT + 5:30). I have fixed this (and checked in the fix).</li> <li>I added some trigonometry functions (and I just realized that I got the spelling of trigonometry wrong inside staging.scala! Will fix this on the next checkin).</li> <li>Transformations - don't repaint and show the updated shape. I'll have more feedback on this after I experiment with this some more.</li> </ul> <p>I noticed that a lot of your scaladoc is in Wiki syntax. How do you process it? Scaladoc2 or something?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-802373</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-802373</link>
				<description></description>
				<pubDate>Mon, 07 Jun 2010 02:20:04 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>How about p.onX / p.onY?</p> </blockquote> <p>That sounds good.</p> <p>How's stuff coming along with transformations and styles (I see from your repo that you've been working in this area)? Any complications?</p> <p>Fyi - I'm gonna be off (this time for a about a week) again in a couple of days. I'll take a closer look at what you're upto after that, and will hopefully write a sample or two of my own (for Staging) at that point.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-798783</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-798783</link>
				<description></description>
				<pubDate>Wed, 02 Jun 2010 06:40:39 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>these seem like good candidates [&#8230;]</p> </blockquote> <p>Sure. I'll take transformations next.</p> <blockquote> <p>Yup, the terminology doesn't sound right.</p> </blockquote> <p>Meh. But yeah. How about p.onX / p.onY?</p> <p>Well, later then. Have a good vacation!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-798713</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-798713</link>
				<description></description>
				<pubDate>Wed, 02 Jun 2010 03:15:50 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>Also: a new example on the wiki page, based on your own Sine of an angle example, but using Staging instead.</p> </blockquote> <p>Looks great!</p> <blockquote> <p>For this example I added two methods to Point. For a point p = point(x, y), p.abscissa returns the point (x, 0) and p.ordinate returns the point (0, y). It's not quite the right terminology, but close enough?</p> </blockquote> <p>Yup, the terminology doesn't sound right. I would think that methods called abscissa and ordinate on a Point would return doubles.</p> <p>From an earlier message:</p> <blockquote> <p>(e.g. can you settle for stroke (which I prefer) or do you think it needs to be called setPenColor (which I can live with if it so be))?</p> </blockquote> <p>setPenColor came from a desire to be kid friendly for the Turtle stuff. Stroke sounds fine for Staging.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-798696</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-798696</link>
				<description></description>
				<pubDate>Wed, 02 Jun 2010 02:49:19 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>Hmm, assert against a regex instead, set a locale in the source, or set a locale in the build?</p> </blockquote> <p>'Assert against a regex' sounds the most straightforward. We could also use DecimalFormat (which seems Locale sensitive as per its Javadoc).</p> <blockquote> <p>We probably need to define &quot;ready&quot;.</p> </blockquote> <p>I still need to dig into things, but off the top of my head, these seem like good candidates for the first release:</p> <ul> <li>Styles (with save/restore or push/pop)</li> <li>Mouse support</li> <li>Transformations at the shape or stage (or both?) level</li> </ul> <p>Thoughts?</p> <p>I'm off for a couple of days - so you won't hear from me for a bit&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-798561</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-798561</link>
				<description></description>
				<pubDate>Tue, 01 Jun 2010 22:58:58 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Crap. Yes, the decimal comma is a Swedish (~/European) thing. I was trying to avoid it in the *ShapesTest tests by using %g instead, but I just didn't notice it in PointTest. Hmm, assert against a regex instead, set a locale in the source, or set a locale in the build?</p> <p>The other bug didn't appear here with either RC2 or RC3. Hopefully it will stay fixed now.</p> <p>Also: a new example on the wiki page, based on your own Sine of an angle example, but using Staging instead.</p> <p>For this example I added two methods to Point. For a point <tt>p = point(x, y)</tt>, <tt>p.abscissa</tt> returns the point (x, 0) and <tt>p.ordinate</tt> returns the point (0, y). It's not quite the right terminology, but close enough?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797912</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797912</link>
				<description></description>
				<pubDate>Tue, 01 Jun 2010 03:58:29 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I got the latest changes, ran the tests, and saw two test failures:</p> <ul> <li>PointTest.test1() - I could be wrong, but this seems related to the JVM Locale. The test seems to want to represent the decimal point as a comma (is that the Swedish way?), whereas on my machine/JVM (running with the default Locale), decimal points are represented as periods. That leads to an assertion failure.</li> <li>ComplexShapesTest.test1 - For this one, using Scala 2.8.0 RC3, I was running into the dreaded exception related to class dependencies not being found for edu.umd.*. I tracked this down to a bug in ScalaCodeRunner (an outdated jar name in the classpath string for the interpreter!). This has been fixed. Quite amazingly, the test (the test code run interactively via the Kojo App, to be precise) was working fine with Scala 2.8.0 RC2!!</li> </ul> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797715</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797715</link>
				<description></description>
				<pubDate>Mon, 31 May 2010 22:07:52 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>Did you check in the tests? I did a pull, but didn't get any test changes…</p> </blockquote> <p>Oops no. I have now.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797623</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797623</link>
				<description></description>
				<pubDate>Mon, 31 May 2010 19:45:41 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>I've changed the tests now, and it passes all tests without any change in the executing code.</p> </blockquote> <p>Did you check in the tests? I did a pull, but didn't get any test changes&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797607</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797607</link>
				<description></description>
				<pubDate>Mon, 31 May 2010 19:26:21 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'll start digging in and will then provide feedback. This could be a little sporadic, as I'll be traveling in the mountains over the next couple of weeks, with limited connectivity.</p> <p>There's no particular reason to 'release' Staging with the Scala 2.8.0-final build of Kojo (I mentioned it because it just happens to be a convenient build coming along in a couple of weeks). Let's see what definition of 'ready' we come up with. We'll then take it from there to determine when to 'release' Staging.</p> <p>Sound Ok?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797545</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797545</link>
				<description></description>
				<pubDate>Mon, 31 May 2010 17:34:51 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><em>I'll publish another Kojo build when Scala 2.8.0 final comes out (most likely within a couple of weeks). Would Staging be ready for its first 'release' by then?</em></p> <p>It could be. There is a lot I want to add which probably won't be ready in the next few weeks, but most of it isn't necessary for Staging to be useful.</p> <p>We probably need to define &quot;ready&quot;. Is there anything you find missing at this point? Is there anything you'd want to adjust (e.g. can you settle for <tt>stroke</tt> (which <em>I</em> prefer) or do you think it needs to be called <tt>setPenColor</tt> (which I can live with if it so be))? Will the examples on the wiki do for sample code, or should I write better ones?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797537</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797537</link>
				<description></description>
				<pubDate>Mon, 31 May 2010 17:08:29 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>You know the feeling, when you make a change and think to yourself &quot;I don't need to run the tests now, because I didn't change the way it works&quot;. Well, surprise, if someone else runs the tests they will <em>still</em> fail, because even if you didn't change the way it works, the way it works will have changed.</p> <p>In this case, however, it was the test data that was bad. Specifically, the dumping format changed from %.4g to %.2g when I moved tests from one file to another (note to self, I really need to move the dumping code to an external class so it will be consistent) but didn't change (all) the strings that are asserted against. E.g. &quot;10,20&quot; was compared to &quot;10.00,20.00&quot;.</p> <p>I've changed the tests now, and it passes all tests without any change in the executing code.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797373</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797373</link>
				<description></description>
				<pubDate>Mon, 31 May 2010 10:01:17 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Merge done.</p> <p>A couple of Staging tests are failing. Please take a quick look to see if you can spot what's wrong. Note - I'm running locally with Scala 2.8.0-RC3.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797202</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797202</link>
				<description></description>
				<pubDate>Mon, 31 May 2010 03:24:17 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>I'm FINALLY getting up to speed again. I've updated the wiki page with some examples and re-arranged the documentation some.</p> </blockquote> <p>Good to see you chugging along (even as I take a little break at the start of the school summer vacations here in India).</p> <blockquote> <p>Of course, some more stuff needs to be merged into Kojo now, if you don't mind.</p> </blockquote> <p>No problems. Will do it today.</p> <p>I'll publish another Kojo build when Scala 2.8.0 final comes out (most likely within a couple of weeks). Would Staging be ready for its first 'release' by then?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-797044</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-797044</link>
				<description></description>
				<pubDate>Sun, 30 May 2010 22:04:06 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'm FINAL<strong>LY</strong> getting up to speed again. I've updated the wiki page with some examples and re-arranged the documentation some.</p> <p>Of course, some more stuff needs to be merged into Kojo now, if you don't mind.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-789420</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-789420</link>
				<description></description>
				<pubDate>Thu, 20 May 2010 18:22:46 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>It seems fine so far.</p> </blockquote> <p>Sounds good.</p> <p>Also, a quick clarification for something I wrote in an earlier message:</p> <blockquote> <p>And a multi-sprite animation toolkit (with collision detection etc, along the lines of Scratch/BlueJ) would also be great.</p> </blockquote> <p>I meant Greenfoot when I said BlueJ.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-788636</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-788636</link>
				<description></description>
				<pubDate>Wed, 19 May 2010 21:31:05 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>It seems fine so far. I've only added a few minor methods yet, hopefully I'll have more time available tomorrow.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-787372</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-787372</link>
				<description></description>
				<pubDate>Tue, 18 May 2010 16:17:54 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>I think it's better if you do it, both because it will most likely fit in better with your design and because it will probably expose any nasty gotchas in my design that way.</p> </blockquote> <p>I have taken an initial stab at this. The code is checked it. It compiles. All the tests pass. It must be good ;)</p> <p>Critical feedback is welcome. There were at least a couple of different ways to do this. I went with a pretty lightweight approach (which I have not been able to find fault with so far).</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-786250</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-786250</link>
				<description></description>
				<pubDate>Mon, 17 May 2010 13:24:50 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>On a higher level, I'd very much like to see something like Karel the Robot to complement the Turtle approach (I think the Turtle is an ingenious tool, but Karel is pretty nifty, too). Perhaps even something like Scratch, but that's a long shot.</p> </blockquote> <p>Sounds very cool. Karel the Robot would be a good next step for students who 'graduate' from the Turtle stuff. And a multi-sprite animation toolkit (with collision detection etc, along the lines of Scratch/BlueJ) would also be great. In fact, once you have the latter, you could build the former on it.</p> <blockquote> <p>I think it's better if you do it, both because it will most likely fit in better with your design and because it will probably expose any nasty gotchas in my design that way.</p> </blockquote> <p>No problem. I'll do it over the next couple of days.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-786070</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-786070</link>
				<description></description>
				<pubDate>Mon, 17 May 2010 07:54:28 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>please think of some 'impressive' samples that we can put under the Samples menu.</p> </blockquote> <p>Um yes. I've written up quite a few samples but haven't shared them very much yet. This is mostly because I've tinkered with the syntax so much &#8212; I have to change the samples back and forth, and I fear that any samples I upload will become incompatible with what Staging actually can do. I will deliver, though.</p> <blockquote> <p>What might the other stuff be?</p> </blockquote> <p>Some of it has already been in StagingAPI (at least partially) but was taken out: color modes and settings, styles, time reading, loop control, mouse access. Some of it is pending: transformations, image dump, animations, keyboard access, web access, file access, text handling.</p> <p>On a higher level, I'd very much like to see something like Karel the Robot to complement the Turtle approach (I think the Turtle is an ingenious tool, but Karel is pretty nifty, too). Perhaps even something like Scratch, but that's a long shot.</p> <blockquote> <p>Do you want to go ahead and do this (making a package etc), then, before I do a merge?</p> </blockquote> <p>I think it's better if you do it, both because it will most likely fit in better with your design and because it will probably expose any nasty gotchas in <em>my</em> design that way.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-786050</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-786050</link>
				<description></description>
				<pubDate>Mon, 17 May 2010 06:38:10 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>To begin with, it was because of I wanted to explore PVector-based shaping. Then, when we decided not to pursue that idea, I started looking at the existing shape classes to see how I could do Processing-style things with them. The way I see it, it would be very hard to write it, and every effort to develop Staging would risk clashing with future changes/extensions to the Kojo shape class system. A separate shape hierarchy is a way to 1) get around that problem, 2) allow complex shapes, SVG shapes etc to be added and share the same basics, 3) make Staging more cohesive.</p> </blockquote> <p>Fair enough.</p> <p>Based on your feedback - I think I'll just import your stuff into Kojo as-is. We'll let Staging and Canvas co-exist as separate 'modules' for now.</p> <p>I'm not planning to work on Canvas in the near future. Let's see how Staging evolves, and then we can think about what to do with Canvas (we can just retire it if Staging does what it does, and more).</p> <p>As you add more stuff to Staging, please think of some 'impressive' samples that we can put under the Samples menu.</p> <blockquote> <p>As I've hinted before, shapes is only one part of what I want to put into Staging</p> </blockquote> <p>Would you mind talking about this a little bit. What might the other stuff be?</p> <blockquote> <p>That sounds good. As I've hinted before, shapes is only one part of what I want to put into Staging, and a package is much better than a humongous object. In fact, I would have made it a package myself but using an inner object seemed more appropriate for experimentation.</p> </blockquote> <p>Do you want to go ahead and do this (making a package etc), then, before I do a merge?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-785265</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-785265</link>
				<description></description>
				<pubDate>Sun, 16 May 2010 09:46:12 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>The basic idea here is to make the StagingAPI object as simple as possible, while giving the various Staging classes/objects a place of their own to live in. How does that sound?</p> </blockquote> <p>That sounds good. As I've hinted before, shapes is only one part of what I want to put into Staging, and a package is much better than a humongous object. In fact, I would have made it a package myself but using an inner object seemed more appropriate for experimentation.</p> <blockquote> <p>Why two Rectangles - one inside core.shapes, and the other inside Staging?</p> </blockquote> <p>To begin with, it was because of I wanted to explore PVector-based shaping. Then, when we decided not to pursue that idea, I started looking at the existing shape classes to see how I could do Processing-style things with them. The way I see it, it would be very hard to write it, and every effort to develop Staging would risk clashing with future changes/extensions to the Kojo shape class system. A separate shape hierarchy is a way to 1) get around that problem, 2) allow complex shapes, SVG shapes etc to be added and share the same basics, 3) make Staging more cohesive.</p> <blockquote> <p>Why a separate draw method in the Shape trait (the core.VisualElement trait already has show and hide methods).</p> </blockquote> <p>It is different because it creates and draws the shape, while show makes an already existing shape visible. Intuitively, all shapes should stem from a fundamental member of Shape, I think. Still, the way it's done now might not be the best way to do it.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-785141</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-785141</link>
				<description></description>
				<pubDate>Sun, 16 May 2010 04:26:14 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Here's some quick (I'm heading out for the day) feedback:</p> <ul> <li>Looks very nice and clean overall.</li> <li>To me, the most natural way of merging this into Kojo appears to be - to move all the classes/objects inside the StagingAPI object into a new staging package. The 'facade' methods would remain inside StagingAPI. The basic idea here is to make the StagingAPI object as simple as possible, while giving the various Staging classes/objects a place of their own to live in. How does that sound?</li> <li>Some additional questions: <ul> <li>This one is a particular case of a more general question. Why two Rectangles - one inside core.shapes, and the other inside Staging?</li> <li>Why a separate draw method in the Shape trait (the core.VisualElement trait already has show and hide methods).</li> </ul> </li> </ul> <p>Do some of the answers to the above relate to the desire to have a non-overlapping sandbox for Staging?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-784961</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-784961</link>
				<description></description>
				<pubDate>Sat, 15 May 2010 22:19:07 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Oops, a few typos found!</p> <p>The comments and variable names for the ellipse-creating methods were misleading, so I changed them. There was also a bug in the translation from an SVG line element to the corresponding line-creating method.</p> <p>I've pushed a changeset with these corrections, and updated both documentation pages.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-784870</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-784870</link>
				<description></description>
				<pubDate>Sat, 15 May 2010 19:07:24 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I forgot to mention that I had put together a sort of manifest for the changes I've made, to make it easier to find what's where.</p> <p>In the file ScalaCodeRunner.scala, I've added the Staging namespace to the interpreter</p> <div class="code"> <pre><code>+ interp.interpret(&quot;val Staging = predef.StagingAPI&quot;)</code></pre></div> <p>and, of course, the StagingAPI object</p> <div class="code"> <pre><code>+ object StagingAPI { ---etc etc---</code></pre></div> <p>In the file figure/Figure.scala, I added a method to let my testing code look at shapes added to the canvas:</p> <div class="code"> <pre><code>+ def dumpChild(n: Int): PNode = { + try { + currLayer.getChild(n) + } + catch { case e =&gt; throw e } + }</code></pre></div> <p>and declaractions for shape classes I added:</p> <div class="code"> <pre><code>+ type FRRectangle = FigRoundRectangle + type FPath = FigPath</code></pre></div> <p>and corresponding drawing methods:</p> <div class="code"> <pre><code>+ def roundRectangle(p1: Point, p2: Point, rx: Double, ry: Double) = { + val rrect = new FigRoundRectangle(canvas, p1, p2, rx, ry) + Utils.runInSwingThread { + rrect.pRect.setStroke(lineStroke) + rrect.pRect.setStrokePaint(lineColor) + rrect.pRect.setPaint(fillColor) + currLayer.addChild(rrect.pRect) + currLayer.repaint() + } + rrect + } + def polyLine(path: kgeom.PolyLine): kgeom.PolyLine = { + Utils.runInSwingThread { + path.setStroke(lineStroke) + path.setStrokePaint(lineColor) + path.setPaint(fillColor) + currLayer.addChild(path) + currLayer.repaint() + } + path + } + def path(descriptor: String): FigPath = { + val path = new FigPath(canvas, descriptor) + Utils.runInSwingThread { + path.pPath.setStroke(lineStroke) + path.pPath.setStrokePaint(lineColor) + path.pPath.setPaint(fillColor) + currLayer.addChild(path.pPath) + currLayer.repaint + } + path + }</code></pre></div> <p>I added a few files:</p> <div class="code"> <pre><code>figure/FigRoundRectangle.scala figure/FigPath.scala test/. . ./Staging/ScreenMethodsTest.scala test/. . ./Staging/ShapesTest.scala test/. . ./Staging/Shapes2Test.scala</code></pre></div> <p>In the file core/Figure.scala, I added declarations for the shape types and methods:</p> <div class="code"> <pre><code>+ type FRRectangle &lt;: RoundRectangle with VisualElement + type FPath &lt;: Path with VisualElement + def roundRectangle(p1: Point, p2: Point, rx: Double, ry: Double): FRRectangle + def polyLine(path: net.kogics.kojo.kgeom.PolyLine): net.kogics.kojo.kgeom.PolyLine + def path(descr: String): FPath</code></pre></div> <p>In the file core/shapes.scala, I added some methods for Point:</p> <div class="code"> <pre><code> class Point(val x: Double, val y: Double) { + def +(that: Point) = new Point(this.x + that.x, this.y + that.y) + def -(that: Point) = new Point(this.x - that.x, this.y - that.y) + def unary_- = new Point(-x, -y) override def toString = &quot;Point(%.2f, %.2f)&quot; format(x, y) }</code></pre></div> <p>In the file core/shapes.scala, I added some methods for Point:</p> <div class="code"> <pre><code>+class RoundRectangle( + override val bLeft: Point, + override val tRight: Point, + rx: Double, ry: Double +) extends Rectangle(bLeft, tRight)</code></pre></div> <p>and the class Path:</p> <div class="code"> <pre><code>+class Path(val descriptor: String)</code></pre></div> <p>That should be it.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-784804</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-784804</link>
				<description></description>
				<pubDate>Sat, 15 May 2010 16:45:32 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Ok - good. I'll start digging into things&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-784793</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-784793</link>
				<description></description>
				<pubDate>Sat, 15 May 2010 16:30:12 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Oh! Well, I'm done now.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-784782</guid>
				<title>Re: Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-784782</link>
				<description></description>
				<pubDate>Sat, 15 May 2010 16:17:14 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Sounds good to me.<br /> Lemme know when you're done with (1).</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-784724</guid>
				<title>Wrapping up</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-784724</link>
				<description></description>
				<pubDate>Sat, 15 May 2010 14:47:17 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'm fairly happy with the shapes right now, so I think it's a good time to consider merging it into Kojo if you want it.</p> <p>I suggest the following procedure:</p> <ol> <li>I'm currently reverting/taking out all changes aren't directly coupled with the contents of StagingAPI</li> <li>When that is finished (which should be later today), you should look it over and tell me which parts you find questionable, if any</li> <li>I make changes as necessary and hand it over to you</li> </ol> <p>ETA: finished step 1 and pushed the result.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-777959</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-777959</link>
				<description></description>
				<pubDate>Sat, 08 May 2010 04:42:01 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Sounds good.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-777757</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-777757</link>
				<description></description>
				<pubDate>Fri, 07 May 2010 23:21:43 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>On second thoughts, it might be better to revisit that later. I'd like to</p> <ol> <li>have a single consistent class hierarchy</li> <li>bring more kinds of shapes into it</li> <li>make it testable</li> <li>encapsulate more than just the dimensions of the shape</li> <li>&#8230;</li> </ol> <p>and at least 1&#8212;3 can be done with calls to Figure methods. When that baseline is stable and testable, we can discuss deeper implementation issues.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-777070</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-777070</link>
				<description></description>
				<pubDate>Fri, 07 May 2010 03:42:42 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>What's the best way for me to reproduce the problem? A version of ScalaCodeRunner with the above modifications to the Shape hierarchy? If so - please send it to me, and I'll try to see what's going on.</p> <p>Note - I have pulled the latest changes from your clone/branch, so hopefully I will just need to plop in the modified ScalaCodeRunner to be up and running&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-776023</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-776023</link>
				<description></description>
				<pubDate>Wed, 05 May 2010 22:13:03 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>What I have right now is a hierarchy of traits, classes, and objects that define as much as possible about shapes in themselves, and let shapes be created such that e.g. <tt>line(p1, p2)</tt> -&gt; <tt>Line(p1, p2)</tt> which a) puts a shape on the canvas and b) returns an instance that can draw that shape again. It can also make new shapes based on the old shapes, e.g. <tt>val a = line(p1, p2) ; val b = a.toRectangle</tt> makes <tt>a</tt> a line and <tt>b</tt> a rectangle over <tt>p1</tt> and <tt>p2</tt>.</p> <p>Currently, it looks like</p> <div class="code"> <pre><code> trait Shape { def draw: Unit } trait BaseShape extends Shape { val origin: Point } // snip several traits class Dot(val origin: Point) extends BaseShape { private val (x, y) = (origin.x, origin.y) def draw { tCanvas.figure0.point(x, y) } def toLine(p: Point): Line = Line(origin, p) } object Dot { def apply(p: Point) = { val shape = new Dot(p) shape.draw shape } }</code></pre></div> <p>But I wanted to make it even more self-contained and create PPath instances directly and add them to the canvas, like this:</p> <div class="code"> <pre><code> trait Shape { val ppath: PPath def draw { tCanvas.figure0.ppath(ppath) } protected val canvas = SpriteCanvas.instance net.kogics.kojo.util.Throttler.throttle() ppath.setPaint(style.fill) ppath.setStrokePaint(style.stroke) ppath.setStroke(style.strokeStyle.toStroke) def hide() { ppath.setVisible(false) canvas.repaint() } def show() { ppath.setVisible(true) canvas.repaint() } } trait BaseShape extends Shape { val origin: Point } // snip class Dot(val origin: Point) extends BaseShape { val (x, y) = (origin.x.toFloat, origin.y.toFloat) val ppath = PPath.createLine(x, y, x, y) def toLine(p: Point): Line = Line(origin, p) } object Dot { def apply(p: Point) = { val shape = new Dot(p) shape.draw shape } }</code></pre></div> <p>Which won't work, instead it gives me the exception I quoted earlier.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-774721</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-774721</link>
				<description></description>
				<pubDate>Tue, 04 May 2010 17:30:33 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>You can set this in nbproject/project.properties:<br /> scalac.unchecked=yes</p> </blockquote> <p>I forgot to mention - this needs to be done within the KojoEnv Module.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-774716</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-774716</link>
				<description></description>
				<pubDate>Tue, 04 May 2010 17:26:55 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>1. Can you tell me how to add the &quot;-unchecked&quot; flag when building?</p> </blockquote> <p>You can set this in nbproject/project.properties:<br /> scalac.unchecked=yes</p> <blockquote> <p>2. Do you have any idea what the following problem is?</p> <p>SEVERE [net.kogics.kojo.xscala.ScalaCodeRunner]: Interpreter Problem<br /> java.io.IOException: class file needed by ScalaCodeRunner is missing.<br /> reference value edu of package &lt;root&gt; refers to nonexisting symbol.</p> </blockquote> <p>The only package in there that starts with edu is the Piccolo stuff. It looks like you're making use of something inside Piccolo that has a dependency which is not on the Classpath.</p> <p>Some questions for you:<br /> Are you using any Piccolo classes directly within your code?<br /> Did you start seeing this problem after adding a particular chunk of code within Kojo?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-774497</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-774497</link>
				<description></description>
				<pubDate>Tue, 04 May 2010 13:41:20 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'm still refactoring and finding out how to do testing in this enviroment, and encountered a problem. The project compiles without errors (but some warnings), but when I try to run an example it bombs (dump below).</p> <p>1. Can you tell me how to add the &quot;-unchecked&quot; flag when building?</p> <p>2. Do you have any idea what the following problem is?</p> <p>When running the following script:</p> <p>import Staging._<br /> clear<br /> Screen.size(250, 250)<br /> val a = Point(15, 15)<br /> dot(a)</p> <p>I get:</p> <p>SEVERE [net.kogics.kojo.xscala.ScalaCodeRunner]: Interpreter Problem<br /> java.io.IOException: class file needed by ScalaCodeRunner is missing.<br /> reference value edu of package &lt;root&gt; refers to nonexisting symbol.<br /> at scala.reflect.generic.UnPickler$Scan.errorMissingRequirement(UnPickler.scala:755)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan.errorMissingRequirement(UnPickler.scala:44)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan.errorMissingRequirement(UnPickler.scala:29)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbol(UnPickler.scala:195)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbolRef(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbol(UnPickler.scala:178)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbolRef(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbol(UnPickler.scala:178)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbolRef(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbol(UnPickler.scala:178)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbolRef(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbol(UnPickler.scala:178)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readSymbolRef$1.apply(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.reflect.generic.UnPickler$Scan.readSymbolRef(UnPickler.scala:709)<br /> at scala.reflect.generic.UnPickler$Scan.readType(UnPickler.scala:273)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:710)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:710)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.reflect.generic.UnPickler$Scan.readTypeRef(UnPickler.scala:710)<br /> at scala.reflect.generic.UnPickler$Scan.readType(UnPickler.scala:283)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:710)<br /> at scala.reflect.generic.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:710)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.reflect.generic.UnPickler$Scan.readTypeRef(UnPickler.scala:710)<br /> at scala.reflect.generic.UnPickler$Scan.readType(UnPickler.scala:304)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan.protected$readType(UnPickler.scala:59)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan$LazyTypeRef$$anonfun$1.apply(UnPickler.scala:59)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan$LazyTypeRef$$anonfun$1.apply(UnPickler.scala:59)<br /> at scala.reflect.generic.UnPickler$Scan.at(UnPickler.scala:151)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan.protected$at(UnPickler.scala:59)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan$LazyTypeRef.complete(UnPickler.scala:59)<br /> at scala.tools.nsc.symtab.classfile.UnPickler$CompileScan$LazyTypeRef.load(UnPickler.scala:64)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.typeParams(Symbols.scala:926)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$scala$tools$nsc$transform$SpecializeTypes$$normalizeMember$1.apply(SpecializeTypes.scala:607)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$scala$tools$nsc$transform$SpecializeTypes$$normalizeMember$1.apply(SpecializeTypes.scala:607)<br /> at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:104)<br /> at scala.tools.nsc.transform.SpecializeTypes.scala$tools$nsc$transform$SpecializeTypes$$normalizeMember(SpecializeTypes.scala:607)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$8.apply(SpecializeTypes.scala:571)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$8.apply(SpecializeTypes.scala:569)<br /> at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:224)<br /> at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:224)<br /> at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:62)<br /> at scala.collection.immutable.List.foreach(List.scala:46)<br /> at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:224)<br /> at scala.collection.immutable.List.flatMap(List.scala:46)<br /> at scala.tools.nsc.transform.SpecializeTypes.specializeClass(SpecializeTypes.scala:569)<br /> at scala.tools.nsc.transform.SpecializeTypes.transformInfo(SpecializeTypes.scala:836)<br /> at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:36)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.rawInfo(Symbols.scala:809)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:753)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14$$anonfun$apply$9.apply(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14$$anonfun$apply$9.apply(SpecializeTypes.scala:833)<br /> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:203)<br /> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:203)<br /> at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:62)<br /> at scala.collection.immutable.List.foreach(List.scala:46)<br /> at scala.collection.TraversableLike$class.map(TraversableLike.scala:203)<br /> at scala.collection.immutable.List.map(List.scala:46)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14.apply(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14.apply(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:104)<br /> at scala.tools.nsc.transform.SpecializeTypes.transformInfo(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:36)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.rawInfo(Symbols.scala:809)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:753)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14$$anonfun$apply$9.apply(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14$$anonfun$apply$9.apply(SpecializeTypes.scala:833)<br /> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:203)<br /> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:203)<br /> at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:62)<br /> at scala.collection.immutable.List.foreach(List.scala:46)<br /> at scala.collection.TraversableLike$class.map(TraversableLike.scala:203)<br /> at scala.collection.immutable.List.map(List.scala:46)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14.apply(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.transform.SpecializeTypes$$anonfun$14.apply(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:104)<br /> at scala.tools.nsc.transform.SpecializeTypes.transformInfo(SpecializeTypes.scala:833)<br /> at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:36)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.rawInfo(Symbols.scala:809)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:753)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.flatOwnerInfo(Symbols.scala:1294)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.companionModule0(Symbols.scala:1252)<br /> at scala.tools.nsc.symtab.Symbols$Symbol.companionModule(Symbols.scala:1260)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.javaName(GenJVM.scala:1740)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.javaType(GenJVM.scala:1830)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.javaType(GenJVM.scala:1834)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.javaType(GenJVM.scala:1839)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genBlock$1$1.apply(GenJVM.scala:1136)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genBlock$1$1.apply(GenJVM.scala:1046)<br /> at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:35)<br /> at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:35)<br /> at scala.tools.nsc.backend.icode.BasicBlocks$BasicBlock.foreach(BasicBlocks.scala:138)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genBlock$1(GenJVM.scala:1046)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genBlocks$1(GenJVM.scala:973)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genCode(GenJVM.scala:1580)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genMethod(GenJVM.scala:649)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genClass$4.apply(GenJVM.scala:258)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genClass$4.apply(GenJVM.scala:258)<br /> at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:62)<br /> at scala.collection.immutable.List.foreach(List.scala:46)<br /> at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genClass(GenJVM.scala:258)<br /> at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.apply(GenJVM.scala:57)<br /> at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$3.apply(GenJVM.scala:53)<br /> at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$3.apply(GenJVM.scala:53)<br /> at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:90)<br /> at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:90)<br /> at scala.collection.Iterator$class.foreach(Iterator.scala:627)<br /> at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:162)<br /> at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:195)<br /> at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)<br /> at scala.collection.mutable.HashMap$$anon$2.foreach(HashMap.scala:90)<br /> at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run(GenJVM.scala:53)<br /> at scala.tools.nsc.Global$Run.compileSources(Global.scala:729)<br /> at scala.tools.nsc.Interpreter.compileAndSaveRun(Interpreter.scala:549)<br /> at scala.tools.nsc.Interpreter$Request.objRun(Interpreter.scala:904)<br /> at scala.tools.nsc.Interpreter$Request.compile(Interpreter.scala:927)<br /> at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:616)<br /> at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:608)<br /> at net.kogics.kojo.xscala.ScalaCodeRunner$InterpActor.interpretAllLines(ScalaCodeRunner.scala:294)<br /> at net.kogics.kojo.xscala.ScalaCodeRunner$InterpActor.interpret(ScalaCodeRunner.scala:298)<br /> at net.kogics.kojo.xscala.ScalaCodeRunner$InterpActor$$anonfun$act$1.apply(ScalaCodeRunner.scala:174)<br /> at net.kogics.kojo.xscala.ScalaCodeRunner$InterpActor$$anonfun$act$1.apply(ScalaCodeRunner.scala:159)<br /> at scala.actors.Actor$class.receive(Actor.scala:456)<br /> at net.kogics.kojo.xscala.ScalaCodeRunner$InterpActor.receive(ScalaCodeRunner.scala:131)<br /> at net.kogics.kojo.xscala.ScalaCodeRunner$InterpActor.act(ScalaCodeRunner.scala:159)<br /> at scala.actors.Reaction$$anonfun$$init$$1.apply(Reaction.scala:30)<br /> at scala.actors.Reaction$$anonfun$$init$$1.apply(Reaction.scala:30)<br /> at scala.actors.ReactorTask.run(ReactorTask.scala:38)<br /> at scala.concurrent.forkjoin.ForkJoinPool$AdaptedRunnable.exec(ForkJoinPool.java:611)<br /> at scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422)<br /> at scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340)<br /> [catch] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325)<br /> INFO [net.kogics.kojo.xscala.ScalaCodeRunner]: CodeRunner actor doing final handling for code.<br /> INFO [net.kogics.kojo.xscala.ScalaCodeRunner]: Interpreter Done notification received<br /> BUILD SUCCESSFUL (total time: 3 minutes 43 seconds)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-772133</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-772133</link>
				<description></description>
				<pubDate>Sun, 02 May 2010 03:43:49 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>There is supposed to be a method to a lot of the (seeming) madness inside Kojo:</p> <blockquote> <p>Well, it's not immediately obvious that tCanvas works with the turtle and figure0 works with the canvas :)</p> </blockquote> <p>The part of Kojo where the default turtle, called turtle0, paints - is the Turtle Canvas (aka tCanvas). The default turtle is accessible as tCanvas.turtle0</p> <p>Figures implement the Processing-like stuff within Kojo. The default figure, called figure0, shares window space with the Turtle Canvas. It is accesible via tCanvas.figure0. At the API level, the default figure is called the Canvas.</p> <p>Out of the box, Kojo tries to make it as easy as possible (for kids) to work with Turtles, so tCanvas implements wrappers for all turtle methods, and delegates to turtle0.</p> <p>Note to myself - this last step may no longer be necessary, given the Builtins object.</p> <blockquote> <p>The shape class system is a bit complex too.</p> </blockquote> <p>This was driven by the desire to keep the same shape hierarchy for both Figures and MathWorld, and the fact that method args cannot be covariant (this bites in the signatures for MathWorld).</p> <p>Note to myself - would it be worthwhile to make the Figure method signatures a little simpler?</p> <blockquote> <p>Fortunately your code is quite readable, so it's not very hard to figure out what it does or what goes where.</p> </blockquote> <p>I'm amazed that you've figured out as much stuff as you have - without pretty much any documentation in the code!</p> <blockquote> <p>I'm perfectly fine, even a bit flattered, if you bring the name &quot;Staging&quot; into Kojo,</p> </blockquote> <p>Great.</p> <blockquote> <p>but in that case I'll start a new API object with another name. I want to have a sandbox that is as disjoint from Kojo as it can be.</p> </blockquote> <p>The disjoint sandbox idea makes good sense.</p> <p>I'll wait for you to polish off your shapes hierarchy and write some unit tests before I start doing the merge&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-771856</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-771856</link>
				<description></description>
				<pubDate>Sat, 01 May 2010 19:30:30 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'm perfectly fine, even a bit flattered, if you bring the name &quot;Staging&quot; into Kojo, but in that case I'll start a new API object with another name. I want to have a sandbox that is as disjoint from Kojo as it can be.</p> <p>A single shape hierarchy is of course preferable, but whatever part of Kojo I tinker with, I will create my own counterpart of the standard item just to see if it can be done another way. And also to have a known baseline: I know what my code does, but sometimes your code doesn't do what I think it does.</p> <p>My ShapeStyle goof is a case in point. I didn't use that code when writing/testing the shape classes, I just thought I needed it to accomodate SVG basic shapes later (and now I think there are better solutions), so I put the methods in and made them compile. Now, where is the Kojo style functionality? Oh, it's in SpriteCanvas, so I use tCanvas, right? Oops. Well, it's not immediately obvious that tCanvas works with the turtle and figure0 works with the canvas :)</p> <p>The shape class system is a bit complex too. To add rounded rectangles, I need to put</p> <ul> <li>a RoundRectangle class in core/shapes.scala</li> <li>a FRRectangle type declaration and a declaration of the roundRectangle method in core/Figure.scala</li> <li>another FRRectangle type declaration and an implementation of roundRectangle in figure/Figure.scala</li> <li>a FigRectangle class in figure/FigRectangle.scala</li> </ul> <p>Fortunately your code is quite readable, so it's not very hard to figure out what it does or what goes where.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-771828</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-771828</link>
				<description></description>
				<pubDate>Sat, 01 May 2010 18:15:11 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>I'm ready if you are, but I'd prefer to first:</p> <p>* refactor the class hierarchy, for instance decouple style from shape and make polyline and polygon subclasses of an abstract polyshape</p> </blockquote> <p>Please go ahead and do this, to take your current work to a logical finishing point. I'll then take your stuff and merge it into Kojo. I'll keep you in the loop as I do this, so that we can come up with something that both of us like (read on for more about this).</p> <blockquote> <p>* know where you want to put it; as I understand it Staging isn't going into Kojo proper</p> </blockquote> <p>I see at least two options:</p> <ul> <li>Pull Staging as-is into Kojo.</li> <li>Roll Staging into Figure and other support classes within the figure package, and maybe still call it Staging at the API level (I like the idea of people 'staging' animations with Kojo).</li> </ul> <p>I'll get a sense of which option looks more promising as I start doing the merge and digging deeper into the code.</p> <p>Some random thoughts based on a cursory look at the Staging code:</p> <ul> <li>I'll try to see if we can get by with just one Shapes class hierarchy (there's already one in the core package, and now Staging has another, independent one).</li> <li>ShapeStyle.withTempStyle looks like a method that probably does not do what you want it to do - because of the calls it makes into tCanvas. Most tCanvas methods delegate to turtle0 (the default turtle), and you probably want this method to call into tCanvas.figure0 (aka 'the Canvas').</li> </ul> <blockquote> <p>* write some unit tests</p> </blockquote> <p>That would be good. If they're high level tests against the Staging API (i.e. Staging.whatever) - they'll help me make sure that I didn't break anything.</p> <p>Thoughts?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-771746</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-771746</link>
				<description></description>
				<pubDate>Sat, 01 May 2010 16:21:01 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'm ready if you are, but I'd prefer to first:</p> <ul> <li>refactor the class hierarchy, for instance decouple style from shape and make polyline and polygon subclasses of an abstract polyshape</li> <li>write some unit tests</li> <li>know where you want to put it; as I understand it Staging isn't going into Kojo proper</li> </ul> <p>&#8230;and some more, but my wife is calling out dinner now!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-771402</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-771402</link>
				<description></description>
				<pubDate>Sat, 01 May 2010 03:05:27 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Very cool!</p> <p>Are you ready for me to merge this into the Kojo 'trunk'?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-771149</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-771149</link>
				<description></description>
				<pubDate>Fri, 30 Apr 2010 20:41:18 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I've pushed a major revision now; it has a different shape API more or less along the lines you suggested. I've also added a shape category for rectangles with rounded corners.</p> <p>I've also updated the documentation to show SVG usage and the new API, link as above and before.</p> <p>It doesn't support SVG's Basic Shape elements yet, but it should be straightforward to add them, calling the shape API from within a renderSVG method.</p> <p>*phew&#8230;*</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-768907</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-768907</link>
				<description></description>
				<pubDate>Wed, 28 Apr 2010 17:25:52 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>The latest revision now has support for all SVG path commands except elliptic arcs, and the code is fairly stable now.</p> </blockquote> <p>That's very impressive!</p> <blockquote> <p>but I hope to find some time to document SVG usage too.</p> </blockquote> <p>Looking forward to that&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-768106</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-768106</link>
				<description></description>
				<pubDate>Tue, 27 Apr 2010 22:24:57 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>The latest revision now has support for all SVG path commands except elliptic arcs, and the code is fairly stable now.</p> <p>Tomorrow I have to work on tax returns, but I hope to find some time to document SVG usage too.</p> <p>I usually don't write unit tests for experimental code, but I think I have to do that for the SVG code since there are so many permutations. I've tested it by running a few dozen scripts manually, but I still haven't even tried seriously malformed descriptors yet.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-766255</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-766255</link>
				<description></description>
				<pubDate>Mon, 26 Apr 2010 06:49:54 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>It doesn't seem to be very active?</p> </blockquote> <p>I have not really looked at it in any detail or tried it myself. Just wanted to make sure that you had looked at this option.</p> <blockquote> <p>but until and unless SVG support is added to Piccolo, it seems easier to make a lightweight implementation in Scala with Kojo in mind.</p> </blockquote> <p>That makes sense.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-766238</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-766238</link>
				<description></description>
				<pubDate>Mon, 26 Apr 2010 06:24:07 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Yes, I had a look at it. It doesn't seem to be very active?</p> <p>Again, it's not my place to make policy or design decisions, but until and unless SVG support is added to Piccolo, it seems easier to make a lightweight implementation in Scala with Kojo in mind.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-765279</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-765279</link>
				<description></description>
				<pubDate>Sun, 25 Apr 2010 04:06:56 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>Well, that's what experimentation is for :)</p> </blockquote> <p>Amen!</p> <blockquote> <p>but it seems that there are good reasons to phase out the PVector class.</p> </blockquote> <p>Hopefully, all the the good stuff in there will survive (in some form or the other). And hopefully the PVector class will also survive (to represent a mathematical vector, and the operations on vectors).</p> <blockquote> <p>I think it would be nice to be able to load SVG shapes. Thoughts?</p> </blockquote> <p>It would be very cool to be able to load SVG shapes. Have you seen this: <a href="http://code.google.com/p/piccolo2d/wiki/SvgSupport">http://code.google.com/p/piccolo2d/wiki/SvgSupport</a></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-765076</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-765076</link>
				<description></description>
				<pubDate>Sat, 24 Apr 2010 23:00:48 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I see your point. I was trying to break new ground and not just reimplement Canvas, but it seems that there are good reasons to phase out the PVector class. Well, that's what experimentation is for :)</p> <p>Anyway, right now I'm working on support for SVG-style path descriptors. AFAICT Piccolo doesn't support SVG out of the box (but I might have missed something there), and I think it would be nice to be able to load SVG shapes. Thoughts?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-230317#post-764745</guid>
				<title>Re: Staging</title>
				<link>http://kogics.wikidot.com/forum/t-230317/staging#post-764745</link>
				<description></description>
				<pubDate>Sat, 24 Apr 2010 12:27:27 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>The thing that bothers me a little about the current design is the fact that points/vectors know about rects, ellipses, etc. I can see a rect knowing about and being dependent on a point, but not the other way around.</p> <blockquote> <p>also because it's more OO</p> </blockquote> <p>Here's my take on how things might develop from an OO perspective:</p> <p>We start with class Point(x: Double, y: Double)</p> <p>We then work up class Line(p1: Point, p2: Point) , class Rect(p1: Point, p2: Point) etc</p> <p>Now, the classical OO way of creating these guys would be via ctors - new Line(&#8230;), new Rect(&#8230;) etc<br /> But we all know that constructors are evil! We prefer factories. In Scala land - that's done via companion objects.<br /> So we create our shapes like this: Line(&#8230;), Rect(&#8230;)</p> <p><em>Note - Why have OO artifacts for the different kinds of shapes? Because given a shape object, you can translate, rotate, scale it etc - during animations. This is relevant because we're sitting on top of a retained mode GUI toolkit (Piccolo) as opposed to an immediate mode toolkit like the Java2D API.</em></p> <p>We might now want to put a Facade around the whole module - so we get to:<br /> Staging.line(&#8230;) = Line(&#8230;) etc</p> <p><em>Note - Within Kojo, a Facade helps big-time with code completion.</em></p> <p>That does not support chaining, but I'm sure something nice could be cooked up (along the lines of a Builder, maybe).</p> <p>Just some food for thought.</p> <p>PS. Both Mathword and Figure follow this model (other than the fact that Figure still uses ctors rather than companion object factories).</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>