Chris Cunningham uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-cbc.334.mcz
==================== Summary ====================
Name: EToys-cbc.334
Author: cbc
Time: 12 June 2018, 9:53:07.614851 pm
UUID: 7b371c28-631f-374b-96cd-0dfcbac9b287
Ancestors: EToys-hjh.333
moved #rotationCenter and #rotationCenter: to base (Morphic) package in category 'rotate scale and flex'
=============== Diff against EToys-hjh.333 ===============
Item was removed:
- ----- Method: Morph>>referencePosition (in category '*Etoys-geometry') -----
- referencePosition
- "Return the current reference position of the receiver"
- | box |
- box := self bounds.
- ^box origin + (self rotationCenter * box extent).
- !
Item was removed:
- ----- Method: Morph>>referencePosition: (in category '*Etoys-geometry') -----
- referencePosition: aPosition
- "Move the receiver to match its reference position with aPosition"
- | newPos intPos |
- newPos := self position + (aPosition - self referencePosition).
- intPos := newPos asIntegerPoint.
- newPos = intPos
- ifTrue:[self position: intPos]
- ifFalse:[self position: newPos].!
Chris Cunningham uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cbc.1450.mcz
==================== Summary ====================
Name: Morphic-cbc.1450
Author: cbc
Time: 12 June 2018, 9:49:08.273851 pm
UUID: 85dec3fe-462d-7242-bdb4-797746d320a0
Ancestors: Morphic-dtl.1449
Recategorized rotationCenter and referencePosition (and setter versions) to more a more appropriate category.
rotationCenter is the relative position of the referencePosition point within the morph. They are related - and should live together.
Also, moved base Morph versions of these out of EToys to be with the others.
=============== Diff against Morphic-dtl.1449 ===============
Item was changed:
+ ----- Method: CircleMorph>>referencePosition (in category 'rotate scale and flex') -----
- ----- Method: CircleMorph>>referencePosition (in category 'geometry eToy') -----
referencePosition
"Return the current reference position of the receiver"
^ self valueOfProperty: #referencePosition ifAbsent: [ self center ]
!
Item was changed:
+ ----- Method: CircleMorph>>rotationCenter (in category 'rotate scale and flex') -----
- ----- Method: CircleMorph>>rotationCenter (in category 'geometry eToy') -----
rotationCenter
"Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
| refPos |
refPos := self referencePosition.
^ (refPos - self bounds origin) / self bounds extent asFloatPoint!
Item was changed:
+ ----- Method: CircleMorph>>rotationCenter: (in category 'rotate scale and flex') -----
- ----- Method: CircleMorph>>rotationCenter: (in category 'geometry eToy') -----
rotationCenter: aPointOrNil
"Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
| newRef box |
aPointOrNil isNil
ifTrue: [self removeProperty: #referencePosition.
self removeProperty: #originalCenter.
self removeProperty: #originalAngle. ]
ifFalse: [ box := self bounds.
newRef := box origin + (aPointOrNil * box extent).
self setRotationCenterFrom: newRef ].
!
Item was changed:
+ ----- Method: MatrixTransformMorph>>rotationCenter (in category 'rotate scale and flex') -----
- ----- Method: MatrixTransformMorph>>rotationCenter (in category 'geometry eToy') -----
rotationCenter
| pt |
pt := self transform localPointToGlobal: super rotationCenter.
^pt - bounds origin / bounds extent asFloatPoint!
Item was changed:
+ ----- Method: MatrixTransformMorph>>rotationCenter: (in category 'rotate scale and flex') -----
- ----- Method: MatrixTransformMorph>>rotationCenter: (in category 'geometry eToy') -----
rotationCenter: aPoint
super rotationCenter: (self transform globalPointToLocal: bounds origin + (bounds extent * aPoint))!
Item was added:
+ ----- Method: Morph>>referencePosition (in category 'rotate scale and flex') -----
+ referencePosition
+ "Return the current reference position of the receiver"
+ | box |
+ box := self bounds.
+ ^box origin + (self rotationCenter * box extent).
+ !
Item was added:
+ ----- Method: Morph>>referencePosition: (in category 'rotate scale and flex') -----
+ referencePosition: aPosition
+ "Move the receiver to match its reference position with aPosition"
+ | newPos intPos |
+ newPos := self position + (aPosition - self referencePosition).
+ intPos := newPos asIntegerPoint.
+ newPos = intPos
+ ifTrue:[self position: intPos]
+ ifFalse:[self position: newPos].!
Item was changed:
+ ----- Method: Morph>>rotationCenter (in category 'rotate scale and flex') -----
- ----- Method: Morph>>rotationCenter (in category 'geometry eToy') -----
rotationCenter
"Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
^self valueOfProperty: #rotationCenter ifAbsent:[0.5@0.5]
!
Item was changed:
+ ----- Method: Morph>>rotationCenter: (in category 'rotate scale and flex') -----
- ----- Method: Morph>>rotationCenter: (in category 'geometry eToy') -----
rotationCenter: aPointOrNil
"Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
aPointOrNil isNil
ifTrue:[self removeProperty: #rotationCenter]
ifFalse:[self setProperty: #rotationCenter toValue: aPointOrNil]
!
Item was changed:
+ ----- Method: PolygonMorph>>referencePosition (in category 'rotate scale and flex') -----
- ----- Method: PolygonMorph>>referencePosition (in category 'geometry eToy') -----
referencePosition
"Return the current reference position of the receiver"
^ self valueOfProperty: #referencePosition ifAbsent: [super referencePosition]
!
Item was changed:
+ ----- Method: PolygonMorph>>rotationCenter (in category 'rotate scale and flex') -----
- ----- Method: PolygonMorph>>rotationCenter (in category 'geometry eToy') -----
rotationCenter
"Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
| refPos |
refPos := self valueOfProperty: #referencePosition
ifAbsent: [^ 0.5(a)0.5].
^ (refPos - self bounds origin) / self bounds extent asFloatPoint!
Item was changed:
+ ----- Method: PolygonMorph>>rotationCenter: (in category 'rotate scale and flex') -----
- ----- Method: PolygonMorph>>rotationCenter: (in category 'geometry eToy') -----
rotationCenter: aPointOrNil
"Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
| box |
aPointOrNil isNil
ifTrue: [self removeProperty: #referencePosition]
ifFalse: [box := self bounds.
self setProperty: #referencePosition
toValue: box origin + (aPointOrNil * box extent)]
!
Item was changed:
+ ----- Method: TransformationMorph>>referencePosition (in category 'rotate scale and flex') -----
- ----- Method: TransformationMorph>>referencePosition (in category 'geometry eToy') -----
referencePosition
"Answer the receiver's reference position, bullet-proofed against infinite recursion in the unlikely but occasionally-seen case that I am my own renderee"
| rendered |
^ (rendered := self renderedMorph) == self
ifTrue:
[super referencePosition]
ifFalse:
[transform localPointToGlobal: rendered referencePosition]!
David T. Lewis uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-hjh.333.mcz
==================== Summary ====================
Name: EToys-hjh.333
Author: hjh
Time: 11 June 2018, 7:47:07.644259 am
UUID: 1872ec0f-374c-4d8a-a701-f118fb19ae40
Ancestors: EToys-nice.332
Move methods
Morph rotationCenter and rotationCenter:
from 'Etoys-geometry' to 'geometry'
=============== Diff against EToys-nice.332 ===============
Item was removed:
- ----- Method: Morph>>rotationCenter (in category '*Etoys-geometry') -----
- rotationCenter
- "Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
- ^self valueOfProperty: #rotationCenter ifAbsent:[0.5@0.5]
- !
Item was removed:
- ----- Method: Morph>>rotationCenter: (in category '*Etoys-geometry') -----
- rotationCenter: aPointOrNil
- "Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
- aPointOrNil isNil
- ifTrue:[self removeProperty: #rotationCenter]
- ifFalse:[self setProperty: #rotationCenter toValue: aPointOrNil]
- !
David T. Lewis uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-dtl.1449.mcz
==================== Summary ====================
Name: Morphic-dtl.1449
Author: dtl
Time: 11 June 2018, 11:44:21.415017 pm
UUID: de56abb6-cb20-4f20-94e8-d046fb1ea057
Ancestors: Morphic-pre.1448
Move methods Morph rotationCenter and rotationCenter: from 'Etoys-geometry' to 'geometry eToy' for consistency with other implementers in Morphic, and also as required for unloading package Etoys. See also EToys-hjh.333.
=============== Diff against Morphic-pre.1448 ===============
Item was added:
+ ----- Method: Morph>>rotationCenter (in category 'geometry eToy') -----
+ rotationCenter
+ "Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
+ ^self valueOfProperty: #rotationCenter ifAbsent:[0.5@0.5]
+ !
Item was added:
+ ----- Method: Morph>>rotationCenter: (in category 'geometry eToy') -----
+ rotationCenter: aPointOrNil
+ "Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
+ aPointOrNil isNil
+ ifTrue:[self removeProperty: #rotationCenter]
+ ifFalse:[self setProperty: #rotationCenter toValue: aPointOrNil]
+ !
David T. Lewis uploaded a new version of SUnitTools to project The Trunk:
http://source.squeak.org/trunk/SUnitTools-tcj.4.mcz
==================== Summary ====================
Name: SUnitTools-tcj.4
Author: tcj
Time: 9 June 2018, 12:55:17.485052 pm
UUID: 9f8d6f94-46c6-4bb1-884d-1d0e66fd5b62
Ancestors: SUnitTools-mt.3
Fixes use of 'find tested item' on TestCase subclasses whose name end in 'Tests' rather than 'Test'. This opens up 'find tested item' to work on 24 additional TestCase subclasses where it would not have worked before. It should result in only one false positive (LongTestCaseTestUnderTest) which will silently fail to locate, as designed
=============== Diff against SUnitTools-mt.3 ===============
Item was changed:
----- Method: CodeHolder>>testFindTested (in category '*SUnitTools-running') -----
testFindTested
+ | cls classNameParts destClassName destMessage |
- | cls destClassName destMessage |
cls := self selectedClass ifNil: [^ self].
cls isTestClass ifFalse: [" already there " ^ self].
+
+ classNameParts := cls name asString piecesCutWhere: [:a :b | b isUppercase].
+ destClassName := (classNameParts last beginsWith: 'Test')
+ ifTrue: [classNameParts allButLast join]
-
- destClassName := (cls name asString endsWith: 'Test')
- ifTrue: [cls name asString allButLast: 4]
ifFalse: [^ self].
destMessage := self selectedMessageName ifNotNil: [:selector | | messageName |
messageName := selector asString.
(messageName beginsWith: 'test') "operate on test methods only"
ifTrue: [ (self class environment classNamed: destClassName)
ifNotNil: [:destClass | destClass selectors
detect: [:destSelector | (self testSelectorFrom: destSelector) = messageName]
ifNone: [nil]]]
ifFalse: [nil]].
self testBrowseClassNamed: destClassName possibleMessageNamed: destMessage
+ !
-
-
- !
Patrick Rein uploaded a new version of 60Deprecated to project The Trunk:
http://source.squeak.org/trunk/60Deprecated-pre.21.mcz
==================== Summary ====================
Name: 60Deprecated-pre.21
Author: pre
Time: 8 June 2018, 5:03:30.874586 pm
UUID: d4659272-8efc-354d-bc27-dcfd6cdeccb9
Ancestors: 60Deprecated-mt.20
Deprecates a method which is very much specific for the objects tool and is not general enough to remain in Morph
=============== Diff against 60Deprecated-mt.20 ===============
Item was added:
+ ----- Method: Morph>>highlightOnlySubmorph: (in category '*60Deprecated-MorphicExtras-accessing') -----
+ highlightOnlySubmorph: aMorph
+ "Distinguish only aMorph with border highlighting (2-pixel wide red); make all my other submorphs have one-pixel-black highlighting. This is a rather special-purpose and hard-coded highlighting regime, of course. Later, if someone cared to do it, we could parameterize the widths and colors via properties, or some such."
+
+ self deprecated: 'Do not use at all anymore. This was a specialized call for the objects tool which does not work in a general way on arbitrary morphs.'.
+ self submorphs do:
+ [:m |
+ m == aMorph
+ ifTrue: [m borderWidth: 1; borderColor: Color red. m firstSubmorph color: Color red]
+ ifFalse: [m borderWidth: 1; borderColor: Color black. m firstSubmorph color: Color black]].
+ !
Patrick Rein uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-pre.239.mcz
==================== Summary ====================
Name: MorphicExtras-pre.239
Author: pre
Time: 8 June 2018, 5:01:33.701586 pm
UUID: d0190a6c-3ee5-824f-8bda-fee68d823a6a
Ancestors: MorphicExtras-pre.238
Minor refactoring of objects tool. This moves a objects tool method from Morph into the ObjectsTool. Other very minor style fixes.
=============== Diff against MorphicExtras-pre.238 ===============
Item was changed:
----- Method: BorderedMorph>>basicInitialize (in category '*MorphicExtras-initialization') -----
basicInitialize
"Do basic generic initialization of the instance variables"
+
super basicInitialize.
- ""
self borderInitialize!
Item was removed:
- ----- Method: Morph>>highlightOnlySubmorph: (in category '*MorphicExtras-accessing') -----
- highlightOnlySubmorph: aMorph
- "Distinguish only aMorph with border highlighting (2-pixel wide red); make all my other submorphs have one-pixel-black highlighting. This is a rather special-purpose and hard-coded highlighting regime, of course. Later, if someone cared to do it, we could parameterize the widths and colors via properties, or some such."
-
- self submorphs do:
- [:m |
- m == aMorph
- ifTrue: [m borderWidth: 1; borderColor: Color red. m firstSubmorph color: Color red]
- ifFalse: [m borderWidth: 1; borderColor: Color black. m firstSubmorph color: Color black]
- ].
- !
Item was added:
+ ----- Method: ObjectsTool>>buttonActiveColor (in category 'constants') -----
+ buttonActiveColor
+
+ ^ Color white!
Item was added:
+ ----- Method: ObjectsTool>>buttonColor (in category 'constants') -----
+ buttonColor
+
+ ^ Color black!
Item was added:
+ ----- Method: ObjectsTool>>highlightOnlySubmorph:in: (in category 'tabs') -----
+ highlightOnlySubmorph: aMorph in: anotherMorph
+ "Distinguish only aMorph with border highlighting (2-pixel wide red); make all my other submorphs have one-pixel-black highlighting. This is a rather special-purpose and hard-coded highlighting regime, of course. Later, if someone cared to do it, we could parameterize the widths and colors via properties, or some such."
+
+ anotherMorph submorphs do: [:m | | color |
+ color := m == aMorph ifTrue: [self buttonActiveColor] ifFalse: [self buttonColor].
+ m
+ borderWidth: 1;
+ borderColor: color.
+ m firstSubmorph color: color]
+ !
Item was changed:
----- Method: ObjectsTool>>installQuads:fromButton: (in category 'alphabetic') -----
installQuads: quads fromButton: aButton
"Install items in the bottom pane that correspond to the given set of quads, as triggered from the given button"
| aPartsBin sortedQuads oldResizing |
aPartsBin := self partsBin.
oldResizing := aPartsBin vResizing.
aPartsBin removeAllMorphs.
sortedQuads := ((PartsBin translatedQuads: quads)
select: [ :each | Smalltalk hasClassNamed: each first ])
sort: [ :a :b | a third < b third ].
aPartsBin listDirection: #leftToRight quadList: sortedQuads.
+ aButton ifNotNil: [self highlightOnlySubmorph: aButton in: self tabsPane].
- aButton ifNotNil: [self tabsPane highlightOnlySubmorph: aButton].
aPartsBin vResizing: oldResizing.
aPartsBin layoutChanged; fullBounds.
self isFlap ifFalse: [ self minimizePartsBinSize ].!
Item was changed:
----- Method: ObjectsTool>>tweakAppearanceAfterModeShift (in category 'initialization') -----
tweakAppearanceAfterModeShift
"After the receiver has been put into a given mode, make an initial selection of category, if appropriate, and highlight the mode button."
+
-
self buttonPane submorphs do:
[:aButton |
| aColor |
"aButton borderWidth: 1."
aColor := (aButton valueOfProperty: #modeSymbol) = modeSymbol
+ ifTrue: [self buttonActiveColor]
+ ifFalse: [self buttonColor].
- ifTrue: [Color red]
- ifFalse: [Color black].
aButton firstSubmorph color: aColor.
+ aButton borderColor: aColor].!
- aButton borderColor: aColor.
- ].!
Patrick Rein uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-pre.1448.mcz
==================== Summary ====================
Name: Morphic-pre.1448
Author: pre
Time: 8 June 2018, 4:41:41.427586 pm
UUID: c9f1f8aa-aba3-9e4a-9f6b-afae872a2a4c
Ancestors: Morphic-kfr.1447
Adds an entry to the morph export menu to allow for easy export of postscript files. As the postscript rendering is part of MorphicExtras, I added a guard.
=============== Diff against Morphic-kfr.1447 ===============
Item was changed:
----- Method: Morph>>addExportMenuItems:hand: (in category 'menus') -----
addExportMenuItems: aMenu hand: aHandMorph
"Add export items to the menu"
aMenu ifNotNil:
[ | aSubMenu |
aSubMenu := MenuMorph new defaultTarget: self.
aSubMenu add: 'BMP file' translated action: #exportAsBMP.
aSubMenu add: 'GIF file' translated action: #exportAsGIF.
aSubMenu add: 'JPEG file' translated action: #exportAsJPEG.
aSubMenu add: 'PNG file' translated action: #exportAsPNG.
+ (self respondsTo: #exportAsEPS) ifTrue: [
+ aSubMenu add: 'EPS file' translated action: #exportAsEPS].
aMenu add: 'export...' translated subMenu: aSubMenu]
!