[etoys-dev] Project refactoring

Bert Freudenberg bert at freudenbergs.de
Thu Nov 26 06:28:24 EST 2009

On 25.11.2009, at 18:48, Karl Ramberg wrote:
> On 2009-11-25 10:59, Bert Freudenberg wrote:
>> There is a discussion underway on squeak-dev about refactoring Projects. Since we intend to eventually use this for Etoys, it would be good to join the fun now rather than deal with the fallout later.
>> Thread starts here:
>> http://lists.squeak.org/pipermail/squeak-dev/2009-November/141294.html
>> E.g. I'm not sure if in Etoys we want projects without a project view as Andreas suggested below.
>> - Bert -
> The project views could be stored in the FileList/ProjectLoader and fetched from the nearest location.
> Then all/most portals to other worlds would have the same location.
> I guess we have to deal with this issue if we want to use Etoys as a SlideShow/ PowerPoint thing eg. each page of a slide would be a project/page.
> Also a merge of BookMorph and Project when presenting would be interesting.
> Karl

More fun with projects:


Interesting stuff! And positive responses from squeak-dev folks so far, they generally like where this is going.

- Bert -

Begin forwarded message:
> From: Andreas Raab <andreas.raab at gmx.de>
> Date: 26. November 2009 05:25:39 MEZ
> To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org>
> Subject: [squeak-dev] Embracing Projects
> Reply-To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org>
> Folks -
> I always felt that one of the least used "big ideas" in Squeak is that of projects. Projects are incredibly powerful but have often been severely misunderstood. A Project in Squeak can define an entire environment (MVC, Morphic, Tweak), it can be a modification to an existing environment, it can identify a set of tools to be used in some context and more.
> The progress that we've made with refactoring of class Project makes it feasible to illustrate the power of projects. If you install the attached change set in an updated trunk image, you will find a new type of project available - a  GamesProject. When you choose this type of project you will notice that it downloads and installs the MorphicGames package that Edgar just announced (thanks Edgar!), sets up the environment with a set of games before launching into it. (note that I didn't go as far as setting up the menu bar with games, removing the tools, sealing the programmer facilities etc. but all of this is possible and should be considered for the various types of projects)
> And of course, when we ship the next image, we could actually include a number of such "proto projects" like the GamesProject - it takes a tiny amount of space but makes it very accessible and very visible from an user point of view. As a conseqence, we can hopefully ship the next Squeak version with (proto-)Games, Etoys, VMMaker, Seaside and whatnot projects.
> Thoughts?
> Cheers,
>  - Andreas
-------------- nächster Teil --------------
'From Squeak3.10.2 of ''5 June 2008'' [latest update: #7179] on 25 November 2009 at 8:19:39 pm'!
MorphicProject subclass: #GamesProject
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Projects-Extras'!

!GamesProject methodsFor: 'initialize' stamp: 'ar 11/25/2009 20:08'!
	"Make sure games are loaded, then set things up."
	self install ifFalse:[^nil]. "install failed"

	super initialize. "default Morphic setup"

	"Now the good stuff. This really should be handled by MorphicGamesInfo.
	So check if it knows how to set up a project and if so, let it take care of things."
	(Smalltalk classNamed: #MorphicGamesinfo) ifNotNil:[:pkgInfo|
		(pkgInfo canUnderstand: #setupProject:) ifTrue:[
			pkgInfo setupProject: self.
	self setupProject: self.
! !

!GamesProject methodsFor: 'initialize' stamp: 'ar 11/25/2009 20:19'!
	"Ensure MorphicGames are installed"

	(MCWorkingCopy allManagers 
		anySatisfy:[:mcw| mcw packageName = 'MorphicGames']) ifTrue:[^true].

	(UIManager default confirm: 'Morphic Games are not present.
Download and install them now?
(Requires Internet access)') ifFalse:[^false].

	['Installing Morphic Games' displayProgressAt: Sensor cursorPoint 
		from: 0 to: 1 during:[:bar|
			(Installer repository: 'http://www.squeaksource.com/Ladrillos')
				install: 'MorphicGames'].
	] on: Error do:[:ex|
		self inform: 'Failed to load Morphic Games:\' withCRs, ex description.
	UIManager default inform: 'Morphic Games have been installed.
We recommended saving the image 
to avoid repeated installation.'.

! !

!GamesProject methodsFor: 'initialize' stamp: 'ar 11/25/2009 20:09'!
setupProject: aProject
	"Set up a new Games Project"
	| top quadList button |
	top := 32.
	quadList := OrderedCollection new.
	#(AtomicGame ChessMorph 
	ChineseCheckers CipherPanel CrosticPanel
	FreeCell Mines SameGame Tetris) do:[:each|
		(Smalltalk classNamed: each) ifNotNil:[:gameClass|
			gameClass addPartsDescriptorQuadsTo: quadList if:[:d| true]]].
	quadList do:[:quad|
			button := IconicButton new initializeWithThumbnail: 
				(PartsBin thumbnailForQuad: quad color: Color white) withLabel: quad third andColor: Color white andSend: quad second to: (Smalltalk at: quad first).
			(quad size > 3 and: [quad fourth isEmptyOrNil not]) ifTrue:
				[button setBalloonText: quad fourth].
 			button position: 40 - (button fullBounds width // 2) @ top.
			aProject world addMorphBack: button.
			top := top + button height + 20].! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

GamesProject class
	instanceVariableNames: ''!

!GamesProject class methodsFor: 'class initialization' stamp: 'ar 11/25/2009 19:13'!
	"We should fix this, TheMainWorldDockingBar should pick up new projects automatically"
	TheWorldMainDockingBar updateInstances.
! !

GamesProject initialize!
-------------- nächster Teil --------------

More information about the etoys-dev mailing list