Karl Ramberg uploaded a new version of Etoys to project Etoys:
http://source.squeak.org/etoys/Etoys-kfr.147.mcz
==================== Summary ====================
Name: Etoys-kfr.147
Author: kfr
Time: 5 December 2012, 2:45:49 pm
UUID: a733212a-b976-5e42-a926-bc41140efc6d
Ancestors: Etoys-kfr.146
Set min and max to filter values
=============== Diff against Etoys-kfr.146 ===============
Item was changed:
----- Method: Player>>setBlur: (in category 'sketch filters') -----
setBlur: aNumber
+ | number |
self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:100 max:0.
+ self sendMessageToCostume: #filtersAdd: with: { #blur:form: . number}!
- self sendMessageToCostume: #filtersAdd: with: { #blur:form: . aNumber}!
Item was changed:
----- Method: Player>>setBrightnessShift: (in category 'sketch filters') -----
setBrightnessShift: aNumber
+ | number |
self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:100 max:-100.
+ self sendMessageToCostume: #filtersAdd: with: { #brightnessShift:form: . number}!
- self sendMessageToCostume: #filtersAdd: with: { #brightnessShift:form: . aNumber}!
Item was changed:
----- Method: Player>>setFishEye: (in category 'sketch filters') -----
setFishEye: aNumber
+ | number |
self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger max:-10.
+ self sendMessageToCostume: #filtersAdd: with: { #fishEye:form: . number}!
- self sendMessageToCostume: #filtersAdd: with: { #fishEye:form: . aNumber}!
Item was changed:
----- Method: Player>>setHueShift: (in category 'sketch filters') -----
setHueShift: aNumber
+ | number |
self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:360 max:-360.
+ self sendMessageToCostume: #filtersAdd: with: {#hueShift:form:. number}!
- self sendMessageToCostume: #filtersAdd: with: {#hueShift:form:. aNumber}!
Item was changed:
----- Method: Player>>setSaturationShift: (in category 'sketch filters') -----
setSaturationShift: aNumber
+ | number |
self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:100 max:-100.
+ self sendMessageToCostume: #filtersAdd: with: { #saturationShift:form: . number}!
- self sendMessageToCostume: #filtersAdd: with: { #saturationShift:form: . aNumber}!
Item was changed:
----- Method: SketchMorph class>>additionsToViewerCategoryGraphicsFilters (in category '*eToys-scripting') -----
additionsToViewerCategoryGraphicsFilters
"Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories."
^ #(
#'graphics filters'
(
+ (slot hueShift 'Shift the hue of the pictures colors. -360 to 360' Number readWrite Player getHueShift Player setHueShift:)
+ (slot brightnessShift 'Shift the brightness of the picture. -100 to 100' Number readWrite Player getBrightnessShift Player setBrightnessShift:)
+ (slot saturationShift 'Shift the saturation of the pictures colors. -100 to 100' Number readWrite Player getSaturationShift Player setSaturationShift:)
- (slot hueShift 'Shift the hue of the pictures colors. -180 to 180' Number readWrite Player getHueShift Player setHueShift:)
- (slot brightnessShift 'Shift the brightness of the picture -100 to 100' Number readWrite Player getBrightnessShift Player setBrightnessShift:)
- (slot saturationShift 'Shift the saturation of the pictures colors -100 to 100' Number readWrite Player getSaturationShift Player setSaturationShift:)
(slot blur 'Blur the picture. 1 to 10' Number readWrite Player getBlur Player setBlur:)
(slot fishEye 'Make a fish eye effect on the picture. -10 and up' Number readWrite Player getFishEye Player setFishEye:)
(slot whirl 'Make a whirl effect on the picture.' Number readWrite Player getWhirl Player setWhirl:)
(command removeFilters 'Remove the picture filters' )
))
!
I looked at the Viewer categories for every object in the Object
Catalog, and at the Squeak lists of categories and tiles, and
documented every tile in every category I found as much as I could in
the Common Tiles chapter of the Etoys Reference Manual. I have not
updated the introduction to the chapter yet. It is incorrect in saying
that some categories are explained only in the Objects chapter.
Now I have some questions.
1) Should we split the Common Tiles chapter, as we split the Objects
chapters, so that we have a chapter for the nearly universal
categories that every Morph has (but not, for example, the Kedama
objects), and another for all of the categories specific to individual
objects and small groups of objects? In the draft chapter, the
boundary is at section 4.18, on book navigation. Near the beginning of
the chapter there is an image of the category menu for Morphs, and a
list of categories for specific object types that do not appear on the
list for Morphs.
2) There are a number of tiles whose effects I could not determine
from the help text or through experiment, and some that appear to be
so buggy as to be unusable. I have made notes in the draft on all of
them, mostly in Formatted (monospace on colored background) text. Any
assistance on interpreting these, or filing bug reports, would be
welcome. At some point I mean to look at their Squeak implementations
(via 'show code textually' on the Scripting Editor menu, and
'selectors containing it' on the control-click menu for text
selections) to see whether they are any more illuminating.
3) Some of the help text clearly needs to be rewritten to, you know, help.
4) I am about to write the chapter on Programming Tools, which will
begin by describing every Squeak tool accessible from any Etoys menu,
such as the System Browser, and tools for viewing Senders,
Implementors, Selectors, and so on provided on the World menu and the
open... and authoring... menus that it gives access to. I intend to
describe the Morphic and Etoys-Scripting classes, also, to some
extent, and then stop. I do mean to write more about the
implementation of Etoys in Squeak, but in other books, which we can
discuss. For example, I have thought about a chapter on writing Squeak
in text-mode scripting tiles in an Etoys User Manual or Etoys By
Example, so that we can discuss concretely teaching more advanced
programming and Computer Science topics on the basis of Etoys.
5) Then I intend to go over the entire book again, with the benefit of
what I have learned. Presumably I will have more questions at that
point.
--
Edward Mokurai (默雷/निशब्दगर्ज/نشبدگرج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://wiki.sugarlabs.org/go/Replacing_Textbooks
Karl Ramberg uploaded a new version of Morphic to project Etoys:
http://source.squeak.org/etoys/Morphic-kfr.98.mcz
==================== Summary ====================
Name: Morphic-kfr.98
Author: kfr
Time: 4 December 2012, 9:59:36 pm
UUID: 500d78fb-6101-e74c-b9e3-4b005d6a5c31
Ancestors: Morphic-kfr.97
Remove instance variable 'filters' and use properties instead
=============== Diff against Morphic-kfr.97 ===============
Item was changed:
Morph subclass: #SketchMorph
+ instanceVariableNames: 'originalForm rotationStyle scalePoint framesToDwell rotatedForm'
- instanceVariableNames: 'originalForm rotationStyle scalePoint framesToDwell rotatedForm filters'
classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Basic'!
!SketchMorph commentStamp: 'kfr. 11/7/2011 11:32' prior: 0!
SketchMorph commentStamp: '<historical>' prior: 0!!
The morph that results when the user draws a color bitmap using the PaintBox (SketchEditorMorph and PaintBoxMorph).
forwardDirection is the angle at which the object will go forward. When the rotationStyle is not #normal, then forwardDirection is any angle, while the rotation is highly restricted. If flexed, this is remembered by the Transform morph. For non-normal rotationStyle, it is rotationDegrees.
setupAngle (a property) is where the user put the green arrow to indicate which direction on the picture is forward. When #normal, draw the morph initially at (0.0 - setupAngle). The enclosing TransformationMorph then rotates it to the true angle.
rotationDegrees In a #normal object, rotationDegrees is constant an equal to setupAngle.
For non-normal, it is the direction the object is going.
When repainting, set it back to its original state. The green arrow is set to setupAngle, and the sketch is shown as drawn originally (rotationDegrees = 0).
rotationStyle = normal (turns), leftRight, upDown, fixed.
When leftRight upDown or fixed, bit map has severe restrictions.
!
Item was changed:
----- Method: SketchMorph>>filters (in category 'filters') -----
filters
+ ^ self valueOfProperty: #filters ifAbsent:
+ [self setProperty: #filters toValue: OrderedCollection new.]!
- ^ filters
- ifNil: [filters := OrderedCollection new]!
Item was changed:
----- Method: SketchMorph>>filtersAdd: (in category 'filters') -----
filtersAdd: aFilterWithValue
self filters
do: [:i | (i includes: aFilterWithValue first)
+ ifTrue: [self filters remove: i]].
+ self filters add: aFilterWithValue.
- ifTrue: [filters remove: i]].
- filters add: aFilterWithValue.
self layoutChanged!
Item was changed:
----- Method: SketchMorph>>generateRotatedForm (in category 'drawing') -----
generateRotatedForm
| scalePt smoothPix pair filteredForm |
scalePoint
ifNil: [scalePoint := 1 @ 1].
scalePt := scalePoint x abs @ scalePoint y abs.
rotationStyle == #none
ifTrue: [scalePt := 1 @ 1].
smoothPix := 1.
rotationStyle = #leftRight
ifTrue: [self heading asSmallAngleDegrees < 0.0
ifTrue: [scalePt := scalePt x negated @ scalePt y]].
rotationStyle = #upDown
ifTrue: [self heading asSmallAngleDegrees abs > 90.0
ifTrue: [scalePt := scalePt x @ scalePt y negated]].
filteredForm := originalForm copy.
+ self filters
+ ifNotNil: [self filters
- filters
- ifNotNil: [filters
do: [:filter | filteredForm := self
perform: filter first
withArguments: (filter allButFirst copyWith: filteredForm)]].
rotatedForm := (scalePt = (1 @ 1)
+ and: [self filters isNil])
- and: [filters isNil])
ifTrue: [originalForm]
ifFalse: [((rotationStyle == #normal
and: [self useInterpolation])
+ and: [self filters isNil])
- and: [filters isNil])
ifTrue: [^ self generateInterpolatedForm].
pair := WarpBlt current
rotate: filteredForm
degrees: 0
center: originalForm boundingBox center
scaleBy: scalePt
smoothing: smoothPix.
pair first]!
Item was changed:
----- Method: SketchMorph>>removeFilters (in category 'filters') -----
removeFilters
+ self removeProperty: #filters.
- filters := nil.
self layoutChanged!