diff --git a/src/Bloc-Examples/BlAlternativeCombinationExamples.class.st b/src/Bloc-Examples/BlAlternativeCombinationExamples.class.st index d4c0d7a36..dd06582e6 100644 --- a/src/Bloc-Examples/BlAlternativeCombinationExamples.class.st +++ b/src/Bloc-Examples/BlAlternativeCombinationExamples.class.st @@ -1,71 +1,82 @@ Class { #name : #BlAlternativeCombinationExamples, - #superclass : #BlKeyCombinationExamples, + #superclass : #BlKeyCombinationExamplesTest, #category : #'Bloc-Examples-KeyBinding' } { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> combinationWithA [ - +BlAlternativeCombinationExamples >> testCombinationWithA [ + + | aCombination | - - aCombination := self emptyCombination. + aCombination := self testEmptyCombination. aCombination key: KeyboardKey A. - self assert: (aCombination combinations asArray collect: #key) equals: { KeyboardKey A }. + self + assert: (aCombination combinations asArray collect: #key) + equals: { KeyboardKey A }. self assert: aCombination printString equals: '(A)'. - + ^ aCombination ] { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> combinationWithAB [ - +BlAlternativeCombinationExamples >> testCombinationWithAB [ + + | aCombination | - - aCombination := self combinationWithA. + aCombination := self testCombinationWithA. aCombination key: KeyboardKey B. - self assert: (aCombination combinations asArray collect: #key) equals: { KeyboardKey A. KeyboardKey B }. + self + assert: (aCombination combinations asArray collect: #key) + equals: { + KeyboardKey A. + KeyboardKey B }. self assert: aCombination printString equals: '(A | B)'. - + ^ aCombination ] { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> combinationWithABC [ - +BlAlternativeCombinationExamples >> testCombinationWithABC [ + + | aCombination | - - aCombination := self combinationWithAB. + aCombination := self testCombinationWithAB. aCombination key: KeyboardKey C. - self assert: (aCombination combinations asArray collect: #key) equals: { KeyboardKey A. KeyboardKey B. KeyboardKey C }. + self + assert: (aCombination combinations asArray collect: #key) + equals: { + KeyboardKey A. + KeyboardKey B. + KeyboardKey C }. self assert: aCombination printString equals: '(A | B | C)'. - + ^ aCombination ] { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> emptyCombination [ - +BlAlternativeCombinationExamples >> testEmptyCombination [ + + | aCombination | - aCombination := BlAlternativeCombination new. self assert: aCombination isAlternative. self assert: aCombination combinations isEmpty. self assert: aCombination printString equals: '()'. - + ^ aCombination ] { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> matchCombinationWithA [ +BlAlternativeCombinationExamples >> testMatchCombinationWithA [ - + | aCombination aBuffer | - aCombination := self combinationWithA. + aCombination := self testCombinationWithA. aBuffer := BlMockedKeyboardBuffer new. aBuffer pressed: true key: KeyboardKey A. @@ -78,11 +89,11 @@ BlAlternativeCombinationExamples >> matchCombinationWithA [ ] { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> matchCombinationWithAB [ +BlAlternativeCombinationExamples >> testMatchCombinationWithAB [ - + | aCombination aBuffer | - aCombination := self combinationWithAB. + aCombination := self testCombinationWithAB. aBuffer := BlMockedKeyboardBuffer new. aBuffer pressed: false key: KeyboardKey A. @@ -104,11 +115,11 @@ BlAlternativeCombinationExamples >> matchCombinationWithAB [ ] { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> noMatchCombinationWithA [ +BlAlternativeCombinationExamples >> testNoMatchCombinationWithA [ - + | aCombination aBuffer | - aCombination := self combinationWithA. + aCombination := self testCombinationWithA. aBuffer := BlMockedKeyboardBuffer new. aBuffer pressed: false key: KeyboardKey A. @@ -121,11 +132,11 @@ BlAlternativeCombinationExamples >> noMatchCombinationWithA [ ] { #category : #'examples - combination' } -BlAlternativeCombinationExamples >> noMatchCombinationWithAB [ +BlAlternativeCombinationExamples >> testNoMatchCombinationWithAB [ - + | aCombination aBuffer | - aCombination := self combinationWithAB. + aCombination := self testCombinationWithAB. aBuffer := BlMockedKeyboardBuffer new. aBuffer pressed: true key: KeyboardKey A. @@ -139,65 +150,74 @@ BlAlternativeCombinationExamples >> noMatchCombinationWithAB [ ] { #category : #'examples - store' } -BlAlternativeCombinationExamples >> storeCombinationWithA [ - +BlAlternativeCombinationExamples >> testStoreCombinationWithA [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self combinationWithA. + aCombination := self testCombinationWithA. aStoreString := aCombination storeString. - self assert: aStoreString equals: '(BlAlternativeCombination new with: (BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination)'. - + self + assert: aStoreString + equals: + '(BlAlternativeCombination new with: (BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination)'. + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] { #category : #'examples - store' } -BlAlternativeCombinationExamples >> storeCombinationWithAB [ - +BlAlternativeCombinationExamples >> testStoreCombinationWithAB [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self combinationWithAB. + aCombination := self testCombinationWithAB. aStoreString := aCombination storeString. - self assert: aStoreString equals: '(((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) or: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination)'. - + self + assert: aStoreString + equals: + '(((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) or: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination)'. + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] { #category : #'examples - store' } -BlAlternativeCombinationExamples >> storeCombinationWithABC [ - +BlAlternativeCombinationExamples >> testStoreCombinationWithABC [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self combinationWithABC. + aCombination := self testCombinationWithABC. aStoreString := aCombination storeString. - self assert: aStoreString equals: '((((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) or: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination) or: (BlKeyboardKey new setName: #C; setValue: nil) asKeyCombination)'. - + self + assert: aStoreString + equals: + '((((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) or: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination) or: (BlKeyboardKey new setName: #C; setValue: nil) asKeyCombination)'. + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] { #category : #'examples - store' } -BlAlternativeCombinationExamples >> storeEmptyCombination [ - +BlAlternativeCombinationExamples >> testStoreEmptyCombination [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self emptyCombination. + aCombination := self testEmptyCombination. aStoreString := aCombination storeString. self assert: aStoreString equals: '(BlAlternativeCombination new)'. - + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] diff --git a/src/Bloc-Examples/BlAnimationExamples.class.st b/src/Bloc-Examples/BlAnimationExamplesTest.class.st similarity index 67% rename from src/Bloc-Examples/BlAnimationExamples.class.st rename to src/Bloc-Examples/BlAnimationExamplesTest.class.st index e8a237dbd..318047320 100644 --- a/src/Bloc-Examples/BlAnimationExamples.class.st +++ b/src/Bloc-Examples/BlAnimationExamplesTest.class.st @@ -5,15 +5,13 @@ DOES NOT WORK " Class { - #name : #BlAnimationExamples, - #superclass : #BlExampleTest, - #traits : 'TBlExample', - #classTraits : 'TBlExample classTrait', + #name : #BlAnimationExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Animation' } { #category : #examples } -BlAnimationExamples class >> ballsAnim [ +BlAnimationExamplesTest class >> ballsAnim [ | space els anims | @@ -47,7 +45,7 @@ BlAnimationExamples class >> ballsAnim [ alp }. els add: el ]. - space := BlSpace new. + space := BlOSpace new. space root addChildren: els. space show. @@ -55,7 +53,7 @@ BlAnimationExamples class >> ballsAnim [ ] { #category : #examples } -BlAnimationExamples class >> bouncingText [ +BlAnimationExamplesTest class >> bouncingText [ "Click on letters to start animation" @@ -66,7 +64,7 @@ BlAnimationExamples class >> bouncingText [ ] { #category : #examples } -BlAnimationExamples class >> sequential [ +BlAnimationExamplesTest class >> sequential [ | space element translation scale sequential | @@ -88,18 +86,288 @@ BlAnimationExamples class >> sequential [ position: 100 @ 100. element addAnimation: sequential. - space := BlSpace new. + space := BlOSpace new. space root addChild: element. space show ] +{ #category : #accessing } +BlAnimationExamplesTest >> blueAt: anIndex [ + | radians | + "0.0 <= anIndex <= 1.0" + + radians := self radiansAt: anIndex. + radians < (Float pi / 2.0) + ifTrue: [ ^ 0 ]. + ^ (radians - (Float pi / 2.0)) sin +] + +{ #category : #examples } +BlAnimationExamplesTest >> bouncingText [ + "Click on letters to start animation!" + + + | letters container animation clickHandler | + letters := 'bloc beta0.1' + collect: [ :aCharacter | self textElement: aCharacter ] + as: Array. + letters withIndexDo: [ :aTextElement :anIndex | "change text color according to index in color spectrum" + aTextElement text: (aTextElement text foreground: + (self colorAt: (anIndex / letters size) asFloat)) ]. + + animation := BlParallelAnimation withAll: + (letters withIndexCollect: [ :aChild :anIndex | + | jiggle | + jiggle := self jiggleAnimation. + jiggle delay: 20 milliSeconds * (anIndex - 1). + jiggle target: aChild. + jiggle ]). + + container := self textContainer. + container addChildren: letters. + + clickHandler := nil. + clickHandler := BlEventHandler + on: BlClickEvent + do: [ + container removeEventHandler: clickHandler. + container addAnimation: animation ]. + container addEventHandler: clickHandler. + + ^ self frameContainer addChild: container +] + +{ #category : #accessing } +BlAnimationExamplesTest >> colorAt: anIndex [ + | normalizedIndex | + "0.0 <= anIndex <= 1.0" + + normalizedIndex := anIndex. + "Because of float errors" + normalizedIndex > 1 ifTrue: [ normalizedIndex := 1 ]. + normalizedIndex < 0 ifTrue: [ normalizedIndex := 0 ]. + + ^ Color + r: (self redAt: normalizedIndex) + g: (self greenAt: normalizedIndex) + b: (self blueAt: normalizedIndex) +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> exampleDate [ + ^ DateAndTime year: 2018 month: 3 day: 31 +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> exampleDelay [ + ^ 0.5 seconds +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> exampleDuration [ + ^ 2 seconds +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> firstSequentialDuration [ + ^ 8 seconds +] + { #category : #'examples - sequential animation' } -BlAnimationExamples >> _1_1_sequential_addFirstChild [ +BlAnimationExamplesTest >> firstSequentialLoops [ + ^ 2 +] + +{ #category : #'instance creation' } +BlAnimationExamplesTest >> frameContainer [ + + + ^ BlElement new + layout: BlLinearLayout horizontal alignCenter; + constraintsDo: [ :c | + c horizontal matchParent. + c vertical matchParent ]; + clipChildren: false +] + +{ #category : #accessing } +BlAnimationExamplesTest >> greenAt: anIndex [ + | radians | + "0.0 <= anIndex <= 1.0" + + radians := self radiansAt: anIndex. + radians > Float pi + ifTrue: [ ^ 0 ]. + ^ radians sin +] + +{ #category : #'instance creation' } +BlAnimationExamplesTest >> jiggleAnimation [ + + + | anAnimation | + anAnimation := BlTransformAnimation new. + anAnimation transform + translateBy: 0 @ (50 + 20 atRandom) negated; + rotateBy: 30 atRandom - 15; + scaleBy: 1.3 + (20 atRandom / 100.0) @ (1.3 + (20 atRandom / 100.0)); + apply. + anAnimation absolute. + anAnimation easing: (BlSineInterpolator new range: Float pi). + anAnimation loops: 3. + anAnimation duration: 1 second. + + ^ anAnimation +] + +{ #category : #accessing } +BlAnimationExamplesTest >> radiansAt: anIndex [ + "0.0 <= anIndex <= 1.0" + self assert: [ anIndex between: 0.0 and: 1.0 ]. + + ^ anIndex * (Float pi * 3) / 2.0 +] + +{ #category : #accessing } +BlAnimationExamplesTest >> redAt: anIndex [ + | radians | + "0.0 <= anIndex <= 1.0" + + radians := self radiansAt: anIndex. + (radians between: Float pi / 2.0 and: Float pi) + ifTrue: [ ^ 0 ]. + + radians < (Float pi/ 2.0) + ifTrue: [ ^ (radians + (Float pi / 2)) sin ]. + + ^ (radians + Float pi) sin +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> secondSequentialDelay [ + ^ 2 seconds +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> secondSequentialDuration [ + ^ 4 seconds +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> secondSequentialLoops [ + ^ 1 +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> testBaseAnimation [ + + + | aBaseAnimation | + aBaseAnimation := BlAnimation new. + aBaseAnimation time: (BlTime simulated date: self exampleDate). + + self assert: aBaseAnimation loops equals: 1. + self assert: aBaseAnimation progress equals: 0. + self assert: aBaseAnimation delay equals: 0 seconds. + self assert: aBaseAnimation duration equals: 1 seconds. + self assert: aBaseAnimation isStarted not. + self assert: aBaseAnimation isRunning not. + self assert: aBaseAnimation isInfinite not. + + ^ aBaseAnimation +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> testBaseAnimationWithDelay [ + + + | aBaseAnimation | + aBaseAnimation := BlAnimation new. + aBaseAnimation time: (BlTime simulated date: self exampleDate). + + aBaseAnimation delay: self exampleDelay. + + self assert: aBaseAnimation loops equals: 1. + self assert: aBaseAnimation progress equals: 0. + self assert: aBaseAnimation delay equals: self exampleDelay. + self assert: aBaseAnimation duration equals: 1 seconds. + self assert: aBaseAnimation isStarted not. + self assert: aBaseAnimation isRunning not. + + ^ aBaseAnimation +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> testBaseAnimationWithDelayAndDurationAndTwoLoops [ + + + | aBaseAnimation | + aBaseAnimation := BlAnimation new. + aBaseAnimation time: (BlTime simulated date: self exampleDate). + + aBaseAnimation delay: self exampleDelay. + aBaseAnimation loops: 2. + aBaseAnimation duration: self exampleDuration. + + self assert: aBaseAnimation loops equals: 2. + self assert: aBaseAnimation progress equals: 0. + self assert: aBaseAnimation delay equals: self exampleDelay. + self assert: aBaseAnimation duration equals: self exampleDuration. + self assert: aBaseAnimation isStarted not. + self assert: aBaseAnimation isRunning not. + + ^ aBaseAnimation +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> testBaseAnimationWithDelayAndTwoLoops [ + + + | aBaseAnimation | + aBaseAnimation := BlAnimation new. + aBaseAnimation time: (BlTime simulated date: self exampleDate). + + aBaseAnimation delay: self exampleDelay. + aBaseAnimation loops: 2. + + self assert: aBaseAnimation loops equals: 2. + self assert: aBaseAnimation progress equals: 0. + self assert: aBaseAnimation delay equals: self exampleDelay. + self assert: aBaseAnimation duration equals: 1 seconds. + self assert: aBaseAnimation isStarted not. + self assert: aBaseAnimation isRunning not. + + ^ aBaseAnimation +] + +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> testInfiniteAnimation [ + + + | aBaseAnimation | + aBaseAnimation := BlAnimation new. + aBaseAnimation time: (BlTime simulated date: self exampleDate). + aBaseAnimation beInfinite. + + self assert: aBaseAnimation loops equals: Float infinity. + self assert: aBaseAnimation loopCount equals: 0. + self assert: aBaseAnimation progress equals: 0. + self assert: aBaseAnimation delay equals: 0 seconds. + self assert: aBaseAnimation duration equals: 1 seconds. + self assert: aBaseAnimation isStarted not. + self assert: aBaseAnimation isRunning not. + self assert: aBaseAnimation isInfinite. + + ^ aBaseAnimation +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> testSequentialAddFirstChild [ | aSequentialAnimation | - aSequentialAnimation := self sequentialAnimationWithDelayAndTwoLoops. + aSequentialAnimation := self testSequentialAnimationWithDelayAndTwoLoops. aSequentialAnimation add: (BlAnimation new duration: self firstSequentialDuration; loops: self firstSequentialLoops). self @@ -110,30 +378,112 @@ BlAnimationExamples >> _1_1_sequential_addFirstChild [ ] { #category : #'examples - sequential animation' } -BlAnimationExamples >> _1_2_sequential_addSecondChild [ - - | aSequentialAnimation aTotalDuration | +BlAnimationExamplesTest >> testSequentialAnimation [ + + | aSequentialAnimation | - aSequentialAnimation := self _1_1_sequential_addFirstChild. - aSequentialAnimation add: (BlAnimation new - duration: self secondSequentialDuration; - loops: self secondSequentialLoops; - delay: self secondSequentialDelay). + aSequentialAnimation := BlSequentialAnimation new. + aSequentialAnimation time: (BlTime simulated date: self exampleDate). + + self assert: aSequentialAnimation duration equals: 0 seconds. + self assert: aSequentialAnimation delay equals: 0 seconds. + self assert: aSequentialAnimation loops equals: 1. + "self assert: aSequentialAnimation repeats equals: 0. repeats is undefined so comment it for now" + self assert: aSequentialAnimation progress equals: 0. + self assert: aSequentialAnimation isStarted not. + self assert: aSequentialAnimation isRunning not. + + ^ aSequentialAnimation +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> testSequentialAnimationWithDelay [ + + + | aSequentialAnimation | + aSequentialAnimation := BlSequentialAnimation new. + aSequentialAnimation time: (BlTime simulated date: self exampleDate). + + aSequentialAnimation delay: self exampleDelay. + + self assert: aSequentialAnimation duration equals: 0 seconds. + self assert: aSequentialAnimation delay equals: self exampleDelay. + self assert: aSequentialAnimation loops equals: 1. + self assert: aSequentialAnimation progress equals: 0. + self assert: aSequentialAnimation isStarted not. + self assert: aSequentialAnimation isRunning not. + + ^ aSequentialAnimation +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> testSequentialAnimationWithDelayAndTwoLoops [ + + + | aSequentialAnimation | + aSequentialAnimation := BlSequentialAnimation new. + aSequentialAnimation time: (BlTime simulated date: self exampleDate). + + aSequentialAnimation delay: self exampleDelay. + aSequentialAnimation loops: 2. + + self assert: aSequentialAnimation duration equals: 0 seconds. + self assert: aSequentialAnimation delay equals: self exampleDelay. + self assert: aSequentialAnimation loops equals: 2. + "self assert: aSequentialAnimation repeats equals: 0. repeats is undefined so comment it for now" + self assert: aSequentialAnimation progress equals: 0. + self assert: aSequentialAnimation isStarted not. + self assert: aSequentialAnimation isRunning not. + + ^ aSequentialAnimation +] + +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> test_1_1_sequential_addFirstChild [ + - aTotalDuration := self firstSequentialDuration * self firstSequentialLoops. - aTotalDuration := aTotalDuration + ((self secondSequentialDuration + self secondSequentialDelay) * self secondSequentialLoops). + | aSequentialAnimation | + + aSequentialAnimation := self testSequentialAnimationWithDelayAndTwoLoops. + aSequentialAnimation add: (BlAnimation new duration: self firstSequentialDuration; loops: self firstSequentialLoops). - self assert: aSequentialAnimation duration equals: aTotalDuration. + self + assert: aSequentialAnimation duration + equals: self firstSequentialDuration * self firstSequentialLoops. ^ aSequentialAnimation ] +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> test_1_2_sequential_addSecondChild [ + + + | aSequentialAnimation aTotalDuration | + aSequentialAnimation := self test_1_1_sequential_addFirstChild. + aSequentialAnimation add: (BlAnimation new + duration: self secondSequentialDuration; + loops: self secondSequentialLoops; + delay: self secondSequentialDelay). + + aTotalDuration := self firstSequentialDuration + * self firstSequentialLoops. + aTotalDuration := aTotalDuration + + + (self secondSequentialDuration + + self secondSequentialDelay + * self secondSequentialLoops). + + self assert: aSequentialAnimation duration equals: aTotalDuration. + + ^ aSequentialAnimation +] + { #category : #'examples - base animation' } -BlAnimationExamples >> _1_baseAnimation_start [ - +BlAnimationExamplesTest >> test_1_baseAnimation_start [ + + | aBaseAnimation | - - aBaseAnimation := self baseAnimationWithDelayAndDurationAndTwoLoops. + aBaseAnimation := self testBaseAnimationWithDelayAndDurationAndTwoLoops. aBaseAnimation start. self assert: aBaseAnimation progress equals: 0. @@ -143,22 +493,23 @@ BlAnimationExamples >> _1_baseAnimation_start [ self assert: aBaseAnimation isRunning. self assert: aBaseAnimation startTime equals: self exampleDate. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - infinite' } -BlAnimationExamples >> _1_massive_infiniteAnimation_start [ - - | aBaseAnimation | +BlAnimationExamplesTest >> test_1_massive_infiniteAnimation_start [ - aBaseAnimation := self baseAnimation. + + | aBaseAnimation | + aBaseAnimation := self testBaseAnimation. aBaseAnimation duration: self exampleDuration. aBaseAnimation beInfinite. aBaseAnimation start. @@ -172,21 +523,20 @@ BlAnimationExamples >> _1_massive_infiniteAnimation_start [ self assert: aBaseAnimation startTime equals: self exampleDate. self assert: aBaseAnimation delayedStartTime equals: self exampleDate. - + self assert: aBaseAnimation loops equals: Float infinity. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - one' } -BlAnimationExamples >> _1_massive_oneLoopAnimation_start [ - +BlAnimationExamplesTest >> test_1_massive_oneLoopAnimation_start [ + + | aBaseAnimation | - - aBaseAnimation := self baseAnimation. + aBaseAnimation := self testBaseAnimation. aBaseAnimation duration: self exampleDuration. aBaseAnimation start. @@ -198,21 +548,20 @@ BlAnimationExamples >> _1_massive_oneLoopAnimation_start [ self assert: aBaseAnimation startTime equals: self exampleDate. self assert: aBaseAnimation delayedStartTime equals: self exampleDate. - + self assert: aBaseAnimation loops equals: 1. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - two' } -BlAnimationExamples >> _1_massive_twoLoopAnimation_start [ - +BlAnimationExamplesTest >> test_1_massive_twoLoopAnimation_start [ + + | aBaseAnimation | - - aBaseAnimation := self baseAnimation. + aBaseAnimation := self testBaseAnimation. aBaseAnimation loops: 2. aBaseAnimation duration: self exampleDuration. aBaseAnimation start. @@ -225,21 +574,20 @@ BlAnimationExamples >> _1_massive_twoLoopAnimation_start [ self assert: aBaseAnimation startTime equals: self exampleDate. self assert: aBaseAnimation delayedStartTime equals: self exampleDate. - + self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _2_1_baseAnimation_step [ - +BlAnimationExamplesTest >> test_2_1_baseAnimation_step [ + + | aBaseAnimation | - - aBaseAnimation := self _1_baseAnimation_start. + aBaseAnimation := self test_1_baseAnimation_start. "do a cycle without advancing the clock" aBaseAnimation run. @@ -250,26 +598,27 @@ BlAnimationExamples >> _2_1_baseAnimation_step [ self assert: aBaseAnimation isRunning. self assert: aBaseAnimation startTime equals: self exampleDate. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - infinite' } -BlAnimationExamples >> _2_1_massive_infiniteAnimation_step_oneDuration [ - +BlAnimationExamplesTest >> test_2_1_massive_infiniteAnimation_step_oneDuration [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_infiniteAnimation_start. + aBaseAnimation := self test_1_massive_infiniteAnimation_start. aBaseAnimation time wait: self exampleDuration. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 1.0. self assert: aBaseAnimation elapsedTime equals: self exampleDuration. @@ -279,25 +628,24 @@ BlAnimationExamples >> _2_1_massive_infiniteAnimation_step_oneDuration [ self assert: aBaseAnimation startTime equals: self exampleDate. self assert: aBaseAnimation delayedStartTime equals: self exampleDate. - + self assert: aBaseAnimation loops equals: Float infinity. - self assert: aBaseAnimation repeats equals: 1. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - one' } -BlAnimationExamples >> _2_1_massive_oneLoopAnimation_step_oneDuration [ - +BlAnimationExamplesTest >> test_2_1_massive_oneLoopAnimation_step_oneDuration [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_oneLoopAnimation_start. + aBaseAnimation := self test_1_massive_oneLoopAnimation_start. aBaseAnimation time wait: self exampleDuration. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 1.0. self assert: aBaseAnimation elapsedTime equals: self exampleDuration. @@ -306,25 +654,24 @@ BlAnimationExamples >> _2_1_massive_oneLoopAnimation_step_oneDuration [ self assert: aBaseAnimation startTime equals: self exampleDate. self assert: aBaseAnimation delayedStartTime equals: self exampleDate. - + self assert: aBaseAnimation loops equals: 1. - self assert: aBaseAnimation repeats equals: 1. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - two' } -BlAnimationExamples >> _2_1_massive_twoLoopAnimation_step_oneDuration [ - +BlAnimationExamplesTest >> test_2_1_massive_twoLoopAnimation_step_oneDuration [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_twoLoopAnimation_start. + aBaseAnimation := self test_1_massive_twoLoopAnimation_start. aBaseAnimation time wait: self exampleDuration. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 1.0. self assert: aBaseAnimation elapsedTime equals: self exampleDuration. @@ -335,7 +682,6 @@ BlAnimationExamples >> _2_1_massive_twoLoopAnimation_step_oneDuration [ self assert: aBaseAnimation delayedStartTime equals: self exampleDate. self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 1. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. @@ -343,11 +689,11 @@ BlAnimationExamples >> _2_1_massive_twoLoopAnimation_step_oneDuration [ ] { #category : #'examples - sequential animation' } -BlAnimationExamples >> _2_1_sequential_step [ - - | aSequentialAnimation | +BlAnimationExamplesTest >> test_2_1_sequential_step [ - aSequentialAnimation := self _1_2_sequential_addSecondChild. + + | aSequentialAnimation | + aSequentialAnimation := self test_1_2_sequential_addSecondChild. aSequentialAnimation run. self assert: aSequentialAnimation progress equals: 0. @@ -357,22 +703,23 @@ BlAnimationExamples >> _2_1_sequential_step [ self assert: aSequentialAnimation isRunning. self assert: aSequentialAnimation startTime equals: self exampleDate. - self assert: aSequentialAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aSequentialAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aSequentialAnimation loops equals: 2. - self assert: aSequentialAnimation repeats equals: 0. self assert: aSequentialAnimation delay equals: self exampleDelay. - + ^ aSequentialAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _2_2_baseAnimation_step_halfDelay [ +BlAnimationExamplesTest >> test_2_2_baseAnimation_step_halfDelay [ "in this example we see what exactly happens when half of delay elapsed" - + + | aBaseAnimation | - - aBaseAnimation := self _2_1_baseAnimation_step. + aBaseAnimation := self test_2_1_baseAnimation_step. aBaseAnimation time wait: self exampleDelay / 2.0. aBaseAnimation run. @@ -384,26 +731,27 @@ BlAnimationExamples >> _2_2_baseAnimation_step_halfDelay [ self assert: aBaseAnimation isRunning. self assert: aBaseAnimation startTime equals: self exampleDate. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - infinite' } -BlAnimationExamples >> _2_2_massive_infiniteAnimation_step_twiceDuration [ - +BlAnimationExamplesTest >> test_2_2_massive_infiniteAnimation_step_twiceDuration [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_infiniteAnimation_start. + aBaseAnimation := self test_1_massive_infiniteAnimation_start. aBaseAnimation time wait: self exampleDuration * 2. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 1.0. self assert: aBaseAnimation elapsedTime equals: self exampleDuration. @@ -411,27 +759,30 @@ BlAnimationExamples >> _2_2_massive_infiniteAnimation_step_twiceDuration [ self assert: aBaseAnimation isRunning. self assert: aBaseAnimation isInfinite. - self assert: aBaseAnimation startTime equals: self exampleDate + self exampleDuration. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDuration. - + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDuration. + self assert: aBaseAnimation loops equals: Float infinity. - self assert: aBaseAnimation repeats equals: 2. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - one' } -BlAnimationExamples >> _2_2_massive_oneLoopAnimation_step_twiceDuration [ - +BlAnimationExamplesTest >> test_2_2_massive_oneLoopAnimation_step_twiceDuration [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_oneLoopAnimation_start. + aBaseAnimation := self test_1_massive_oneLoopAnimation_start. aBaseAnimation time wait: self exampleDuration * 2. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 1.0. self assert: aBaseAnimation elapsedTime equals: self exampleDuration. @@ -440,21 +791,20 @@ BlAnimationExamples >> _2_2_massive_oneLoopAnimation_step_twiceDuration [ self assert: aBaseAnimation startTime equals: self exampleDate. self assert: aBaseAnimation delayedStartTime equals: self exampleDate. - + self assert: aBaseAnimation loops equals: 1. - self assert: aBaseAnimation repeats equals: 1. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - two' } -BlAnimationExamples >> _2_2_massive_twoLoopAnimation_step_twiceDuration [ - - | aBaseAnimation | +BlAnimationExamplesTest >> test_2_2_massive_twoLoopAnimation_step_twiceDuration [ - aBaseAnimation := self _1_massive_twoLoopAnimation_start. + + | aBaseAnimation | + aBaseAnimation := self test_1_massive_twoLoopAnimation_start. aBaseAnimation time wait: self exampleDuration * 2. aBaseAnimation run. @@ -465,24 +815,27 @@ BlAnimationExamples >> _2_2_massive_twoLoopAnimation_step_twiceDuration [ self assert: aBaseAnimation isStarted. self assert: aBaseAnimation isRunning not. - self assert: aBaseAnimation startTime equals: self exampleDate + self exampleDuration. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDuration. + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDuration. self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 2. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _2_3_baseAnimation_step_fullDelay [ +BlAnimationExamplesTest >> test_2_3_baseAnimation_step_fullDelay [ "in this example we see what exactly happens when the whole delay elapsed" - - | aBaseAnimation | - aBaseAnimation := self _2_2_baseAnimation_step_halfDelay. + + | aBaseAnimation | + aBaseAnimation := self test_2_2_baseAnimation_step_halfDelay. aBaseAnimation time wait: self exampleDelay / 2.0. aBaseAnimation run. @@ -494,26 +847,27 @@ BlAnimationExamples >> _2_3_baseAnimation_step_fullDelay [ self assert: aBaseAnimation isRunning. self assert: aBaseAnimation startTime equals: self exampleDate. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - infinite' } -BlAnimationExamples >> _2_3_massive_infiniteAnimation_step_trippleDuration [ - +BlAnimationExamplesTest >> test_2_3_massive_infiniteAnimation_step_trippleDuration [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_infiniteAnimation_start. + aBaseAnimation := self test_1_massive_infiniteAnimation_start. aBaseAnimation time wait: self exampleDuration * 3. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 1.0. self assert: aBaseAnimation elapsedTime equals: self exampleDuration. @@ -521,55 +875,63 @@ BlAnimationExamples >> _2_3_massive_infiniteAnimation_step_trippleDuration [ self assert: aBaseAnimation isRunning. self assert: aBaseAnimation isInfinite. - self assert: aBaseAnimation startTime equals: self exampleDate + (self exampleDuration * 2). - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + (self exampleDuration * 2). - + self + assert: aBaseAnimation startTime + equals: self exampleDate + (self exampleDuration * 2). + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + (self exampleDuration * 2). + self assert: aBaseAnimation loops equals: Float infinity. - self assert: aBaseAnimation repeats equals: 3. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - infinite' } -BlAnimationExamples >> _2_3_massive_infiniteAnimation_step_trippleDurationAndHalf [ - +BlAnimationExamplesTest >> test_2_3_massive_infiniteAnimation_step_trippleDurationAndHalf [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_infiniteAnimation_start. + aBaseAnimation := self test_1_massive_infiniteAnimation_start. aBaseAnimation time wait: self exampleDuration * 3.5. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 0.5. - self assert: aBaseAnimation elapsedTime equals: self exampleDuration / 2.0. + self + assert: aBaseAnimation elapsedTime + equals: self exampleDuration / 2.0. self assert: aBaseAnimation isStarted. self assert: aBaseAnimation isRunning. self assert: aBaseAnimation isInfinite. - self assert: aBaseAnimation startTime equals: self exampleDate + (self exampleDuration * 3). - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + (self exampleDuration * 3). - + self + assert: aBaseAnimation startTime + equals: self exampleDate + (self exampleDuration * 3). + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + (self exampleDuration * 3). + self assert: aBaseAnimation loops equals: Float infinity. - self assert: aBaseAnimation repeats equals: 3. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - one' } -BlAnimationExamples >> _2_3_massive_oneLoopAnimation_step_trippleDuration [ - +BlAnimationExamplesTest >> test_2_3_massive_oneLoopAnimation_step_trippleDuration [ + + | aBaseAnimation | - - aBaseAnimation := self _1_massive_oneLoopAnimation_start. + aBaseAnimation := self test_1_massive_oneLoopAnimation_start. aBaseAnimation time wait: self exampleDuration * 3. - + aBaseAnimation run. - + self assert: aBaseAnimation progress equals: 1.0. self assert: aBaseAnimation elapsedTime equals: self exampleDuration. @@ -578,21 +940,20 @@ BlAnimationExamples >> _2_3_massive_oneLoopAnimation_step_trippleDuration [ self assert: aBaseAnimation startTime equals: self exampleDate. self assert: aBaseAnimation delayedStartTime equals: self exampleDate. - + self assert: aBaseAnimation loops equals: 1. - self assert: aBaseAnimation repeats equals: 1. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - massive time delta - two' } -BlAnimationExamples >> _2_3_massive_twoLoopAnimation_step_trippleDuration [ - - | aBaseAnimation | +BlAnimationExamplesTest >> test_2_3_massive_twoLoopAnimation_step_trippleDuration [ - aBaseAnimation := self _1_massive_twoLoopAnimation_start. + + | aBaseAnimation | + aBaseAnimation := self test_1_massive_twoLoopAnimation_start. aBaseAnimation time wait: self exampleDuration * 3. aBaseAnimation run. @@ -603,53 +964,59 @@ BlAnimationExamples >> _2_3_massive_twoLoopAnimation_step_trippleDuration [ self assert: aBaseAnimation isStarted. self assert: aBaseAnimation isRunning not. - self assert: aBaseAnimation startTime equals: self exampleDate + self exampleDuration. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDuration. + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDuration. self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 2. self assert: aBaseAnimation delay equals: 0 seconds. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _3_1_baseAnimation_step_quarterOfDuration [ +BlAnimationExamplesTest >> test_3_1_baseAnimation_step_quarterOfDuration [ "in this example we see what exactly happens when one quarter of duration is passed" - - | aBaseAnimation | - aBaseAnimation := self _2_3_baseAnimation_step_fullDelay. + + | aBaseAnimation | + aBaseAnimation := self test_2_3_baseAnimation_step_fullDelay. aBaseAnimation time wait: self exampleDuration / 4.0. aBaseAnimation run. self assert: aBaseAnimation progress equals: 0.25. - self assert: aBaseAnimation elapsedTime equals: self exampleDuration / 4.0. + self + assert: aBaseAnimation elapsedTime + equals: self exampleDuration / 4.0. self assert: aBaseAnimation isStarted. self assert: aBaseAnimation isRunning. self assert: aBaseAnimation startTime equals: self exampleDate. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - sequential animation' } -BlAnimationExamples >> _3_1_sequential_step_halfDelay [ +BlAnimationExamplesTest >> test_3_1_sequential_step_halfDelay [ "in this example we see what exactly happens when a half of the delay elapsed" - + + | aSequentialAnimation | - - aSequentialAnimation := self _2_1_sequential_step. + aSequentialAnimation := self test_2_1_sequential_step. aSequentialAnimation time wait: self exampleDelay / 2.0. aSequentialAnimation run. @@ -661,50 +1028,54 @@ BlAnimationExamples >> _3_1_sequential_step_halfDelay [ self assert: aSequentialAnimation isRunning. self assert: aSequentialAnimation startTime equals: self exampleDate. - self assert: aSequentialAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aSequentialAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aSequentialAnimation loops equals: 2. - self assert: aSequentialAnimation repeats equals: 0. self assert: aSequentialAnimation delay equals: self exampleDelay. - + ^ aSequentialAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _3_2_baseAnimation_step_halfOfDuration [ +BlAnimationExamplesTest >> test_3_2_baseAnimation_step_halfOfDuration [ "in this example we see what exactly happens when half of the duration is passed" - - | aBaseAnimation | - aBaseAnimation := self _3_1_baseAnimation_step_quarterOfDuration. + + | aBaseAnimation | + aBaseAnimation := self test_3_1_baseAnimation_step_quarterOfDuration. aBaseAnimation time wait: self exampleDuration / 4.0. aBaseAnimation run. self assert: aBaseAnimation progress equals: 0.5. - self assert: aBaseAnimation elapsedTime equals: self exampleDuration / 2.0. + self + assert: aBaseAnimation elapsedTime + equals: self exampleDuration / 2.0. self assert: aBaseAnimation isStarted. self assert: aBaseAnimation isRunning. self assert: aBaseAnimation startTime equals: self exampleDate. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. - + ^ aBaseAnimation ] { #category : #'examples - sequential animation' } -BlAnimationExamples >> _3_2_sequential_step_fullDelay [ - +BlAnimationExamplesTest >> test_3_2_sequential_step_fullDelay [ + + | aSequentialAnimation | - - aSequentialAnimation := self _3_1_sequential_step_halfDelay. + aSequentialAnimation := self test_3_1_sequential_step_halfDelay. aSequentialAnimation time wait: self exampleDelay / 2.0. aSequentialAnimation run. @@ -716,26 +1087,30 @@ BlAnimationExamples >> _3_2_sequential_step_fullDelay [ self assert: aSequentialAnimation isRunning. self assert: aSequentialAnimation startTime equals: self exampleDate. - self assert: aSequentialAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aSequentialAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aSequentialAnimation loops equals: 2. - self assert: aSequentialAnimation repeats equals: 0. self assert: aSequentialAnimation delay equals: self exampleDelay. - + ^ aSequentialAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _3_3_baseAnimation_step_fullDuration [ +BlAnimationExamplesTest >> test_3_3_baseAnimation_step_fullDuration [ "in this example we see what exactly happens when the whole duration is passed" - - | aBaseAnimation loopDoneListener loopDoneCount | - aBaseAnimation := self _3_2_baseAnimation_step_halfOfDuration. + + | aBaseAnimation loopDoneListener loopDoneCount | + aBaseAnimation := self test_3_2_baseAnimation_step_halfOfDuration. aBaseAnimation time wait: self exampleDuration / 2.0. loopDoneCount := 0. - loopDoneListener := BlEventHandler on: BlAnimationLoopDoneEvent do: [ :anEvent | loopDoneCount := loopDoneCount + 1 ]. + loopDoneListener := BlEventHandler + on: BlAnimationLoopDoneEvent + do: [ :anEvent | + loopDoneCount := loopDoneCount + 1 ]. aBaseAnimation addEventHandler: loopDoneListener. aBaseAnimation run. @@ -748,102 +1123,25 @@ BlAnimationExamples >> _3_3_baseAnimation_step_fullDuration [ self assert: aBaseAnimation isRunning. self assert: aBaseAnimation startTime equals: self exampleDate. - self assert: aBaseAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - - self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 1. - self assert: aBaseAnimation delay equals: self exampleDelay. - self assert: aBaseAnimation duration equals: self exampleDuration. - - aBaseAnimation removeEventHandler: loopDoneListener. - - ^ aBaseAnimation -] - -{ #category : #'examples - base animation' } -BlAnimationExamples >> _4_1_baseAnimation_secondLoop_step_halfDelay [ - - | aBaseAnimation | - - aBaseAnimation := self _3_3_baseAnimation_step_fullDuration. - aBaseAnimation time wait: self exampleDelay / 2.0. - aBaseAnimation run. - - self assert: aBaseAnimation progress equals: 0.0. - self assert: aBaseAnimation elapsedTime equals: 0 seconds. - - self assert: aBaseAnimation isStarted. - self assert: aBaseAnimation isRunning. - - self assert: aBaseAnimation startTime equals: (self exampleDate + self exampleDelay + self exampleDuration). - self assert: aBaseAnimation delayedStartTime equals: (self exampleDate + self exampleDelay + self exampleDuration) + self exampleDelay. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 1. - self assert: aBaseAnimation delay equals: self exampleDelay. - self assert: aBaseAnimation duration equals: self exampleDuration. - - ^ aBaseAnimation -] - -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> _4_1_sequential_first_step_halfOfDuration [ - - | aSequentialAnimation aFirstAnimation aSecondAnimation | - - aSequentialAnimation := self _3_2_sequential_step_fullDelay. - aSequentialAnimation time wait: self firstSequentialDuration / 2.0. - - aSequentialAnimation run. - - self assert: (aSequentialAnimation progress closeTo: 0.1818181). - self assert: aSequentialAnimation elapsedTime equals: self firstSequentialDuration / 2.0. - - self assert: aSequentialAnimation isStarted. - self assert: aSequentialAnimation isRunning. - - self assert: aSequentialAnimation startTime equals: self exampleDate. - self assert: aSequentialAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - - self assert: aSequentialAnimation loops equals: 2. - self assert: aSequentialAnimation repeats equals: 0. - self assert: aSequentialAnimation delay equals: self exampleDelay. - - aFirstAnimation := aSequentialAnimation animations first. - - self assert: aFirstAnimation progress equals: 0.5. - self assert: aFirstAnimation elapsedTime equals: self firstSequentialDuration / 2.0. - - self assert: aFirstAnimation isStarted. - self assert: aFirstAnimation isRunning. - - self assert: aFirstAnimation startTime equals: self exampleDate + self exampleDelay. - self assert: aFirstAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - - self assert: aFirstAnimation loops equals: self firstSequentialLoops. - self assert: aFirstAnimation repeats equals: 0. - self assert: aFirstAnimation delay equals: 0 seconds. - - aSecondAnimation := aSequentialAnimation animations second. - - self assert: aSecondAnimation progress equals: 0. + self assert: aBaseAnimation delay equals: self exampleDelay. + self assert: aBaseAnimation duration equals: self exampleDuration. - self assert: aSecondAnimation isStarted not. - self assert: aSecondAnimation isRunning not. - - self assert: aSecondAnimation loops equals: self secondSequentialLoops. - self assert: aSecondAnimation repeats equals: 0. - self assert: aSecondAnimation delay equals: self secondSequentialDelay. - - ^ aSequentialAnimation + aBaseAnimation removeEventHandler: loopDoneListener. + + ^ aBaseAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _4_2_baseAnimation_secondLoop_step_fullDelay [ - - | aBaseAnimation | +BlAnimationExamplesTest >> test_4_1_baseAnimation_secondLoop_step_halfDelay [ - aBaseAnimation := self _4_1_baseAnimation_secondLoop_step_halfDelay. + + | aBaseAnimation | + aBaseAnimation := self test_3_3_baseAnimation_step_fullDuration. aBaseAnimation time wait: self exampleDelay / 2.0. aBaseAnimation run. @@ -853,11 +1151,15 @@ BlAnimationExamples >> _4_2_baseAnimation_secondLoop_step_fullDelay [ self assert: aBaseAnimation isStarted. self assert: aBaseAnimation isRunning. - self assert: aBaseAnimation startTime equals: (self exampleDate + self exampleDelay + self exampleDuration). - self assert: aBaseAnimation delayedStartTime equals: (self exampleDate + self exampleDelay + self exampleDuration) + self exampleDelay. + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDelay + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay + self exampleDuration + + self exampleDelay. self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 1. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. @@ -865,617 +1167,422 @@ BlAnimationExamples >> _4_2_baseAnimation_secondLoop_step_fullDelay [ ] { #category : #'examples - sequential animation' } -BlAnimationExamples >> _4_2_sequential_first_step_fullDuration [ - +BlAnimationExamplesTest >> test_4_1_sequential_first_step_halfOfDuration [ + + | aSequentialAnimation aFirstAnimation aSecondAnimation | - - aSequentialAnimation := self _4_1_sequential_first_step_halfOfDuration. + aSequentialAnimation := self test_3_2_sequential_step_fullDelay. aSequentialAnimation time wait: self firstSequentialDuration / 2.0. aSequentialAnimation run. - self assert: (aSequentialAnimation progress closeTo: 0.363636). - self assert: aSequentialAnimation elapsedTime equals: self firstSequentialDuration. + self assert: (aSequentialAnimation progress closeTo: 0.1818181). + self + assert: aSequentialAnimation elapsedTime + equals: self firstSequentialDuration / 2.0. self assert: aSequentialAnimation isStarted. self assert: aSequentialAnimation isRunning. self assert: aSequentialAnimation startTime equals: self exampleDate. - self assert: aSequentialAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - - self assert: aSequentialAnimation loops equals: 2. - self assert: aSequentialAnimation repeats equals: 0. - self assert: aSequentialAnimation delay equals: self exampleDelay. - - aFirstAnimation := aSequentialAnimation animations first. - - self assert: aFirstAnimation progress equals: 1.0. - self assert: aFirstAnimation elapsedTime equals: self firstSequentialDuration. - - self assert: aFirstAnimation isStarted. - self assert: aFirstAnimation isRunning. - - self assert: aFirstAnimation startTime equals: self exampleDate + self exampleDelay. - self assert: aFirstAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - - self assert: aFirstAnimation loops equals: self firstSequentialLoops. - self assert: aFirstAnimation repeats equals: 1. - self assert: aFirstAnimation delay equals: 0 seconds. - - aSecondAnimation := aSequentialAnimation animations second. - - self assert: aSecondAnimation progress equals: 0. - - self assert: aSecondAnimation isStarted not. - self assert: aSecondAnimation isRunning not. - - self assert: aSecondAnimation loops equals: self secondSequentialLoops. - self assert: aSecondAnimation repeats equals: 0. - self assert: aSecondAnimation delay equals: self secondSequentialDelay. - - ^ aSequentialAnimation -] - -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> _4_2_sequential_first_step_fullDurationAndHalf [ - "The animation state must be equal to _5_1_sequential_first_secondStep_halfDuration, - because we move time by the same amount" - - | aSequentialAnimation aFirstAnimation aSecondAnimation | - - aSequentialAnimation := self _4_1_sequential_first_step_halfOfDuration. - aSequentialAnimation time wait: self firstSequentialDuration. - - aSequentialAnimation run. - - self assert: (aSequentialAnimation progress closeTo: 0.545454545). - self assert: aSequentialAnimation elapsedTime equals: self firstSequentialDuration + (self firstSequentialDuration / 2.0). - - self assert: aSequentialAnimation isStarted. - self assert: aSequentialAnimation isRunning. + self + assert: aSequentialAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. - self assert: aSequentialAnimation startTime equals: self exampleDate. - self assert: aSequentialAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - self assert: aSequentialAnimation loops equals: 2. - self assert: aSequentialAnimation repeats equals: 0. self assert: aSequentialAnimation delay equals: self exampleDelay. - + aFirstAnimation := aSequentialAnimation animations first. - + self assert: aFirstAnimation progress equals: 0.5. - self assert: aFirstAnimation elapsedTime equals: self firstSequentialDuration / 2.0. + self + assert: aFirstAnimation elapsedTime + equals: self firstSequentialDuration / 2.0. self assert: aFirstAnimation isStarted. self assert: aFirstAnimation isRunning. - self assert: aFirstAnimation startTime equals: self exampleDate + self exampleDelay + self firstSequentialDuration. - self assert: aFirstAnimation delayedStartTime equals: self exampleDate + self exampleDelay + self firstSequentialDuration. - + self + assert: aFirstAnimation startTime + equals: self exampleDate + self exampleDelay. + self + assert: aFirstAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aFirstAnimation loops equals: self firstSequentialLoops. - self assert: aFirstAnimation repeats equals: 1. + self assert: aFirstAnimation repeats equals: 0. self assert: aFirstAnimation delay equals: 0 seconds. - + aSecondAnimation := aSequentialAnimation animations second. - + self assert: aSecondAnimation progress equals: 0. self assert: aSecondAnimation isStarted not. self assert: aSecondAnimation isRunning not. - - self assert: aSecondAnimation loops equals: self secondSequentialLoops. - self assert: aSecondAnimation repeats equals: 0. - self assert: aSecondAnimation delay equals: self secondSequentialDelay. - - ^ aSequentialAnimation -] - -{ #category : #'examples - base animation' } -BlAnimationExamples >> _4_3_baseAnimation_secondLoop_step_quarterOfDuration [ - - | aBaseAnimation | - - aBaseAnimation := self _4_2_baseAnimation_secondLoop_step_fullDelay. - aBaseAnimation time wait: self exampleDuration / 4.0. - aBaseAnimation run. - - self assert: aBaseAnimation progress equals: 0.25. - self assert: aBaseAnimation elapsedTime equals: self exampleDuration / 4.0. - - self assert: aBaseAnimation isStarted. - self assert: aBaseAnimation isRunning. - self assert: aBaseAnimation startTime equals: (self exampleDate + self exampleDelay + self exampleDuration). - self assert: aBaseAnimation delayedStartTime equals: (self exampleDate + self exampleDelay + self exampleDuration) + self exampleDelay. - - self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 1. - self assert: aBaseAnimation delay equals: self exampleDelay. - self assert: aBaseAnimation duration equals: self exampleDuration. + self + assert: aSecondAnimation loops + equals: self secondSequentialLoops. + self + assert: aSecondAnimation delay + equals: self secondSequentialDelay. - ^ aBaseAnimation + ^ aSequentialAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> _4_4_baseAnimation_secondLoop_step_halfOfDuration [ - - | aBaseAnimation | +BlAnimationExamplesTest >> test_4_2_baseAnimation_secondLoop_step_fullDelay [ - aBaseAnimation := self _4_3_baseAnimation_secondLoop_step_quarterOfDuration. - aBaseAnimation time wait: self exampleDuration / 4.0. + + | aBaseAnimation | + aBaseAnimation := self + test_4_1_baseAnimation_secondLoop_step_halfDelay. + aBaseAnimation time wait: self exampleDelay / 2.0. aBaseAnimation run. - self assert: aBaseAnimation progress equals: 0.5. - self assert: aBaseAnimation elapsedTime equals: self exampleDuration / 2.0. + self assert: aBaseAnimation progress equals: 0.0. + self assert: aBaseAnimation elapsedTime equals: 0 seconds. self assert: aBaseAnimation isStarted. self assert: aBaseAnimation isRunning. - self assert: aBaseAnimation startTime equals: (self exampleDate + self exampleDelay + self exampleDuration). - self assert: aBaseAnimation delayedStartTime equals: (self exampleDate + self exampleDelay + self exampleDuration) + self exampleDelay. - - self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 1. - self assert: aBaseAnimation delay equals: self exampleDelay. - self assert: aBaseAnimation duration equals: self exampleDuration. - - ^ aBaseAnimation -] - -{ #category : #'examples - base animation' } -BlAnimationExamples >> _4_5_baseAnimation_secondLoop_step_fullDuration [ - - | aBaseAnimation loopDoneCount loopDoneListener | - - aBaseAnimation := self _4_4_baseAnimation_secondLoop_step_halfOfDuration. - aBaseAnimation time wait: self exampleDuration / 2.0. - - loopDoneCount := 0. - loopDoneListener := BlEventHandler on: BlAnimationLoopDoneEvent do: [ :anEvent | loopDoneCount := loopDoneCount + 1 ]. - aBaseAnimation addEventHandler: loopDoneListener. - - aBaseAnimation run. - - self assert: aBaseAnimation progress equals: 1. - self assert: aBaseAnimation elapsedTime equals: self exampleDuration. - self assert: loopDoneCount equals: 1. - - self assert: aBaseAnimation isStarted. - self assert: aBaseAnimation isRunning not. - - self assert: aBaseAnimation startTime equals: (self exampleDate + self exampleDelay + self exampleDuration). - self assert: aBaseAnimation delayedStartTime equals: (self exampleDate + self exampleDelay + self exampleDuration) + self exampleDelay. + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDelay + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay + self exampleDuration + + self exampleDelay. self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 2. self assert: aBaseAnimation delay equals: self exampleDelay. self assert: aBaseAnimation duration equals: self exampleDuration. - - aBaseAnimation removeEventHandler: loopDoneListener. ^ aBaseAnimation ] { #category : #'examples - sequential animation' } -BlAnimationExamples >> _5_1_sequential_first_secondStep_halfDuration [ - +BlAnimationExamplesTest >> test_4_2_sequential_first_step_fullDuration [ + + | aSequentialAnimation aFirstAnimation aSecondAnimation | - - aSequentialAnimation := self _4_2_sequential_first_step_fullDuration. + aSequentialAnimation := self + test_4_1_sequential_first_step_halfOfDuration. aSequentialAnimation time wait: self firstSequentialDuration / 2.0. aSequentialAnimation run. - self assert: (aSequentialAnimation progress closeTo: 0.545454545). - self assert: aSequentialAnimation elapsedTime equals: self firstSequentialDuration + (self firstSequentialDuration / 2.0). + self assert: (aSequentialAnimation progress closeTo: 0.363636). + self + assert: aSequentialAnimation elapsedTime + equals: self firstSequentialDuration. self assert: aSequentialAnimation isStarted. self assert: aSequentialAnimation isRunning. self assert: aSequentialAnimation startTime equals: self exampleDate. - self assert: aSequentialAnimation delayedStartTime equals: self exampleDate + self exampleDelay. - + self + assert: aSequentialAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aSequentialAnimation loops equals: 2. - self assert: aSequentialAnimation repeats equals: 0. self assert: aSequentialAnimation delay equals: self exampleDelay. - + aFirstAnimation := aSequentialAnimation animations first. - - self assert: aFirstAnimation progress equals: 0.5. - self assert: aFirstAnimation elapsedTime equals: self firstSequentialDuration / 2.0. + + self assert: aFirstAnimation progress equals: 1.0. + self + assert: aFirstAnimation elapsedTime + equals: self firstSequentialDuration. self assert: aFirstAnimation isStarted. self assert: aFirstAnimation isRunning. - self assert: aFirstAnimation startTime equals: self exampleDate + self exampleDelay + self firstSequentialDuration. - self assert: aFirstAnimation delayedStartTime equals: self exampleDate + self exampleDelay + self firstSequentialDuration. - + self + assert: aFirstAnimation startTime + equals: self exampleDate + self exampleDelay. + self + assert: aFirstAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. + self assert: aFirstAnimation loops equals: self firstSequentialLoops. - self assert: aFirstAnimation repeats equals: 1. self assert: aFirstAnimation delay equals: 0 seconds. - + aSecondAnimation := aSequentialAnimation animations second. - + self assert: aSecondAnimation progress equals: 0. self assert: aSecondAnimation isStarted not. self assert: aSecondAnimation isRunning not. - - self assert: aSecondAnimation loops equals: self secondSequentialLoops. - self assert: aSecondAnimation repeats equals: 0. - self assert: aSecondAnimation delay equals: self secondSequentialDelay. - - ^ aSequentialAnimation -] - -{ #category : #'examples - base animation' } -BlAnimationExamples >> baseAnimation [ - - | aBaseAnimation | - - aBaseAnimation := BlAnimation new. - aBaseAnimation time: (BlTime simulated date: self exampleDate). - - self assert: aBaseAnimation loops equals: 1. - self assert: aBaseAnimation repeats equals: 0. - self assert: aBaseAnimation progress equals: 0. - self assert: aBaseAnimation delay equals: 0 seconds. - self assert: aBaseAnimation duration equals: 1 seconds. - self assert: aBaseAnimation isStarted not. - self assert: aBaseAnimation isRunning not. - self assert: aBaseAnimation isInfinite not. - - ^ aBaseAnimation -] - -{ #category : #'examples - base animation' } -BlAnimationExamples >> baseAnimationWithDelay [ - - | aBaseAnimation | - - aBaseAnimation := BlAnimation new. - aBaseAnimation time: (BlTime simulated date: self exampleDate). - - aBaseAnimation delay: self exampleDelay. - self assert: aBaseAnimation loops equals: 1. - self assert: aBaseAnimation repeats equals: 0. - self assert: aBaseAnimation progress equals: 0. - self assert: aBaseAnimation delay equals: self exampleDelay. - self assert: aBaseAnimation duration equals: 1 seconds. - self assert: aBaseAnimation isStarted not. - self assert: aBaseAnimation isRunning not. + self + assert: aSecondAnimation loops + equals: self secondSequentialLoops. + self + assert: aSecondAnimation delay + equals: self secondSequentialDelay. - ^ aBaseAnimation + ^ aSequentialAnimation ] -{ #category : #'examples - base animation' } -BlAnimationExamples >> baseAnimationWithDelayAndDurationAndTwoLoops [ - - | aBaseAnimation | - - aBaseAnimation := BlAnimation new. - aBaseAnimation time: (BlTime simulated date: self exampleDate). +{ #category : #'examples - sequential animation' } +BlAnimationExamplesTest >> test_4_2_sequential_first_step_fullDurationAndHalf [ + "The animation state must be equal to _5_1_sequential_first_secondStep_halfDuration, + because we move time by the same amount" - aBaseAnimation delay: self exampleDelay. - aBaseAnimation loops: 2. - aBaseAnimation duration: self exampleDuration. + + | aSequentialAnimation aFirstAnimation aSecondAnimation | + aSequentialAnimation := self + test_4_1_sequential_first_step_halfOfDuration. + aSequentialAnimation time wait: self firstSequentialDuration. - self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. - self assert: aBaseAnimation progress equals: 0. - self assert: aBaseAnimation delay equals: self exampleDelay. - self assert: aBaseAnimation duration equals: self exampleDuration. - self assert: aBaseAnimation isStarted not. - self assert: aBaseAnimation isRunning not. + aSequentialAnimation run. - ^ aBaseAnimation -] + self assert: (aSequentialAnimation progress closeTo: 0.545454545). + self + assert: aSequentialAnimation elapsedTime + equals: + self firstSequentialDuration + (self firstSequentialDuration / 2.0). -{ #category : #'examples - base animation' } -BlAnimationExamples >> baseAnimationWithDelayAndTwoLoops [ - - | aBaseAnimation | - - aBaseAnimation := BlAnimation new. - aBaseAnimation time: (BlTime simulated date: self exampleDate). + self assert: aSequentialAnimation isStarted. + self assert: aSequentialAnimation isRunning. - aBaseAnimation delay: self exampleDelay. - aBaseAnimation loops: 2. + self assert: aSequentialAnimation startTime equals: self exampleDate. + self + assert: aSequentialAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. - self assert: aBaseAnimation loops equals: 2. - self assert: aBaseAnimation repeats equals: 0. - self assert: aBaseAnimation progress equals: 0. - self assert: aBaseAnimation delay equals: self exampleDelay. - self assert: aBaseAnimation duration equals: 1 seconds. - self assert: aBaseAnimation isStarted not. - self assert: aBaseAnimation isRunning not. + self assert: aSequentialAnimation loops equals: 2. + self assert: aSequentialAnimation delay equals: self exampleDelay. - ^ aBaseAnimation -] + aFirstAnimation := aSequentialAnimation animations first. -{ #category : #accessing } -BlAnimationExamples >> blueAt: anIndex [ - | radians | - "0.0 <= anIndex <= 1.0" - - radians := self radiansAt: anIndex. - radians < (Float pi / 2.0) - ifTrue: [ ^ 0 ]. - ^ (radians - (Float pi / 2.0)) sin -] + self assert: aFirstAnimation progress equals: 0.5. + self + assert: aFirstAnimation elapsedTime + equals: self firstSequentialDuration / 2.0. -{ #category : #examples } -BlAnimationExamples >> bouncingText [ - "Click on letters to start animation!" - + self assert: aFirstAnimation isStarted. + self assert: aFirstAnimation isRunning. - | letters container animation clickHandler | - letters := 'bloc beta0.1' - collect: [ :aCharacter | self textElement: aCharacter ] - as: Array. - letters withIndexDo: [ :aTextElement :anIndex | - "change text color according to index in color spectrum" - aTextElement text: - (aTextElement text foreground: - (self colorAt: (anIndex / letters size) asFloat)) ]. + self + assert: aFirstAnimation startTime + equals: + self exampleDate + self exampleDelay + self firstSequentialDuration. + self + assert: aFirstAnimation delayedStartTime + equals: + self exampleDate + self exampleDelay + self firstSequentialDuration. - animation := BlParallelAnimation withAll: - (letters withIndexCollect: [ :aChild :anIndex | - | jiggle | - jiggle := self jiggleAnimation. - jiggle delay: 20 milliSeconds * (anIndex - 1). - jiggle target: aChild. - jiggle ]). + self assert: aFirstAnimation loops equals: self firstSequentialLoops. + self assert: aFirstAnimation delay equals: 0 seconds. - container := self textContainer. - container addChildren: letters. + aSecondAnimation := aSequentialAnimation animations second. - clickHandler := nil. - clickHandler := BlEventHandler - on: BlClickEvent - do: [ - container removeEventHandler: clickHandler. - container addAnimation: animation ]. - container addEventHandler: clickHandler. + self assert: aSecondAnimation progress equals: 0. - ^ self frameContainer addChild: container -] + self assert: aSecondAnimation isStarted not. + self assert: aSecondAnimation isRunning not. -{ #category : #accessing } -BlAnimationExamples >> colorAt: anIndex [ - | normalizedIndex | - "0.0 <= anIndex <= 1.0" - - normalizedIndex := anIndex. - "Because of float errors" - normalizedIndex > 1 ifTrue: [ normalizedIndex := 1 ]. - normalizedIndex < 0 ifTrue: [ normalizedIndex := 0 ]. - - ^ Color - r: (self redAt: normalizedIndex) - g: (self greenAt: normalizedIndex) - b: (self blueAt: normalizedIndex) -] + self + assert: aSecondAnimation loops + equals: self secondSequentialLoops. + self + assert: aSecondAnimation delay + equals: self secondSequentialDelay. -{ #category : #'examples - base animation' } -BlAnimationExamples >> exampleDate [ - ^ DateAndTime year: 2018 month: 3 day: 31 + ^ aSequentialAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> exampleDelay [ - ^ 0.5 seconds -] +BlAnimationExamplesTest >> test_4_3_baseAnimation_secondLoop_step_quarterOfDuration [ -{ #category : #'examples - base animation' } -BlAnimationExamples >> exampleDuration [ - ^ 2 seconds -] + + | aBaseAnimation | + aBaseAnimation := self + test_4_2_baseAnimation_secondLoop_step_fullDelay. + aBaseAnimation time wait: self exampleDuration / 4.0. + aBaseAnimation run. -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> firstSequentialDuration [ - ^ 8 seconds -] + self assert: aBaseAnimation progress equals: 0.25. + self + assert: aBaseAnimation elapsedTime + equals: self exampleDuration / 4.0. -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> firstSequentialLoops [ - ^ 2 -] + self assert: aBaseAnimation isStarted. + self assert: aBaseAnimation isRunning. -{ #category : #'instance creation' } -BlAnimationExamples >> frameContainer [ - + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDelay + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay + self exampleDuration + + self exampleDelay. - ^ BlElement new - layout: BlLinearLayout horizontal alignCenter; - constraintsDo: [ :c | - c horizontal matchParent. - c vertical matchParent ]; - clipChildren: false -] + self assert: aBaseAnimation loops equals: 2. + self assert: aBaseAnimation delay equals: self exampleDelay. + self assert: aBaseAnimation duration equals: self exampleDuration. -{ #category : #accessing } -BlAnimationExamples >> greenAt: anIndex [ - | radians | - "0.0 <= anIndex <= 1.0" - - radians := self radiansAt: anIndex. - radians > Float pi - ifTrue: [ ^ 0 ]. - ^ radians sin + ^ aBaseAnimation ] { #category : #'examples - base animation' } -BlAnimationExamples >> infiniteAnimation [ - +BlAnimationExamplesTest >> test_4_4_baseAnimation_secondLoop_step_halfOfDuration [ + + | aBaseAnimation | - - aBaseAnimation := BlAnimation new. - aBaseAnimation time: (BlTime simulated date: self exampleDate). - aBaseAnimation beInfinite. + aBaseAnimation := self + test_4_3_baseAnimation_secondLoop_step_quarterOfDuration. + aBaseAnimation time wait: self exampleDuration / 4.0. + aBaseAnimation run. - self assert: aBaseAnimation loops equals: Float infinity. - self assert: aBaseAnimation loopCount equals: 0. - self assert: aBaseAnimation progress equals: 0. - self assert: aBaseAnimation delay equals: 0 seconds. - self assert: aBaseAnimation duration equals: 1 seconds. - self assert: aBaseAnimation isStarted not. - self assert: aBaseAnimation isRunning not. - self assert: aBaseAnimation isInfinite. + self assert: aBaseAnimation progress equals: 0.5. + self + assert: aBaseAnimation elapsedTime + equals: self exampleDuration / 2.0. + + self assert: aBaseAnimation isStarted. + self assert: aBaseAnimation isRunning. + + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDelay + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay + self exampleDuration + + self exampleDelay. + + self assert: aBaseAnimation loops equals: 2. + self assert: aBaseAnimation delay equals: self exampleDelay. + self assert: aBaseAnimation duration equals: self exampleDuration. ^ aBaseAnimation ] -{ #category : #'instance creation' } -BlAnimationExamples >> jiggleAnimation [ - | anAnimation | - - - anAnimation := BlTransformAnimation new. - anAnimation transform - translateBy: 0 @ (50 + 20 atRandom) negated; - rotateBy: (30 atRandom - 15); - scaleBy: (1.3 + (20 atRandom / 100.0))@(1.3 + (20 atRandom / 100.0)); - apply. - anAnimation absolute. - anAnimation easing: (BlSineInterpolator new range: Float pi). - anAnimation loops: 3. - anAnimation duration: 1 second. - - ^ anAnimation -] +{ #category : #'examples - base animation' } +BlAnimationExamplesTest >> test_4_5_baseAnimation_secondLoop_step_fullDuration [ -{ #category : #accessing } -BlAnimationExamples >> radiansAt: anIndex [ - "0.0 <= anIndex <= 1.0" - self assert: [ anIndex between: 0.0 and: 1.0 ]. - - ^ anIndex * (Float pi * 3) / 2.0 -] + + | aBaseAnimation loopDoneCount loopDoneListener | + aBaseAnimation := self + test_4_4_baseAnimation_secondLoop_step_halfOfDuration. + aBaseAnimation time wait: self exampleDuration / 2.0. -{ #category : #accessing } -BlAnimationExamples >> redAt: anIndex [ - | radians | - "0.0 <= anIndex <= 1.0" - - radians := self radiansAt: anIndex. - (radians between: Float pi / 2.0 and: Float pi) - ifTrue: [ ^ 0 ]. + loopDoneCount := 0. + loopDoneListener := BlEventHandler + on: BlAnimationLoopDoneEvent + do: [ :anEvent | + loopDoneCount := loopDoneCount + 1 ]. + aBaseAnimation addEventHandler: loopDoneListener. - radians < (Float pi/ 2.0) - ifTrue: [ ^ (radians + (Float pi / 2)) sin ]. + aBaseAnimation run. - ^ (radians + Float pi) sin -] + self assert: aBaseAnimation progress equals: 1. + self assert: aBaseAnimation elapsedTime equals: self exampleDuration. + self assert: loopDoneCount equals: 1. -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> secondSequentialDelay [ - ^ 2 seconds -] + self assert: aBaseAnimation isStarted. + self assert: aBaseAnimation isRunning not. -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> secondSequentialDuration [ - ^ 4 seconds -] + self + assert: aBaseAnimation startTime + equals: self exampleDate + self exampleDelay + self exampleDuration. + self + assert: aBaseAnimation delayedStartTime + equals: self exampleDate + self exampleDelay + self exampleDuration + + self exampleDelay. -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> secondSequentialLoops [ - ^ 1 -] + self assert: aBaseAnimation loops equals: 2. + self assert: aBaseAnimation delay equals: self exampleDelay. + self assert: aBaseAnimation duration equals: self exampleDuration. -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> sequentialAddFirstChild [ - - - | aSequentialAnimation | + aBaseAnimation removeEventHandler: loopDoneListener. - aSequentialAnimation := self sequentialAnimationWithDelayAndTwoLoops. - aSequentialAnimation add: (BlAnimation new duration: self firstSequentialDuration; loops: self firstSequentialLoops). - - self - assert: aSequentialAnimation duration - equals: self firstSequentialDuration * self firstSequentialLoops. - - ^ aSequentialAnimation + ^ aBaseAnimation ] { #category : #'examples - sequential animation' } -BlAnimationExamples >> sequentialAnimation [ - - | aSequentialAnimation | +BlAnimationExamplesTest >> test_5_1_sequential_first_secondStep_halfDuration [ - aSequentialAnimation := BlSequentialAnimation new. - aSequentialAnimation time: (BlTime simulated date: self exampleDate). + + | aSequentialAnimation aFirstAnimation aSecondAnimation | + aSequentialAnimation := self + test_4_2_sequential_first_step_fullDuration. + aSequentialAnimation time wait: self firstSequentialDuration / 2.0. - self assert: aSequentialAnimation duration equals: 0 seconds. - self assert: aSequentialAnimation delay equals: 0 seconds. - self assert: aSequentialAnimation loops equals: 1. - "self assert: aSequentialAnimation repeats equals: 0. repeats is undefined so comment it for now" - self assert: aSequentialAnimation progress equals: 0. - self assert: aSequentialAnimation isStarted not. - self assert: aSequentialAnimation isRunning not. + aSequentialAnimation run. - ^ aSequentialAnimation -] + self assert: (aSequentialAnimation progress closeTo: 0.545454545). + self + assert: aSequentialAnimation elapsedTime + equals: + self firstSequentialDuration + (self firstSequentialDuration / 2.0). -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> sequentialAnimationWithDelay [ - - | aSequentialAnimation | + self assert: aSequentialAnimation isStarted. + self assert: aSequentialAnimation isRunning. - aSequentialAnimation := BlSequentialAnimation new. - aSequentialAnimation time: (BlTime simulated date: self exampleDate). - - aSequentialAnimation delay: self exampleDelay. + self assert: aSequentialAnimation startTime equals: self exampleDate. + self + assert: aSequentialAnimation delayedStartTime + equals: self exampleDate + self exampleDelay. - self assert: aSequentialAnimation duration equals: 0 seconds. + self assert: aSequentialAnimation loops equals: 2. self assert: aSequentialAnimation delay equals: self exampleDelay. - self assert: aSequentialAnimation loops equals: 1. - self assert: aSequentialAnimation repeats equals: 0. - self assert: aSequentialAnimation progress equals: 0. - self assert: aSequentialAnimation isStarted not. - self assert: aSequentialAnimation isRunning not. - ^ aSequentialAnimation -] + aFirstAnimation := aSequentialAnimation animations first. -{ #category : #'examples - sequential animation' } -BlAnimationExamples >> sequentialAnimationWithDelayAndTwoLoops [ - - | aSequentialAnimation | + self assert: aFirstAnimation progress equals: 0.5. + self + assert: aFirstAnimation elapsedTime + equals: self firstSequentialDuration / 2.0. - aSequentialAnimation := BlSequentialAnimation new. - aSequentialAnimation time: (BlTime simulated date: self exampleDate). + self assert: aFirstAnimation isStarted. + self assert: aFirstAnimation isRunning. - aSequentialAnimation delay: self exampleDelay. - aSequentialAnimation loops: 2. + self + assert: aFirstAnimation startTime + equals: + self exampleDate + self exampleDelay + self firstSequentialDuration. + self + assert: aFirstAnimation delayedStartTime + equals: + self exampleDate + self exampleDelay + self firstSequentialDuration. - self assert: aSequentialAnimation duration equals: 0 seconds. - self assert: aSequentialAnimation delay equals: self exampleDelay. - self assert: aSequentialAnimation loops equals: 2. - "self assert: aSequentialAnimation repeats equals: 0. repeats is undefined so comment it for now" - self assert: aSequentialAnimation progress equals: 0. - self assert: aSequentialAnimation isStarted not. - self assert: aSequentialAnimation isRunning not. + self assert: aFirstAnimation loops equals: self firstSequentialLoops. + self assert: aFirstAnimation delay equals: 0 seconds. + + aSecondAnimation := aSequentialAnimation animations second. + + self assert: aSecondAnimation progress equals: 0. + + self assert: aSecondAnimation isStarted not. + self assert: aSecondAnimation isRunning not. + + self + assert: aSecondAnimation loops + equals: self secondSequentialLoops. + self + assert: aSecondAnimation delay + equals: self secondSequentialDelay. ^ aSequentialAnimation ] { #category : #'instance creation' } -BlAnimationExamples >> textContainer [ - +BlAnimationExamplesTest >> textContainer [ + ^ BlElement new - layout: (BlLinearLayout horizontal alignBottomCenter); - constraintsDo: [ :c | - c horizontal fitContent. - c vertical fitContent ]; - clipChildren: false + layout: BlLinearLayout horizontal alignBottomCenter; + constraintsDo: [ :c | + c horizontal fitContent. + c vertical fitContent ]; + clipChildren: false ] { #category : #accessing } -BlAnimationExamples >> textElement: aCharacter [ +BlAnimationExamplesTest >> textElement: aCharacter [ | aText | aText := aCharacter asRopedText diff --git a/src/Bloc-Examples/BlAttributeRopeExamples.class.st b/src/Bloc-Examples/BlAttributeRopeExamplesTest.class.st similarity index 56% rename from src/Bloc-Examples/BlAttributeRopeExamples.class.st rename to src/Bloc-Examples/BlAttributeRopeExamplesTest.class.st index 07e96bd5b..dee41654a 100644 --- a/src/Bloc-Examples/BlAttributeRopeExamples.class.st +++ b/src/Bloc-Examples/BlAttributeRopeExamplesTest.class.st @@ -3,35 +3,35 @@ I contain examples of an attribute rope " Class { - #name : #BlAttributeRopeExamples, - #superclass : #BlExampleTest, + #name : #BlAttributeRopeExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Rope' } { #category : #'examples - attributes' } -BlAttributeRopeExamples >> attributes_empty_0_to_0 [ +BlAttributeRopeExamplesTest >> testAttributes_empty_0_to_0 [ + | aRope anAttributedRope | - - aRope := self small_empty. + aRope := self testSmall_empty. anAttributedRope := aRope attributes: { 1 } from: 0 to: 0. self assert: anAttributedRope isNotEmpty. - self assert: anAttributedRope attributes equals: { 0 . 1 }. + self assert: anAttributedRope attributes equals: { 0. 1 }. self assert: anAttributedRope rope == aRope rope. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> attributes_small_0_to_0 [ - +BlAttributeRopeExamplesTest >> testAttributes_small_0_to_0 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 0. - self assert: anAttributedRope left attributes equals: { 0 . 1 }. + self assert: anAttributedRope left attributes equals: { 0. 1 }. self assert: anAttributedRope left rope collection equals: ''. self assert: anAttributedRope right == aRope. @@ -40,14 +40,14 @@ BlAttributeRopeExamples >> attributes_small_0_to_0 [ ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> attributes_small_0_to_1 [ - +BlAttributeRopeExamplesTest >> testAttributes_small_0_to_1 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 1. - self assert: anAttributedRope left attributes equals: { 0 . 1 }. + self assert: anAttributedRope left attributes equals: { 0. 1 }. self assert: anAttributedRope left rope collection equals: 'H'. self assert: anAttributedRope right attributes equals: { 0 }. @@ -57,82 +57,84 @@ BlAttributeRopeExamples >> attributes_small_0_to_1 [ ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> attributes_small_0_to_5 [ - +BlAttributeRopeExamplesTest >> testAttributes_small_0_to_5 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 5. self assert: anAttributedRope rope == aRope rope. - self assert: anAttributedRope attributes equals: { 0 . 1 }. + self assert: anAttributedRope attributes equals: { 0. 1 }. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> attributes_small_2_to_2 [ - - | aRope anAttributedRope | +BlAttributeRopeExamplesTest >> testAttributes_small_2_to_2 [ - aRope := self small. + + | aRope anAttributedRope | + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 2 to: 2. self assert: anAttributedRope left rope collection equals: 'He'. self assert: anAttributedRope left attributes equals: { 0 }. self assert: anAttributedRope right left rope collection equals: ''. - self assert: anAttributedRope right left attributes equals: { 0 . 1 }. + self assert: anAttributedRope right left attributes equals: { 0. 1 }. - self assert: anAttributedRope right right rope collection equals: 'llo'. + self + assert: anAttributedRope right right rope collection + equals: 'llo'. self assert: anAttributedRope right right attributes equals: { 0 }. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> attributes_small_4_to_5 [ - +BlAttributeRopeExamplesTest >> testAttributes_small_4_to_5 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 4 to: 5. self assert: anAttributedRope left attributes equals: { 0 }. self assert: anAttributedRope left rope collection equals: 'Hell'. - self assert: anAttributedRope right attributes equals: { 0 . 1 }. + self assert: anAttributedRope right attributes equals: { 0. 1 }. self assert: anAttributedRope right rope collection equals: 'o'. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> attributes_small_5_to_5 [ - - | aRope anAttributedRope | +BlAttributeRopeExamplesTest >> testAttributes_small_5_to_5 [ - aRope := self small. + + | aRope anAttributedRope | + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 5 to: 5. self assert: anAttributedRope left == aRope. - self assert: anAttributedRope right attributes equals: { 0 . 1 }. + self assert: anAttributedRope right attributes equals: { 0. 1 }. self assert: anAttributedRope right rope collection equals: ''. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> clear_attributes_empty_0_to_0 [ - +BlAttributeRopeExamplesTest >> testClear_attributes_empty_0_to_0 [ + + | anEmptyRope aRopeWithoutAttributes | - - anEmptyRope := self small_empty. - + anEmptyRope := self testSmall_empty. + "clearing attributes on the empty attributed rope actually completely removes attributes" aRopeWithoutAttributes := anEmptyRope clearAttributes: 0 to: 0. - + self assert: aRopeWithoutAttributes isEmpty. self assert: aRopeWithoutAttributes collection equals: ''. self assert: aRopeWithoutAttributes == anEmptyRope rope. @@ -141,119 +143,143 @@ BlAttributeRopeExamples >> clear_attributes_empty_0_to_0 [ ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> clear_attributes_small_0_to_0 [ - +BlAttributeRopeExamplesTest >> testClear_attributes_small_0_to_0 [ + + | aRope aRopeWithoutAttributes | - - aRope := self small. + aRope := self testSmall. aRopeWithoutAttributes := aRope clearAttributes: 0 to: 0. - + self assert: aRopeWithoutAttributes == aRope. ^ aRopeWithoutAttributes ] { #category : #'examples - attributes' } -BlAttributeRopeExamples >> clear_attributes_small_0_to_1 [ - +BlAttributeRopeExamplesTest >> testClear_attributes_small_0_to_1 [ + + | aRope aRopeWithoutAttributes | - - aRope := self small. + aRope := self testSmall. aRopeWithoutAttributes := aRope clearAttributes: 0 to: 1. - + self assert: aRopeWithoutAttributes left collection equals: 'H'. self assert: aRopeWithoutAttributes right attributes equals: { 0 }. - self assert: aRopeWithoutAttributes right rope collection equals: 'ello'. + self + assert: aRopeWithoutAttributes right rope collection + equals: 'ello'. ^ aRopeWithoutAttributes ] { #category : #'examples - utility' } -BlAttributeRopeExamples >> mergeAttributes [ - - | firstDuplicate secondDuplicate theOriginalAttributes theAddedAttributes theAttributesWithoutDuplicates | +BlAttributeRopeExamplesTest >> testMergeAttributes [ + + | firstDuplicate secondDuplicate theOriginalAttributes theAddedAttributes theAttributesWithoutDuplicates | "they are equal but not identical" firstDuplicate := String fromString: 'Haba'. secondDuplicate := String fromString: 'Haba'. - + self assert: firstDuplicate equals: secondDuplicate. self assert: (firstDuplicate == secondDuplicate) not. - - theOriginalAttributes := { firstDuplicate . 1 . 2 }. - theAddedAttributes := { 3 . secondDuplicate }. - - theAttributesWithoutDuplicates := BlAttributeRope mergeAttributes: theOriginalAttributes and: theAddedAttributes. - - self assert: theAttributesWithoutDuplicates equals: { secondDuplicate . 1 . 2 . 3 }. - + + theOriginalAttributes := { + firstDuplicate. + 1. + 2 }. + theAddedAttributes := { + 3. + secondDuplicate }. + + theAttributesWithoutDuplicates := BlAttributeRope + mergeAttributes: + theOriginalAttributes + and: theAddedAttributes. + + self assert: theAttributesWithoutDuplicates equals: { + secondDuplicate. + 1. + 2. + 3 }. + ^ theAttributesWithoutDuplicates ] { #category : #'examples - utility' } -BlAttributeRopeExamples >> removeDuplicates [ - - | firstDuplicate secondDuplicate theOriginalAttributes theAttributesWithoutDuplicates | +BlAttributeRopeExamplesTest >> testRemoveDuplicates [ + + | firstDuplicate secondDuplicate theOriginalAttributes theAttributesWithoutDuplicates | "they are equal but not identical" firstDuplicate := String fromString: 'Haba'. secondDuplicate := String fromString: 'Haba'. - + self assert: firstDuplicate equals: secondDuplicate. self assert: (firstDuplicate == secondDuplicate) not. - - theOriginalAttributes := { firstDuplicate . 1 . 2 . 3 . secondDuplicate }. - theAttributesWithoutDuplicates := BlAttributeRope removeDuplicates: theOriginalAttributes. - - self assert: theAttributesWithoutDuplicates equals: { secondDuplicate . 1 . 2 . 3 . }. - + + theOriginalAttributes := { + firstDuplicate. + 1. + 2. + 3. + secondDuplicate }. + theAttributesWithoutDuplicates := BlAttributeRope removeDuplicates: + theOriginalAttributes. + + self assert: theAttributesWithoutDuplicates equals: { + secondDuplicate. + 1. + 2. + 3 }. + ^ theAttributesWithoutDuplicates ] { #category : #'instance creation' } -BlAttributeRopeExamples >> small [ - - - | aRope | +BlAttributeRopeExamplesTest >> testSmall [ + "Creates an instance of the rope of size smaller than combineLength with one attribute applied on the whole rope" + + | aRope | aRope := BlAttributeRope - attributes: { 0 } - rope: (BlCollectionRope collection: 'Hello'). + attributes: { 0 } + rope: (BlCollectionRope collection: 'Hello'). "attribute rope does not increase depth because it is just a plain wrapper" self assert: aRope depth equals: 1. self assert: aRope size equals: 5. - self assert: aRope attributes equals: { 0 }. + self assert: aRope attributes equals: { 0 }. self assert: aRope rope collection equals: 'Hello'. self assert: aRope isLeaf not. self assert: aRope size <= BlRope combineLength. - + ^ aRope ] { #category : #'examples - accessing' } -BlAttributeRopeExamples >> small_at_each [ - +BlAttributeRopeExamplesTest >> testSmall_at_each [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: (aRope at: 1) equals: $H. self assert: (aRope at: 2) equals: $e. self assert: (aRope at: 3) equals: $l. self assert: (aRope at: 4) equals: $l. self assert: (aRope at: 5) equals: $o. - + ^ aRope ] { #category : #'examples - accessing' } -BlAttributeRopeExamples >> small_children [ - +BlAttributeRopeExamplesTest >> testSmall_children [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope children equals: { aRope rope }. @@ -261,39 +287,39 @@ BlAttributeRopeExamples >> small_children [ ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_0_to_0 [ - +BlAttributeRopeExamplesTest >> testSmall_delete_0_to_0 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 0. self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_0_to_1 [ - +BlAttributeRopeExamplesTest >> testSmall_delete_0_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 1. - + self assert: aNewRope size equals: 4. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'ello'. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_0_to_5 [ - - | aRope aNewRope | +BlAttributeRopeExamplesTest >> testSmall_delete_0_to_5 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 0 to: 5. self assert: aNewRope size equals: 0. @@ -304,26 +330,26 @@ BlAttributeRopeExamples >> small_delete_0_to_5 [ ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_1_to_1 [ - +BlAttributeRopeExamplesTest >> testSmall_delete_1_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 1. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_1_to_3 [ - +BlAttributeRopeExamplesTest >> testSmall_delete_1_to_3 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 3. - + self assert: aNewRope size equals: 3. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'Hlo'. @@ -332,28 +358,28 @@ BlAttributeRopeExamples >> small_delete_1_to_3 [ ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_1_to_5 [ - +BlAttributeRopeExamplesTest >> testSmall_delete_1_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 5. - + self assert: aNewRope size equals: 1. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'H'. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_4_to_5 [ - +BlAttributeRopeExamplesTest >> testSmall_delete_4_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 4 to: 5. - + self assert: aNewRope size equals: 4. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'Hell'. @@ -362,24 +388,24 @@ BlAttributeRopeExamples >> small_delete_4_to_5 [ ] { #category : #'examples - deletion' } -BlAttributeRopeExamples >> small_delete_5_to_5 [ - +BlAttributeRopeExamplesTest >> testSmall_delete_5_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 5 to: 5. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - accessing' } -BlAttributeRopeExamples >> small_depth [ - +BlAttributeRopeExamplesTest >> testSmall_depth [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope depth equals: 1. @@ -387,12 +413,14 @@ BlAttributeRopeExamples >> small_depth [ ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_do [ - +BlAttributeRopeExamplesTest >> testSmall_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'Hello'. @@ -400,11 +428,11 @@ BlAttributeRopeExamples >> small_do [ ] { #category : #'instance creation' } -BlAttributeRopeExamples >> small_empty [ - - | aRope anEmpty | +BlAttributeRopeExamplesTest >> testSmall_empty [ - aRope := self small. + + | aRope anEmpty | + aRope := self testSmall. anEmpty := aRope empty. self assert: anEmpty size equals: 0. @@ -417,27 +445,32 @@ BlAttributeRopeExamples >> small_empty [ ] { #category : #'examples - from to' } -BlAttributeRopeExamples >> small_from_0_to_0 [ - +BlAttributeRopeExamplesTest >> testSmall_from_0_to_0 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 0. - + self assert: aNewRope size equals: 0. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_from_0_to_0_do [ - +BlAttributeRopeExamplesTest >> testSmall_from_0_to_0_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 0 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 0 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -445,27 +478,32 @@ BlAttributeRopeExamples >> small_from_0_to_0_do [ ] { #category : #'examples - from to' } -BlAttributeRopeExamples >> small_from_0_to_1 [ - +BlAttributeRopeExamplesTest >> testSmall_from_0_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 1. - + self assert: aNewRope size equals: 1. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'H'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_from_0_to_1_do [ - +BlAttributeRopeExamplesTest >> testSmall_from_0_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'H'. @@ -473,25 +511,30 @@ BlAttributeRopeExamples >> small_from_0_to_1_do [ ] { #category : #'examples - from to' } -BlAttributeRopeExamples >> small_from_0_to_5 [ - +BlAttributeRopeExamplesTest >> testSmall_from_0_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 5. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_from_0_to_5_do [ - +BlAttributeRopeExamplesTest >> testSmall_from_0_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'Hello'. @@ -499,27 +542,32 @@ BlAttributeRopeExamples >> small_from_0_to_5_do [ ] { #category : #'examples - from to' } -BlAttributeRopeExamples >> small_from_1_to_1 [ - +BlAttributeRopeExamplesTest >> testSmall_from_1_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 1. - + self assert: aNewRope size equals: 0. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_from_1_to_1_do [ - +BlAttributeRopeExamplesTest >> testSmall_from_1_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -527,27 +575,32 @@ BlAttributeRopeExamples >> small_from_1_to_1_do [ ] { #category : #'examples - from to' } -BlAttributeRopeExamples >> small_from_1_to_2 [ - +BlAttributeRopeExamplesTest >> testSmall_from_1_to_2 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 2. - + self assert: aNewRope size equals: 1. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'e'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_from_1_to_2_do [ - +BlAttributeRopeExamplesTest >> testSmall_from_1_to_2_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 2 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 2 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'e'. @@ -555,27 +608,32 @@ BlAttributeRopeExamples >> small_from_1_to_2_do [ ] { #category : #'examples - from to' } -BlAttributeRopeExamples >> small_from_1_to_5 [ - +BlAttributeRopeExamplesTest >> testSmall_from_1_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 5. - + self assert: aNewRope size equals: 4. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'ello'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_from_1_to_5_do [ - +BlAttributeRopeExamplesTest >> testSmall_from_1_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'ello'. @@ -583,27 +641,32 @@ BlAttributeRopeExamples >> small_from_1_to_5_do [ ] { #category : #'examples - from to' } -BlAttributeRopeExamples >> small_from_3_to_5 [ - +BlAttributeRopeExamplesTest >> testSmall_from_3_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 3 to: 5. - + self assert: aNewRope size equals: 2. self assert: aNewRope attributes equals: { 0 }. self assert: aNewRope rope collection equals: 'lo'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlAttributeRopeExamples >> small_from_3_to_5_do [ - +BlAttributeRopeExamplesTest >> testSmall_from_3_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 3 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 3 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'lo'. @@ -611,11 +674,11 @@ BlAttributeRopeExamples >> small_from_3_to_5_do [ ] { #category : #'examples - testing' } -BlAttributeRopeExamples >> small_isEmpty [ - +BlAttributeRopeExamplesTest >> testSmall_isEmpty [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isEmpty not. @@ -623,11 +686,11 @@ BlAttributeRopeExamples >> small_isEmpty [ ] { #category : #'examples - testing' } -BlAttributeRopeExamples >> small_isLeaf [ - +BlAttributeRopeExamplesTest >> testSmall_isLeaf [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isLeaf not. @@ -635,11 +698,11 @@ BlAttributeRopeExamples >> small_isLeaf [ ] { #category : #'examples - testing' } -BlAttributeRopeExamples >> small_isNotEmpty [ - +BlAttributeRopeExamplesTest >> testSmall_isNotEmpty [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isNotEmpty. @@ -647,11 +710,11 @@ BlAttributeRopeExamples >> small_isNotEmpty [ ] { #category : #'examples - accessing' } -BlAttributeRopeExamples >> small_size [ - +BlAttributeRopeExamplesTest >> testSmall_size [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope size equals: 5. diff --git a/src/Bloc-Examples/BlClickEventExamples.class.st b/src/Bloc-Examples/BlClickEventExamples.class.st deleted file mode 100644 index 1221ab86d..000000000 --- a/src/Bloc-Examples/BlClickEventExamples.class.st +++ /dev/null @@ -1,335 +0,0 @@ -Class { - #name : #BlClickEventExamples, - #superclass : #Object, - #traits : 'TBlDevScripterExamples + TAssertable', - #classTraits : 'TBlDevScripterExamples classTrait + TAssertable classTrait', - #category : #'Bloc-Examples-Event' -} - -{ #category : #'examples - events' } -BlClickEventExamples >> clickInHiddenChild [ - - | aScripter | - aScripter := self twoElementsInScripter. - - aScripter substeps: 'Click in hidden child' do: [ :aStep | - - aStep do - label: 'Set child with hidden visibility'; - block: [ :aChild | aChild visibility: BlVisibility hidden ]; - onChildAt: 1. - - aStep click onChildAt: 1. - - aStep check - label: 'Check the click was consumed by parent'; - do: [ - | aClickCollection | - aClickCollection := aScripter userData at: #clicks. - self assert: aClickCollection size equals: 1. - self assert: aClickCollection first equals: #parent. ] - ]. - - ^ aScripter syncContinue -] - -{ #category : #'examples - events' } -BlClickEventExamples >> clickInHiddenChildAndVisibleClippedGrandchild [ - - | aScripter | - aScripter := self threeElementsWithTrueChildClippingInScripter. - - aScripter substeps: 'Click in hidden grandchild' do: [ :aStep | - - aStep do - label: 'Set child with hidden visibility'; - block: [ :aChild | aChild visibility: BlVisibility hidden ]; - onChildAt: 1. - - aStep click - onChildAt: 1; - onChildAt: 1. - - aStep check - label: 'Check the click was consumed by parent'; - do: [ - | aClickCollection | - aClickCollection := aScripter userData at: #clicks. - self assert: aClickCollection size equals: 1. - self assert: aClickCollection first equals: #parent. ] - ]. - - ^ aScripter syncContinue -] - -{ #category : #'examples - events' } -BlClickEventExamples >> clickInHiddenChildAndVisibleGrandchild [ - - | aScripter | - aScripter := self threeElementsInScripter. - - aScripter substeps: 'Click in hidden grandchild' do: [ :aStep | - - aStep do - label: 'Set child with hidden visibility'; - block: [ :aChild | aChild visibility: BlVisibility hidden ]; - onChildAt: 1. - - aStep click - onChildAt: 1; - onChildAt: 1. - - aStep check - label: 'Check the click was consumed by parent'; - do: [ - | aClickCollection | - aClickCollection := aScripter userData at: #clicks. - self assert: aClickCollection size equals: 1. - self assert: aClickCollection first equals: #parent. ] - ]. - - ^ aScripter syncContinue -] - -{ #category : #'examples - events' } -BlClickEventExamples >> clickInHiddenChildAndVisibleUnclippedGrandchild [ - - | aScripter | - aScripter := self threeElementsWithFalseChildClippingInScripter. - - aScripter substeps: 'Click in hidden grandchild' do: [ :aStep | - - aStep do - label: 'Set child with hidden visibility'; - block: [ :aChild | aChild visibility: BlVisibility hidden ]; - onChildAt: 1. - - aStep click - onChildAt: 1; - onChildAt: 1. - - aStep check - label: 'Check the click was consumed by parent'; - do: [ - | aClickCollection | - aClickCollection := aScripter userData at: #clicks. - self assert: aClickCollection size equals: 1. - self assert: aClickCollection first equals: #parent. ] - ]. - - ^ aScripter syncContinue -] - -{ #category : #'examples - events' } -BlClickEventExamples >> clickInParentWithGoneChild [ - - | aScripter | - aScripter := self twoElementsInScripter. - - aScripter substeps: 'Click in gone child' do: [ :aStep | - - aStep do - label: 'Set child with gone visibility'; - block: [ :aChild | aChild visibility: BlVisibility gone ]; - onChildAt: 1. - - aStep click. - - aStep check - label: 'Check the click was consumed by parent'; - do: [ - | aClickCollection | - aClickCollection := aScripter userData at: #clicks. - self assert: aClickCollection size equals: 1. - self assert: aClickCollection first equals: #parent. ] - ]. - - ^ aScripter syncContinue -] - -{ #category : #'examples - events' } -BlClickEventExamples >> clickInVisibleChild [ - - | aScripter | - aScripter := self twoElementsInScripter. - - aScripter substeps: 'Click in visible child' do: [ :aStep | - aStep click onChildAt: 1. - - aStep check - label: 'Check the click was consumed by child'; - do: [ - | aClickCollection | - aClickCollection := aScripter userData at: #clicks. - self assert: aClickCollection size equals: 1. - self assert: aClickCollection first equals: #child. ] - ]. - - ^ aScripter syncContinue -] - -{ #category : #'examples - elements' } -BlClickEventExamples >> element [ - - ^ BlElement new - layout: BlLinearLayout vertical; - border: (BlBorder paint: Color gray width: 1); - background: Color purple muchLighter; - constraintsDo: [ :c | - c horizontal matchParent. - c vertical matchParent ] -] - -{ #category : #'examples - elements' } -BlClickEventExamples >> threeElements [ - - ^ self element - addChild: (self element - addChild: self element as: #grandchild; - background: Color red muchLighter) - as: #child; - background: Color green muchLighter; - id: #parent -] - -{ #category : #'examples - elements in scripter' } -BlClickEventExamples >> threeElementsInScripter [ - - ^ self scripterWithElement: [ :aTarget :aScripter | - | anElement aChild anEventCollection | - anElement := self threeElements. - anEventCollection := aScripter userData - at: #clicks - ifAbsentPut: [ OrderedCollection new ]. - anElement when: BlClickEvent do: [ :anEvent | - anEventCollection add: #parent. - anEvent consumed: true ]. - aChild := anElement childAt: 1. - aChild when: BlClickEvent do: [ :anEvent | - anEventCollection add: #child. - anEvent consumed: true ]. - (aChild childAt: 1) when: BlClickEvent do: [ :anEvent | - anEventCollection add: #grandchild. - anEvent consumed: true ]. - anElement - ] -] - -{ #category : #'examples - elements' } -BlClickEventExamples >> threeElementsWithFalseChildClipping [ - - | aParent aChild aGrandchild | - aParent := self element - background: Color green muchLighter; - id: #parent; - layout: BlFrameLayout new; - size: 100@100. - - aChild := self element - size: 30@30; - id: #child; - clipChildren: false; - constraintsDo: [ :c | - c frame horizontal alignCenter. - c frame vertical alignCenter ]. - - aGrandchild := self element - size: 20@20; - background: Color red muchLighter; - id: #grandchild; - constraintsDo: [ :c | - c ignoreByLayout. - c ignored horizontal alignRightAt: 1.1. - c ignored vertical alignTopAt: 1.1 ]. - - aParent addChild: aChild. - aChild addChild: aGrandchild. - - ^ aParent -] - -{ #category : #'examples - elements in scripter' } -BlClickEventExamples >> threeElementsWithFalseChildClippingInScripter [ - - ^ self scripterWithElement: [ :aTarget :aScripter | - | anElement aChild anEventCollection | - anElement := self threeElementsWithFalseChildClipping. - anEventCollection := aScripter userData - at: #clicks - ifAbsentPut: [ OrderedCollection new ]. - anElement when: BlClickEvent do: [ :anEvent | - anEventCollection add: #parent. - anEvent consumed: true ]. - aChild := anElement childAt: 1. - aChild when: BlClickEvent do: [ :anEvent | - anEventCollection add: #child. - anEvent consumed: true ]. - (aChild childAt: 1) when: BlClickEvent do: [ :anEvent | - anEventCollection add: #grandchild. - anEvent consumed: true ]. - anElement - ] -] - -{ #category : #'examples - elements' } -BlClickEventExamples >> threeElementsWithTrueChildClipping [ - - | aParent aChild | - aParent := self threeElementsWithFalseChildClipping. - - aChild := aParent childAt: 1. - aChild clipChildren: true. - - ^ aParent -] - -{ #category : #'examples - elements in scripter' } -BlClickEventExamples >> threeElementsWithTrueChildClippingInScripter [ - - ^ self scripterWithElement: [ :aTarget :aScripter | - | anElement aChild anEventCollection | - anElement := self threeElementsWithTrueChildClipping. - anEventCollection := aScripter userData - at: #clicks - ifAbsentPut: [ OrderedCollection new ]. - anElement when: BlClickEvent do: [ :anEvent | - anEventCollection add: #parent. - anEvent consumed: true ]. - aChild := anElement childAt: 1. - aChild when: BlClickEvent do: [ :anEvent | - anEventCollection add: #child. - anEvent consumed: true ]. - (aChild childAt: 1) when: BlClickEvent do: [ :anEvent | - anEventCollection add: #grandchild. - anEvent consumed: true ]. - anElement - ] -] - -{ #category : #'examples - elements' } -BlClickEventExamples >> twoElements [ - - ^ self element - addChild: self element as: #child; - background: Color green muchLighter; - id: #parent -] - -{ #category : #'examples - elements in scripter' } -BlClickEventExamples >> twoElementsInScripter [ - - ^ self scripterWithElement: [ :aTarget :aScripter | - | anElement anEventCollection | - anElement := self twoElements. - anEventCollection := aScripter userData - at: #clicks - ifAbsentPut: [ OrderedCollection new ]. - anElement when: BlClickEvent do: [ :anEvent | - anEventCollection add: #parent. - anEvent consumed: true ]. - (anElement childAt: 1) when: BlClickEvent do: [ :anEvent | - anEventCollection add: #child. - anEvent consumed: true ]. - anElement - ] -] diff --git a/src/Bloc-Examples/BlClickEventExamplesTest.class.st b/src/Bloc-Examples/BlClickEventExamplesTest.class.st new file mode 100644 index 000000000..4d287e4e8 --- /dev/null +++ b/src/Bloc-Examples/BlClickEventExamplesTest.class.st @@ -0,0 +1,335 @@ +Class { + #name : #BlClickEventExamplesTest, + #superclass : #TestCase, + #traits : 'TBlDevScripterExamples + TAssertable', + #classTraits : 'TBlDevScripterExamples classTrait + TAssertable classTrait', + #category : #'Bloc-Examples-Event' +} + +{ #category : #'examples - elements' } +BlClickEventExamplesTest >> element [ + + + ^ BlElement new + layout: BlLinearLayout vertical; + border: (BlBorder paint: Color gray width: 1); + background: Color purple muchLighter; + constraintsDo: [ :c | + c horizontal matchParent. + c vertical matchParent ] +] + +{ #category : #'examples - events' } +BlClickEventExamplesTest >> testClickInHiddenChild [ + + + | aScripter | + aScripter := self twoElementsInScripter. + + aScripter substeps: 'Click in hidden child' do: [ :aStep | + aStep do + label: 'Set child with hidden visibility'; + block: [ :aChild | aChild visibility: BlVisibility hidden ]; + onChildAt: 1. + + aStep testClick onChildAt: 1. + + aStep check + label: 'Check the click was consumed by parent'; + do: [ + | aClickCollection | + aClickCollection := aScripter userData at: #clicks. + self assert: aClickCollection size equals: 1. + self assert: aClickCollection first equals: #parent ] ]. + + ^ aScripter syncContinue +] + +{ #category : #'examples - events' } +BlClickEventExamplesTest >> testClickInHiddenChildAndVisibleClippedGrandchild [ + + + | aScripter | + aScripter := self threeElementsWithTrueChildClippingInScripter. + + aScripter substeps: 'Click in hidden grandchild' do: [ :aStep | + aStep do + label: 'Set child with hidden visibility'; + block: [ :aChild | aChild visibility: BlVisibility hidden ]; + onChildAt: 1. + + aStep testClick + onChildAt: 1; + onChildAt: 1. + + aStep check + label: 'Check the click was consumed by parent'; + do: [ + | aClickCollection | + aClickCollection := aScripter userData at: #clicks. + self assert: aClickCollection size equals: 1. + self assert: aClickCollection first equals: #parent ] ]. + + ^ aScripter syncContinue +] + +{ #category : #'examples - events' } +BlClickEventExamplesTest >> testClickInHiddenChildAndVisibleGrandchild [ + + + | aScripter | + aScripter := self threeElementsInScripter. + + aScripter substeps: 'Click in hidden grandchild' do: [ :aStep | + aStep do + label: 'Set child with hidden visibility'; + block: [ :aChild | aChild visibility: BlVisibility hidden ]; + onChildAt: 1. + + aStep testClick + onChildAt: 1; + onChildAt: 1. + + aStep check + label: 'Check the click was consumed by parent'; + do: [ + | aClickCollection | + aClickCollection := aScripter userData at: #clicks. + self assert: aClickCollection size equals: 1. + self assert: aClickCollection first equals: #parent ] ]. + + ^ aScripter syncContinue +] + +{ #category : #'examples - events' } +BlClickEventExamplesTest >> testClickInHiddenChildAndVisibleUnclippedGrandchild [ + + + | aScripter | + aScripter := self threeElementsWithFalseChildClippingInScripter. + + aScripter substeps: 'Click in hidden grandchild' do: [ :aStep | + aStep do + label: 'Set child with hidden visibility'; + block: [ :aChild | aChild visibility: BlVisibility hidden ]; + onChildAt: 1. + + aStep testClick + onChildAt: 1; + onChildAt: 1. + + aStep check + label: 'Check the click was consumed by parent'; + do: [ + | aClickCollection | + aClickCollection := aScripter userData at: #clicks. + self assert: aClickCollection size equals: 1. + self assert: aClickCollection first equals: #parent ] ]. + + ^ aScripter syncContinue +] + +{ #category : #'examples - events' } +BlClickEventExamplesTest >> testClickInParentWithGoneChild [ + + + | aScripter | + aScripter := self twoElementsInScripter. + + aScripter substeps: 'Click in gone child' do: [ :aStep | + aStep do + label: 'Set child with gone visibility'; + block: [ :aChild | aChild visibility: BlVisibility gone ]; + onChildAt: 1. + + aStep testClick. + + aStep check + label: 'Check the click was consumed by parent'; + do: [ + | aClickCollection | + aClickCollection := aScripter userData at: #clicks. + self assert: aClickCollection size equals: 1. + self assert: aClickCollection first equals: #parent ] ]. + + ^ aScripter syncContinue +] + +{ #category : #'examples - events' } +BlClickEventExamplesTest >> testClickInVisibleChild [ + + + | aScripter | + aScripter := self twoElementsInScripter. + + aScripter substeps: 'Click in visible child' do: [ :aStep | + aStep testClick onChildAt: 1. + + aStep check + label: 'Check the click was consumed by child'; + do: [ + | aClickCollection | + aClickCollection := aScripter userData at: #clicks. + self assert: aClickCollection size equals: 1. + self assert: aClickCollection first equals: #child ] ]. + + ^ aScripter syncContinue +] + +{ #category : #'examples - elements' } +BlClickEventExamplesTest >> threeElements [ + + + ^ self element + addChild: (self element + addChild: self element as: #grandchild; + background: Color red muchLighter) + as: #child; + background: Color green muchLighter; + id: #parent +] + +{ #category : #'examples - elements in scripter' } +BlClickEventExamplesTest >> threeElementsInScripter [ + + + ^ self scripterWithElement: [ :aTarget :aScripter | + | anElement aChild anEventCollection | + anElement := self threeElements. + anEventCollection := aScripter userData + at: #clicks + ifAbsentPut: [ OrderedCollection new ]. + anElement when: BlClickEvent do: [ :anEvent | + anEventCollection add: #parent. + anEvent consumed: true ]. + aChild := anElement childAt: 1. + aChild when: BlClickEvent do: [ :anEvent | + anEventCollection add: #child. + anEvent consumed: true ]. + (aChild childAt: 1) when: BlClickEvent do: [ :anEvent | + anEventCollection add: #grandchild. + anEvent consumed: true ]. + anElement ] +] + +{ #category : #'examples - elements' } +BlClickEventExamplesTest >> threeElementsWithFalseChildClipping [ + + + | aParent aChild aGrandchild | + aParent := self element + background: Color green muchLighter; + id: #parent; + layout: BlFrameLayout new; + size: 100 @ 100. + + aChild := self element + size: 30 @ 30; + id: #child; + clipChildren: false; + constraintsDo: [ :c | + c frame horizontal alignCenter. + c frame vertical alignCenter ]. + + aGrandchild := self element + size: 20 @ 20; + background: Color red muchLighter; + id: #grandchild; + constraintsDo: [ :c | + c ignoreByLayout. + c ignored horizontal alignRightAt: 1.1. + c ignored vertical alignTopAt: 1.1 ]. + + aParent addChild: aChild. + aChild addChild: aGrandchild. + + ^ aParent +] + +{ #category : #'examples - elements in scripter' } +BlClickEventExamplesTest >> threeElementsWithFalseChildClippingInScripter [ + + + ^ self scripterWithElement: [ :aTarget :aScripter | + | anElement aChild anEventCollection | + anElement := self threeElementsWithFalseChildClipping. + anEventCollection := aScripter userData + at: #clicks + ifAbsentPut: [ OrderedCollection new ]. + anElement when: BlClickEvent do: [ :anEvent | + anEventCollection add: #parent. + anEvent consumed: true ]. + aChild := anElement childAt: 1. + aChild when: BlClickEvent do: [ :anEvent | + anEventCollection add: #child. + anEvent consumed: true ]. + (aChild childAt: 1) when: BlClickEvent do: [ :anEvent | + anEventCollection add: #grandchild. + anEvent consumed: true ]. + anElement ] +] + +{ #category : #'examples - elements' } +BlClickEventExamplesTest >> threeElementsWithTrueChildClipping [ + + + | aParent aChild | + aParent := self threeElementsWithFalseChildClipping. + + aChild := aParent childAt: 1. + aChild clipChildren: true. + + ^ aParent +] + +{ #category : #'examples - elements in scripter' } +BlClickEventExamplesTest >> threeElementsWithTrueChildClippingInScripter [ + + + ^ self scripterWithElement: [ :aTarget :aScripter | + | anElement aChild anEventCollection | + anElement := self threeElementsWithTrueChildClipping. + anEventCollection := aScripter userData + at: #clicks + ifAbsentPut: [ OrderedCollection new ]. + anElement when: BlClickEvent do: [ :anEvent | + anEventCollection add: #parent. + anEvent consumed: true ]. + aChild := anElement childAt: 1. + aChild when: BlClickEvent do: [ :anEvent | + anEventCollection add: #child. + anEvent consumed: true ]. + (aChild childAt: 1) when: BlClickEvent do: [ :anEvent | + anEventCollection add: #grandchild. + anEvent consumed: true ]. + anElement ] +] + +{ #category : #'examples - elements' } +BlClickEventExamplesTest >> twoElements [ + + + ^ self element + addChild: self element as: #child; + background: Color green muchLighter; + id: #parent +] + +{ #category : #'examples - elements in scripter' } +BlClickEventExamplesTest >> twoElementsInScripter [ + + + ^ self scripterWithElement: [ :aTarget :aScripter | + | anElement anEventCollection | + anElement := self twoElements. + anEventCollection := aScripter userData + at: #clicks + ifAbsentPut: [ OrderedCollection new ]. + anElement when: BlClickEvent do: [ :anEvent | + anEventCollection add: #parent. + anEvent consumed: true ]. + (anElement childAt: 1) when: BlClickEvent do: [ :anEvent | + anEventCollection add: #child. + anEvent consumed: true ]. + anElement ] +] diff --git a/src/Bloc-Examples/BlCollectionRopeExamples.class.st b/src/Bloc-Examples/BlCollectionRopeExamplesTest.class.st similarity index 58% rename from src/Bloc-Examples/BlCollectionRopeExamples.class.st rename to src/Bloc-Examples/BlCollectionRopeExamplesTest.class.st index 60dd8c3ff..4b4a9c0b1 100644 --- a/src/Bloc-Examples/BlCollectionRopeExamples.class.st +++ b/src/Bloc-Examples/BlCollectionRopeExamplesTest.class.st @@ -3,17 +3,17 @@ I contain examples of a collection rope " Class { - #name : #BlCollectionRopeExamples, - #superclass : #BlExampleTest, + #name : #BlCollectionRopeExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Rope' } { #category : #'examples - attributes' } -BlCollectionRopeExamples >> attributes_empty_0_to_0 [ - +BlCollectionRopeExamplesTest >> testAttributes_empty_0_to_0 [ + + | aRope anAttributedRope | - - aRope := self small_empty. + aRope := self testSmall_empty. anAttributedRope := aRope attributes: { 1 } from: 0 to: 0. self assert: anAttributedRope isNotEmpty. @@ -24,11 +24,11 @@ BlCollectionRopeExamples >> attributes_empty_0_to_0 [ ] { #category : #'examples - attributes' } -BlCollectionRopeExamples >> attributes_small_0_to_0 [ - +BlCollectionRopeExamplesTest >> testAttributes_small_0_to_0 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 0. self assert: anAttributedRope left attributes equals: { 1 }. @@ -40,11 +40,11 @@ BlCollectionRopeExamples >> attributes_small_0_to_0 [ ] { #category : #'examples - attributes' } -BlCollectionRopeExamples >> attributes_small_0_to_1 [ - +BlCollectionRopeExamplesTest >> testAttributes_small_0_to_1 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 1. self assert: anAttributedRope left attributes equals: { 1 }. @@ -56,11 +56,11 @@ BlCollectionRopeExamples >> attributes_small_0_to_1 [ ] { #category : #'examples - attributes' } -BlCollectionRopeExamples >> attributes_small_0_to_5 [ - +BlCollectionRopeExamplesTest >> testAttributes_small_0_to_5 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 5. self assert: anAttributedRope rope == aRope. @@ -70,11 +70,11 @@ BlCollectionRopeExamples >> attributes_small_0_to_5 [ ] { #category : #'examples - attributes' } -BlCollectionRopeExamples >> attributes_small_2_to_2 [ - - | aRope anAttributedRope | +BlCollectionRopeExamplesTest >> testAttributes_small_2_to_2 [ - aRope := self small. + + | aRope anAttributedRope | + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 2 to: 2. self assert: anAttributedRope left asString equals: 'He'. @@ -88,11 +88,11 @@ BlCollectionRopeExamples >> attributes_small_2_to_2 [ ] { #category : #'examples - attributes' } -BlCollectionRopeExamples >> attributes_small_4_to_5 [ - +BlCollectionRopeExamplesTest >> testAttributes_small_4_to_5 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 4 to: 5. self assert: anAttributedRope left asString equals: 'Hell'. @@ -104,11 +104,11 @@ BlCollectionRopeExamples >> attributes_small_4_to_5 [ ] { #category : #'examples - attributes' } -BlCollectionRopeExamples >> attributes_small_5_to_5 [ - - | aRope anAttributedRope | +BlCollectionRopeExamplesTest >> testAttributes_small_5_to_5 [ - aRope := self small. + + | aRope anAttributedRope | + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 5 to: 5. self assert: anAttributedRope left asString equals: 'Hello'. @@ -120,11 +120,11 @@ BlCollectionRopeExamples >> attributes_small_5_to_5 [ ] { #category : #'examples - attributes' } -BlCollectionRopeExamples >> clear_attributes_empty_0_to_0 [ - +BlCollectionRopeExamplesTest >> testClear_attributes_empty_0_to_0 [ + + | anEmptyRope aRopeWithoutAttributes | - - anEmptyRope := self small_empty. + anEmptyRope := self testSmall_empty. aRopeWithoutAttributes := anEmptyRope clearAttributes: 0 to: 0. self assert: aRopeWithoutAttributes isEmpty. @@ -134,11 +134,11 @@ BlCollectionRopeExamples >> clear_attributes_empty_0_to_0 [ ] { #category : #'instance creation' } -BlCollectionRopeExamples >> small [ - - - | aRope | +BlCollectionRopeExamplesTest >> testSmall [ + "Creates an instance of the rope of size smaller than combineLength" + + | aRope | aRope := BlCollectionRope collection: 'Hello'. self assert: aRope depth equals: 1. @@ -151,95 +151,95 @@ BlCollectionRopeExamples >> small [ ] { #category : #'examples - accessing' } -BlCollectionRopeExamples >> small_at_each [ - +BlCollectionRopeExamplesTest >> testSmall_at_each [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: (aRope at: 1) equals: $H. self assert: (aRope at: 2) equals: $e. self assert: (aRope at: 3) equals: $l. self assert: (aRope at: 4) equals: $l. self assert: (aRope at: 5) equals: $o. - + ^ aRope ] { #category : #'examples - accessing' } -BlCollectionRopeExamples >> small_children [ - +BlCollectionRopeExamplesTest >> testSmall_children [ + + | aRope | - - aRope := self small. + aRope := self testSmall. - self assert: aRope children equals: { }. + self assert: aRope children equals: { }. ^ aRope ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_0_to_0 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_0_to_0 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 0. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_0_to_1 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_0_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 1. - + self assert: aNewRope size equals: 4. self assert: aNewRope asString equals: 'ello'. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_0_to_5 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_0_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 5. - + self assert: aNewRope size equals: 0. self assert: aNewRope asString equals: ''. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_1_to_1 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_1_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 1. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_1_to_3 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_1_to_3 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 3. - + self assert: aNewRope size equals: 3. self assert: aNewRope asString equals: 'Hlo'. @@ -247,27 +247,27 @@ BlCollectionRopeExamples >> small_delete_1_to_3 [ ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_1_to_5 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_1_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 5. - + self assert: aNewRope size equals: 1. self assert: aNewRope asString equals: 'H'. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_4_to_5 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_4_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 4 to: 5. - + self assert: aNewRope size equals: 4. self assert: aNewRope asString equals: 'Hell'. @@ -275,24 +275,24 @@ BlCollectionRopeExamples >> small_delete_4_to_5 [ ] { #category : #'examples - deletion' } -BlCollectionRopeExamples >> small_delete_5_to_5 [ - +BlCollectionRopeExamplesTest >> testSmall_delete_5_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 5 to: 5. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - accessing' } -BlCollectionRopeExamples >> small_depth [ - +BlCollectionRopeExamplesTest >> testSmall_depth [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope depth equals: 1. @@ -300,12 +300,14 @@ BlCollectionRopeExamples >> small_depth [ ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_do [ - +BlCollectionRopeExamplesTest >> testSmall_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'Hello'. @@ -313,11 +315,11 @@ BlCollectionRopeExamples >> small_do [ ] { #category : #'instance creation' } -BlCollectionRopeExamples >> small_empty [ - - | aRope anEmpty | +BlCollectionRopeExamplesTest >> testSmall_empty [ - aRope := self small. + + | aRope anEmpty | + aRope := self testSmall. anEmpty := aRope empty. self assert: anEmpty size equals: 0. @@ -327,26 +329,31 @@ BlCollectionRopeExamples >> small_empty [ ] { #category : #'examples - from to' } -BlCollectionRopeExamples >> small_from_0_to_0 [ - +BlCollectionRopeExamplesTest >> testSmall_from_0_to_0 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 0. - + self assert: aNewRope size equals: 0. self assert: aNewRope asString equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_from_0_to_0_do [ - +BlCollectionRopeExamplesTest >> testSmall_from_0_to_0_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 0 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 0 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -354,26 +361,31 @@ BlCollectionRopeExamples >> small_from_0_to_0_do [ ] { #category : #'examples - from to' } -BlCollectionRopeExamples >> small_from_0_to_1 [ - +BlCollectionRopeExamplesTest >> testSmall_from_0_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 1. - + self assert: aNewRope size equals: 1. self assert: aNewRope asString equals: 'H'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_from_0_to_1_do [ - +BlCollectionRopeExamplesTest >> testSmall_from_0_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'H'. @@ -381,25 +393,30 @@ BlCollectionRopeExamples >> small_from_0_to_1_do [ ] { #category : #'examples - from to' } -BlCollectionRopeExamples >> small_from_0_to_5 [ - +BlCollectionRopeExamplesTest >> testSmall_from_0_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 5. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_from_0_to_5_do [ - +BlCollectionRopeExamplesTest >> testSmall_from_0_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'Hello'. @@ -407,26 +424,31 @@ BlCollectionRopeExamples >> small_from_0_to_5_do [ ] { #category : #'examples - from to' } -BlCollectionRopeExamples >> small_from_1_to_1 [ - +BlCollectionRopeExamplesTest >> testSmall_from_1_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 1. - + self assert: aNewRope size equals: 0. self assert: aNewRope asString equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_from_1_to_1_do [ - +BlCollectionRopeExamplesTest >> testSmall_from_1_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -434,26 +456,31 @@ BlCollectionRopeExamples >> small_from_1_to_1_do [ ] { #category : #'examples - from to' } -BlCollectionRopeExamples >> small_from_1_to_2 [ - +BlCollectionRopeExamplesTest >> testSmall_from_1_to_2 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 2. - + self assert: aNewRope size equals: 1. self assert: aNewRope asString equals: 'e'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_from_1_to_2_do [ - +BlCollectionRopeExamplesTest >> testSmall_from_1_to_2_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 2 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 2 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'e'. @@ -461,26 +488,31 @@ BlCollectionRopeExamples >> small_from_1_to_2_do [ ] { #category : #'examples - from to' } -BlCollectionRopeExamples >> small_from_1_to_5 [ - +BlCollectionRopeExamplesTest >> testSmall_from_1_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 5. - + self assert: aNewRope size equals: 4. self assert: aNewRope asString equals: 'ello'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_from_1_to_5_do [ - +BlCollectionRopeExamplesTest >> testSmall_from_1_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'ello'. @@ -488,26 +520,31 @@ BlCollectionRopeExamples >> small_from_1_to_5_do [ ] { #category : #'examples - from to' } -BlCollectionRopeExamples >> small_from_3_to_5 [ - +BlCollectionRopeExamplesTest >> testSmall_from_3_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 3 to: 5. - + self assert: aNewRope size equals: 2. self assert: aNewRope asString equals: 'lo'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlCollectionRopeExamples >> small_from_3_to_5_do [ - +BlCollectionRopeExamplesTest >> testSmall_from_3_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 3 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 3 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'lo'. @@ -515,11 +552,11 @@ BlCollectionRopeExamples >> small_from_3_to_5_do [ ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_rope_123_at_0 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_rope_123_at_0 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insert: (BlCollectionRope collection: '123') at: 0. self assert: aNewRope size equals: 8. @@ -529,11 +566,11 @@ BlCollectionRopeExamples >> small_insert_rope_123_at_0 [ ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_rope_123_at_1 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_rope_123_at_1 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insert: (BlCollectionRope collection: '123') at: 1. self assert: aNewRope size equals: 8. @@ -543,11 +580,11 @@ BlCollectionRopeExamples >> small_insert_rope_123_at_1 [ ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_rope_123_at_2 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_rope_123_at_2 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insert: (BlCollectionRope collection: '123') at: 2. self assert: aNewRope size equals: 8. @@ -557,11 +594,11 @@ BlCollectionRopeExamples >> small_insert_rope_123_at_2 [ ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_rope_123_at_3 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_rope_123_at_3 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insert: (BlCollectionRope collection: '123') at: 3. self assert: aNewRope size equals: 8. @@ -571,11 +608,11 @@ BlCollectionRopeExamples >> small_insert_rope_123_at_3 [ ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_rope_123_at_4 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_rope_123_at_4 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insert: (BlCollectionRope collection: '123') at: 4. self assert: aNewRope size equals: 8. @@ -585,11 +622,11 @@ BlCollectionRopeExamples >> small_insert_rope_123_at_4 [ ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_rope_123_at_5 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_rope_123_at_5 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insert: (BlCollectionRope collection: '123') at: 5. self assert: aNewRope size equals: 8. @@ -599,81 +636,81 @@ BlCollectionRopeExamples >> small_insert_rope_123_at_5 [ ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_string_123_at_0 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_string_123_at_0 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insertItems: '123' at: 0. self assert: aNewRope size equals: 8. self assert: aNewRope asString equals: '123Hello'. - + ^ aNewRope ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_string_123_at_1 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_string_123_at_1 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insertItems: '123' at: 1. self assert: aNewRope size equals: 8. self assert: aNewRope asString equals: 'H123ello'. - + ^ aNewRope ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_string_123_at_2 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_string_123_at_2 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insertItems: '123' at: 2. self assert: aNewRope size equals: 8. self assert: aNewRope asString equals: 'He123llo'. - + ^ aNewRope ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_string_123_at_3 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_string_123_at_3 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insertItems: '123' at: 3. self assert: aNewRope size equals: 8. self assert: aNewRope asString equals: 'Hel123lo'. - + ^ aNewRope ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_string_123_at_4 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_string_123_at_4 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insertItems: '123' at: 4. self assert: aNewRope size equals: 8. self assert: aNewRope asString equals: 'Hell123o'. - + ^ aNewRope ] { #category : #'examples - insertion' } -BlCollectionRopeExamples >> small_insert_string_123_at_5 [ - - | aRope aNewRope | +BlCollectionRopeExamplesTest >> testSmall_insert_string_123_at_5 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope insertItems: '123' at: 5. self assert: aNewRope size equals: 8. @@ -683,11 +720,11 @@ BlCollectionRopeExamples >> small_insert_string_123_at_5 [ ] { #category : #'examples - testing' } -BlCollectionRopeExamples >> small_isEmpty [ - +BlCollectionRopeExamplesTest >> testSmall_isEmpty [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isEmpty not. @@ -695,11 +732,11 @@ BlCollectionRopeExamples >> small_isEmpty [ ] { #category : #'examples - testing' } -BlCollectionRopeExamples >> small_isLeaf [ - +BlCollectionRopeExamplesTest >> testSmall_isLeaf [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isLeaf. @@ -707,11 +744,11 @@ BlCollectionRopeExamples >> small_isLeaf [ ] { #category : #'examples - testing' } -BlCollectionRopeExamples >> small_isNotEmpty [ - +BlCollectionRopeExamplesTest >> testSmall_isNotEmpty [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isNotEmpty. @@ -719,11 +756,11 @@ BlCollectionRopeExamples >> small_isNotEmpty [ ] { #category : #'examples - accessing' } -BlCollectionRopeExamples >> small_size [ - +BlCollectionRopeExamplesTest >> testSmall_size [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope size equals: 5. diff --git a/src/Bloc-Examples/BlCollectionRopeIteratorExamples.class.st b/src/Bloc-Examples/BlCollectionRopeIteratorExamples.class.st deleted file mode 100644 index 480470abd..000000000 --- a/src/Bloc-Examples/BlCollectionRopeIteratorExamples.class.st +++ /dev/null @@ -1,773 +0,0 @@ -Class { - #name : #BlCollectionRopeIteratorExamples, - #superclass : #Object, - #category : #'Bloc-Examples-Rope' -} - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineIndicesWithCrlf_0 [ - - | anIterator aNextLine | - - anIterator := (BlCollectionRope collection: ('Line 1', String crlf, 'Line 2', String crlf, String crlf, 'Line 4')) iterator. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 8. - self assert: aNextLine equals: { 0 . 6 . 8 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 1'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineIndicesWithCrlf_08 [ - - | anIterator aNextLine | - - anIterator := self nextLineIndicesWithCrlf_0. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 16. - self assert: aNextLine equals: { 8 . 14 . 16 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 2'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineIndicesWithCrlf_16 [ - - | anIterator aNextLine | - - anIterator := self nextLineIndicesWithCrlf_08. - - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 18. - self assert: aNextLine equals: { 16 . 16 . 18 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: ''. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineIndicesWithCrlf_18 [ - - | anIterator aNextLine | - - anIterator := self nextLineIndicesWithCrlf_16. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 24. - self assert: aNextLine equals: { 18 . 24 . 24 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 4'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithCr_0 [ - - | anIterator aNextLine | - - anIterator := (BlCollectionRope collection: ('Line 1', String cr, 'Line 2', String cr, String cr, 'Line 4')) iterator. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 7. - self assert: aNextLine equals: { 0 . 6 . 7 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 1'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithCr_07 [ - - | anIterator aNextLine | - - anIterator := self nextLineWithCr_0. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 14. - self assert: aNextLine equals: { 7 . 13 . 14 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 2'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithCr_14 [ - - | anIterator aNextLine | - - anIterator := self nextLineWithCr_07. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 15. - self assert: aNextLine equals: { 14 . 14 . 15 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: ''. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithCr_15 [ - - | anIterator aNextLine | - - anIterator := self nextLineWithCr_14. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 21. - self assert: aNextLine equals: { 15 . 21 . 21 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 4'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithCrlf [ - - | anIterator | - - anIterator := (BlCollectionRope collection: ('Line 1', String crlf, 'Line 2', String crlf, String crlf, 'Line 4')) iterator. - - self assert: anIterator nextLine asString equals: 'Line 1'. - self assert: anIterator nextLine asString equals: 'Line 2'. - self assert: anIterator nextLine asString equals: ''. - self assert: anIterator nextLine asString equals: 'Line 4'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithLf_0 [ - - | anIterator aNextLine | - - anIterator := (BlCollectionRope collection: ('Line 1', String lf, 'Line 2', String lf, String lf, 'Line 4')) iterator. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 7. - self assert: aNextLine equals: { 0 . 6 . 7 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 1'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithLf_07 [ - - | anIterator aNextLine | - - anIterator := self nextLineWithLf_0. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 14. - self assert: aNextLine equals: { 7 . 13 . 14 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 2'. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithLf_14 [ - - | anIterator aNextLine | - - anIterator := self nextLineWithLf_07. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 15. - self assert: aNextLine equals: { 14 . 14 . 15 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: ''. - - ^ anIterator -] - -{ #category : #'examples - next line' } -BlCollectionRopeIteratorExamples >> nextLineWithLf_15 [ - - | anIterator aNextLine | - - anIterator := self nextLineWithLf_14. - aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd :aDelimitedEnd | - { aLineStart . aLineEnd . aDelimitedEnd } ]. - - self assert: anIterator position equals: 21. - self assert: aNextLine equals: { 15 . 21 . 21 }. - self assert: (anIterator rope from: aNextLine first to: aNextLine second) asString equals: 'Line 4'. - - ^ anIterator -] - -{ #category : #'examples - next segment' } -BlCollectionRopeIteratorExamples >> nextSegmentWithLookAhead_at_0 [ - - | anIterator aSegmentResult | - - anIterator := self small. - - aSegmentResult := anIterator - nextSegment: [ :aBuffer | aBuffer first = aBuffer second ] - indicesDo: [ :aFromIndex :aToIndex :anInitialValue :aFinalValue | { - aFromIndex . aToIndex . anInitialValue . aFinalValue - } ] - lookahead: 3. - - self assert: aSegmentResult equals: { 0 . 2 . false . true }. - self assert: (anIterator rope from: aSegmentResult first to: aSegmentResult second) asString equals: 'He'. - - ^ anIterator -] - -{ #category : #'examples - next segment' } -BlCollectionRopeIteratorExamples >> nextSegmentWithLookAhead_at_3 [ - - | anIterator aSegmentResult | - - anIterator := self nextSegmentWithLookAhead_at_0. - - aSegmentResult := anIterator - nextSegment: [ :aBuffer | aBuffer first = aBuffer second ] - indicesDo: [ :aFromIndex :aToIndex :anInitialValue :aFinalValue | { - aFromIndex . aToIndex . anInitialValue . aFinalValue - } ] - lookahead: 3. - - self assert: aSegmentResult equals: { 2 . 3 . true . false }. - self assert: (anIterator rope from: aSegmentResult first to: aSegmentResult second) asString equals: 'l'. - - ^ anIterator -] - -{ #category : #'examples - next segment' } -BlCollectionRopeIteratorExamples >> nextSegmentWithLookAhead_at_5 [ - - | anIterator aSegmentResult | - - anIterator := self nextSegmentWithLookAhead_at_3. - - aSegmentResult := anIterator - nextSegment: [ :aBuffer | aBuffer first = aBuffer second ] - indicesDo: [ :aFromIndex :aToIndex :anInitialValue :aFinalValue | { - aFromIndex . aToIndex . anInitialValue . aFinalValue - } ] - lookahead: 3. - - self assert: aSegmentResult equals: { 3 . 5 . false . false }. - self assert: (anIterator rope from: aSegmentResult first to: aSegmentResult second) asString equals: 'lo'. - - ^ anIterator -] - -{ #category : #'instance creation' } -BlCollectionRopeIteratorExamples >> small [ - - | anIterator | - - anIterator := BlCollectionRopeExamples new small iterator: 0 to: 5. - - self assert: anIterator position equals: 0. - self assert: anIterator start equals: 0. - self assert: anIterator end equals: 5. - - self assert: anIterator hasNext. - self assert: anIterator hasPrevious not. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_nextSpan_at_0 [ - - | anIterator aSpan | - - anIterator := self small. - aSpan := anIterator nextSpan. - - self assert: aSpan collection equals: 'Hello'. - self assert: anIterator position equals: 5. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_nextSpan_at_1 [ - - | anIterator aSpan | - - anIterator := self small_next_at_0. - aSpan := anIterator nextSpan. - - self assert: aSpan collection equals: 'ello'. - self assert: anIterator position equals: 5. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_nextSpan_at_2 [ - - | anIterator aSpan | - - anIterator := self small_next_at_1. - aSpan := anIterator nextSpan. - - self assert: aSpan collection equals: 'llo'. - self assert: anIterator position equals: 5. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_nextSpan_at_3 [ - - | anIterator aSpan | - - anIterator := self small_next_at_2. - aSpan := anIterator nextSpan. - - self assert: aSpan collection equals: 'lo'. - self assert: anIterator position equals: 5. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_nextSpan_at_4 [ - - | anIterator aSpan | - - anIterator := self small_next_at_3. - aSpan := anIterator nextSpan. - - self assert: aSpan collection equals: 'o'. - self assert: anIterator position equals: 5. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_nextSpan_at_5 [ - - - | anIterator anError | - - anIterator := self small_next_at_4. - - anError := nil. - [ anIterator nextSpan ] on: Error do: [ :e | anError := e ]. - - self assert: anError isNotNil. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_next_at_0 [ - - | anIterator anItem | - - anIterator := self small. - - anItem := anIterator next. - - self assert: anItem equals: $H. - self assert: anIterator position equals: 1. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_next_at_1 [ - - | anIterator anItem | - - anIterator := self small_next_at_0. - - anItem := anIterator next. - - self assert: anItem equals: $e. - self assert: anIterator position equals: 2. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_next_at_2 [ - - | anIterator anItem | - - anIterator := self small_next_at_1. - - anItem := anIterator next. - - self assert: anItem equals: $l. - self assert: anIterator position equals: 3. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_next_at_3 [ - - | anIterator anItem | - - anIterator := self small_next_at_2. - - anItem := anIterator next. - - self assert: anItem equals: $l. - self assert: anIterator position equals: 4. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_next_at_4 [ - - | anIterator anItem | - - anIterator := self small_next_at_3. - - anItem := anIterator next. - - self assert: anItem equals: $o. - self assert: anIterator position equals: 5. - self assert: anIterator hasNext not. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_next_at_5 [ - - - | anIterator anError | - - anIterator := self small_next_at_4. - - anError := nil. - [ anIterator next ] on: Error do: [ :e | anError := e ]. - - self assert: anError isNotNil. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_peek_at_0 [ - - | anIterator anItem | - - anIterator := self small. - - anItem := anIterator peek. - - self assert: anItem equals: $H. - self assert: anIterator position equals: 0. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious not. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_peek_at_1 [ - - | anIterator anItem | - - anIterator := self small_next_at_0. - - anItem := anIterator peek. - - self assert: anItem equals: $e. - self assert: anIterator position equals: 1. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_peek_at_2 [ - - | anIterator anItem | - - anIterator := self small_next_at_1. - - anItem := anIterator peek. - - self assert: anItem equals: $l. - self assert: anIterator position equals: 2. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_peek_at_3 [ - - | anIterator anItem | - - anIterator := self small_next_at_2. - - anItem := anIterator peek. - - self assert: anItem equals: $l. - self assert: anIterator position equals: 3. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_peek_at_4 [ - - | anIterator anItem | - - anIterator := self small_next_at_3. - - anItem := anIterator peek. - - self assert: anItem equals: $o. - self assert: anIterator position equals: 4. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_peek_at_5 [ - - - | anIterator anError | - - anIterator := self small_next_at_4. - - anError := nil. - [ anIterator peek ] on: Error do: [ :e | anError := e ]. - - self assert: anError isNotNil. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_previous_at_0 [ - - - | anIterator anError | - - anIterator := self small. - - anError := nil. - [ anIterator previous ] on: Error do: [ :e | anError := e ]. - - self assert: anError isNotNil. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_previous_at_1 [ - - | anIterator anItem | - - anIterator := self small_next_at_0. - - anItem := anIterator previous. - - self assert: anItem equals: $H. - self assert: anIterator position equals: 0. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious not. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_previous_at_2 [ - - | anIterator anItem | - - anIterator := self small_next_at_1. - - anItem := anIterator previous. - - self assert: anItem equals: $e. - self assert: anIterator position equals: 1. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_previous_at_3 [ - - | anIterator anItem | - - anIterator := self small_next_at_2. - - anItem := anIterator previous. - - self assert: anItem equals: $l. - self assert: anIterator position equals: 2. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_previous_at_4 [ - - | anIterator anItem | - - anIterator := self small_next_at_3. - - anItem := anIterator previous. - - self assert: anItem equals: $l. - self assert: anIterator position equals: 3. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_previous_at_5 [ - - | anIterator anItem | - - anIterator := self small_next_at_4. - - anItem := anIterator previous. - - self assert: anItem equals: $o. - self assert: anIterator position equals: 4. - self assert: anIterator hasNext. - self assert: anIterator hasPrevious. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_skip_0_at_0 [ - - | anIterator | - - anIterator := self small. - anIterator skip: 0. - - self assert: anIterator position equals: 0. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_skip_1_at_0 [ - - | anIterator | - - anIterator := self small. - anIterator skip: 1. - - self assert: anIterator position equals: 1. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_skip_2_at_0 [ - - | anIterator | - - anIterator := self small. - anIterator skip: 2. - - self assert: anIterator position equals: 2. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_skip_3_at_0 [ - - | anIterator | - - anIterator := self small. - anIterator skip: 3. - - self assert: anIterator position equals: 3. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_skip_4_at_0 [ - - | anIterator | - - anIterator := self small. - anIterator skip: 4. - - self assert: anIterator position equals: 4. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_skip_5_at_0 [ - - | anIterator | - - anIterator := self small. - anIterator skip: 5. - - self assert: anIterator position equals: 5. - - ^ anIterator -] - -{ #category : #'examples - enumeration' } -BlCollectionRopeIteratorExamples >> small_skip_6_at_0 [ - - - | anIterator anError | - - anIterator := self small. - - anError := nil. - [ anIterator skip: 6 ] on: Error do: [ :e | anError := e ]. - - self assert: anError isNotNil. - - ^ anIterator -] diff --git a/src/Bloc-Examples/BlCollectionRopeIteratorExamplesTest.class.st b/src/Bloc-Examples/BlCollectionRopeIteratorExamplesTest.class.st new file mode 100644 index 000000000..616a8dd1c --- /dev/null +++ b/src/Bloc-Examples/BlCollectionRopeIteratorExamplesTest.class.st @@ -0,0 +1,952 @@ +Class { + #name : #BlCollectionRopeIteratorExamplesTest, + #superclass : #TestCase, + #category : #'Bloc-Examples-Rope' +} + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineIndicesWithCrlf_0 [ + + + | anIterator aNextLine | + anIterator := (BlCollectionRope collection: + 'Line 1' , String crlf , 'Line 2' , String crlf + , String crlf , 'Line 4') iterator. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 8. + self assert: aNextLine equals: { 0. 6. 8 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 1'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineIndicesWithCrlf_08 [ + + + | anIterator aNextLine | + anIterator := self testNextLineIndicesWithCrlf_0. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 16. + self assert: aNextLine equals: { 8. 14. 16 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 2'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineIndicesWithCrlf_16 [ + + + | anIterator aNextLine | + anIterator := self testNextLineIndicesWithCrlf_08. + + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 18. + self assert: aNextLine equals: { 16. 16. 18 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: ''. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineIndicesWithCrlf_18 [ + + + | anIterator aNextLine | + anIterator := self testNextLineIndicesWithCrlf_16. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 24. + self assert: aNextLine equals: { 18. 24. 24 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 4'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithCr_0 [ + + + | anIterator aNextLine | + anIterator := (BlCollectionRope collection: + 'Line 1' , String cr , 'Line 2' , String cr + , String cr , 'Line 4') iterator. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 7. + self assert: aNextLine equals: { 0. 6. 7 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 1'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithCr_07 [ + + + | anIterator aNextLine | + anIterator := self testNextLineWithCr_0. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 14. + self assert: aNextLine equals: { 7. 13. 14 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 2'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithCr_14 [ + + + | anIterator aNextLine | + anIterator := self testNextLineWithCr_07. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 15. + self assert: aNextLine equals: { 14. 14. 15 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: ''. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithCr_15 [ + + + | anIterator aNextLine | + anIterator := self testNextLineWithCr_14. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 21. + self assert: aNextLine equals: { 15. 21. 21 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 4'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithCrlf [ + + + | anIterator | + anIterator := (BlCollectionRope collection: + 'Line 1' , String crlf , 'Line 2' , String crlf + , String crlf , 'Line 4') iterator. + + self assert: anIterator nextLine asString equals: 'Line 1'. + self assert: anIterator nextLine asString equals: 'Line 2'. + self assert: anIterator nextLine asString equals: ''. + self assert: anIterator nextLine asString equals: 'Line 4'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithLf_0 [ + + + | anIterator aNextLine | + anIterator := (BlCollectionRope collection: + 'Line 1' , String lf , 'Line 2' , String lf + , String lf , 'Line 4') iterator. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 7. + self assert: aNextLine equals: { 0. 6. 7 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 1'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithLf_07 [ + + + | anIterator aNextLine | + anIterator := self testNextLineWithLf_0. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 14. + self assert: aNextLine equals: { 7. 13. 14 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 2'. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithLf_14 [ + + + | anIterator aNextLine | + anIterator := self testNextLineWithLf_07. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 15. + self assert: aNextLine equals: { 14. 14. 15 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: ''. + + ^ anIterator +] + +{ #category : #'examples - next line' } +BlCollectionRopeIteratorExamplesTest >> testNextLineWithLf_15 [ + + + | anIterator aNextLine | + anIterator := self testNextLineWithLf_14. + aNextLine := anIterator nextLineIndicesDo: [ + :aLineStart + :aLineEnd + :aDelimitedEnd | + { + aLineStart. + aLineEnd. + aDelimitedEnd } ]. + + self assert: anIterator position equals: 21. + self assert: aNextLine equals: { 15. 21. 21 }. + self + assert: + (anIterator rope from: aNextLine first to: aNextLine second) + asString + equals: 'Line 4'. + + ^ anIterator +] + +{ #category : #'examples - next segment' } +BlCollectionRopeIteratorExamplesTest >> testNextSegmentWithLookAhead_at_0 [ + + + | anIterator aSegmentResult | + anIterator := self testSmall. + + aSegmentResult := anIterator + nextSegment: [ :aBuffer | + aBuffer first = aBuffer second ] + indicesDo: [ + :aFromIndex + :aToIndex + :anInitialValue + :aFinalValue | + { + aFromIndex. + aToIndex. + anInitialValue. + aFinalValue } ] + lookahead: 3. + + self assert: aSegmentResult equals: { 0. 2. false. true }. + self + assert: + (anIterator rope + from: aSegmentResult first + to: aSegmentResult second) asString + equals: 'He'. + + ^ anIterator +] + +{ #category : #'examples - next segment' } +BlCollectionRopeIteratorExamplesTest >> testNextSegmentWithLookAhead_at_3 [ + + + | anIterator aSegmentResult | + anIterator := self testNextSegmentWithLookAhead_at_0. + + aSegmentResult := anIterator + nextSegment: [ :aBuffer | + aBuffer first = aBuffer second ] + indicesDo: [ + :aFromIndex + :aToIndex + :anInitialValue + :aFinalValue | + { + aFromIndex. + aToIndex. + anInitialValue. + aFinalValue } ] + lookahead: 3. + + self assert: aSegmentResult equals: { 2. 3. true. false }. + self + assert: + (anIterator rope + from: aSegmentResult first + to: aSegmentResult second) asString + equals: 'l'. + + ^ anIterator +] + +{ #category : #'examples - next segment' } +BlCollectionRopeIteratorExamplesTest >> testNextSegmentWithLookAhead_at_5 [ + + + | anIterator aSegmentResult | + anIterator := self testNextSegmentWithLookAhead_at_3. + + aSegmentResult := anIterator + nextSegment: [ :aBuffer | + aBuffer first = aBuffer second ] + indicesDo: [ + :aFromIndex + :aToIndex + :anInitialValue + :aFinalValue | + { + aFromIndex. + aToIndex. + anInitialValue. + aFinalValue } ] + lookahead: 3. + + self assert: aSegmentResult equals: { 3. 5. false. false }. + self + assert: + (anIterator rope + from: aSegmentResult first + to: aSegmentResult second) asString + equals: 'lo'. + + ^ anIterator +] + +{ #category : #'instance creation' } +BlCollectionRopeIteratorExamplesTest >> testSmall [ + + + | anIterator | + anIterator := BlCollectionRopeExamplesTest new testSmall + iterator: 0 + to: 5. + + self assert: anIterator position equals: 0. + self assert: anIterator start equals: 0. + self assert: anIterator end equals: 5. + + self assert: anIterator hasNext. + self assert: anIterator hasPrevious not. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_nextSpan_at_0 [ + + + | anIterator aSpan | + anIterator := self testSmall. + aSpan := anIterator nextSpan. + + self assert: aSpan collection equals: 'Hello'. + self assert: anIterator position equals: 5. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_nextSpan_at_1 [ + + + | anIterator aSpan | + anIterator := self testSmall_next_at_0. + aSpan := anIterator nextSpan. + + self assert: aSpan collection equals: 'ello'. + self assert: anIterator position equals: 5. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_nextSpan_at_2 [ + + + | anIterator aSpan | + anIterator := self testSmall_next_at_1. + aSpan := anIterator nextSpan. + + self assert: aSpan collection equals: 'llo'. + self assert: anIterator position equals: 5. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_nextSpan_at_3 [ + + + | anIterator aSpan | + anIterator := self testSmall_next_at_2. + aSpan := anIterator nextSpan. + + self assert: aSpan collection equals: 'lo'. + self assert: anIterator position equals: 5. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_nextSpan_at_4 [ + + + | anIterator aSpan | + anIterator := self testSmall_next_at_3. + aSpan := anIterator nextSpan. + + self assert: aSpan collection equals: 'o'. + self assert: anIterator position equals: 5. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_nextSpan_at_5 [ + "Iterator throws an error when the end is reached" + + + | anIterator anError | + anIterator := self testSmall_next_at_4. + + anError := nil. + [ anIterator nextSpan ] + on: Error + do: [ :e | anError := e ]. + + self assert: anError isNotNil. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_next_at_0 [ + + + | anIterator anItem | + anIterator := self testSmall. + + anItem := anIterator next. + + self assert: anItem equals: $H. + self assert: anIterator position equals: 1. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_next_at_1 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_0. + + anItem := anIterator next. + + self assert: anItem equals: $e. + self assert: anIterator position equals: 2. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_next_at_2 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_1. + + anItem := anIterator next. + + self assert: anItem equals: $l. + self assert: anIterator position equals: 3. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_next_at_3 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_2. + + anItem := anIterator next. + + self assert: anItem equals: $l. + self assert: anIterator position equals: 4. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_next_at_4 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_3. + + anItem := anIterator next. + + self assert: anItem equals: $o. + self assert: anIterator position equals: 5. + self assert: anIterator hasNext not. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_next_at_5 [ + "Iterator throws an error when the end is reached" + + + | anIterator anError | + anIterator := self testSmall_next_at_4. + + anError := nil. + [ anIterator next ] + on: Error + do: [ :e | anError := e ]. + + self assert: anError isNotNil. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_peek_at_0 [ + + + | anIterator anItem | + anIterator := self testSmall. + + anItem := anIterator peek. + + self assert: anItem equals: $H. + self assert: anIterator position equals: 0. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious not. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_peek_at_1 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_0. + + anItem := anIterator peek. + + self assert: anItem equals: $e. + self assert: anIterator position equals: 1. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_peek_at_2 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_1. + + anItem := anIterator peek. + + self assert: anItem equals: $l. + self assert: anIterator position equals: 2. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_peek_at_3 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_2. + + anItem := anIterator peek. + + self assert: anItem equals: $l. + self assert: anIterator position equals: 3. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_peek_at_4 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_3. + + anItem := anIterator peek. + + self assert: anItem equals: $o. + self assert: anIterator position equals: 4. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_peek_at_5 [ + "Iterator throws an error when the end is reached" + + + | anIterator anError | + anIterator := self testSmall_next_at_4. + + anError := nil. + [ anIterator peek ] + on: Error + do: [ :e | anError := e ]. + + self assert: anError isNotNil. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_previous_at_0 [ + "Iterator throws an error when the start is reached" + + + | anIterator anError | + anIterator := self testSmall. + + anError := nil. + [ anIterator previous ] + on: Error + do: [ :e | anError := e ]. + + self assert: anError isNotNil. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_previous_at_1 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_0. + + anItem := anIterator previous. + + self assert: anItem equals: $H. + self assert: anIterator position equals: 0. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious not. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_previous_at_2 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_1. + + anItem := anIterator previous. + + self assert: anItem equals: $e. + self assert: anIterator position equals: 1. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_previous_at_3 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_2. + + anItem := anIterator previous. + + self assert: anItem equals: $l. + self assert: anIterator position equals: 2. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_previous_at_4 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_3. + + anItem := anIterator previous. + + self assert: anItem equals: $l. + self assert: anIterator position equals: 3. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_previous_at_5 [ + + + | anIterator anItem | + anIterator := self testSmall_next_at_4. + + anItem := anIterator previous. + + self assert: anItem equals: $o. + self assert: anIterator position equals: 4. + self assert: anIterator hasNext. + self assert: anIterator hasPrevious. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_skip_0_at_0 [ + + + | anIterator | + anIterator := self testSmall. + anIterator skip: 0. + + self assert: anIterator position equals: 0. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_skip_1_at_0 [ + + + | anIterator | + anIterator := self testSmall. + anIterator skip: 1. + + self assert: anIterator position equals: 1. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_skip_2_at_0 [ + + + | anIterator | + anIterator := self testSmall. + anIterator skip: 2. + + self assert: anIterator position equals: 2. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_skip_3_at_0 [ + + + | anIterator | + anIterator := self testSmall. + anIterator skip: 3. + + self assert: anIterator position equals: 3. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_skip_4_at_0 [ + + + | anIterator | + anIterator := self testSmall. + anIterator skip: 4. + + self assert: anIterator position equals: 4. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_skip_5_at_0 [ + + + | anIterator | + anIterator := self testSmall. + anIterator skip: 5. + + self assert: anIterator position equals: 5. + + ^ anIterator +] + +{ #category : #'examples - enumeration' } +BlCollectionRopeIteratorExamplesTest >> testSmall_skip_6_at_0 [ + "Iterator throws an error when the end is reached" + + + | anIterator anError | + anIterator := self testSmall. + + anError := nil. + [ anIterator skip: 6 ] + on: Error + do: [ :e | anError := e ]. + + self assert: anError isNotNil. + + ^ anIterator +] diff --git a/src/Bloc-Examples/BlCollectionRopeIteratorTest.class.st b/src/Bloc-Examples/BlCollectionRopeIteratorTest.class.st index f8ccf7684..e09d34397 100644 --- a/src/Bloc-Examples/BlCollectionRopeIteratorTest.class.st +++ b/src/Bloc-Examples/BlCollectionRopeIteratorTest.class.st @@ -45,7 +45,7 @@ BlCollectionRopeIteratorTest >> originClassName [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf0 [ - + | anIterator aNextLine | anIterator := (BlCollectionRope collection: 'Line 1' , String crlf , 'Line 2' , String crlf @@ -73,9 +73,9 @@ BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf08 [ - + | anIterator aNextLine | - anIterator := self nextLineIndicesWithCrlf_0. + anIterator := self testNextLineIndicesWithCrlf_0. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -99,9 +99,9 @@ BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf08 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf16 [ - + | anIterator aNextLine | - anIterator := self nextLineIndicesWithCrlf_08. + anIterator := self testNextLineIndicesWithCrlf_08. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart @@ -126,9 +126,9 @@ BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf16 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf18 [ - + | anIterator aNextLine | - anIterator := self nextLineIndicesWithCrlf_16. + anIterator := self testNextLineIndicesWithCrlf_16. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -152,9 +152,9 @@ BlCollectionRopeIteratorTest >> testNextLineIndicesWithCrlf18 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithCr07 [ - + | anIterator aNextLine | - anIterator := self nextLineWithCr_0. + anIterator := self testNextLineWithCr_0. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -178,9 +178,9 @@ BlCollectionRopeIteratorTest >> testNextLineWithCr07 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithCr14 [ - + | anIterator aNextLine | - anIterator := self nextLineWithCr_07. + anIterator := self testNextLineWithCr_07. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -204,9 +204,9 @@ BlCollectionRopeIteratorTest >> testNextLineWithCr14 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithCr15 [ - + | anIterator aNextLine | - anIterator := self nextLineWithCr_14. + anIterator := self testNextLineWithCr_14. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -230,7 +230,7 @@ BlCollectionRopeIteratorTest >> testNextLineWithCr15 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithCrlf [ - + | anIterator | anIterator := (BlCollectionRope collection: 'Line 1' , String crlf , 'Line 2' , String crlf @@ -247,7 +247,7 @@ BlCollectionRopeIteratorTest >> testNextLineWithCrlf [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithLf0 [ - + | anIterator aNextLine | anIterator := (BlCollectionRope collection: 'Line 1' , String lf , 'Line 2' , String lf @@ -275,9 +275,9 @@ BlCollectionRopeIteratorTest >> testNextLineWithLf0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithLf07 [ - + | anIterator aNextLine | - anIterator := self nextLineWithLf_0. + anIterator := self testNextLineWithLf_0. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -301,9 +301,9 @@ BlCollectionRopeIteratorTest >> testNextLineWithLf07 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithLf14 [ - + | anIterator aNextLine | - anIterator := self nextLineWithLf_07. + anIterator := self testNextLineWithLf_07. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -327,9 +327,9 @@ BlCollectionRopeIteratorTest >> testNextLineWithLf14 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextLineWithLf15 [ - + | anIterator aNextLine | - anIterator := self nextLineWithLf_14. + anIterator := self testNextLineWithLf_14. aNextLine := anIterator nextLineIndicesDo: [ :aLineStart :aLineEnd @@ -353,9 +353,9 @@ BlCollectionRopeIteratorTest >> testNextLineWithLf15 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextSegmentWithLookAheadAt0 [ - + | anIterator aSegmentResult | - anIterator := self small. + anIterator := self testSmall. aSegmentResult := anIterator nextSegment: [ :aBuffer | @@ -386,9 +386,9 @@ BlCollectionRopeIteratorTest >> testNextSegmentWithLookAheadAt0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextSegmentWithLookAheadAt3 [ - + | anIterator aSegmentResult | - anIterator := self nextSegmentWithLookAhead_at_0. + anIterator := self testNextSegmentWithLookAhead_at_0. aSegmentResult := anIterator nextSegment: [ :aBuffer | @@ -419,9 +419,9 @@ BlCollectionRopeIteratorTest >> testNextSegmentWithLookAheadAt3 [ { #category : #tests } BlCollectionRopeIteratorTest >> testNextSegmentWithLookAheadAt5 [ - + | anIterator aSegmentResult | - anIterator := self nextSegmentWithLookAhead_at_3. + anIterator := self testNextSegmentWithLookAhead_at_3. aSegmentResult := anIterator nextSegment: [ :aBuffer | @@ -452,9 +452,11 @@ BlCollectionRopeIteratorTest >> testNextSegmentWithLookAheadAt5 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmall [ - + | anIterator | - anIterator := BlCollectionRopeExamples new small iterator: 0 to: 5. + anIterator := BlCollectionRopeExamplesTest new testSmall + iterator: 0 + to: 5. self assert: anIterator position equals: 0. self assert: anIterator start equals: 0. @@ -469,9 +471,9 @@ BlCollectionRopeIteratorTest >> testSmall [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextAt0 [ - + | anIterator anItem | - anIterator := self small. + anIterator := self testSmall. anItem := anIterator next. @@ -486,9 +488,9 @@ BlCollectionRopeIteratorTest >> testSmallNextAt0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextAt1 [ - + | anIterator anItem | - anIterator := self small_next_at_0. + anIterator := self testSmall_next_at_0. anItem := anIterator next. @@ -503,9 +505,9 @@ BlCollectionRopeIteratorTest >> testSmallNextAt1 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextAt2 [ - + | anIterator anItem | - anIterator := self small_next_at_1. + anIterator := self testSmall_next_at_1. anItem := anIterator next. @@ -520,9 +522,9 @@ BlCollectionRopeIteratorTest >> testSmallNextAt2 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextAt3 [ - + | anIterator anItem | - anIterator := self small_next_at_2. + anIterator := self testSmall_next_at_2. anItem := anIterator next. @@ -537,9 +539,9 @@ BlCollectionRopeIteratorTest >> testSmallNextAt3 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextAt4 [ - + | anIterator anItem | - anIterator := self small_next_at_3. + anIterator := self testSmall_next_at_3. anItem := anIterator next. @@ -553,11 +555,11 @@ BlCollectionRopeIteratorTest >> testSmallNextAt4 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextAt5 [ + "Iterator throws an error when the end is reached" - - + | anIterator anError | - anIterator := self small_next_at_4. + anIterator := self testSmall_next_at_4. anError := nil. [ anIterator next ] @@ -572,9 +574,9 @@ BlCollectionRopeIteratorTest >> testSmallNextAt5 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextSpanAt0 [ - + | anIterator aSpan | - anIterator := self small. + anIterator := self testSmall. aSpan := anIterator nextSpan. self assert: aSpan collection equals: 'Hello'. @@ -586,9 +588,9 @@ BlCollectionRopeIteratorTest >> testSmallNextSpanAt0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextSpanAt1 [ - + | anIterator aSpan | - anIterator := self small_next_at_0. + anIterator := self testSmall_next_at_0. aSpan := anIterator nextSpan. self assert: aSpan collection equals: 'ello'. @@ -600,9 +602,9 @@ BlCollectionRopeIteratorTest >> testSmallNextSpanAt1 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextSpanAt2 [ - + | anIterator aSpan | - anIterator := self small_next_at_1. + anIterator := self testSmall_next_at_1. aSpan := anIterator nextSpan. self assert: aSpan collection equals: 'llo'. @@ -614,9 +616,9 @@ BlCollectionRopeIteratorTest >> testSmallNextSpanAt2 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextSpanAt3 [ - + | anIterator aSpan | - anIterator := self small_next_at_2. + anIterator := self testSmall_next_at_2. aSpan := anIterator nextSpan. self assert: aSpan collection equals: 'lo'. @@ -628,9 +630,9 @@ BlCollectionRopeIteratorTest >> testSmallNextSpanAt3 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextSpanAt4 [ - + | anIterator aSpan | - anIterator := self small_next_at_3. + anIterator := self testSmall_next_at_3. aSpan := anIterator nextSpan. self assert: aSpan collection equals: 'o'. @@ -641,11 +643,11 @@ BlCollectionRopeIteratorTest >> testSmallNextSpanAt4 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallNextSpanAt5 [ + "Iterator throws an error when the end is reached" - - + | anIterator anError | - anIterator := self small_next_at_4. + anIterator := self testSmall_next_at_4. anError := nil. [ anIterator nextSpan ] @@ -660,9 +662,9 @@ BlCollectionRopeIteratorTest >> testSmallNextSpanAt5 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPeekAt0 [ - + | anIterator anItem | - anIterator := self small. + anIterator := self testSmall. anItem := anIterator peek. @@ -677,9 +679,9 @@ BlCollectionRopeIteratorTest >> testSmallPeekAt0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPeekAt1 [ - + | anIterator anItem | - anIterator := self small_next_at_0. + anIterator := self testSmall_next_at_0. anItem := anIterator peek. @@ -694,9 +696,9 @@ BlCollectionRopeIteratorTest >> testSmallPeekAt1 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPeekAt2 [ - + | anIterator anItem | - anIterator := self small_next_at_1. + anIterator := self testSmall_next_at_1. anItem := anIterator peek. @@ -711,9 +713,9 @@ BlCollectionRopeIteratorTest >> testSmallPeekAt2 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPeekAt3 [ - + | anIterator anItem | - anIterator := self small_next_at_2. + anIterator := self testSmall_next_at_2. anItem := anIterator peek. @@ -728,9 +730,9 @@ BlCollectionRopeIteratorTest >> testSmallPeekAt3 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPeekAt4 [ - + | anIterator anItem | - anIterator := self small_next_at_3. + anIterator := self testSmall_next_at_3. anItem := anIterator peek. @@ -744,11 +746,11 @@ BlCollectionRopeIteratorTest >> testSmallPeekAt4 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPeekAt5 [ + "Iterator throws an error when the end is reached" - - + | anIterator anError | - anIterator := self small_next_at_4. + anIterator := self testSmall_next_at_4. anError := nil. [ anIterator peek ] @@ -762,11 +764,11 @@ BlCollectionRopeIteratorTest >> testSmallPeekAt5 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPreviousAt0 [ + "Iterator throws an error when the start is reached" - - + | anIterator anError | - anIterator := self small. + anIterator := self testSmall. anError := nil. [ anIterator previous ] @@ -781,9 +783,9 @@ BlCollectionRopeIteratorTest >> testSmallPreviousAt0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPreviousAt1 [ - + | anIterator anItem | - anIterator := self small_next_at_0. + anIterator := self testSmall_next_at_0. anItem := anIterator previous. @@ -798,9 +800,9 @@ BlCollectionRopeIteratorTest >> testSmallPreviousAt1 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPreviousAt2 [ - + | anIterator anItem | - anIterator := self small_next_at_1. + anIterator := self testSmall_next_at_1. anItem := anIterator previous. @@ -815,9 +817,9 @@ BlCollectionRopeIteratorTest >> testSmallPreviousAt2 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPreviousAt3 [ - + | anIterator anItem | - anIterator := self small_next_at_2. + anIterator := self testSmall_next_at_2. anItem := anIterator previous. @@ -832,9 +834,9 @@ BlCollectionRopeIteratorTest >> testSmallPreviousAt3 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPreviousAt4 [ - + | anIterator anItem | - anIterator := self small_next_at_3. + anIterator := self testSmall_next_at_3. anItem := anIterator previous. @@ -849,9 +851,9 @@ BlCollectionRopeIteratorTest >> testSmallPreviousAt4 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallPreviousAt5 [ - + | anIterator anItem | - anIterator := self small_next_at_4. + anIterator := self testSmall_next_at_4. anItem := anIterator previous. @@ -866,9 +868,9 @@ BlCollectionRopeIteratorTest >> testSmallPreviousAt5 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallSkip0At0 [ - + | anIterator | - anIterator := self small. + anIterator := self testSmall. anIterator skip: 0. self assert: anIterator position equals: 0. @@ -879,9 +881,9 @@ BlCollectionRopeIteratorTest >> testSmallSkip0At0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallSkip1At0 [ - + | anIterator | - anIterator := self small. + anIterator := self testSmall. anIterator skip: 1. self assert: anIterator position equals: 1. @@ -892,9 +894,9 @@ BlCollectionRopeIteratorTest >> testSmallSkip1At0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallSkip2At0 [ - + | anIterator | - anIterator := self small. + anIterator := self testSmall. anIterator skip: 2. self assert: anIterator position equals: 2. @@ -905,9 +907,9 @@ BlCollectionRopeIteratorTest >> testSmallSkip2At0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallSkip3At0 [ - + | anIterator | - anIterator := self small. + anIterator := self testSmall. anIterator skip: 3. self assert: anIterator position equals: 3. @@ -918,9 +920,9 @@ BlCollectionRopeIteratorTest >> testSmallSkip3At0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallSkip4At0 [ - + | anIterator | - anIterator := self small. + anIterator := self testSmall. anIterator skip: 4. self assert: anIterator position equals: 4. @@ -931,9 +933,9 @@ BlCollectionRopeIteratorTest >> testSmallSkip4At0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallSkip5At0 [ - + | anIterator | - anIterator := self small. + anIterator := self testSmall. anIterator skip: 5. self assert: anIterator position equals: 5. @@ -943,11 +945,11 @@ BlCollectionRopeIteratorTest >> testSmallSkip5At0 [ { #category : #tests } BlCollectionRopeIteratorTest >> testSmallSkip6At0 [ + "Iterator throws an error when the end is reached" - - + | anIterator anError | - anIterator := self small. + anIterator := self testSmall. anError := nil. [ anIterator skip: 6 ] diff --git a/src/Bloc-Examples/BlCompulsoryCombinationExamples.class.st b/src/Bloc-Examples/BlCompulsoryCombinationExamples.class.st index 98263e576..3c4338fdf 100644 --- a/src/Bloc-Examples/BlCompulsoryCombinationExamples.class.st +++ b/src/Bloc-Examples/BlCompulsoryCombinationExamples.class.st @@ -1,15 +1,15 @@ Class { #name : #BlCompulsoryCombinationExamples, - #superclass : #BlKeyCombinationExamples, + #superclass : #BlKeyCombinationExamplesTest, #category : #'Bloc-Examples-KeyBinding' } { #category : #'examples - combination' } -BlCompulsoryCombinationExamples >> combinationWithA [ +BlCompulsoryCombinationExamples >> testCombinationWithA [ - + | aCombination | - aCombination := self emptyCombination. + aCombination := self testEmptyCombination. aCombination key: KeyboardKey A. self @@ -21,11 +21,11 @@ BlCompulsoryCombinationExamples >> combinationWithA [ ] { #category : #'examples - combination' } -BlCompulsoryCombinationExamples >> combinationWithAB [ +BlCompulsoryCombinationExamples >> testCombinationWithAB [ - + | aCombination | - aCombination := self combinationWithA. + aCombination := self testCombinationWithA. aCombination key: KeyboardKey B. self @@ -39,11 +39,11 @@ BlCompulsoryCombinationExamples >> combinationWithAB [ ] { #category : #'examples - combination' } -BlCompulsoryCombinationExamples >> combinationWithABC [ +BlCompulsoryCombinationExamples >> testCombinationWithABC [ - + | aCombination | - aCombination := self combinationWithAB. + aCombination := self testCombinationWithAB. aCombination key: KeyboardKey C. self @@ -58,79 +58,88 @@ BlCompulsoryCombinationExamples >> combinationWithABC [ ] { #category : #'examples - combination' } -BlCompulsoryCombinationExamples >> emptyCombination [ - +BlCompulsoryCombinationExamples >> testEmptyCombination [ + + | aCombination | - aCombination := BlCompulsoryCombination new. self assert: aCombination isCompulsory. self assert: aCombination combinations isEmpty. self assert: aCombination printString equals: '()'. - + ^ aCombination ] { #category : #'examples - store' } -BlCompulsoryCombinationExamples >> storeCombinationWithA [ - +BlCompulsoryCombinationExamples >> testStoreCombinationWithA [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self combinationWithA. + aCombination := self testCombinationWithA. aStoreString := aCombination storeString. - self assert: aStoreString equals: '(BlCompulsoryCombination new with: (BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination)'. - + self + assert: aStoreString + equals: + '(BlCompulsoryCombination new with: (BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination)'. + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] { #category : #'examples - store' } -BlCompulsoryCombinationExamples >> storeCombinationWithAB [ - +BlCompulsoryCombinationExamples >> testStoreCombinationWithAB [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self combinationWithAB. + aCombination := self testCombinationWithAB. aStoreString := aCombination storeString. - self assert: aStoreString equals: '(((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) and: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination)'. - + self + assert: aStoreString + equals: + '(((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) and: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination)'. + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] { #category : #'examples - store' } -BlCompulsoryCombinationExamples >> storeCombinationWithABC [ - +BlCompulsoryCombinationExamples >> testStoreCombinationWithABC [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self combinationWithABC. + aCombination := self testCombinationWithABC. aStoreString := aCombination storeString. - self assert: aStoreString equals: '((((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) and: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination) and: (BlKeyboardKey new setName: #C; setValue: nil) asKeyCombination)'. - + self + assert: aStoreString + equals: + '((((BlKeyboardKey new setName: #A; setValue: nil) asKeyCombination) and: (BlKeyboardKey new setName: #B; setValue: nil) asKeyCombination) and: (BlKeyboardKey new setName: #C; setValue: nil) asKeyCombination)'. + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] { #category : #'examples - store' } -BlCompulsoryCombinationExamples >> storeEmptyCombination [ - +BlCompulsoryCombinationExamples >> testStoreEmptyCombination [ + + | aCombination aStoreString aRestoredCombination | - - aCombination := self emptyCombination. + aCombination := self testEmptyCombination. aStoreString := aCombination storeString. self assert: aStoreString equals: '(BlCompulsoryCombination new)'. - + aRestoredCombination := Object evaluate: aStoreString. self assert: aRestoredCombination equals: aCombination. - + ^ aStoreString ] diff --git a/src/Bloc-Examples/BlConcatenationRopeExamples.class.st b/src/Bloc-Examples/BlConcatenationRopeExamplesTest.class.st similarity index 52% rename from src/Bloc-Examples/BlConcatenationRopeExamples.class.st rename to src/Bloc-Examples/BlConcatenationRopeExamplesTest.class.st index 98dce09b4..55dad6dd0 100644 --- a/src/Bloc-Examples/BlConcatenationRopeExamples.class.st +++ b/src/Bloc-Examples/BlConcatenationRopeExamplesTest.class.st @@ -1,67 +1,53 @@ Class { - #name : #BlConcatenationRopeExamples, - #superclass : #BlExampleTest, + #name : #BlConcatenationRopeExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Rope' } { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_0_to_0 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_0_to_0 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 0. self assert: anAttributedRope left left rope collection equals: ''. self assert: anAttributedRope left left attributes equals: { 1 }. self assert: anAttributedRope left right == aRope left. - + self assert: anAttributedRope right == aRope right. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_0_to_1 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_0_to_1 [ + + | aRope anAttributedRope | - - aRope := self small. - + aRope := self testSmall. + anAttributedRope := aRope attributes: { 1 } from: 0 to: 1. self assert: anAttributedRope left left rope collection equals: 'H'. self assert: anAttributedRope left left attributes equals: { 1 }. self assert: anAttributedRope left right collection equals: 'ello'. - + self assert: anAttributedRope right collection equals: 'World'. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_0_to_10 [ - - | aRope anAttributedRope | - - aRope := self small. - anAttributedRope := aRope attributes: { 1 } from: 0 to: 10. +BlConcatenationRopeExamplesTest >> testAttributes_small_0_to_5 [ - self assert: anAttributedRope rope == aRope. - self assert: anAttributedRope attributes equals: { 1 }. - - ^ anAttributedRope -] - -{ #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_0_to_5 [ - + | aRope anAttributedRope | - - aRope := self small. - + aRope := self testSmall. + anAttributedRope := aRope attributes: { 1 } from: 0 to: 5. self assert: anAttributedRope left rope == aRope left. @@ -73,53 +59,65 @@ BlConcatenationRopeExamples >> attributes_small_0_to_5 [ ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_2_to_2 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_2_to_2 [ + + | aRope anAttributedRope | - - aRope := self small. - + aRope := self testSmall. + anAttributedRope := aRope attributes: { 1 } from: 2 to: 2. self assert: anAttributedRope left left collection equals: 'He'. - self assert: anAttributedRope left right left attributes equals: { 1 }. - self assert: anAttributedRope left right left rope collection equals: ''. - - self assert: anAttributedRope left right right collection equals: 'llo'. - + self + assert: anAttributedRope left right left attributes + equals: { 1 }. + self + assert: anAttributedRope left right left rope collection + equals: ''. + + self + assert: anAttributedRope left right right collection + equals: 'llo'. + self assert: anAttributedRope right == aRope right. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_2_to_3 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_2_to_3 [ + + | aRope anAttributedRope | - - aRope := self small. - + aRope := self testSmall. + anAttributedRope := aRope attributes: { 1 } from: 2 to: 3. self assert: anAttributedRope left left collection equals: 'He'. - self assert: anAttributedRope left right left attributes equals: { 1 }. - self assert: anAttributedRope left right left rope collection equals: 'l'. - - self assert: anAttributedRope left right right collection equals: 'lo'. - + self + assert: anAttributedRope left right left attributes + equals: { 1 }. + self + assert: anAttributedRope left right left rope collection + equals: 'l'. + + self + assert: anAttributedRope left right right collection + equals: 'lo'. + self assert: anAttributedRope right == aRope right. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_4_to_5 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_4_to_5 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 4 to: 5. @@ -134,11 +132,11 @@ BlConcatenationRopeExamples >> attributes_small_4_to_5 [ ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_4_to_6 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_4_to_6 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 4 to: 6. @@ -149,22 +147,22 @@ BlConcatenationRopeExamples >> attributes_small_4_to_6 [ self assert: anAttributedRope right left rope collection equals: 'W'. self assert: anAttributedRope right left attributes equals: { 1 }. - + self assert: anAttributedRope right right collection equals: 'orld'. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_5_to_10 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_5_to_10 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 5 to: 10. self assert: anAttributedRope left == aRope left. - + self assert: anAttributedRope right rope == aRope right. self assert: anAttributedRope right attributes equals: { 1 }. @@ -172,14 +170,14 @@ BlConcatenationRopeExamples >> attributes_small_5_to_10 [ ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_5_to_6 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_5_to_6 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 5 to: 6. - + self assert: anAttributedRope left == aRope left. self assert: anAttributedRope right left rope collection equals: 'W'. @@ -191,59 +189,71 @@ BlConcatenationRopeExamples >> attributes_small_5_to_6 [ ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_6_to_6 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_6_to_6 [ + + | aRope anAttributedRope | - - aRope := self small. - + aRope := self testSmall. + anAttributedRope := aRope attributes: { 1 } from: 6 to: 6. self assert: anAttributedRope left == aRope left. self assert: anAttributedRope right left collection equals: 'W'. - self assert: anAttributedRope right right left attributes equals: { 1 }. - self assert: anAttributedRope right right left rope collection equals: ''. - - self assert: anAttributedRope right right right collection equals: 'orld'. + self + assert: anAttributedRope right right left attributes + equals: { 1 }. + self + assert: anAttributedRope right right left rope collection + equals: ''. + + self + assert: anAttributedRope right right right collection + equals: 'orld'. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_6_to_7 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_6_to_7 [ + + | aRope anAttributedRope | - - aRope := self small. - + aRope := self testSmall. + anAttributedRope := aRope attributes: { 1 } from: 6 to: 7. self assert: anAttributedRope left == aRope left. self assert: anAttributedRope right left collection equals: 'W'. - self assert: anAttributedRope right right left attributes equals: { 1 }. - self assert: anAttributedRope right right left rope collection equals: 'o'. - - self assert: anAttributedRope right right right collection equals: 'rld'. + self + assert: anAttributedRope right right left attributes + equals: { 1 }. + self + assert: anAttributedRope right right left rope collection + equals: 'o'. + + self + assert: anAttributedRope right right right collection + equals: 'rld'. ^ anAttributedRope ] { #category : #'examples - attributes' } -BlConcatenationRopeExamples >> attributes_small_9_to_10 [ - +BlConcatenationRopeExamplesTest >> testAttributes_small_9_to_10 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 9 to: 10. self assert: anAttributedRope left == aRope left. - + self assert: anAttributedRope right left collection equals: 'Worl'. - + self assert: anAttributedRope right right rope collection equals: 'd'. self assert: anAttributedRope right right attributes equals: { 1 }. @@ -251,47 +261,46 @@ BlConcatenationRopeExamples >> attributes_small_9_to_10 [ ] { #category : #'as yet unclassified' } -BlConcatenationRopeExamples >> readStreamSmall [ - - | rope stream | +BlConcatenationRopeExamplesTest >> testReadStreamSmall [ - rope := self small. + | rope stream | + rope := self testSmall. stream := rope readStream. self assert: stream next equals: $H. self assert: (stream next: 3) asString equals: 'ell'. - self assert: stream upToEnd asString equals: 'oWorld'. + self assert: stream upToEnd asString equals: 'oWorld' ] { #category : #'instance creation' } -BlConcatenationRopeExamples >> small [ - - - | aRope | +BlConcatenationRopeExamplesTest >> testSmall [ + "Creates an instance of the rope of size smaller than combineLength" + + | aRope | aRope := BlConcatenationRope - left: (BlCollectionRope collection: 'Hello') - right: (BlCollectionRope collection: 'World'). + left: (BlCollectionRope collection: 'Hello') + right: (BlCollectionRope collection: 'World'). self assert: aRope depth equals: 2. self assert: aRope size equals: 10. - + self assert: aRope left collection equals: 'Hello'. self assert: aRope right collection equals: 'World'. self assert: aRope isLeaf not. self assert: aRope size <= BlRope combineLength. - + ^ aRope ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_0_to_0 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_0_to_0 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 0 to: 0. self assert: aNewRope == aRope. @@ -300,11 +309,11 @@ BlConcatenationRopeExamples >> small_delete_0_to_0 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_0_to_1 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_0_to_1 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 0 to: 1. self assert: aNewRope collection equals: 'elloWorld'. @@ -313,11 +322,11 @@ BlConcatenationRopeExamples >> small_delete_0_to_1 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_0_to_10 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_0_to_10 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 0 to: 10. self assert: aNewRope isEmpty. @@ -327,11 +336,11 @@ BlConcatenationRopeExamples >> small_delete_0_to_10 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_0_to_5 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_0_to_5 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 0 to: 5. self assert: aNewRope == aRope right. @@ -340,11 +349,11 @@ BlConcatenationRopeExamples >> small_delete_0_to_5 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_10_to_10 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_10_to_10 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 10 to: 10. self assert: aNewRope == aRope. @@ -353,11 +362,11 @@ BlConcatenationRopeExamples >> small_delete_10_to_10 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_1_to_2 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_1_to_2 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 1 to: 2. self assert: aNewRope collection equals: 'HlloWorld'. @@ -367,11 +376,11 @@ BlConcatenationRopeExamples >> small_delete_1_to_2 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_4_to_4 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_4_to_4 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 4 to: 4. self assert: aNewRope collection equals: 'HelloWorld'. @@ -380,11 +389,11 @@ BlConcatenationRopeExamples >> small_delete_4_to_4 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_4_to_5 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_4_to_5 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 4 to: 5. self assert: aNewRope collection equals: 'HellWorld'. @@ -393,11 +402,11 @@ BlConcatenationRopeExamples >> small_delete_4_to_5 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_4_to_6 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_4_to_6 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 4 to: 6. self assert: aNewRope collection equals: 'Hellorld'. @@ -406,11 +415,11 @@ BlConcatenationRopeExamples >> small_delete_4_to_6 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_5_to_10 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_5_to_10 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 5 to: 10. self assert: aNewRope == aRope left. @@ -419,11 +428,11 @@ BlConcatenationRopeExamples >> small_delete_5_to_10 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_5_to_5 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_5_to_5 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 5 to: 5. self assert: aNewRope collection equals: 'HelloWorld'. @@ -432,11 +441,11 @@ BlConcatenationRopeExamples >> small_delete_5_to_5 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_5_to_6 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_5_to_6 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 5 to: 6. self assert: aNewRope collection equals: 'Helloorld'. @@ -445,11 +454,11 @@ BlConcatenationRopeExamples >> small_delete_5_to_6 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_6_to_7 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_6_to_7 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 6 to: 7. self assert: aNewRope collection equals: 'HelloWrld'. @@ -458,11 +467,11 @@ BlConcatenationRopeExamples >> small_delete_6_to_7 [ ] { #category : #'examples - delete' } -BlConcatenationRopeExamples >> small_delete_9_to_10 [ - - | aRope aNewRope | +BlConcatenationRopeExamplesTest >> testSmall_delete_9_to_10 [ - aRope := self small. + + | aRope aNewRope | + aRope := self testSmall. aNewRope := aRope delete: 9 to: 10. self assert: aNewRope collection equals: 'HelloWorl'. @@ -471,12 +480,14 @@ BlConcatenationRopeExamples >> small_delete_9_to_10 [ ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_do [ - +BlConcatenationRopeExamplesTest >> testSmall_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'HelloWorld'. @@ -484,11 +495,11 @@ BlConcatenationRopeExamples >> small_do [ ] { #category : #'instance creation' } -BlConcatenationRopeExamples >> small_empty [ - - | aRope anEmpty | +BlConcatenationRopeExamplesTest >> testSmall_empty [ - aRope := self small. + + | aRope anEmpty | + aRope := self testSmall. anEmpty := aRope empty. self assert: anEmpty size equals: 0. @@ -498,26 +509,31 @@ BlConcatenationRopeExamples >> small_empty [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_0_to_0 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_0_to_0 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 0. - + self assert: aNewRope size equals: 0. self assert: aNewRope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_0_to_0_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_0_to_0_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 0 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 0 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -525,25 +541,30 @@ BlConcatenationRopeExamples >> small_from_0_to_0_do [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_0_to_10 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_0_to_10 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 10. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_0_to_10_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_0_to_10_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 10 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 10 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'HelloWorld'. @@ -551,12 +572,17 @@ BlConcatenationRopeExamples >> small_from_0_to_10_do [ ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_0_to_1_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_0_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'H'. @@ -564,25 +590,30 @@ BlConcatenationRopeExamples >> small_from_0_to_1_do [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_0_to_5 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_0_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 5. - + self assert: aNewRope == aRope left. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_0_to_5_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_0_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'Hello'. @@ -590,26 +621,31 @@ BlConcatenationRopeExamples >> small_from_0_to_5_do [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_10_to_10 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_10_to_10 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 10 to: 10. - + self assert: aNewRope size equals: 0. self assert: aNewRope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_10_to_10_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_10_to_10_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 10 to: 10 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 10 + to: 10 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -617,12 +653,17 @@ BlConcatenationRopeExamples >> small_from_10_to_10_do [ ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_1_to_1_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_1_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -630,25 +671,30 @@ BlConcatenationRopeExamples >> small_from_1_to_1_do [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_1_to_2 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_1_to_2 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 2. - + self assert: aNewRope collection equals: 'e'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_1_to_2_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_1_to_2_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 2 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 2 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'e'. @@ -656,12 +702,17 @@ BlConcatenationRopeExamples >> small_from_1_to_2_do [ ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_1_to_5_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_1_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'ello'. @@ -669,12 +720,17 @@ BlConcatenationRopeExamples >> small_from_1_to_5_do [ ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_3_to_5_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_3_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 3 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 3 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'lo'. @@ -682,51 +738,56 @@ BlConcatenationRopeExamples >> small_from_3_to_5_do [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_4_to_5 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_4_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 4 to: 5. - + self assert: aNewRope collection equals: 'o'. - + ^ aNewRope ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_4_to_6 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_4_to_6 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 4 to: 6. - + self assert: aNewRope collection equals: 'oW'. - + ^ aNewRope ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_5_to_10 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_5_to_10 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 5 to: 10. - + self assert: aNewRope == aRope right. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_5_to_10_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_5_to_10_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 5 to: 10 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 5 + to: 10 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'World'. @@ -734,26 +795,31 @@ BlConcatenationRopeExamples >> small_from_5_to_10_do [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_5_to_5 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_5_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 5 to: 5. - + self assert: aNewRope size equals: 0. self assert: aNewRope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_5_to_5_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_5_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 5 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 5 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -761,25 +827,30 @@ BlConcatenationRopeExamples >> small_from_5_to_5_do [ ] { #category : #'examples - from to' } -BlConcatenationRopeExamples >> small_from_5_to_6 [ - +BlConcatenationRopeExamplesTest >> testSmall_from_5_to_6 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 5 to: 6. - + self assert: aNewRope collection equals: 'W'. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_5_to_6_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_5_to_6_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 5 to: 6 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 5 + to: 6 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'W'. @@ -787,14 +858,33 @@ BlConcatenationRopeExamples >> small_from_5_to_6_do [ ] { #category : #'examples - enumeration' } -BlConcatenationRopeExamples >> small_from_9_to_10_do [ - +BlConcatenationRopeExamplesTest >> testSmall_from_9_to_10_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 9 to: 10 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 9 + to: 10 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'd'. ^ theIterated ] + +{ #category : #'examples - attributes' } +BlConcatenationRopeExamplesTest >> testSttributes_small_0_to_10 [ + + + | aRope anAttributedRope | + aRope := self testSmall. + anAttributedRope := aRope attributes: { 1 } from: 0 to: 10. + + self assert: anAttributedRope rope == aRope. + self assert: anAttributedRope attributes equals: { 1 }. + + ^ anAttributedRope +] diff --git a/src/Bloc-Examples/BlElementBoundsByScripterExamples.class.st b/src/Bloc-Examples/BlElementBoundsByScripterExamples.class.st index 51f46f04e..dab17681c 100644 --- a/src/Bloc-Examples/BlElementBoundsByScripterExamples.class.st +++ b/src/Bloc-Examples/BlElementBoundsByScripterExamples.class.st @@ -6,9 +6,9 @@ Class { { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_0 [ - - | aScripter | - + + + | aScripter | aScripter := self scripter. aScripter element: self bounds_in_space_element_container. @@ -17,87 +17,100 @@ BlElementBoundsByScripterExamples >> bounds_in_space_0 [ { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_1 [ - - | aScripter | - + + + | aScripter | aScripter := self bounds_in_space_0. aScripter check id: #parent_1; - value: [ :anElement | anElement extent ] equals: [ self bounds_in_space_element_extent ]; - value: [ :anElement | anElement boundsInSpace ] equals: [ self bounds_in_space_element_bounds ]. + value: [ :anElement | anElement extent ] + equals: [ self bounds_in_space_element_extent ]; + value: [ :anElement | anElement boundsInSpace ] + equals: [ self bounds_in_space_element_bounds ]. aScripter check id: #parent_2; - value: [ :anElement | anElement extent ] equals: [ self bounds_in_space_element_extent ]; - value: [ :anElement | anElement boundsInSpace ] equals: [ self bounds_in_space_element_bounds translateBy: 50@50 ]. + value: [ :anElement | anElement extent ] + equals: [ self bounds_in_space_element_extent ]; + value: [ :anElement | anElement boundsInSpace ] + equals: [ self bounds_in_space_element_bounds translateBy: 50 @ 50 ]. aScripter check id: #child; - value: [ :anElement | anElement extent ] equals: [ self bounds_in_space_element_extent ]; - value: [ :anElement | anElement boundsInSpace ] equals: [ self bounds_in_space_element_bounds ]; - value: [ :anElement | anElement positionInSpaceChangedCount ] equals: [ 0 ]. + value: [ :anElement | anElement extent ] + equals: [ self bounds_in_space_element_extent ]; + value: [ :anElement | anElement boundsInSpace ] + equals: [ self bounds_in_space_element_bounds ]; + value: [ :anElement | anElement positionInSpaceChangedCount ] + equals: [ 0 ]. ^ aScripter syncContinue ] { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_2 [ - - | aScripter | - + + + | aScripter | aScripter := self bounds_in_space_1. - - aScripter do - action: [ :anElement | - | aChild | - aChild := anElement childWithId: #child. - aChild removeFromParent. - (anElement childWithId: #parent_2) addChild: aChild ]. + + aScripter do action: [ :anElement | + | aChild | + aChild := anElement childWithId: #child. + aChild removeFromParent. + (anElement childWithId: #parent_2) addChild: aChild ]. ^ aScripter syncContinue ] { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_3 [ - - - | aScripter | + + + | aScripter | aScripter := self bounds_in_space_2. aScripter check id: #parent_1; - value: [ :anElement | anElement extent ] equals: [ self bounds_in_space_element_extent ]; - value: [ :anElement | anElement boundsInSpace ] equals: [ self bounds_in_space_element_bounds ]. + value: [ :anElement | anElement extent ] + equals: [ self bounds_in_space_element_extent ]; + value: [ :anElement | anElement boundsInSpace ] + equals: [ self bounds_in_space_element_bounds ]. aScripter check id: #parent_2; - value: [ :anElement | anElement extent ] equals: [ self bounds_in_space_element_extent ]; - value: [ :anElement | anElement boundsInSpace ] equals: [ self bounds_in_space_element_bounds translateBy: 50@50 ]. + value: [ :anElement | anElement extent ] + equals: [ self bounds_in_space_element_extent ]; + value: [ :anElement | anElement boundsInSpace ] + equals: [ self bounds_in_space_element_bounds translateBy: 50 @ 50 ]. aScripter check id: #child; - value: [ :anElement | anElement extent ] equals: [ self bounds_in_space_element_extent ]; - value: [ :anElement | anElement boundsInSpace ] equals: [ self bounds_in_space_element_bounds translateBy: 50@50 ]; - value: [ :anElement | anElement positionInSpaceChangedCount ] equals: [ 1 ]. + value: [ :anElement | anElement extent ] + equals: [ self bounds_in_space_element_extent ]; + value: [ :anElement | anElement boundsInSpace ] + equals: [ self bounds_in_space_element_bounds translateBy: 50 @ 50 ]; + value: [ :anElement | anElement positionInSpaceChangedCount ] + equals: [ 1 ]. ^ aScripter syncContinue ] { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_element_1 [ - + ^ BlElement new - id: #parent_1; - size: self bounds_in_space_element_extent; - border: (BlBorder paint: (Color blue alpha: 0.2) width: 2) + id: #parent_1; + size: self bounds_in_space_element_extent; + border: (BlBorder paint: (Color blue alpha: 0.2) width: 2) ] { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_element_2 [ - + ^ BlElement new id: #parent_2; size: self bounds_in_space_element_extent; @@ -107,47 +120,48 @@ BlElementBoundsByScripterExamples >> bounds_in_space_element_2 [ { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_element_bounds [ - - ^ 0@0 extent: 500@400 + + ^ 0 @ 0 extent: 500 @ 400 ] { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_element_child [ - + + ^ BlExampleEventsCountingElement new - id: #child; - background: (Color veryVeryLightGray alpha: 0.4); - constraintsDo: [ :c | - c horizontal matchParent. - c vertical matchParent ] + id: #child; + background: (Color veryVeryLightGray alpha: 0.4); + constraintsDo: [ :c | + c horizontal matchParent. + c vertical matchParent ] ] { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_element_container [ - + ^ BlElement new - id: #container; - constraintsDo: [ :c | - c horizontal matchParent. - c vertical matchParent ]; - addChildren: { - self bounds_in_space_element_1 addChild: self bounds_in_space_element_child. - self bounds_in_space_element_2 - } + id: #container; + constraintsDo: [ :c | + c horizontal matchParent. + c vertical matchParent ]; + addChildren: { + (self bounds_in_space_element_1 addChild: + self bounds_in_space_element_child). + self bounds_in_space_element_2 } ] { #category : #'examples - bounds in space' } BlElementBoundsByScripterExamples >> bounds_in_space_element_extent [ - - ^ 500@400 + + ^ 500 @ 400 ] { #category : #'examples - scripter' } BlElementBoundsByScripterExamples >> scripter [ - + ^ BlDevScripter new ] diff --git a/src/Bloc-Examples/BlErrorHandlingExamples.class.st b/src/Bloc-Examples/BlErrorHandlingExamplesTest.class.st similarity index 78% rename from src/Bloc-Examples/BlErrorHandlingExamples.class.st rename to src/Bloc-Examples/BlErrorHandlingExamplesTest.class.st index d81c9eb95..7a4c881fc 100644 --- a/src/Bloc-Examples/BlErrorHandlingExamples.class.st +++ b/src/Bloc-Examples/BlErrorHandlingExamplesTest.class.st @@ -2,26 +2,77 @@ I exemplify how Bloc handles errors in different parts of the BlElement such as drawing, layout or event handling " Class { - #name : #BlErrorHandlingExamples, - #superclass : #BlExampleTest, + #name : #BlErrorHandlingExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Errors' } +{ #category : #'instance creation' } +BlErrorHandlingExamplesTest >> sceneWith: aFaultyElement [ + "Create a visual scene with a faulty element embedded in it" + | aContainer aLeftChild aRightChild aSpace | + + aContainer := BlElement new. + aContainer layout: BlLinearLayout horizontal. + aContainer constraintsDo: [ :c | + c horizontal matchParent. + c vertical matchParent ]. + + aLeftChild := BlElement new. + aLeftChild background: Color veryVeryLightGray. + aLeftChild margin: (BlInsets all: 20). + aLeftChild layout: BlFrameLayout new. + aLeftChild constraintsDo: [ :c | + c linear weight: 0.7. + c horizontal matchParent. + c vertical matchParent ]. + + aFaultyElement constraintsDo: [ :c | + c frame horizontal weight: 0.5; alignCenter. + c frame vertical weight: 0.3; alignCenter. + c horizontal matchParent. + c vertical matchParent ]. + + aLeftChild addChild: aFaultyElement. + + aRightChild := BlElement new. + aRightChild background: Color veryVeryLightGray. + aRightChild margin: (BlInsets all: 20). + aRightChild constraintsDo: [ :c | + c linear weight: 0.3. + c horizontal matchParent. + c vertical matchParent ]. + + aContainer addChildren: { aLeftChild . aRightChild }. + + aSpace := BlOSpace new. + aSpace host: BlMorphicWindowHost new. + aSpace addChild: aContainer. + aSpace show. + aSpace pulse. + aSpace close. + aContainer removeFromParent. + + ^ aContainer +] + { #category : #'error - examples' } -BlErrorHandlingExamples >> sceneElementThatHasBrokenDrawing [ - +BlErrorHandlingExamplesTest >> testSceneElementThatHasBrokenDrawing [ + + | aFaultyElement theErrors aSceneElement | - aFaultyElement := BlExampleElementWithBrokenDrawing new. aFaultyElement background: Color gray. aSceneElement := self sceneWith: aFaultyElement. - + theErrors := aFaultyElement errorHandler errors. self assert: theErrors size equals: 1. self assert: (theErrors first error isKindOf: ZeroDivide). - self assert: theErrors first errorHandler equals: aFaultyElement errorHandler. + self + assert: theErrors first errorHandler + equals: aFaultyElement errorHandler. self assert: theErrors first framePhase isDrawingPhase. self assert: theErrors first element equals: aFaultyElement. @@ -29,26 +80,30 @@ BlErrorHandlingExamples >> sceneElementThatHasBrokenDrawing [ ] { #category : #'error - examples' } -BlErrorHandlingExamples >> sceneElementThatHasBrokenDrawingAndOnLayout [ - +BlErrorHandlingExamplesTest >> testSceneElementThatHasBrokenDrawingAndOnLayout [ + + | aFaultyElement theErrors aSceneElement | - aFaultyElement := BlExampleElementWithBrokenDrawingAndOnLayout new. aFaultyElement background: Color gray. aSceneElement := self sceneWith: aFaultyElement. - + theErrors := aFaultyElement errorHandler errors. self assert: theErrors size equals: 2. self assert: (theErrors first error isKindOf: SubscriptOutOfBounds). - self assert: theErrors first errorHandler equals: aFaultyElement errorHandler. + self + assert: theErrors first errorHandler + equals: aFaultyElement errorHandler. self assert: theErrors first framePhase isLayoutPhase. self assert: theErrors first element equals: aFaultyElement. - + self assert: (theErrors second error isKindOf: ZeroDivide). - self assert: theErrors second errorHandler equals: aFaultyElement errorHandler. + self + assert: theErrors second errorHandler + equals: aFaultyElement errorHandler. self assert: theErrors second framePhase isDrawingPhase. self assert: theErrors second element equals: aFaultyElement. @@ -56,11 +111,10 @@ BlErrorHandlingExamples >> sceneElementThatHasBrokenDrawingAndOnLayout [ ] { #category : #'error - examples' } -BlErrorHandlingExamples >> sceneElementThatHasBrokenOnLayout [ - - - | aSceneElement aFaultyElement theErrors | +BlErrorHandlingExamplesTest >> testSceneElementThatHasBrokenOnLayout [ + + | aSceneElement aFaultyElement theErrors | aFaultyElement := BlExampleElementWithBrokenOnLayout new. aFaultyElement background: Color gray. @@ -69,58 +123,11 @@ BlErrorHandlingExamples >> sceneElementThatHasBrokenOnLayout [ theErrors := aFaultyElement errorHandler errors. self assert: theErrors size equals: 1. self assert: (theErrors first error isKindOf: SubscriptOutOfBounds). - self assert: theErrors first errorHandler equals: aFaultyElement errorHandler. + self + assert: theErrors first errorHandler + equals: aFaultyElement errorHandler. self assert: theErrors first framePhase isLayoutPhase. self assert: theErrors first element equals: aFaultyElement. - - ^ aSceneElement -] - -{ #category : #'instance creation' } -BlErrorHandlingExamples >> sceneWith: aFaultyElement [ - "Create a visual scene with a faulty element embedded in it" - | aContainer aLeftChild aRightChild aSpace | - - aContainer := BlElement new. - aContainer layout: BlLinearLayout horizontal. - aContainer constraintsDo: [ :c | - c horizontal matchParent. - c vertical matchParent ]. - - aLeftChild := BlElement new. - aLeftChild background: Color veryVeryLightGray. - aLeftChild margin: (BlInsets all: 20). - aLeftChild layout: BlFrameLayout new. - aLeftChild constraintsDo: [ :c | - c linear weight: 0.7. - c horizontal matchParent. - c vertical matchParent ]. - aFaultyElement constraintsDo: [ :c | - c frame horizontal weight: 0.5; alignCenter. - c frame vertical weight: 0.3; alignCenter. - c horizontal matchParent. - c vertical matchParent ]. - - aLeftChild addChild: aFaultyElement. - - aRightChild := BlElement new. - aRightChild background: Color veryVeryLightGray. - aRightChild margin: (BlInsets all: 20). - aRightChild constraintsDo: [ :c | - c linear weight: 0.3. - c horizontal matchParent. - c vertical matchParent ]. - - aContainer addChildren: { aLeftChild . aRightChild }. - - aSpace := BlSpace new. - aSpace host: BlMorphicWindowHost new. - aSpace root addChild: aContainer. - aSpace show. - aSpace pulse. - aSpace close. - aContainer removeFromParent. - - ^ aContainer + ^ aSceneElement ] diff --git a/src/Bloc-Examples/BlEventProcessorExamples.class.st b/src/Bloc-Examples/BlEventProcessorExamples.class.st deleted file mode 100644 index 0ebf837a7..000000000 --- a/src/Bloc-Examples/BlEventProcessorExamples.class.st +++ /dev/null @@ -1,12 +0,0 @@ -Class { - #name : #BlEventProcessorExamples, - #superclass : #BlExampleTest, - #category : #'Bloc-Examples-Event' -} - -{ #category : #'examples - scripter' } -BlEventProcessorExamples >> scripter [ - - - ^ BlDevScripter new -] diff --git a/src/Bloc-Examples/BlEventProcessorExamplesTest.class.st b/src/Bloc-Examples/BlEventProcessorExamplesTest.class.st new file mode 100644 index 000000000..885de216c --- /dev/null +++ b/src/Bloc-Examples/BlEventProcessorExamplesTest.class.st @@ -0,0 +1,12 @@ +Class { + #name : #BlEventProcessorExamplesTest, + #superclass : #TestCase, + #category : #'Bloc-Examples-Event' +} + +{ #category : #'examples - scripter' } +BlEventProcessorExamplesTest >> scripter [ + + + ^ BlDevScripter new +] diff --git a/src/Bloc-Examples/BlFileCollectionRopeExamples.class.st b/src/Bloc-Examples/BlFileCollectionRopeExamples.class.st index 146e52183..43617a136 100644 --- a/src/Bloc-Examples/BlFileCollectionRopeExamples.class.st +++ b/src/Bloc-Examples/BlFileCollectionRopeExamples.class.st @@ -1,19 +1,21 @@ Class { #name : #BlFileCollectionRopeExamples, - #superclass : #BlCollectionRopeExamples, + #superclass : #BlCollectionRopeExamplesTest, #category : #'Bloc-Examples-Rope' } { #category : #'instance creation' } -BlFileCollectionRopeExamples >> small [ - - - | aRope file | +BlFileCollectionRopeExamples >> testSmall [ + "Creates an instance of the rope of size smaller than combineLength" - file := FileReference newTempFilePrefix: 'BlFileCollectionRopeExamples-' suffix: '-small'. + + | aRope file | + file := FileReference + newTempFilePrefix: 'BlFileCollectionRopeExamples-' + suffix: '-small'. file writeStreamDo: [ :stream | stream << 'Hello' ]. - aRope := BlCollectionRope collection: - (BlRopeableCollectionFile new fileReference: file). + aRope := BlCollectionRope collection: + (BlRopeableCollectionFile new fileReference: file). self assert: aRope depth equals: 1. self assert: aRope size equals: 5. diff --git a/src/Bloc-Examples/BlFocusProcessorExamples.class.st b/src/Bloc-Examples/BlFocusProcessorExamples.class.st index 9f604cd15..75d43a067 100644 --- a/src/Bloc-Examples/BlFocusProcessorExamples.class.st +++ b/src/Bloc-Examples/BlFocusProcessorExamples.class.st @@ -1,138 +1,141 @@ Class { #name : #BlFocusProcessorExamples, - #superclass : #BlEventProcessorExamples, + #superclass : #BlEventProcessorExamplesTest, #category : #'Bloc-Examples-Event' } { #category : #'private - instance creation' } BlFocusProcessorExamples >> elementWithFocusHandler [ - + + | aTextStyler hasFocus isFocused aTextBuilder aLabel | - hasFocus := isFocused := false. aTextStyler := [ :aString | aString asRopedText light fontSize: 9 ]. - + aTextBuilder := [ - | aText | - - aText := '' asRopedText. - aText append: (isFocused - ifTrue: [ (aTextStyler value: 'is focused') foreground: Color blue ] - ifFalse: [ aTextStyler value: 'not focused' ]). - aText append: (aTextStyler value: ' / '). - aText append: (hasFocus - ifTrue: [ (aTextStyler value: 'has focus') foreground: Color blue ] - ifFalse: [ aTextStyler value: 'no focus' ]). - aText ]. - + | aText | + aText := '' asRopedText. + aText append: (isFocused + ifTrue: [ + (aTextStyler value: 'is focused') foreground: + Color blue ] + ifFalse: [ aTextStyler value: 'not focused' ]). + aText append: (aTextStyler value: ' / '). + aText append: (hasFocus + ifTrue: [ + (aTextStyler value: 'has focus') foreground: + Color blue ] + ifFalse: [ aTextStyler value: 'no focus' ]). + aText ]. + aLabel := nil. ^ BlExampleEventsCountingElement new - addChild: (aLabel := BlTextElement new - text: aTextBuilder value; - constraintsDo: [ :c | - c ignoreByLayout. - c ignored horizontal alignRight. - c padding: (BlInsets top: 5 right: 5) ]); - when: BlFocusInEvent do: [ :anEvent | - hasFocus := true. - aLabel text: aTextBuilder value ]; - when: BlFocusOutEvent do: [ :anEvent | - hasFocus := false. - aLabel text: aTextBuilder value ]; - when: BlFocusEvent do: [ :anEvent | - isFocused := true. - aLabel text: aTextBuilder value ]; - when: BlBlurEvent do: [ :anEvent | - isFocused := false. - aLabel text: aTextBuilder value ] + addChild: (aLabel := BlTextElement new + text: aTextBuilder value; + constraintsDo: [ :c | + c ignoreByLayout. + c ignored horizontal alignRight. + c padding: (BlInsets top: 5 right: 5) ]); + when: BlFocusInEvent do: [ :anEvent | + hasFocus := true. + aLabel text: aTextBuilder value ]; + when: BlFocusOutEvent do: [ :anEvent | + hasFocus := false. + aLabel text: aTextBuilder value ]; + when: BlFocusEvent do: [ :anEvent | + isFocused := true. + aLabel text: aTextBuilder value ]; + when: BlBlurEvent do: [ :anEvent | + isFocused := false. + aLabel text: aTextBuilder value ] ] { #category : #'examples - lose focus' } BlFocusProcessorExamples >> loseFocus_01_give_focus_to_child_1 [ - + + | aScripter | - aScripter := self scripter. aScripter element: self scripterElement. - - aScripter substeps: 'Give focus to child-1' do: [ :aStep | + + aScripter substeps: 'Give focus to child-1' do: [ :aStep | aStep requestFocus onChildNamed: #'child-1'. - + aStep check label: 'Check focus-in fired on child-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus fired on child-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-out not fired on child-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'child-1'. - + aStep check label: 'Check blur not fired on child-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-in fired on container-2'; value: [ :anElement | anElement focusInCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus fired on container-2'; value: [ :anElement | anElement focusCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check blur fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 0; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; onSelf. - + aStep check label: 'Check blur not fired'; value: [ :anElement | anElement blurCount ] equals: 0; @@ -140,33 +143,32 @@ BlFocusProcessorExamples >> loseFocus_01_give_focus_to_child_1 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'child-1' ]; - onFocusProcessor. - ]. - + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'child-1' ]; + onFocusProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - lose focus' } BlFocusProcessorExamples >> loseFocus_02_remove_child_1 [ - + + | aScripter aChild1 | - aScripter := self loseFocus_01_give_focus_to_child_1. - + aChild1 := aScripter root childWithId: #'child-1'. aScripter set key: #'child-1' value: [ aChild1 ]. - + aScripter substeps: 'Remove child-1' do: [ :aStep | - aStep do action: [ :anElement | anElement removeFromParent ]; id: #'child-1'. - + aStep check label: 'Check focus-in fired on child-1'; value: [ aChild1 focusInCount ] equals: 1. - + aStep check label: 'Check focus fired on child-1'; value: [ aChild1 focusCount ] equals: 1. @@ -178,57 +180,57 @@ BlFocusProcessorExamples >> loseFocus_02_remove_child_1 [ aStep check label: 'Check blur not fired on child-1'; value: [ aChild1 blurCount ] equals: 1. - + aStep check label: 'Check focus-in fired on container-2'; value: [ :anElement | anElement focusInCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus fired on container-2'; value: [ :anElement | anElement focusCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check blur fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 0; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; @@ -250,35 +252,35 @@ BlFocusProcessorExamples >> loseFocus_02_remove_child_1 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'container-1' ]; + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'container-1' ]; onFocusProcessor ]. - + ^ aScripter syncContinue ] { #category : #'examples - lose focus' } BlFocusProcessorExamples >> loseFocus_03_add_back_child_1 [ - + + | aScripter aChild1 | - aScripter := self loseFocus_02_remove_child_1. - + aChild1 := aScripter userData at: #'child-1'. - + aScripter substeps: 'Add child-1 back' do: [ :aStep | - aStep do action: [ :anElement | anElement addChild: aChild1 ]; id: #'container-1'. - + aStep check label: 'Check focus-in fired on child-1'; value: [ aChild1 focusInCount ] equals: 2. - + aStep check label: 'Check focus fired on child-1'; value: [ aChild1 focusCount ] equals: 2. - + aStep check label: 'Check focus-out not fired on child-1'; value: [ aChild1 focusOutCount ] equals: 1. @@ -286,52 +288,52 @@ BlFocusProcessorExamples >> loseFocus_03_add_back_child_1 [ aStep check label: 'Check blur not fired on child-1'; value: [ aChild1 blurCount ] equals: 1. - + aStep check label: 'Check focus-in fired on container-2'; value: [ :anElement | anElement focusInCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus fired on container-2'; value: [ :anElement | anElement focusCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check blur fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 0; @@ -350,7 +352,7 @@ BlFocusProcessorExamples >> loseFocus_03_add_back_child_1 [ aStep check label: 'Check child-1 is still marked as focused'; satisfies: [ aChild1 isFocused ]. - + aStep check label: 'Check container-1 is no longer focused'; satisfies: [ :anElement | anElement isFocused not ]; @@ -358,38 +360,39 @@ BlFocusProcessorExamples >> loseFocus_03_add_back_child_1 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'child-1' ]; + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'child-1' ]; onFocusProcessor ]. - + ^ aScripter syncContinue ] { #category : #'examples - request focus' } BlFocusProcessorExamples >> requestFocus_01_parent [ - + + | aScripter | - aScripter := self scripter. aScripter element: self scripterElement. - - aScripter substeps: 'Request focus on parent' do: [ :aStep | + + aScripter substeps: 'Request focus on parent' do: [ :aStep | aStep requestFocus. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 1; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; onSelf. - + aStep check label: 'Check blur not fired'; value: [ :anElement | anElement blurCount ] equals: 0; @@ -397,58 +400,58 @@ BlFocusProcessorExamples >> requestFocus_01_parent [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element ]; - onFocusProcessor. - ]. - + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element ]; + onFocusProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - request focus' } BlFocusProcessorExamples >> requestFocus_02_container_1 [ - + + | aScripter | - aScripter := self requestFocus_01_parent. - - aScripter substeps: 'Request focus on container-1' do: [ :aStep | + + aScripter substeps: 'Request focus on container-1' do: [ :aStep | aStep requestFocus onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 1; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; onSelf. - + aStep check label: 'Check blur not fired'; value: [ :anElement | anElement blurCount ] equals: 1; @@ -456,78 +459,78 @@ BlFocusProcessorExamples >> requestFocus_02_container_1 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'container-1' ]; - onFocusProcessor. - ]. - + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'container-1' ]; + onFocusProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - request focus' } BlFocusProcessorExamples >> requestFocus_03_container_2 [ - + + | aScripter | - aScripter := self requestFocus_02_container_1. - - aScripter substeps: 'Request focus on container-2' do: [ :aStep | + + aScripter substeps: 'Request focus on container-2' do: [ :aStep | aStep requestFocus onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in fired on container-2'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus fired on container-2'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check blur fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 1; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; onSelf. - + aStep check label: 'Check blur not fired'; value: [ :anElement | anElement blurCount ] equals: 1; @@ -535,98 +538,98 @@ BlFocusProcessorExamples >> requestFocus_03_container_2 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'container-2' ]; - onFocusProcessor. - ]. - + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'container-2' ]; + onFocusProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - request focus' } BlFocusProcessorExamples >> requestFocus_04_child_1 [ - + + | aScripter | - aScripter := self requestFocus_03_container_2. - - aScripter substeps: 'Request focus on child-1' do: [ :aStep | + + aScripter substeps: 'Request focus on child-1' do: [ :aStep | aStep requestFocus onChildNamed: #'child-1'. - + aStep check label: 'Check focus-in fired on child-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus fired on child-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-out not fired on child-1'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'child-1'. - + aStep check label: 'Check blur not fired on child-1'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-in fired on container-2'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus fired on container-2'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 2; onChildNamed: #'container-1'. - + aStep check label: 'Check focus fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check blur fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 1; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; onSelf. - + aStep check label: 'Check blur not fired'; value: [ :anElement | anElement blurCount ] equals: 1; @@ -634,118 +637,118 @@ BlFocusProcessorExamples >> requestFocus_04_child_1 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'child-1' ]; - onFocusProcessor. - ]. - + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'child-1' ]; + onFocusProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - request focus' } BlFocusProcessorExamples >> requestFocus_05_child_4 [ - + + | aScripter | - aScripter := self requestFocus_04_child_1. - - aScripter substeps: 'Request focus on child-4' do: [ :aStep | + + aScripter substeps: 'Request focus on child-4' do: [ :aStep | aStep requestFocus onChildNamed: #'child-4'. - + aStep check label: 'Check focus-in fired on child-4'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'child-4'. - + aStep check label: 'Check focus fired on child-4'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'child-4'. - + aStep check label: 'Check focus-out not fired on child-4'; value: [ :anElement | anElement focusOutCount ] equals: 0; onChildNamed: #'child-4'. - + aStep check label: 'Check blur not fired on child-4'; value: [ :anElement | anElement blurCount ] equals: 0; onChildNamed: #'child-4'. - + aStep check label: 'Check focus-in not fired on child-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus not fired on child-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-out fired on child-1'; value: [ :anElement | anElement focusOutCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check blur fired on child-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-in fired on container-2'; value: [ :anElement | anElement focusInCount ] equals: 2; onChildNamed: #'container-2'. - + aStep check label: 'Check focus not fired on container-2'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in not fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 2; onChildNamed: #'container-1'. - + aStep check label: 'Check focus not fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 2; onChildNamed: #'container-1'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus fired'; value: [ :anElement | anElement focusCount ] equals: 1; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; onSelf. - + aStep check label: 'Check blur not fired'; value: [ :anElement | anElement blurCount ] equals: 1; @@ -753,118 +756,118 @@ BlFocusProcessorExamples >> requestFocus_05_child_4 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'child-4' ]; - onFocusProcessor. - ]. - + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'child-4' ]; + onFocusProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - request focus' } BlFocusProcessorExamples >> requestFocus_06_container_1 [ - + + | aScripter | - aScripter := self requestFocus_05_child_4. - - aScripter substeps: 'Request focus on container-1' do: [ :aStep | + + aScripter substeps: 'Request focus on container-1' do: [ :aStep | aStep requestFocus onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in not fired on child-4'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'child-4'. - + aStep check label: 'Check focus not fired on child-4'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'child-4'. - + aStep check label: 'Check focus-out fired on child-4'; value: [ :anElement | anElement focusOutCount ] equals: 1; onChildNamed: #'child-4'. - + aStep check label: 'Check blur fired on child-4'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'child-4'. - + aStep check label: 'Check focus-in not fired on child-1'; value: [ :anElement | anElement focusInCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus not fired on child-1'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-out not fired on child-1'; value: [ :anElement | anElement focusOutCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check blur not fired on child-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'child-1'. - + aStep check label: 'Check focus-in not fired on container-2'; value: [ :anElement | anElement focusInCount ] equals: 2; onChildNamed: #'container-2'. - + aStep check label: 'Check focus not fired on container-2'; value: [ :anElement | anElement focusCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-out fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 2; onChildNamed: #'container-2'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-2'. - + aStep check label: 'Check focus-in fired on container-1'; value: [ :anElement | anElement focusInCount ] equals: 3; onChildNamed: #'container-1'. - + aStep check label: 'Check focus fired on container-1'; value: [ :anElement | anElement focusCount ] equals: 2; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-out not fired on conatiner-1'; value: [ :anElement | anElement focusOutCount ] equals: 2; onChildNamed: #'container-1'. - + aStep check label: 'Check blur not fired on container-1'; value: [ :anElement | anElement blurCount ] equals: 1; onChildNamed: #'container-1'. - + aStep check label: 'Check focus-in not fired'; value: [ :anElement | anElement focusInCount ] equals: 1; onSelf. - + aStep check label: 'Check focus not fired'; value: [ :anElement | anElement focusCount ] equals: 1; onSelf. - + aStep check label: 'Check focus-out not fired'; value: [ :anElement | anElement focusOutCount ] equals: 0; onSelf. - + aStep check label: 'Check blur not fired'; value: [ :anElement | anElement blurCount ] equals: 1; @@ -872,73 +875,84 @@ BlFocusProcessorExamples >> requestFocus_06_container_1 [ aStep check label: 'Check focus owner'; - value: [ :aFocusProcessor | aFocusProcessor focusOwner ] equals: [ aScripter element childWithId: #'container-1' ]; - onFocusProcessor. - ]. - + value: [ :aFocusProcessor | aFocusProcessor focusOwner ] + equals: [ aScripter element childWithId: #'container-1' ]; + onFocusProcessor ]. + ^ aScripter syncContinue ] { #category : #'private - instance creation' } BlFocusProcessorExamples >> scripterElement [ - - + + ^ self elementWithFocusHandler - size: 600@400; - position: 50@50; - border: (BlBorder paint: Color gray width: 1); - background: Color white; - id: #parent; - addChild: (BlTextElement new text: ('#parent' asRopedText light fontSize: 11); position: 8@5); - addChildren: { - self elementWithFocusHandler - id: #'container-1'; - size: 240@320; - position: 40@40; - border: (BlBorder paint: Color gray width: 1); - background: (Color gray alpha: 0.1); - addChild: (BlTextElement new text: ('#''container-1''' asRopedText light fontSize: 11); position: 8@5); - addChildren: { - self elementWithFocusHandler - id: #'child-1'; - size: 200@130; - position: 20@20; - background: (Color gray alpha: 0.3); - border: (BlBorder paint: Color lightGray width: 1); - addChild: (BlTextElement new text: ('#''child-1''' asRopedText light fontSize: 11); position: 8@5). - - self elementWithFocusHandler - id: #'child-2'; - size: 200@130; - position: 20@170; - background: (Color gray alpha: 0.3); - border: (BlBorder paint: Color lightGray width: 1); - addChild: (BlTextElement new text: ('#''child-2''' asRopedText light fontSize: 11); position: 8@5) - }. - - self elementWithFocusHandler - id: #'container-2'; - size: 240@320; - position: 320@40; - border: (BlBorder paint: Color gray width: 1); - background: (Color gray alpha: 0.1); - addChild: (BlTextElement new text: ('#''container-2''' asRopedText light fontSize: 11); position: 8@5); - addChildren: { - self elementWithFocusHandler - id: #'child-3'; - size: 200@130; - position: 20@20; - background: (Color gray alpha: 0.3); - border: (BlBorder paint: Color lightGray width: 1); - addChild: (BlTextElement new text: ('#''child-3''' asRopedText light fontSize: 11); position: 8@5). - - self elementWithFocusHandler - id: #'child-4'; - size: 200@130; - position: 20@170; - background: (Color gray alpha: 0.3); - border: (BlBorder paint: Color lightGray width: 1); - addChild: (BlTextElement new text: ('#''child-4''' asRopedText light fontSize: 11); position: 8@5) - }. - } + size: 600 @ 400; + position: 50 @ 50; + border: (BlBorder paint: Color gray width: 1); + background: Color white; + id: #parent; + addChild: (BlTextElement new + text: ('#parent' asRopedText light fontSize: 11); + position: 8 @ 5); + addChildren: { + (self elementWithFocusHandler + id: #'container-1'; + size: 240 @ 320; + position: 40 @ 40; + border: (BlBorder paint: Color gray width: 1); + background: (Color gray alpha: 0.1); + addChild: (BlTextElement new + text: ('#''container-1''' asRopedText light fontSize: 11); + position: 8 @ 5); + addChildren: { + (self elementWithFocusHandler + id: #'child-1'; + size: 200 @ 130; + position: 20 @ 20; + background: (Color gray alpha: 0.3); + border: (BlBorder paint: Color lightGray width: 1); + addChild: (BlTextElement new + text: ('#''child-1''' asRopedText light fontSize: 11); + position: 8 @ 5)). + + (self elementWithFocusHandler + id: #'child-2'; + size: 200 @ 130; + position: 20 @ 170; + background: (Color gray alpha: 0.3); + border: (BlBorder paint: Color lightGray width: 1); + addChild: (BlTextElement new + text: ('#''child-2''' asRopedText light fontSize: 11); + position: 8 @ 5)) }). + + (self elementWithFocusHandler + id: #'container-2'; + size: 240 @ 320; + position: 320 @ 40; + border: (BlBorder paint: Color gray width: 1); + background: (Color gray alpha: 0.1); + addChild: (BlTextElement new + text: ('#''container-2''' asRopedText light fontSize: 11); + position: 8 @ 5); + addChildren: { + (self elementWithFocusHandler + id: #'child-3'; + size: 200 @ 130; + position: 20 @ 20; + background: (Color gray alpha: 0.3); + border: (BlBorder paint: Color lightGray width: 1); + addChild: (BlTextElement new + text: ('#''child-3''' asRopedText light fontSize: 11); + position: 8 @ 5)). + + (self elementWithFocusHandler + id: #'child-4'; + size: 200 @ 130; + position: 20 @ 170; + background: (Color gray alpha: 0.3); + border: (BlBorder paint: Color lightGray width: 1); + addChild: (BlTextElement new + text: ('#''child-4''' asRopedText light fontSize: 11); + position: 8 @ 5)) }) } ] diff --git a/src/Bloc-Examples/BlGeometryVisualAndLayoutBoundsExamples.class.st b/src/Bloc-Examples/BlGeometryVisualAndLayoutBoundsExamples.class.st index a5f1621f4..e2bf6c0e9 100644 --- a/src/Bloc-Examples/BlGeometryVisualAndLayoutBoundsExamples.class.st +++ b/src/Bloc-Examples/BlGeometryVisualAndLayoutBoundsExamples.class.st @@ -66,32 +66,29 @@ The debugging mode is also possible to activate in the GT-Inspector's menu, next Class { #name : #BlGeometryVisualAndLayoutBoundsExamples, #superclass : #BlExampleTest, - #traits : 'TBlExample', - #classTraits : 'TBlExample classTrait', #category : #'Bloc-Examples-Basic' } { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> alignedIcon [ - + + | anIconElement aLabelElement aContainerElement | - anIconElement := self emptyIconElement - geometry: self trianglePolygon. + anIconElement := self emptyIconElement geometry: self trianglePolygon. aLabelElement := self textElementWithRunText. aContainerElement := self iconAndTextContainer. - aContainerElement - addChildren: - {anIconElement. - aLabelElement}. + aContainerElement addChildren: { + anIconElement. + aLabelElement }. ^ aContainerElement ] { #category : #'rectangle and start' } BlGeometryVisualAndLayoutBoundsExamples >> centeredOutskirts [ - - - | aContainer | + "Rectangle and star elements with centered stroke" + + | aContainer | aContainer := self container. aContainer addChild: self rectangleWithSmallerGeometryCentered. aContainer addChild: self starWithSmallerGeometryCentered. @@ -101,8 +98,9 @@ BlGeometryVisualAndLayoutBoundsExamples >> centeredOutskirts [ { #category : #bounds } BlGeometryVisualAndLayoutBoundsExamples >> clippedTriangle [ - - + "Clipped triangle polygon with layout bounds" + + | aContainer | aContainer := self unclippedTriangle. aContainer clipChildren: true. @@ -111,14 +109,15 @@ BlGeometryVisualAndLayoutBoundsExamples >> clippedTriangle [ { #category : #'rectangle and start' } BlGeometryVisualAndLayoutBoundsExamples >> container [ - - + "A container for the rectangle and the star" + + | aContainer | aContainer := BlElement new. aContainer layout: (BlGridLayout horizontal cellSpacing: 20). aContainer margin: (BlInsets all: 10). aContainer padding: (BlInsets all: 10). - aContainer constraintsDo: [ :c | + aContainer constraintsDo: [ :c | c horizontal fitContent. c vertical fitContent ]. ^ aContainer @@ -126,7 +125,8 @@ BlGeometryVisualAndLayoutBoundsExamples >> container [ { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> debuggingAlignedIcon [ - + + | aContainerElement | aContainerElement := self alignedIcon. ^ aContainerElement @@ -134,7 +134,8 @@ BlGeometryVisualAndLayoutBoundsExamples >> debuggingAlignedIcon [ { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> debuggingMisalignedIcon [ - + + | aContainerElement | aContainerElement := self misalignedIcon. aContainerElement children first. @@ -143,8 +144,9 @@ BlGeometryVisualAndLayoutBoundsExamples >> debuggingMisalignedIcon [ { #category : #bounds } BlGeometryVisualAndLayoutBoundsExamples >> debuggingMode [ - - + "Triangle polygon with visual and geometry bounds" + + | aContainer | aContainer := self fullyVisibleTriangle. ^ aContainer @@ -152,17 +154,18 @@ BlGeometryVisualAndLayoutBoundsExamples >> debuggingMode [ { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> emptyIconElement [ - + + ^ BlDevElement new - size: 8 @ 12; - background: Color green muchDarker. + size: 8 @ 12; + background: Color green muchDarker ] { #category : #bounds } BlGeometryVisualAndLayoutBoundsExamples >> fullyVisibleTriangle [ + "Fully visible triangle polygon that exceeds layout bounds" - - + | aContainer | aContainer := self clippedTriangle. aContainer clipChildren: false. @@ -172,224 +175,231 @@ BlGeometryVisualAndLayoutBoundsExamples >> fullyVisibleTriangle [ { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> iconAndTextContainer [ - + + | aContainerElement | aContainerElement := BlElement new - layout: BlLinearLayout horizontal alignCenter; - constraintsDo: [ :c | - c horizontal fitContent. - c vertical fitContent ]; - background: (Color gray alpha: 0.3); - padding: (BlInsets all: 3); - margin: (BlInsets left: 5). - aContainerElement - transformDo: [ :t | - t origin: BlAffineTransformationTopLeftOrigin new. - t scaleBy: 5 ]. + layout: BlLinearLayout horizontal alignCenter; + constraintsDo: [ :c | + c horizontal fitContent. + c vertical fitContent ]; + background: (Color gray alpha: 0.3); + padding: (BlInsets all: 3); + margin: (BlInsets left: 5). + aContainerElement transformDo: [ :t | + t origin: BlAffineTransformationTopLeftOrigin new. + t scaleBy: 5 ]. ^ aContainerElement ] { #category : #'rectangle and start' } BlGeometryVisualAndLayoutBoundsExamples >> insideOutskirts [ - - - | aContainer | + "Rectangle and star elements with inside stroke" + + | aContainer | aContainer := self container. aContainer addChild: self rectangleWithSmallerGeometryInside. aContainer addChild: self starWithSmallerGeometryInside. - + ^ aContainer ] { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> misalignedIcon [ - + + | anIconElement aLabelElement aContainerElement | - anIconElement := self emptyIconElement - geometry: self misalignedTrianglePolygon. + anIconElement := self emptyIconElement geometry: + self misalignedTrianglePolygon. aLabelElement := self textElementWithRunText. aContainerElement := self iconAndTextContainer. - aContainerElement - addChildren: - {anIconElement. - aLabelElement}. + aContainerElement addChildren: { + anIconElement. + aLabelElement }. ^ aContainerElement ] { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> misalignedTrianglePolygon [ - - - ^ BlPolygonGeometry - vertices: - {(0 @ 3). - (8 @ 7.5). - (0 @ 12)} + "Triangle polygon" + + + ^ BlPolygonGeometry vertices: { + (0 @ 3). + (8 @ 7.5). + (0 @ 12) } ] { #category : #'rectangle and start' } BlGeometryVisualAndLayoutBoundsExamples >> outsideOutskirts [ - - - | aContainer | + "Rectangle and star elements with outside stroke" + + | aContainer | aContainer := self container. aContainer addChild: self rectangleWithSmallerGeometryOutside. aContainer addChild: self starWithSmallerGeometryOutside. - + ^ aContainer ] { #category : #rectangle } BlGeometryVisualAndLayoutBoundsExamples >> rectanglePolygon [ - - + "Rectangle polygon" + + ^ BlPolygonGeometry vertices: { - (50@50). (150@50). (150@100). (50@100) - } + (50 @ 50). + (150 @ 50). + (150 @ 100). + (50 @ 100) } ] { #category : #rectangle } BlGeometryVisualAndLayoutBoundsExamples >> rectangleWithSmallerGeometry [ - - + "Rectangle element in debug mode, displaying bounds" + + | aRectangleElement | - aRectangleElement := BlDevElement new. aRectangleElement geometry: self rectanglePolygon. - aRectangleElement size: 200@150. + aRectangleElement size: 200 @ 150. aRectangleElement background: (Color gray alpha: 0.2). - aRectangleElement border: (BlBorder paint: (Color gray alpha: 0.5) width: 10). - + aRectangleElement border: + (BlBorder paint: (Color gray alpha: 0.5) width: 10). + ^ aRectangleElement ] { #category : #rectangle } BlGeometryVisualAndLayoutBoundsExamples >> rectangleWithSmallerGeometryCentered [ - - + "Rectangle element with centered stroke" + + | aRectangleElement | - aRectangleElement := self rectangleWithSmallerGeometry. aRectangleElement outskirts: BlOutskirts centered. - + ^ aRectangleElement ] { #category : #rectangle } BlGeometryVisualAndLayoutBoundsExamples >> rectangleWithSmallerGeometryInside [ - - + "Rectangle element with inside stroke" + + | aRectangleElement | - aRectangleElement := self rectangleWithSmallerGeometry. aRectangleElement outskirts: BlOutskirts inside. - + ^ aRectangleElement ] { #category : #rectangle } BlGeometryVisualAndLayoutBoundsExamples >> rectangleWithSmallerGeometryOutside [ - - + "Rectangle element with outside stroke" + + | aRectangleElement | - aRectangleElement := self rectangleWithSmallerGeometry. aRectangleElement outskirts: BlOutskirts outside. - + ^ aRectangleElement ] { #category : #star } BlGeometryVisualAndLayoutBoundsExamples >> starPolygon [ - - - ^ BlPolygonGeometry - vertices: - {(100 @ 50). - (115 @ 90). - (150 @ 90). - (125 @ 110). - (135 @ 150). - (100 @ 130). - (65 @ 150). - (75 @ 110). - (50 @ 90). - (85 @ 90)} + "Star polygon" + + + ^ BlPolygonGeometry vertices: { + (100 @ 50). + (115 @ 90). + (150 @ 90). + (125 @ 110). + (135 @ 150). + (100 @ 130). + (65 @ 150). + (75 @ 110). + (50 @ 90). + (85 @ 90) } ] { #category : #star } BlGeometryVisualAndLayoutBoundsExamples >> starWithSmallerGeometry [ - - + "Star element in debug mode, displaying bounds" + + | aStarElement | aStarElement := BlDevElement new. aStarElement geometry: self starPolygon. aStarElement size: 200 @ 200. aStarElement background: (Color gray alpha: 0.2). - aStarElement border: (BlBorder paint: (Color gray alpha: 0.5) width: 10). + aStarElement border: + (BlBorder paint: (Color gray alpha: 0.5) width: 10). ^ aStarElement ] { #category : #star } BlGeometryVisualAndLayoutBoundsExamples >> starWithSmallerGeometryCentered [ - - + "Star element with centered stroke" + + | aStarElement | - aStarElement := self starWithSmallerGeometry. aStarElement outskirts: BlOutskirts centered. - + ^ aStarElement ] { #category : #star } BlGeometryVisualAndLayoutBoundsExamples >> starWithSmallerGeometryInside [ - - + "Star element with inside stroke" + + | aStarElement | - aStarElement := self starWithSmallerGeometry. aStarElement outskirts: BlOutskirts inside. - + ^ aStarElement ] { #category : #star } BlGeometryVisualAndLayoutBoundsExamples >> starWithSmallerGeometryOutside [ - - + "Star element with outside stroke" + + | aStarElement | - aStarElement := self starWithSmallerGeometry. aStarElement outskirts: BlOutskirts outside. - + ^ aStarElement ] { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> textElementWithRunText [ - + + ^ BlTextElement new text: 'Run' asRopedText ] { #category : #'debugging triangle and text' } BlGeometryVisualAndLayoutBoundsExamples >> trianglePolygon [ - - - ^ BlPolygonGeometry - vertices: - {(0 @ 0). - (8 @ 6). - (0 @ 12)} + "Triangle polygon" + + + ^ BlPolygonGeometry vertices: { + (0 @ 0). + (8 @ 6). + (0 @ 12) } ] { #category : #bounds } BlGeometryVisualAndLayoutBoundsExamples >> unclippedTriangle [ + "Clipped triangle polygon with layount bounds" - - + | aContainer aPolygonElement | aContainer := BlElement new. aContainer size: 8 @ 11. diff --git a/src/Bloc-Examples/BlHandlerAnnouncerRegistryExamples.class.st b/src/Bloc-Examples/BlHandlerAnnouncerRegistryExamplesTest.class.st similarity index 71% rename from src/Bloc-Examples/BlHandlerAnnouncerRegistryExamples.class.st rename to src/Bloc-Examples/BlHandlerAnnouncerRegistryExamplesTest.class.st index a7372817f..b2a665e2d 100644 --- a/src/Bloc-Examples/BlHandlerAnnouncerRegistryExamples.class.st +++ b/src/Bloc-Examples/BlHandlerAnnouncerRegistryExamplesTest.class.st @@ -3,15 +3,15 @@ I contain examples of event handler registry with Announcer as its backend " Class { - #name : #BlHandlerAnnouncerRegistryExamples, - #superclass : #BlExampleTest, + #name : #BlHandlerAnnouncerRegistryExamplesTest, + #superclass : #TestCase, #traits : 'TBlHandlerRegistryExamples', #classTraits : 'TBlHandlerRegistryExamples classTrait', #category : #'Bloc-Examples-EventHandling' } { #category : #'instance creation' } -BlHandlerAnnouncerRegistryExamples >> emptyRegistry [ +BlHandlerAnnouncerRegistryExamplesTest >> emptyRegistry [ ^ BlHandlerAnnouncerRegistry new diff --git a/src/Bloc-Examples/BlHandlerArrayRegistryExamples.class.st b/src/Bloc-Examples/BlHandlerArrayRegistryExamplesTest.class.st similarity index 72% rename from src/Bloc-Examples/BlHandlerArrayRegistryExamples.class.st rename to src/Bloc-Examples/BlHandlerArrayRegistryExamplesTest.class.st index 0e6da3265..7ac675ba3 100644 --- a/src/Bloc-Examples/BlHandlerArrayRegistryExamples.class.st +++ b/src/Bloc-Examples/BlHandlerArrayRegistryExamplesTest.class.st @@ -3,15 +3,15 @@ I contain examples of event handler registry with Array as its backend " Class { - #name : #BlHandlerArrayRegistryExamples, - #superclass : #BlExampleTest, + #name : #BlHandlerArrayRegistryExamplesTest, + #superclass : #TestCase, #traits : 'TBlHandlerRegistryExamples', #classTraits : 'TBlHandlerRegistryExamples classTrait', #category : #'Bloc-Examples-EventHandling' } { #category : #'instance creation' } -BlHandlerArrayRegistryExamples >> emptyRegistry [ +BlHandlerArrayRegistryExamplesTest >> emptyRegistry [ ^ BlHandlerArrayRegistry new diff --git a/src/Bloc-Examples/BlKeyCombinationExamples.class.st b/src/Bloc-Examples/BlKeyCombinationExamplesTest.class.st similarity index 73% rename from src/Bloc-Examples/BlKeyCombinationExamples.class.st rename to src/Bloc-Examples/BlKeyCombinationExamplesTest.class.st index 50e6b19e1..c99e70161 100644 --- a/src/Bloc-Examples/BlKeyCombinationExamples.class.st +++ b/src/Bloc-Examples/BlKeyCombinationExamplesTest.class.st @@ -3,34 +3,34 @@ I contain examples of how to use key combination " Class { - #name : #BlKeyCombinationExamples, - #superclass : #BlExampleTest, + #name : #BlKeyCombinationExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-KeyBinding' } { #category : #'instance creation' } -BlKeyCombinationExamples >> alternativeCombination [ - - +BlKeyCombinationExamplesTest >> alternativeCombination [ + + ^ BlAlternativeCombination new ] { #category : #'instance creation' } -BlKeyCombinationExamples >> arrowLeft [ - - +BlKeyCombinationExamplesTest >> arrowLeft [ + + ^ KeyboardKey left ] { #category : #'instance creation' } -BlKeyCombinationExamples >> compulsoryCombination [ - - +BlKeyCombinationExamplesTest >> compulsoryCombination [ + + ^ BlCompulsoryCombination new ] { #category : #examples } -BlKeyCombinationExamples >> keyLogger [ +BlKeyCombinationExamplesTest >> keyLogger [ ^ BlElement new @@ -75,21 +75,21 @@ BlKeyCombinationExamples >> keyLogger [ ] { #category : #'instance creation' } -BlKeyCombinationExamples >> leftMeta [ +BlKeyCombinationExamplesTest >> leftMeta [ - + ^ KeyboardKey metaLeft ] { #category : #'instance creation' } -BlKeyCombinationExamples >> leftShift [ +BlKeyCombinationExamplesTest >> leftShift [ - + ^ KeyboardKey shiftLeft ] { #category : #examples } -BlKeyCombinationExamples >> meta: aKeyAlternative left: aLeftMeta right: aRightMeta [ +BlKeyCombinationExamplesTest >> meta: aKeyAlternative left: aLeftMeta right: aRightMeta [ ^ aKeyAlternative key: aLeftMeta; @@ -98,21 +98,21 @@ BlKeyCombinationExamples >> meta: aKeyAlternative left: aLeftMeta right: aRightM ] { #category : #'instance creation' } -BlKeyCombinationExamples >> rightMeta [ +BlKeyCombinationExamplesTest >> rightMeta [ - + ^ KeyboardKey metaRight ] { #category : #'instance creation' } -BlKeyCombinationExamples >> rightShift [ +BlKeyCombinationExamplesTest >> rightShift [ - + ^ KeyboardKey shiftLeft ] { #category : #examples } -BlKeyCombinationExamples >> shift: aShiftAlternative arrowLeft: anArrowLeft and: aCompulsoryCombination [ +BlKeyCombinationExamplesTest >> shift: aShiftAlternative arrowLeft: anArrowLeft and: aCompulsoryCombination [ ^ aCompulsoryCombination with: aShiftAlternative; @@ -121,7 +121,7 @@ BlKeyCombinationExamples >> shift: aShiftAlternative arrowLeft: anArrowLeft and: ] { #category : #examples } -BlKeyCombinationExamples >> shift: aKeyAlternative left: aLeftShift right: aRightShift [ +BlKeyCombinationExamplesTest >> shift: aKeyAlternative left: aLeftShift right: aRightShift [ ^ aKeyAlternative key: aLeftShift; diff --git a/src/Bloc-Examples/BlMouseEventExamples.class.st b/src/Bloc-Examples/BlMouseEventExamplesTest.class.st similarity index 63% rename from src/Bloc-Examples/BlMouseEventExamples.class.st rename to src/Bloc-Examples/BlMouseEventExamplesTest.class.st index cdf195d74..9a553a6fc 100644 --- a/src/Bloc-Examples/BlMouseEventExamples.class.st +++ b/src/Bloc-Examples/BlMouseEventExamplesTest.class.st @@ -1,11 +1,11 @@ Class { - #name : #BlMouseEventExamples, - #superclass : #BlExampleTest, + #name : #BlMouseEventExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Event' } { #category : #private } -BlMouseEventExamples >> bottomLeftText: anEvent [ +BlMouseEventExamplesTest >> bottomLeftText: anEvent [ self pointToText: (self boundsOf: anEvent currentTarget parent) bottomLeft @@ -13,7 +13,7 @@ BlMouseEventExamples >> bottomLeftText: anEvent [ ] { #category : #private } -BlMouseEventExamples >> bottomRightText: anEvent [ +BlMouseEventExamplesTest >> bottomRightText: anEvent [ self pointToText: (self boundsOf: anEvent currentTarget parent) bottomRight @@ -21,7 +21,7 @@ BlMouseEventExamples >> bottomRightText: anEvent [ ] { #category : #private } -BlMouseEventExamples >> boundsOf: anElement [ +BlMouseEventExamplesTest >> boundsOf: anElement [ | aRoot | aRoot := anElement. @@ -32,79 +32,89 @@ BlMouseEventExamples >> boundsOf: anElement [ ] { #category : #'instance creation' } -BlMouseEventExamples >> box [ - - +BlMouseEventExamplesTest >> box [ + + ^ BlElement new - addChild: (self label - constraintsDo: [ :c | - c ignored horizontal alignLeft. - c ignored vertical alignTop ]; - when: BlElementPositionInSpaceChangedEvent do: [ :anEvent | self topLeftText: anEvent ]); - addChild: (self label - constraintsDo: [ :c | - c ignored horizontal alignRight. - c ignored vertical alignTop ]; - when: BlElementPositionInSpaceChangedEvent do: [ :anEvent | self topRightText: anEvent ]); - addChild: (self label - constraintsDo: [ :c | - c ignored horizontal alignLeft. - c ignored vertical alignBottom ]; - when: BlElementPositionInSpaceChangedEvent do: [ :anEvent | self bottomLeftText: anEvent ]); - addChild: (self label - constraintsDo: [ :c | - c ignored horizontal alignRight. - c ignored vertical alignBottom ]; - when: BlElementPositionInSpaceChangedEvent do: [ :anEvent | self bottomRightText: anEvent ]) + addChild: (self label + constraintsDo: [ :c | + c ignored horizontal alignLeft. + c ignored vertical alignTop ]; + when: BlElementPositionInSpaceChangedEvent + do: [ :anEvent | self topLeftText: anEvent ]); + addChild: (self label + constraintsDo: [ :c | + c ignored horizontal alignRight. + c ignored vertical alignTop ]; + when: BlElementPositionInSpaceChangedEvent + do: [ :anEvent | self topRightText: anEvent ]); + addChild: (self label + constraintsDo: [ :c | + c ignored horizontal alignLeft. + c ignored vertical alignBottom ]; + when: BlElementPositionInSpaceChangedEvent + do: [ :anEvent | self bottomLeftText: anEvent ]); + addChild: (self label + constraintsDo: [ :c | + c ignored horizontal alignRight. + c ignored vertical alignBottom ]; + when: BlElementPositionInSpaceChangedEvent + do: [ :anEvent | self bottomRightText: anEvent ]) ] { #category : #'instance creation' } -BlMouseEventExamples >> child [ - - +BlMouseEventExamplesTest >> child [ + + ^ self box - border: (BlBorder paint: Color red width: 1); - background: (Color red alpha: 0.3); - size: 400@300 + border: (BlBorder paint: Color red width: 1); + background: (Color red alpha: 0.3); + size: 400 @ 300 ] { #category : #'instance creation' } -BlMouseEventExamples >> grandChild [ - - +BlMouseEventExamplesTest >> grandChild [ + + ^ self box - border: (BlBorder paint: Color blue width: 1); - background: (Color blue alpha: 0.3); - size: 400@100 + border: (BlBorder paint: Color blue width: 1); + background: (Color blue alpha: 0.3); + size: 400 @ 100 ] { #category : #'instance creation' } -BlMouseEventExamples >> label [ - - +BlMouseEventExamplesTest >> label [ + + ^ BlTextElement new - preventMeAndChildrenMouseEvents; - text: ((0@0) asRopedText fontSize: 10); - padding: (BlInsets all: 2); - constraintsDo: [ :c | c ignoreByLayout ] + preventMeAndChildrenMouseEvents; + text: ((0 @ 0) asRopedText fontSize: 10); + padding: (BlInsets all: 2); + constraintsDo: [ :c | c ignoreByLayout ] ] { #category : #'instance creation' } -BlMouseEventExamples >> parent [ - - +BlMouseEventExamplesTest >> parent [ + + ^ self box - border: (BlBorder paint: Color gray width: 1); - background: (Color gray alpha: 0.3); - size: 300@250; - in: [ :anElement | anElement userData at: #blocEvents put: #parent ]; - yourself + border: (BlBorder paint: Color gray width: 1); + background: (Color gray alpha: 0.3); + size: 300 @ 250; + in: [ :anElement | + anElement userData at: #blocEvents put: #parent ]; + yourself +] + +{ #category : #private } +BlMouseEventExamplesTest >> pointToText: aPoint for: aTextElement [ + aTextElement text: (aPoint asRopedText fontSize: 10; foreground: (aTextElement parent background paint color darker alpha: 1)) ] { #category : #'examples - find event target' } -BlMouseEventExamples >> parentWithClip [ +BlMouseEventExamplesTest >> testParentWithClip [ - + | gray red blue | blue := self grandChild. blue position: 100 @ 50. @@ -143,9 +153,9 @@ BlMouseEventExamples >> parentWithClip [ ] { #category : #'examples - find event target' } -BlMouseEventExamples >> parentWithoutClipChildWithClip [ +BlMouseEventExamplesTest >> testParentWithoutClipChildWithClip [ - + | gray red blue | blue := self grandChild. blue position: 100 @ 50. @@ -184,9 +194,9 @@ BlMouseEventExamples >> parentWithoutClipChildWithClip [ ] { #category : #'examples - find event target' } -BlMouseEventExamples >> parentWithoutClipChildWithoutClip [ +BlMouseEventExamplesTest >> testParentWithoutClipChildWithoutClip [ - + | gray red blue | blue := self grandChild. blue position: 100 @ 50. @@ -226,12 +236,7 @@ BlMouseEventExamples >> parentWithoutClipChildWithoutClip [ ] { #category : #private } -BlMouseEventExamples >> pointToText: aPoint for: aTextElement [ - aTextElement text: (aPoint asRopedText fontSize: 10; foreground: (aTextElement parent background paint color darker alpha: 1)) -] - -{ #category : #private } -BlMouseEventExamples >> topLeftText: anEvent [ +BlMouseEventExamplesTest >> topLeftText: anEvent [ self pointToText: (self boundsOf: anEvent currentTarget parent) topLeft @@ -239,7 +244,7 @@ BlMouseEventExamples >> topLeftText: anEvent [ ] { #category : #private } -BlMouseEventExamples >> topRightText: anEvent [ +BlMouseEventExamplesTest >> topRightText: anEvent [ self pointToText: (self boundsOf: anEvent currentTarget parent) topRight diff --git a/src/Bloc-Examples/BlMouseProcessorClickExamples.class.st b/src/Bloc-Examples/BlMouseProcessorClickExamples.class.st index b94bfdb7e..8dbb017d9 100644 --- a/src/Bloc-Examples/BlMouseProcessorClickExamples.class.st +++ b/src/Bloc-Examples/BlMouseProcessorClickExamples.class.st @@ -6,102 +6,115 @@ Class { { #category : #'examples - scripter' } BlMouseProcessorClickExamples >> click [ - + + | aScripter | - aScripter := self mouseEnter. - - aScripter substeps: 'Click' do: [ :aStep | + + aScripter substeps: 'Click' do: [ :aStep | aStep mouseDown. aStep mouseUp. - - aStep check + + aStep check label: 'Check last click event is not nil'; - satisfies: [ :aMouseProcessor | aMouseProcessor lastClickEvent isNotNil ]; + satisfies: [ :aMouseProcessor | + aMouseProcessor lastClickEvent isNotNil ]; onMouseProcessor. - aStep check + aStep check label: 'Check last click event is ClickEvent'; - satisfies: [ :aMouseProcessor | aMouseProcessor lastClickEvent isKindOf: BlClickEvent ]; + satisfies: [ :aMouseProcessor | + aMouseProcessor lastClickEvent isKindOf: BlClickEvent ]; onMouseProcessor. - - aStep check + + aStep check label: 'Check last click event has correct target'; - satisfies: [ :aMouseProcessor | aMouseProcessor lastClickEvent target = aScripter element ]; + satisfies: [ :aMouseProcessor | + aMouseProcessor lastClickEvent target = aScripter element ]; onMouseProcessor. - - aStep check + + aStep check label: 'Check element was clicked'; satisfies: [ :anElement | anElement clickCount = 1 ]; onSelf ]. aScripter syncContinue. - + ^ aScripter ] { #category : #'examples - scripter' } BlMouseProcessorClickExamples >> mouseDown [ - + + | aScripter | - aScripter := self mouseEnter. - - aScripter substeps: 'Click' do: [ :aStep | + + aScripter substeps: 'Click' do: [ :aStep | aStep mouseDown. - - aStep check + + aStep check label: 'Check previous mouse down event'; - value: [ :aMouseProcessor | aMouseProcessor lastMouseDownEvent target ] equals: [ aScripter element ]; + value: [ :aMouseProcessor | + aMouseProcessor lastMouseDownEvent target ] + equals: [ aScripter element ]; onMouseProcessor. - aStep check + aStep check label: 'Check last over target is the element'; - value: [ :aMouseProcessor | aMouseProcessor lastOverTarget ] equals: [ aScripter element ]; + value: [ :aMouseProcessor | aMouseProcessor lastOverTarget ] + equals: [ aScripter element ]; onMouseProcessor. - aStep check + aStep check label: 'Check entered targets'; - value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] equals: [ { aScripter element. aScripter root } ] ; + value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] + equals: [ + { + aScripter element. + aScripter root } ]; onMouseProcessor ]. - + ^ aScripter syncContinue ] { #category : #'examples - scripter' } BlMouseProcessorClickExamples >> mouseEnter [ - + + | aScripter | - aScripter := self scripter. aScripter element: self scripterElement. - - aScripter substeps: 'Mouse Enter' do: [ :aStep | - aStep mouseMove - by: 30@30. - aStep mouseMove - by: 70@60. + aScripter substeps: 'Mouse Enter' do: [ :aStep | + aStep mouseMove by: 30 @ 30. - aStep check + aStep mouseMove by: 70 @ 60. + + aStep check label: 'Check last over target is the element'; - value: [ :aMouseProcessor | aMouseProcessor lastOverTarget ] equals: [ aScripter element ]; + value: [ :aMouseProcessor | aMouseProcessor lastOverTarget ] + equals: [ aScripter element ]; onMouseProcessor. - aStep check + aStep check label: 'Check entered targets'; - value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] equals: [ { aScripter element. aScripter root } ] ; + value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] + equals: [ + { + aScripter element. + aScripter root } ]; onMouseProcessor ]. aScripter syncContinue. - + ^ aScripter ] { #category : #'examples - scripter' } BlMouseProcessorClickExamples >> scripterElement [ - - + + ^ BlExampleEventsCountingElement new - size: 100@75; - position: 50@50 + size: 100 @ 75; + position: 50 @ 50 ] diff --git a/src/Bloc-Examples/BlMouseProcessorEnterLeaveExamples.class.st b/src/Bloc-Examples/BlMouseProcessorEnterLeaveExamples.class.st index 43d49a831..5a506e81b 100644 --- a/src/Bloc-Examples/BlMouseProcessorEnterLeaveExamples.class.st +++ b/src/Bloc-Examples/BlMouseProcessorEnterLeaveExamples.class.st @@ -6,29 +6,27 @@ Class { { #category : #'examples - scripter' } BlMouseProcessorEnterLeaveExamples >> mouseEnter [ - + + | aScripter | - aScripter := self scripter. aScripter element: self scripterElement. - - aScripter substeps: 'Mouse Enter' do: [ :aStep | - aStep mouseMove - by: 30@30. - - aStep mouseMove - by: 70@60. - + + aScripter substeps: 'Mouse Enter' do: [ :aStep | + aStep mouseMove by: 30 @ 30. + + aStep mouseMove by: 70 @ 60. + aStep check label: 'Check mouse enter fired'; value: [ :anElement | anElement mouseEnterCount ] equals: 1; onSelf. - + aStep check label: 'Check mouse over fired'; value: [ :anElement | anElement mouseOverCount ] equals: 1; onSelf. - + aStep check label: 'Check mouse move fired'; value: [ :anElement | anElement mouseMoveCount ] equals: 1; @@ -36,34 +34,36 @@ BlMouseProcessorEnterLeaveExamples >> mouseEnter [ aStep check label: 'Check entered targets'; - value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] equals: { aScripter element . aScripter root }; - onMouseProcessor. - ]. + value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] + equals: { + aScripter element. + aScripter root }; + onMouseProcessor ]. aScripter syncContinue. - + ^ aScripter ] { #category : #'examples - scripter' } BlMouseProcessorEnterLeaveExamples >> mouseLeave [ - + + | aScripter | - aScripter := self mouseEnter. - + aScripter substeps: 'Mouse Leave' do: [ :aStep | - aStep mouseMove by: 100@20. - + aStep mouseMove by: 100 @ 20. + aStep check label: 'Check mouse leave fired'; value: [ :anElement | anElement mouseLeaveCount ] equals: 1; onSelf. - + aStep check label: 'Check mouse out fired'; value: [ :anElement | anElement mouseOutCount ] equals: 1; onSelf. - + aStep check label: 'Check mouse move not fired'; value: [ :anElement | anElement mouseMoveCount ] equals: 1; @@ -71,61 +71,62 @@ BlMouseProcessorEnterLeaveExamples >> mouseLeave [ aStep check label: 'Check entered targets'; - value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] equals: { aScripter root }; - onMouseProcessor. - ]. - + value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] + equals: { aScripter root }; + onMouseProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - scripter' } BlMouseProcessorEnterLeaveExamples >> mouseLeaveDueToRemovalFromScene [ - + + | aScripter | - aScripter := self mouseEnter. - + aScripter substeps: 'Remove from scene graph' do: [ :aStep | aStep do block: [ :anElement | anElement removeFromParent ]; onSelf ]. - - aScripter substeps: 'Pulse one time to generate mouse leave events' do: [ :aStep | - aStep do - block: [ :theScripter | theScripter pulse ]; - onScripter ]. - + + aScripter + substeps: 'Pulse one time to generate mouse leave events' + do: [ :aStep | + aStep do + block: [ :theScripter | theScripter pulse ]; + onScripter ]. + aScripter substeps: 'Check that events are fired' do: [ :aStep | aStep check label: 'Check mouse leave fired'; value: [ :anElement | anElement mouseLeaveCount ] equals: 1; onSelf. - + aStep check label: 'Check mouse out fired'; value: [ :anElement | anElement mouseOutCount ] equals: 1; onSelf. - + aStep check label: 'Check mouse move not fired'; value: [ :anElement | anElement mouseMoveCount ] equals: 1; onSelf. - + aStep check label: 'Check entered targets'; - value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] equals: { aScripter root }; - onMouseProcessor. - - ]. - + value: [ :aMouseProcessor | aMouseProcessor enteredTargets ] + equals: { aScripter root }; + onMouseProcessor ]. + ^ aScripter syncContinue ] { #category : #'examples - scripter' } BlMouseProcessorEnterLeaveExamples >> scripterElement [ - - + + ^ BlExampleEventsCountingElement new - size: 100@75; - position: 50@50 + size: 100 @ 75; + position: 50 @ 50 ] diff --git a/src/Bloc-Examples/BlMouseProcessorExamples.class.st b/src/Bloc-Examples/BlMouseProcessorExamples.class.st index 870b81d7a..fcaf16aa0 100644 --- a/src/Bloc-Examples/BlMouseProcessorExamples.class.st +++ b/src/Bloc-Examples/BlMouseProcessorExamples.class.st @@ -4,16 +4,58 @@ I contain examples-tests of mouse processor " Class { #name : #BlMouseProcessorExamples, - #superclass : #BlEventProcessorExamples, + #superclass : #BlEventProcessorExamplesTest, #category : #'Bloc-Examples-Event' } +{ #category : #'instance creation' } +BlMouseProcessorExamples >> middleMouseDownEvent [ + + + ^ BlMouseDownEvent middle +] + +{ #category : #'instance creation' } +BlMouseProcessorExamples >> middleMouseUpEvent [ + + + ^ BlMouseUpEvent middle +] + +{ #category : #'instance creation' } +BlMouseProcessorExamples >> primaryMouseDownEvent [ + + + ^ BlMouseDownEvent primary +] + +{ #category : #'instance creation' } +BlMouseProcessorExamples >> primaryMouseUpEvent [ + + + ^ BlMouseUpEvent primary +] + +{ #category : #'instance creation' } +BlMouseProcessorExamples >> secondaryMouseDownEvent [ + + + ^ BlMouseDownEvent secondary +] + +{ #category : #'instance creation' } +BlMouseProcessorExamples >> secondaryMouseUpEvent [ + + + ^ BlMouseUpEvent secondary +] + { #category : #'examples - sequence' } -BlMouseProcessorExamples >> click [ - +BlMouseProcessorExamples >> testClick [ + + | aMouseProcessor | - - aMouseProcessor := self mouseProcessor. + aMouseProcessor := self testMouseProcessor. aMouseProcessor handleMouseDown: self primaryMouseDownEvent. aMouseProcessor handleMouseUp: self primaryMouseUpEvent. @@ -24,43 +66,30 @@ BlMouseProcessorExamples >> click [ ] { #category : #examples } -BlMouseProcessorExamples >> middleDown [ - +BlMouseProcessorExamples >> testMiddleDown [ + + | aMouseProcessor anEvent | - - aMouseProcessor := self mouseProcessor. + aMouseProcessor := self testMouseProcessor. anEvent := self middleMouseDownEvent. aMouseProcessor handleMouseDown: anEvent. self assert: aMouseProcessor pressedButtons size equals: 1. - self assert: (aMouseProcessor pressedButtons includes: BlMouseButton middle). + self assert: + (aMouseProcessor pressedButtons includes: BlMouseButton middle). ^ aMouseProcessor ] { #category : #'instance creation' } -BlMouseProcessorExamples >> middleMouseDownEvent [ - - - ^ BlMouseDownEvent middle -] - -{ #category : #'instance creation' } -BlMouseProcessorExamples >> middleMouseUpEvent [ - +BlMouseProcessorExamples >> testMouseProcessor [ - ^ BlMouseUpEvent middle -] - -{ #category : #'instance creation' } -BlMouseProcessorExamples >> mouseProcessor [ + | aMouseProcessor aSpace | - - aSpace := BlSpace new. aMouseProcessor := BlMouseProcessor space: aSpace. - + self assert: aMouseProcessor space equals: aSpace. self assert: aMouseProcessor pressedButtons isEmpty. @@ -68,60 +97,64 @@ BlMouseProcessorExamples >> mouseProcessor [ ] { #category : #examples } -BlMouseProcessorExamples >> primaryDown [ - +BlMouseProcessorExamples >> testPrimaryDown [ + + | aMouseProcessor anEvent | - - aMouseProcessor := self mouseProcessor. + aMouseProcessor := self testMouseProcessor. anEvent := self primaryMouseDownEvent. aMouseProcessor handleMouseDown: anEvent. self assert: aMouseProcessor pressedButtons size equals: 1. - self assert: (aMouseProcessor pressedButtons includes: BlMouseButton primary). + self assert: + (aMouseProcessor pressedButtons includes: BlMouseButton primary). ^ aMouseProcessor ] { #category : #examples } -BlMouseProcessorExamples >> primaryDownSecondaryDown [ - - | aMouseProcessor anEvent | +BlMouseProcessorExamples >> testPrimaryDownSecondaryDown [ - aMouseProcessor := self primaryDown. + + | aMouseProcessor anEvent | + aMouseProcessor := self testPrimaryDown. anEvent := self secondaryMouseDownEvent. aMouseProcessor handleMouseDown: anEvent. self assert: aMouseProcessor pressedButtons size equals: 2. - self assert: (aMouseProcessor pressedButtons includes: BlMouseButton primary). - self assert: (aMouseProcessor pressedButtons includes: BlMouseButton secondary). + self assert: + (aMouseProcessor pressedButtons includes: BlMouseButton primary). + self assert: + (aMouseProcessor pressedButtons includes: BlMouseButton secondary). ^ aMouseProcessor ] { #category : #examples } -BlMouseProcessorExamples >> primaryDownSecondaryDownPrimaryUp [ - - | aMouseProcessor anEvent | +BlMouseProcessorExamples >> testPrimaryDownSecondaryDownPrimaryUp [ - aMouseProcessor := self primaryDownSecondaryDown. + + | aMouseProcessor anEvent | + aMouseProcessor := self testPrimaryDownSecondaryDown. anEvent := self primaryMouseUpEvent. aMouseProcessor handleMouseUp: anEvent. self assert: aMouseProcessor pressedButtons size equals: 1. - self assert: (aMouseProcessor pressedButtons includes: BlMouseButton secondary). + self assert: + (aMouseProcessor pressedButtons includes: BlMouseButton secondary). ^ aMouseProcessor ] { #category : #examples } -BlMouseProcessorExamples >> primaryDownSecondaryDownPrimaryUpSecondaryUp [ - - | aMouseProcessor anEvent | +BlMouseProcessorExamples >> testPrimaryDownSecondaryDownPrimaryUpSecondaryUp [ - aMouseProcessor := self primaryDownSecondaryDownPrimaryUp. + + | aMouseProcessor anEvent | + aMouseProcessor := self testPrimaryDownSecondaryDownPrimaryUp. anEvent := self secondaryMouseUpEvent. aMouseProcessor handleMouseUp: anEvent. @@ -131,46 +164,19 @@ BlMouseProcessorExamples >> primaryDownSecondaryDownPrimaryUpSecondaryUp [ ^ aMouseProcessor ] -{ #category : #'instance creation' } -BlMouseProcessorExamples >> primaryMouseDownEvent [ - - - ^ BlMouseDownEvent primary -] - -{ #category : #'instance creation' } -BlMouseProcessorExamples >> primaryMouseUpEvent [ - - - ^ BlMouseUpEvent primary -] - { #category : #examples } -BlMouseProcessorExamples >> secondaryDown [ - +BlMouseProcessorExamples >> testSecondaryDown [ + + | aMouseProcessor anEvent | - - aMouseProcessor := self mouseProcessor. + aMouseProcessor := self testMouseProcessor. anEvent := self secondaryMouseDownEvent. aMouseProcessor handleMouseDown: anEvent. self assert: aMouseProcessor pressedButtons size equals: 1. - self assert: (aMouseProcessor pressedButtons includes: BlMouseButton secondary). + self assert: + (aMouseProcessor pressedButtons includes: BlMouseButton secondary). ^ aMouseProcessor ] - -{ #category : #'instance creation' } -BlMouseProcessorExamples >> secondaryMouseDownEvent [ - - - ^ BlMouseDownEvent secondary -] - -{ #category : #'instance creation' } -BlMouseProcessorExamples >> secondaryMouseUpEvent [ - - - ^ BlMouseUpEvent secondary -] diff --git a/src/Bloc-Examples/BlMouseWheelEventExamples.class.st b/src/Bloc-Examples/BlMouseWheelEventExamples.class.st deleted file mode 100644 index 9afc446d6..000000000 --- a/src/Bloc-Examples/BlMouseWheelEventExamples.class.st +++ /dev/null @@ -1,76 +0,0 @@ -Class { - #name : #BlMouseWheelEventExamples, - #superclass : #BlExampleTest, - #category : #'Bloc-Examples-Event' -} - -{ #category : #'examples - mouse wheel events' } -BlMouseWheelEventExamples >> basicMouseWheelEvent [ - - | anEvent | - anEvent := BlMouseWheelEvent new. - self assert: anEvent isConsumed not. - ^ anEvent -] - -{ #category : #'examples - elements' } -BlMouseWheelEventExamples >> element [ - - | anElement | - anElement := BlElement new. - - anElement - background: Color veryVeryLightGray; - border: (BlBorder paint: Color lightGray width: 1); - margin: (BlInsets all: 10); - constraintsDo: [ :c | - c horizontal matchParent. - c vertical matchParent ]. - - ^ anElement -] - -{ #category : #'examples - mouse wheel events' } -BlMouseWheelEventExamples >> mouseWheelEventWithVector: aVector [ - - | anEvent anElement | - anEvent := self basicMouseWheelEvent. - - anEvent vector: aVector. - anElement := self element. - anEvent target: anElement. - anEvent currentTarget: anElement. - - self assert: anEvent vector equals: aVector. - ^ anEvent -] - -{ #category : #'examples - mouse wheel events' } -BlMouseWheelEventExamples >> mouseWheelEvent_0degrees [ - - ^ self mouseWheelEventWithVector: (BlVector x: 10 y: 0). -] - -{ #category : #'examples - mouse wheel events' } -BlMouseWheelEventExamples >> mouseWheelEvent_180degrees [ - - ^ self mouseWheelEventWithVector: (BlVector x: -10 y: 0). -] - -{ #category : #'examples - mouse wheel events' } -BlMouseWheelEventExamples >> mouseWheelEvent_270degrees [ - - ^ self mouseWheelEventWithVector: (BlVector x: 0 y: -10). -] - -{ #category : #'examples - mouse wheel events' } -BlMouseWheelEventExamples >> mouseWheelEvent_346degrees [ - - ^ self mouseWheelEventWithVector: (BlVector x: 4 y: -1). -] - -{ #category : #'examples - mouse wheel events' } -BlMouseWheelEventExamples >> mouseWheelEvent_45degrees [ - - ^ self mouseWheelEventWithVector: (BlVector x: 10 y: 10). -] diff --git a/src/Bloc-Examples/BlMouseWheelEventExamplesTest.class.st b/src/Bloc-Examples/BlMouseWheelEventExamplesTest.class.st new file mode 100644 index 000000000..c8314e1e9 --- /dev/null +++ b/src/Bloc-Examples/BlMouseWheelEventExamplesTest.class.st @@ -0,0 +1,103 @@ +Class { + #name : #BlMouseWheelEventExamplesTest, + #superclass : #TestCase, + #category : #'Bloc-Examples-Event' +} + +{ #category : #'examples - elements' } +BlMouseWheelEventExamplesTest >> element [ + + + | anElement | + anElement := BlElement new. + + anElement + background: Color veryVeryLightGray; + border: (BlBorder paint: Color lightGray width: 1); + margin: (BlInsets all: 10); + constraintsDo: [ :c | + c horizontal matchParent. + c vertical matchParent ]. + + ^ anElement +] + +{ #category : #'examples - mouse wheel events' } +BlMouseWheelEventExamplesTest >> mouseWheelEventWithVector: aVector [ + + + | anEvent anElement | + anEvent := self testBasicMouseWheelEvent. + + anEvent vector: aVector. + anElement := self element. + anEvent target: anElement. + anEvent currentTarget: anElement. + + ^ anEvent +] + +{ #category : #'examples - mouse wheel events' } +BlMouseWheelEventExamplesTest >> testBasicMouseWheelEvent [ + + + | anEvent | + anEvent := BlMouseWheelEvent new. + self assert: anEvent isConsumed not. + ^ anEvent +] + +{ #category : #'examples - mouse wheel events' } +BlMouseWheelEventExamplesTest >> testMouseWheelEvent_0degrees [ + + + | vector event | + vector := BlVector x: 10 y: 0. + event := self mouseWheelEventWithVector: vector. + self assert: event vector equals: vector. + ^ event +] + +{ #category : #'examples - mouse wheel events' } +BlMouseWheelEventExamplesTest >> testMouseWheelEvent_180degrees [ + + + | vector event | + vector := BlVector x: -10 y: 0. + event := self mouseWheelEventWithVector: vector. + self assert: event vector equals: vector. + ^ event +] + +{ #category : #'examples - mouse wheel events' } +BlMouseWheelEventExamplesTest >> testMouseWheelEvent_270degrees [ + + + | vector event | + vector := BlVector x: 0 y: -10. + event := self mouseWheelEventWithVector: vector. + self assert: event vector equals: vector. + ^ event +] + +{ #category : #'examples - mouse wheel events' } +BlMouseWheelEventExamplesTest >> testMouseWheelEvent_346degrees [ + + + | vector event | + vector := BlVector x: 4 y: -1. + event := self mouseWheelEventWithVector: vector. + self assert: event vector equals: vector. + ^ event +] + +{ #category : #'examples - mouse wheel events' } +BlMouseWheelEventExamplesTest >> testMouseWheelEvent_45degrees [ + + + | vector event | + vector := BlVector x: 10 y: 10. + event := self mouseWheelEventWithVector: vector. + self assert: event vector equals: vector. + ^ event +] diff --git a/src/Bloc-Examples/BlRopeIteratorExamples.class.st b/src/Bloc-Examples/BlRopeIteratorExamplesTest.class.st similarity index 63% rename from src/Bloc-Examples/BlRopeIteratorExamples.class.st rename to src/Bloc-Examples/BlRopeIteratorExamplesTest.class.st index e082f79a1..ba0ac3717 100644 --- a/src/Bloc-Examples/BlRopeIteratorExamples.class.st +++ b/src/Bloc-Examples/BlRopeIteratorExamplesTest.class.st @@ -3,64 +3,78 @@ I contain examples of rope iterators " Class { - #name : #BlRopeIteratorExamples, - #superclass : #Object, + #name : #BlRopeIteratorExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Rope' } { #category : #'examples - next span' } -BlRopeIteratorExamples >> nextSpanFontColorOnA [ - +BlRopeIteratorExamplesTest >> testNextSpanFontColorOnA [ + + | aRope anIterator aSpan | - aRope := BlCollectionRope collection: 'A'. anIterator := aRope iterator. - aSpan := anIterator nextSpan: [ :eachAttribute| eachAttribute isKindOf: BlTextForegroundAttribute ]. - + aSpan := anIterator nextSpan: [ :eachAttribute | + eachAttribute isKindOf: BlTextForegroundAttribute ]. + self assert: aSpan == aRope. self assert: anIterator hasNext not. - + ^ aSpan ] { #category : #'examples - next span' } -BlRopeIteratorExamples >> nextSpanFontColorOnAWithColor [ - - | aRope anIterator aSpan | +BlRopeIteratorExamplesTest >> testNextSpanFontColorOnAWithColor [ - aRope := (BlCollectionRope collection: 'A') attributes: { BlTextForegroundAttribute paint: Color red }. + + | aRope anIterator aSpan | + aRope := (BlCollectionRope collection: 'A') attributes: + { (BlTextForegroundAttribute paint: Color red) }. anIterator := aRope iterator. - aSpan := anIterator nextSpan: [ :eachAttribute| eachAttribute isKindOf: BlTextForegroundAttribute ]. - + aSpan := anIterator nextSpan: [ :eachAttribute | + eachAttribute isKindOf: BlTextForegroundAttribute ]. + self assert: aSpan == aRope. self assert: anIterator hasNext not. - + ^ aSpan ] { #category : #'examples - next span' } -BlRopeIteratorExamples >> nextSpanFontColorOnHelloWorldWithColor [ - - | aRope anIterator aSpan | +BlRopeIteratorExamplesTest >> testNextSpanFontColorOnHelloWorldWithColor [ - aRope := (BlCollectionRope collection: 'Hello World'). - aRope := aRope attributes: { BlTextForegroundAttribute paint: Color red } from: 0 to: 5. - aRope := aRope attributes: { BlTextForegroundAttribute paint: Color blue } from: 6 to: 11. + + | aRope anIterator aSpan | + aRope := BlCollectionRope collection: 'Hello World'. + aRope := aRope + attributes: + { (BlTextForegroundAttribute paint: Color red) } + from: 0 + to: 5. + aRope := aRope + attributes: + { (BlTextForegroundAttribute paint: Color blue) } + from: 6 + to: 11. anIterator := aRope iterator. - - aSpan := anIterator nextSpan: [ :eachAttribute| eachAttribute isKindOf: BlTextForegroundAttribute ]. + + aSpan := anIterator nextSpan: [ :eachAttribute | + eachAttribute isKindOf: BlTextForegroundAttribute ]. self assert: aSpan == aRope left. self assert: anIterator hasNext. self assert: aSpan asString equals: 'Hello'. - - aSpan := anIterator nextSpan: [ :eachAttribute| eachAttribute isKindOf: BlTextForegroundAttribute ]. + + aSpan := anIterator nextSpan: [ :eachAttribute | + eachAttribute isKindOf: BlTextForegroundAttribute ]. self assert: aSpan == aRope right left. self assert: anIterator hasNext. self assert: aSpan asString equals: ' '. - - aSpan := anIterator nextSpan: [ :eachAttribute| eachAttribute isKindOf: BlTextForegroundAttribute ]. + + aSpan := anIterator nextSpan: [ :eachAttribute | + eachAttribute isKindOf: BlTextForegroundAttribute ]. self assert: aSpan == aRope right right. self assert: anIterator hasNext not. self assert: aSpan asString equals: 'World'. @@ -69,236 +83,240 @@ BlRopeIteratorExamples >> nextSpanFontColorOnHelloWorldWithColor [ ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_123Cr_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_123Cr_at_0 [ + + | anIterator | - - anIterator := (BlCollectionRope collection: '123', String cr) iterator. - + anIterator := (BlCollectionRope collection: '123' , String cr) + iterator. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 3. self assert: anEndDelimiter equals: 4 ]. self assert: anIterator position equals: 4. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_123Crabc_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_123Crabc_at_0 [ + + | anIterator | - - anIterator := (BlCollectionRope collection: '123', String cr, 'abc') iterator. - + anIterator := (BlCollectionRope collection: '123' , String cr , 'abc') + iterator. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 3. self assert: anEndDelimiter equals: 4 ]. self assert: anIterator position equals: 4. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_123Crabc_at_4 [ - +BlRopeIteratorExamplesTest >> testNext_line_123Crabc_at_4 [ + + | anIterator | - - anIterator := self next_line_123Crabc_at_0. - + anIterator := self testNext_line_123Crabc_at_0. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 4. self assert: anEnd equals: 7. self assert: anEndDelimiter equals: 7 ]. self assert: anIterator position equals: 7. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_123_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_123_at_0 [ + + | anIterator | - anIterator := (BlCollectionRope collection: '123') iterator. - + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 3. self assert: anEndDelimiter equals: 3 ]. self assert: anIterator position equals: 3. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_Cr123_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_Cr123_at_0 [ + + | anIterator | - - anIterator := (BlCollectionRope collection: String cr, '123') iterator. - + anIterator := (BlCollectionRope collection: String cr , '123') + iterator. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 0. self assert: anEndDelimiter equals: 1 ]. self assert: anIterator position equals: 1. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_Cr123_at_1 [ - +BlRopeIteratorExamplesTest >> testNext_line_Cr123_at_1 [ + + | anIterator | - - anIterator := self next_line_Cr123_at_0. - + anIterator := self testNext_line_Cr123_at_0. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 1. self assert: anEnd equals: 4. self assert: anEndDelimiter equals: 4 ]. self assert: anIterator position equals: 4. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_Cr1_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_Cr1_at_0 [ + + | anIterator | - - anIterator := (BlCollectionRope collection: String cr, '1') iterator. - + anIterator := (BlCollectionRope collection: String cr , '1') iterator. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 0. self assert: anEndDelimiter equals: 1 ]. self assert: anIterator position equals: 1. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_Cr1_at_1 [ - +BlRopeIteratorExamplesTest >> testNext_line_Cr1_at_1 [ + + | anIterator | - - anIterator := self next_line_Cr1_at_0. - + anIterator := self testNext_line_Cr1_at_0. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 1. self assert: anEnd equals: 2. self assert: anEndDelimiter equals: 2 ]. self assert: anIterator position equals: 2. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_CrCr_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_CrCr_at_0 [ + + | anIterator | - - anIterator := (BlCollectionRope collection: String cr, String cr) iterator. - + anIterator := (BlCollectionRope collection: String cr , String cr) + iterator. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 0. self assert: anEndDelimiter equals: 1 ]. self assert: anIterator position equals: 1. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_CrCr_at_1 [ - +BlRopeIteratorExamplesTest >> testNext_line_CrCr_at_1 [ + + | anIterator | - - anIterator := self next_line_CrCr_at_0. - + anIterator := self testNext_line_CrCr_at_0. + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 1. self assert: anEnd equals: 1. self assert: anEndDelimiter equals: 2 ]. self assert: anIterator position equals: 2. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_CrLf_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_CrLf_at_0 [ + + | anIterator | - anIterator := (BlCollectionRope collection: String crlf) iterator. - + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 0. self assert: anEndDelimiter equals: 2 ]. self assert: anIterator position equals: 2. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_Cr_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_Cr_at_0 [ + + | anIterator | - anIterator := (BlCollectionRope collection: String cr) iterator. - + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 0. self assert: anEndDelimiter equals: 1 ]. self assert: anIterator position equals: 1. - + ^ anIterator ] { #category : #'examples - next line' } -BlRopeIteratorExamples >> next_line_Lf_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_line_Lf_at_0 [ + + | anIterator | - anIterator := (BlCollectionRope collection: String lf) iterator. - + anIterator nextLineIndicesDo: [ :aStart :anEnd :anEndDelimiter | self assert: aStart equals: 0. self assert: anEnd equals: 0. self assert: anEndDelimiter equals: 1 ]. self assert: anIterator position equals: 1. - + ^ anIterator ] { #category : #'examples - next segment' } -BlRopeIteratorExamples >> next_segment_123abc_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_segment_123abc_at_0 [ + + | aRope anIterator aSegment | - aRope := BlCollectionRope collection: '123abc'. anIterator := aRope iterator. - + aSegment := anIterator nextSegment: [ :aChar | aChar isDigit ]. - + self assert: aSegment collection equals: '123'. self assert: anIterator position equals: 3. @@ -306,14 +324,14 @@ BlRopeIteratorExamples >> next_segment_123abc_at_0 [ ] { #category : #'examples - next segment' } -BlRopeIteratorExamples >> next_segment_123abc_at_3 [ - +BlRopeIteratorExamplesTest >> testNext_segment_123abc_at_3 [ + + | anIterator aSegment | + anIterator := self testNext_segment_123abc_at_0. - anIterator := self next_segment_123abc_at_0. - aSegment := anIterator nextSegment: [ :aChar | aChar isDigit ]. - + self assert: aSegment collection equals: 'abc'. self assert: anIterator position equals: 6. @@ -321,31 +339,33 @@ BlRopeIteratorExamples >> next_segment_123abc_at_3 [ ] { #category : #'examples - next segment' } -BlRopeIteratorExamples >> next_segment_123abc_at_6 [ - - +BlRopeIteratorExamplesTest >> testNext_segment_123abc_at_6 [ + "Iterator throws an error when the end is reached" + + | anIterator anError | + anIterator := self testNext_segment_123abc_at_3. - anIterator := self next_segment_123abc_at_3. - anError := nil. - [ anIterator nextSegment: [ :aChar | aChar isDigit ]. ] on: Error do: [ :e | anError := e ]. - + [ anIterator nextSegment: [ :aChar | aChar isDigit ] ] + on: Error + do: [ :e | anError := e ]. + self assert: anError isNotNil. ^ anIterator ] { #category : #'examples - next segment' } -BlRopeIteratorExamples >> next_segment_a_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_segment_a_at_0 [ + + | aRope anIterator aSegment | - aRope := BlCollectionRope collection: 'a'. anIterator := aRope iterator. - + aSegment := anIterator nextSegment: [ :aChar | aChar isDigit ]. - + self assert: aSegment collection equals: 'a'. self assert: anIterator position equals: 1. @@ -353,15 +373,15 @@ BlRopeIteratorExamples >> next_segment_a_at_0 [ ] { #category : #'examples - next segment' } -BlRopeIteratorExamples >> next_segment_abc_at_0 [ - +BlRopeIteratorExamplesTest >> testNext_segment_abc_at_0 [ + + | aRope anIterator aSegment | - aRope := BlCollectionRope collection: 'abc'. anIterator := aRope iterator. - + aSegment := anIterator nextSegment: [ :aChar | aChar isDigit ]. - + self assert: aSegment collection equals: 'abc'. self assert: anIterator position equals: 3. diff --git a/src/Bloc-Examples/BlSharedEventDistributorExamples.class.st b/src/Bloc-Examples/BlSharedEventDistributorExamples.class.st index ce0aa60ad..dfe172667 100644 --- a/src/Bloc-Examples/BlSharedEventDistributorExamples.class.st +++ b/src/Bloc-Examples/BlSharedEventDistributorExamples.class.st @@ -10,57 +10,77 @@ Class { { #category : #'instance creation' } BlSharedEventDistributorExamples >> container [ - + + ^ self element - layout: BlLinearLayout horizontal; - background: Color veryLightGray lighter; - constraintsDo: [ :c | - c horizontal fitContent. - c vertical fitContent. - c margin: (BlInsets all: 3). - c padding: (BlInsets all: 3). - ] + layout: BlLinearLayout horizontal; + background: Color veryLightGray lighter; + constraintsDo: [ :c | + c horizontal fitContent. + c vertical fitContent. + c margin: (BlInsets all: 3). + c padding: (BlInsets all: 3) ] ] { #category : #'instance creation' } BlSharedEventDistributorExamples >> element [ - + + ^ BlElement new ] { #category : #'instance creation' } BlSharedEventDistributorExamples >> element100x100 [ - + + | aBackgroundColor aHighlightColor anElement | aBackgroundColor := self randomColor. aHighlightColor := aBackgroundColor darker. anElement := self element. ^ anElement - size: 100@100; - background: aBackgroundColor; - margin: (BlInsets all: 3); - addEventHandlerOn: BlClickEvent do: [ :anEvent | anElement background: Color random ]; - addEventHandlerOn: BlMouseEnterEvent do: [ :anEvent | anElement background: aHighlightColor ]; - addEventHandlerOn: BlMouseLeaveEvent do: [ :anEvent | anElement background: aBackgroundColor ]. + size: 100 @ 100; + background: aBackgroundColor; + margin: (BlInsets all: 3); + addEventHandlerOn: BlClickEvent + do: [ :anEvent | anElement background: Color random ]; + addEventHandlerOn: BlMouseEnterEvent + do: [ :anEvent | anElement background: aHighlightColor ]; + addEventHandlerOn: BlMouseLeaveEvent + do: [ :anEvent | anElement background: aBackgroundColor ] ] { #category : #'examples - sharing events' } BlSharedEventDistributorExamples >> example [ - + + | aHandler anElements aContainer | - aHandler := self installTwoElements. + aHandler := self testInstallTwoElements. anElements := aHandler elements. aContainer := self container. aContainer addChildren: anElements. - aHandler shareEvents: { BlMouseEnterEvent. BlMouseLeaveEvent. BlClickEvent }. + aHandler shareEvents: { + BlMouseEnterEvent. + BlMouseLeaveEvent. + BlClickEvent }. ^ aContainer ] +{ #category : #'instance creation' } +BlSharedEventDistributorExamples >> randomColor [ + + + ^ { + Color green. + Color yellow. + Color red } atRandom +] + { #category : #'examples - basic' } -BlSharedEventDistributorExamples >> installOneElement [ - +BlSharedEventDistributorExamples >> testInstallOneElement [ + + | aHandler anElement | - aHandler := self sharedEventDistributor. + aHandler := self testSharedEventDistributor. anElement := self element100x100. anElement addEventHandler: aHandler. self assert: aHandler elements size equals: 1. @@ -68,10 +88,11 @@ BlSharedEventDistributorExamples >> installOneElement [ ] { #category : #'examples - basic' } -BlSharedEventDistributorExamples >> installTwoElements [ - +BlSharedEventDistributorExamples >> testInstallTwoElements [ + + | aHandler anElement | - aHandler := self installOneElement. + aHandler := self testInstallOneElement. anElement := self element100x100. anElement addEventHandler: aHandler. self assert: aHandler elements size equals: 2. @@ -79,45 +100,60 @@ BlSharedEventDistributorExamples >> installTwoElements [ ] { #category : #'examples - sharing events' } -BlSharedEventDistributorExamples >> mouseEnterEventOneOutOfTwoElements [ - +BlSharedEventDistributorExamples >> testMouseEnterEventOneOutOfTwoElements [ + + | aHandler anElements aContainer aMouseEnterTwo aMouseEnterOne anElementOne anElementTwo | aMouseEnterOne := aMouseEnterTwo := 0. - aHandler := self installTwoElements. + aHandler := self testInstallTwoElements. anElements := aHandler elements. aContainer := self container. aContainer addChildren: anElements. anElementOne := anElements first. anElementTwo := anElements second. - aHandler shareEvents: { BlMouseEnterEvent. BlMouseLeaveEvent. BlClickEvent }. - anElementOne when: BlMouseEnterEvent do: [ aMouseEnterOne := aMouseEnterOne + 1 ]. - anElementTwo when: BlMouseEnterEvent do: [ aMouseEnterTwo := aMouseEnterTwo + 1 ]. - - BlSpace simulateMouseMoveInside: anElementOne. + aHandler shareEvents: { + BlMouseEnterEvent. + BlMouseLeaveEvent. + BlClickEvent }. + anElementOne + when: BlMouseEnterEvent + do: [ aMouseEnterOne := aMouseEnterOne + 1 ]. + anElementTwo + when: BlMouseEnterEvent + do: [ aMouseEnterTwo := aMouseEnterTwo + 1 ]. + + BlOSpace simulateMouseMoveInside: anElementOne. self assert: aMouseEnterOne equals: 1. self assert: aMouseEnterTwo equals: 1. - + ^ aContainer ] { #category : #'examples - sharing events' } -BlSharedEventDistributorExamples >> mouseLeaveEventOneOutOfTwoElements [ - +BlSharedEventDistributorExamples >> testMouseLeaveEventOneOutOfTwoElements [ + | aHandler anElements aContainer aMouseLeaveTwo aMouseLeaveOne anElementOne anElementTwo | aMouseLeaveOne := aMouseLeaveTwo := 0. - aHandler := self installTwoElements. + aHandler := self testInstallTwoElements. anElements := aHandler elements. aContainer := self container. aContainer addChildren: anElements. anElementOne := anElements first. anElementTwo := anElements second. - aHandler shareEvents: { BlMouseEnterEvent. BlMouseLeaveEvent. BlClickEvent }. - anElementOne when: BlMouseLeaveEvent do: [ aMouseLeaveOne := aMouseLeaveOne + 1 ]. - anElementTwo when: BlMouseLeaveEvent do: [ aMouseLeaveTwo := aMouseLeaveTwo + 1 ]. + aHandler shareEvents: { + BlMouseEnterEvent. + BlMouseLeaveEvent. + BlClickEvent }. + anElementOne + when: BlMouseLeaveEvent + do: [ aMouseLeaveOne := aMouseLeaveOne + 1 ]. + anElementTwo + when: BlMouseLeaveEvent + do: [ aMouseLeaveTwo := aMouseLeaveTwo + 1 ]. BlSpace simulateEvents: { @@ -133,19 +169,14 @@ BlSharedEventDistributorExamples >> mouseLeaveEventOneOutOfTwoElements [ self assert: aMouseLeaveOne equals: 1. self assert: aMouseLeaveTwo equals: 1. - + ^ aContainer ] { #category : #'instance creation' } -BlSharedEventDistributorExamples >> randomColor [ - - ^ { Color green. Color yellow. Color red } atRandom -] +BlSharedEventDistributorExamples >> testSharedEventDistributor [ -{ #category : #'instance creation' } -BlSharedEventDistributorExamples >> sharedEventDistributor [ - + | aHandler | aHandler := BlSharedEventDistributor new. self assert: aHandler elements isEmpty. @@ -153,10 +184,11 @@ BlSharedEventDistributorExamples >> sharedEventDistributor [ ] { #category : #'examples - basic' } -BlSharedEventDistributorExamples >> uninstallOneElement [ - +BlSharedEventDistributorExamples >> testUninstallOneElement [ + + | aHandler anElement | - aHandler := self installOneElement. + aHandler := self testInstallOneElement. anElement := aHandler elements anyOne. anElement removeEventHandler: aHandler. self assert: aHandler elements size equals: 0. diff --git a/src/Bloc-Examples/BlSingleKeyCombinationExamples.class.st b/src/Bloc-Examples/BlSingleKeyCombinationExamples.class.st index 7fb07d095..588def170 100644 --- a/src/Bloc-Examples/BlSingleKeyCombinationExamples.class.st +++ b/src/Bloc-Examples/BlSingleKeyCombinationExamples.class.st @@ -1,33 +1,36 @@ Class { #name : #BlSingleKeyCombinationExamples, - #superclass : #BlKeyCombinationExamples, + #superclass : #BlKeyCombinationExamplesTest, #category : #'Bloc-Examples-KeyBinding' } { #category : #'examples - combination' } -BlSingleKeyCombinationExamples >> arrowLeftCombination [ - +BlSingleKeyCombinationExamples >> testArrowLeftCombination [ + + | aKeyCombination | - aKeyCombination := self arrowLeft asKeyCombination. self assert: (aKeyCombination isKindOf: BlSingleKeyCombination). self assert: aKeyCombination key equals: self arrowLeft. - + ^ aKeyCombination ] { #category : #'examples - store' } -BlSingleKeyCombinationExamples >> storeArrowLeftCombination [ - +BlSingleKeyCombinationExamples >> testStoreArrowLeftCombination [ + + | aKeyCombination aStoreString aRestoredKeyCombination | - - aKeyCombination := self arrowLeftCombination. + aKeyCombination := self testArrowLeftCombination. aStoreString := aKeyCombination storeString. - - self assert: aStoreString equals: '(BlKeyboardKey new setName: #ArrowLeft; setValue: nil) asKeyCombination'. - + + self + assert: aStoreString + equals: + '(BlKeyboardKey new setName: #ArrowLeft; setValue: nil) asKeyCombination'. + aRestoredKeyCombination := Object evaluate: aStoreString. self assert: aRestoredKeyCombination equals: aKeyCombination. - + ^ aStoreString ] diff --git a/src/Bloc-Examples/BlSpaceEventExamples.class.st b/src/Bloc-Examples/BlSpaceEventExamplesTest.class.st similarity index 51% rename from src/Bloc-Examples/BlSpaceEventExamples.class.st rename to src/Bloc-Examples/BlSpaceEventExamplesTest.class.st index 109dac1b1..d10134023 100644 --- a/src/Bloc-Examples/BlSpaceEventExamples.class.st +++ b/src/Bloc-Examples/BlSpaceEventExamplesTest.class.st @@ -3,93 +3,101 @@ I contain examples of space related events " Class { - #name : #BlSpaceEventExamples, - #superclass : #BlExampleTest, + #name : #BlSpaceEventExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Event' } +{ #category : #'instance creation' } +BlSpaceEventExamplesTest >> space [ + + + ^ BlSpace new host: BlHeadlessHost new +] + { #category : #'event handling' } -BlSpaceEventExamples >> ignoreSpaceEventsAfterCloseRequest [ - +BlSpaceEventExamplesTest >> testIgnoreSpaceEventsAfterCloseRequest [ + + | aSpace | - aSpace := self space. aSpace eventRecorder: BlMemoryEventRecorder new. aSpace show. - aSpace hostSpace enqueueEvent: (BlSpaceCloseRequest new timestamp: DateAndTime now). + aSpace hostSpace enqueueEvent: + (BlSpaceCloseRequest new timestamp: DateAndTime now). self assert: aSpace hasHostSpace not. ^ aSpace ] -{ #category : #'instance creation' } -BlSpaceEventExamples >> space [ - - - ^ BlSpace new - host: BlHeadlessHost new; - yourself -] - { #category : #'show / close' } -BlSpaceEventExamples >> spaceClosed [ - +BlSpaceEventExamplesTest >> testSpaceClosed [ + + | aSpace spaceClosed | spaceClosed := 0. - + aSpace := self space. - aSpace addEventHandlerOn: BlSpaceClosedEvent do: [ spaceClosed := spaceClosed + 1 ]. - + aSpace + addEventHandlerOn: BlSpaceClosedEvent + do: [ spaceClosed := spaceClosed + 1 ]. + aSpace show. self assert: spaceClosed equals: 0. aSpace close. self assert: spaceClosed equals: 1. - + ^ aSpace ] { #category : #'show / close' } -BlSpaceEventExamples >> spaceDestroyed [ - +BlSpaceEventExamplesTest >> testSpaceDestroyed [ + + | aSpace events | events := OrderedCollection new. - + aSpace := self space. - aSpace addEventHandlerOn: BlSpaceClosedEvent do: [ - events add: #closed ]. - aSpace addEventHandlerOn: BlSpaceDestroyedEvent do: [ - events add: #destroyed ]. - + aSpace + addEventHandlerOn: BlSpaceClosedEvent + do: [ events add: #closed ]. + aSpace + addEventHandlerOn: BlSpaceDestroyedEvent + do: [ events add: #destroyed ]. + aSpace show. self assert: events size equals: 0. aSpace close. self assert: events size equals: 2. - self assert: events asArray equals: #(closed destroyed). - + self assert: events asArray equals: #( closed destroyed ). + ^ aSpace ] { #category : #'show / close' } -BlSpaceEventExamples >> spaceShown [ - +BlSpaceEventExamplesTest >> testSpaceShown [ + + | aSpace spaceShown | spaceShown := 0. - + aSpace := self space. - aSpace addEventHandlerOn: BlSpaceShownEvent do: [ spaceShown := spaceShown + 1 ]. + aSpace + addEventHandlerOn: BlSpaceShownEvent + do: [ spaceShown := spaceShown + 1 ]. aSpace show. self assert: spaceShown equals: 1. aSpace close. self assert: spaceShown equals: 1. - - + + ^ aSpace ] diff --git a/src/Bloc-Examples/BlSpaceExamplesMigrated.class.st b/src/Bloc-Examples/BlSpaceExamplesMigratedTest.class.st similarity index 69% rename from src/Bloc-Examples/BlSpaceExamplesMigrated.class.st rename to src/Bloc-Examples/BlSpaceExamplesMigratedTest.class.st index 76ba7660d..a15865328 100644 --- a/src/Bloc-Examples/BlSpaceExamplesMigrated.class.st +++ b/src/Bloc-Examples/BlSpaceExamplesMigratedTest.class.st @@ -2,13 +2,13 @@ I contain example of how to use space " Class { - #name : #BlSpaceExamplesMigrated, - #superclass : #Object, + #name : #BlSpaceExamplesMigratedTest, + #superclass : #TestCase, #category : #'Bloc-Examples-SpaceMigrated' } { #category : #script } -BlSpaceExamplesMigrated class >> slownDownSpace [ +BlSpaceExamplesMigratedTest class >> slownDownSpace [ self new spaceWithSlownDownTimeAndAnimatedElement @@ -17,44 +17,76 @@ BlSpaceExamplesMigrated class >> slownDownSpace [ ] { #category : #'private - instance creation' } -BlSpaceExamplesMigrated >> animatedElement [ - - +BlSpaceExamplesMigratedTest >> animatedElement [ + + + ^ BlElement new + background: Color blue; + size: 150 @ 150; + position: 100 @ 100; + addAnimation: self testInfiniteAnimation +] + +{ #category : #'examples - icon' } +BlSpaceExamplesMigratedTest >> iconElement [ + ^ BlElement new - background: Color blue; - size: 150@150; - position: 100@100; - addAnimation: self infiniteAnimation + size: 16@16; + background: (Color green alpha: 0.5); + geometry: BlCircleGeometry new. ] { #category : #'examples - icon' } -BlSpaceExamplesMigrated >> changeIcon [ - +BlSpaceExamplesMigratedTest >> iconStencil [ + + | aStencil | + aStencil := BlSpaceIconDummyStencil new. + aStencil block: [ self iconElement ]. + ^ aStencil +] + +{ #category : #'examples - time' } +BlSpaceExamplesMigratedTest >> spaceWithSlownDownTimeAndAnimatedElement [ + + + | aSpace | + aSpace := self spaceWithSlownDownTime. + aSpace root addChild: self animatedElement. + + ^ aSpace +] + +{ #category : #'examples - icon' } +BlSpaceExamplesMigratedTest >> testChangeIcon [ + + | aSpace aCollection | - aSpace := self emptySpace. - + aSpace := self testEmptySpace. + aCollection := OrderedCollection new. - aSpace - when: BlSpaceIconChangedEvent + aSpace + when: BlSpaceIconChangedEvent do: [ :anEvent | aCollection add: anEvent ]. - + aSpace icon: self iconStencil. - + self assert: aCollection size equals: 1. self assert: aCollection first class equals: BlSpaceIconChangedEvent. - self assert: aCollection first iconStencil class equals: BlSpaceIconDummyStencil. - + self + assert: aCollection first iconStencil class + equals: BlSpaceIconDummyStencil. + aSpace icon: aSpace icon. self assert: aCollection size equals: 1. - + ^ aSpace ] { #category : #'instance creation' } -BlSpaceExamplesMigrated >> emptySpace [ - +BlSpaceExamplesMigratedTest >> testEmptySpace [ + + | aSpace | - aSpace := BlOSpace new. self assert: aSpace session equals: Smalltalk session. self assert: aSpace root hasChildren not. @@ -62,7 +94,7 @@ BlSpaceExamplesMigrated >> emptySpace [ self assert: aSpace extent equals: aSpace defaultExtent. self assert: aSpace height equals: aSpace defaultExtent y. self assert: aSpace width equals: aSpace defaultExtent x. - self assert: aSpace position equals: 0@0. + self assert: aSpace position equals: 0 @ 0. self assert: aSpace resizable. self assert: aSpace borderless not. self assert: aSpace fullscreen not. @@ -79,58 +111,29 @@ BlSpaceExamplesMigrated >> emptySpace [ ] { #category : #lifecycle } -BlSpaceExamplesMigrated >> firstPulse [ - +BlSpaceExamplesMigratedTest >> testFirstPulse [ + + | aSpace | - - aSpace := self emptySpace. + aSpace := self testEmptySpace. aSpace pulse. - + self deny: aSpace hasDirtyElements. - self assert: aSpace root position equals: 0@0. + self assert: aSpace root position equals: 0 @ 0. self assert: aSpace root extent equals: aSpace extent. ^ aSpace ] -{ #category : #'examples - icon' } -BlSpaceExamplesMigrated >> iconElement [ - - ^ BlElement new - size: 16@16; - background: (Color green alpha: 0.5); - geometry: BlCircleGeometry new. -] - -{ #category : #'examples - icon' } -BlSpaceExamplesMigrated >> iconStencil [ - - | aStencil | - aStencil := BlSpaceIconDummyStencil new. - aStencil block: [ self iconElement ]. - ^ aStencil -] - { #category : #'private - instance creation' } -BlSpaceExamplesMigrated >> infiniteAnimation [ +BlSpaceExamplesMigratedTest >> testInfiniteAnimation [ + | anAnimation | - anAnimation := BlSequentialAnimation new. anAnimation add: (BlTransformAnimation scale: 2) absolute. anAnimation add: (BlTransformAnimation scale: 0.5) absolute. anAnimation beInfinite. - - ^ anAnimation -] -{ #category : #'examples - time' } -BlSpaceExamplesMigrated >> spaceWithSlownDownTimeAndAnimatedElement [ - - | aSpace | - - aSpace := self spaceWithSlownDownTime. - aSpace root addChild: self animatedElement. - - ^ aSpace + ^ anAnimation ] diff --git a/src/Bloc-Examples/BlSubRopeExamples.class.st b/src/Bloc-Examples/BlSubRopeExamplesTest.class.st similarity index 60% rename from src/Bloc-Examples/BlSubRopeExamples.class.st rename to src/Bloc-Examples/BlSubRopeExamplesTest.class.st index d34d981b1..1a8be42c7 100644 --- a/src/Bloc-Examples/BlSubRopeExamples.class.st +++ b/src/Bloc-Examples/BlSubRopeExamplesTest.class.st @@ -1,15 +1,15 @@ Class { - #name : #BlSubRopeExamples, - #superclass : #BlExampleTest, + #name : #BlSubRopeExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Examples-Rope' } { #category : #'examples - attributes' } -BlSubRopeExamples >> attributes_empty_0_to_0 [ - +BlSubRopeExamplesTest >> testAttributes_empty_0_to_0 [ + + | aRope anAttributedRope | - - aRope := self small_empty. + aRope := self testSmall_empty. anAttributedRope := aRope attributes: { 1 } from: 0 to: 0. self assert: anAttributedRope isNotEmpty. @@ -20,11 +20,11 @@ BlSubRopeExamples >> attributes_empty_0_to_0 [ ] { #category : #'examples - attributes' } -BlSubRopeExamples >> attributes_small_0_to_0 [ - +BlSubRopeExamplesTest >> testAttributes_small_0_to_0 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 0. self assert: anAttributedRope left attributes equals: { 1 }. @@ -36,15 +36,15 @@ BlSubRopeExamples >> attributes_small_0_to_0 [ ] { #category : #'examples - attributes' } -BlSubRopeExamples >> attributes_small_0_to_1 [ - +BlSubRopeExamplesTest >> testAttributes_small_0_to_1 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 1. self assert: anAttributedRope left attributes equals: { 1 }. - + self assert: anAttributedRope left attributes equals: { 1 }. self assert: anAttributedRope left rope size equals: 1. self assert: anAttributedRope left rope offset equals: 5. @@ -58,11 +58,11 @@ BlSubRopeExamples >> attributes_small_0_to_1 [ ] { #category : #'examples - attributes' } -BlSubRopeExamples >> attributes_small_0_to_5 [ - +BlSubRopeExamplesTest >> testAttributes_small_0_to_5 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 0 to: 5. self assert: anAttributedRope rope == aRope. @@ -72,11 +72,11 @@ BlSubRopeExamples >> attributes_small_0_to_5 [ ] { #category : #'examples - attributes' } -BlSubRopeExamples >> attributes_small_2_to_2 [ - - | aRope anAttributedRope | +BlSubRopeExamplesTest >> testAttributes_small_2_to_2 [ - aRope := self small. + + | aRope anAttributedRope | + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 2 to: 2. @@ -87,7 +87,7 @@ BlSubRopeExamples >> attributes_small_2_to_2 [ self assert: anAttributedRope right left size equals: 0. self assert: anAttributedRope right left attributes equals: { 1 }. self assert: anAttributedRope right left rope collection equals: ''. - + self assert: anAttributedRope right right offset equals: 7. self assert: anAttributedRope right right rope == aRope rope. @@ -95,11 +95,11 @@ BlSubRopeExamples >> attributes_small_2_to_2 [ ] { #category : #'examples - attributes' } -BlSubRopeExamples >> attributes_small_4_to_5 [ - +BlSubRopeExamplesTest >> testAttributes_small_4_to_5 [ + + | aRope anAttributedRope | - - aRope := self small. + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 4 to: 5. self assert: anAttributedRope left size equals: 4. @@ -115,13 +115,13 @@ BlSubRopeExamples >> attributes_small_4_to_5 [ ] { #category : #'examples - attributes' } -BlSubRopeExamples >> attributes_small_5_to_5 [ - - | aRope anAttributedRope | +BlSubRopeExamplesTest >> testAttributes_small_5_to_5 [ - aRope := self small. + + | aRope anAttributedRope | + aRope := self testSmall. anAttributedRope := aRope attributes: { 1 } from: 5 to: 5. - + self assert: anAttributedRope left == aRope. self assert: anAttributedRope right attributes equals: { 1 }. @@ -131,11 +131,11 @@ BlSubRopeExamples >> attributes_small_5_to_5 [ ] { #category : #'examples - attributes' } -BlSubRopeExamples >> clear_attributes_empty_0_to_0 [ - +BlSubRopeExamplesTest >> testClear_attributes_empty_0_to_0 [ + + | anEmptyRope aRopeWithoutAttributes | - - anEmptyRope := self small_empty. + anEmptyRope := self testSmall_empty. aRopeWithoutAttributes := anEmptyRope clearAttributes: 0 to: 0. self assert: aRopeWithoutAttributes isEmpty. @@ -145,30 +145,26 @@ BlSubRopeExamples >> clear_attributes_empty_0_to_0 [ ] { #category : #'as yet unclassified' } -BlSubRopeExamples >> readStreamSmall [ - - | rope stream | +BlSubRopeExamplesTest >> testReadStreamSmall [ - rope := self small. + | rope stream | + rope := self testSmall. stream := rope readStream. self assert: stream next equals: $H. self assert: (stream next: 3) asString equals: 'ell'. - self assert: stream upToEnd asString equals: 'o'. + self assert: stream upToEnd asString equals: 'o' ] { #category : #'instance creation' } -BlSubRopeExamples >> small [ - - - | aCollectionRope aRope | +BlSubRopeExamplesTest >> testSmall [ + "Creates an instance of the rope of size smaller than combineLength with one attribute applied on the whole rope" + + | aCollectionRope aRope | aCollectionRope := BlCollectionRope collection: 'EarthHelloWorld'. - aRope := BlSubRope - rope: aCollectionRope - offset: 5 - length: 5. + aRope := BlSubRope rope: aCollectionRope offset: 5 length: 5. "attribute rope does not increase depth because it is just a plain wrapper" self assert: aRope depth equals: 1. @@ -177,32 +173,32 @@ BlSubRopeExamples >> small [ self assert: aRope rope == aCollectionRope. self assert: aRope isLeaf not. self assert: aRope size <= BlRope combineLength. - + ^ aRope ] { #category : #'examples - accessing' } -BlSubRopeExamples >> small_at_each [ - +BlSubRopeExamplesTest >> testSmall_at_each [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: (aRope at: 1) equals: $H. self assert: (aRope at: 2) equals: $e. self assert: (aRope at: 3) equals: $l. self assert: (aRope at: 4) equals: $l. self assert: (aRope at: 5) equals: $o. - + ^ aRope ] { #category : #'examples - accessing' } -BlSubRopeExamples >> small_children [ - +BlSubRopeExamplesTest >> testSmall_children [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope children equals: { aRope rope }. @@ -210,11 +206,11 @@ BlSubRopeExamples >> small_children [ ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_0_to_0 [ - +BlSubRopeExamplesTest >> testSmall_delete_0_to_0 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 0. self assert: aNewRope == aRope. @@ -223,54 +219,54 @@ BlSubRopeExamples >> small_delete_0_to_0 [ ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_0_to_1 [ - +BlSubRopeExamplesTest >> testSmall_delete_0_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 1. - + self assert: aNewRope size equals: 4. self assert: aNewRope collection equals: 'ello'. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_0_to_5 [ - +BlSubRopeExamplesTest >> testSmall_delete_0_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 0 to: 5. - + self assert: aNewRope size equals: 0. self assert: aNewRope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_1_to_1 [ - +BlSubRopeExamplesTest >> testSmall_delete_1_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 1. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_1_to_3 [ - +BlSubRopeExamplesTest >> testSmall_delete_1_to_3 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 3. - + self assert: aNewRope size equals: 3. self assert: aNewRope collection equals: 'Hlo'. @@ -278,27 +274,27 @@ BlSubRopeExamples >> small_delete_1_to_3 [ ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_1_to_5 [ - +BlSubRopeExamplesTest >> testSmall_delete_1_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 1 to: 5. - + self assert: aNewRope size equals: 1. self assert: aNewRope collection equals: 'H'. - + ^ aNewRope ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_4_to_5 [ - +BlSubRopeExamplesTest >> testSmall_delete_4_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 4 to: 5. - + self assert: aNewRope size equals: 4. self assert: aNewRope collection equals: 'Hell'. @@ -306,24 +302,24 @@ BlSubRopeExamples >> small_delete_4_to_5 [ ] { #category : #'examples - deletion' } -BlSubRopeExamples >> small_delete_5_to_5 [ - +BlSubRopeExamplesTest >> testSmall_delete_5_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope delete: 5 to: 5. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - accessing' } -BlSubRopeExamples >> small_depth [ - +BlSubRopeExamplesTest >> testSmall_depth [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope depth equals: 1. @@ -331,12 +327,14 @@ BlSubRopeExamples >> small_depth [ ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_do [ - +BlSubRopeExamplesTest >> testSmall_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'Hello'. @@ -344,11 +342,11 @@ BlSubRopeExamples >> small_do [ ] { #category : #'instance creation' } -BlSubRopeExamples >> small_empty [ - - | aRope anEmpty | +BlSubRopeExamplesTest >> testSmall_empty [ - aRope := self small. + + | aRope anEmpty | + aRope := self testSmall. anEmpty := aRope empty. self assert: anEmpty size equals: 0. @@ -358,26 +356,31 @@ BlSubRopeExamples >> small_empty [ ] { #category : #'examples - from to' } -BlSubRopeExamples >> small_from_0_to_0 [ - +BlSubRopeExamplesTest >> testSmall_from_0_to_0 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 0. - + self assert: aNewRope size equals: 0. self assert: aNewRope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_from_0_to_0_do [ - +BlSubRopeExamplesTest >> testSmall_from_0_to_0_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 0 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 0 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -385,27 +388,32 @@ BlSubRopeExamples >> small_from_0_to_0_do [ ] { #category : #'examples - from to' } -BlSubRopeExamples >> small_from_0_to_1 [ - +BlSubRopeExamplesTest >> testSmall_from_0_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 1. - + self assert: aNewRope size equals: 1. self assert: aNewRope offset equals: 5. self assert: aNewRope rope == aRope rope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_from_0_to_1_do [ - +BlSubRopeExamplesTest >> testSmall_from_0_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'H'. @@ -413,25 +421,30 @@ BlSubRopeExamples >> small_from_0_to_1_do [ ] { #category : #'examples - from to' } -BlSubRopeExamples >> small_from_0_to_5 [ - +BlSubRopeExamplesTest >> testSmall_from_0_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 0 to: 5. - + self assert: aNewRope == aRope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_from_0_to_5_do [ - +BlSubRopeExamplesTest >> testSmall_from_0_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 0 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 0 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'Hello'. @@ -439,26 +452,31 @@ BlSubRopeExamples >> small_from_0_to_5_do [ ] { #category : #'examples - from to' } -BlSubRopeExamples >> small_from_1_to_1 [ - +BlSubRopeExamplesTest >> testSmall_from_1_to_1 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 1. - + self assert: aNewRope size equals: 0. self assert: aNewRope collection equals: ''. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_from_1_to_1_do [ - +BlSubRopeExamplesTest >> testSmall_from_1_to_1_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 1 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 1 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: ''. @@ -466,27 +484,32 @@ BlSubRopeExamples >> small_from_1_to_1_do [ ] { #category : #'examples - from to' } -BlSubRopeExamples >> small_from_1_to_2 [ - +BlSubRopeExamplesTest >> testSmall_from_1_to_2 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 2. - + self assert: aNewRope size equals: 1. self assert: aNewRope offset equals: 6. self assert: aNewRope rope == aRope rope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_from_1_to_2_do [ - +BlSubRopeExamplesTest >> testSmall_from_1_to_2_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 2 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 2 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'e'. @@ -494,27 +517,32 @@ BlSubRopeExamples >> small_from_1_to_2_do [ ] { #category : #'examples - from to' } -BlSubRopeExamples >> small_from_1_to_5 [ - +BlSubRopeExamplesTest >> testSmall_from_1_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 1 to: 5. - + self assert: aNewRope size equals: 4. self assert: aNewRope offset equals: 6. self assert: aNewRope rope == aRope rope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_from_1_to_5_do [ - +BlSubRopeExamplesTest >> testSmall_from_1_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 1 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 1 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'ello'. @@ -522,27 +550,32 @@ BlSubRopeExamples >> small_from_1_to_5_do [ ] { #category : #'examples - from to' } -BlSubRopeExamples >> small_from_3_to_5 [ - +BlSubRopeExamplesTest >> testSmall_from_3_to_5 [ + + | aRope aNewRope | - - aRope := self small. + aRope := self testSmall. aNewRope := aRope from: 3 to: 5. - + self assert: aNewRope size equals: 2. self assert: aNewRope offset equals: 8. self assert: aNewRope rope == aRope rope. - + ^ aNewRope ] { #category : #'examples - enumeration' } -BlSubRopeExamples >> small_from_3_to_5_do [ - +BlSubRopeExamplesTest >> testSmall_from_3_to_5_do [ + + | aRope theIterated | - - aRope := self small. - theIterated := String streamContents: [ :aStream | aRope from: 3 to: 5 do: [ :eachCharacter| aStream nextPut: eachCharacter ] ]. + aRope := self testSmall. + theIterated := String streamContents: [ :aStream | + aRope + from: 3 + to: 5 + do: [ :eachCharacter | + aStream nextPut: eachCharacter ] ]. self assert: theIterated equals: 'lo'. @@ -550,11 +583,11 @@ BlSubRopeExamples >> small_from_3_to_5_do [ ] { #category : #'examples - testing' } -BlSubRopeExamples >> small_isEmpty [ - +BlSubRopeExamplesTest >> testSmall_isEmpty [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isEmpty not. @@ -562,11 +595,11 @@ BlSubRopeExamples >> small_isEmpty [ ] { #category : #'examples - testing' } -BlSubRopeExamples >> small_isLeaf [ - +BlSubRopeExamplesTest >> testSmall_isLeaf [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isLeaf not. @@ -574,11 +607,11 @@ BlSubRopeExamples >> small_isLeaf [ ] { #category : #'examples - testing' } -BlSubRopeExamples >> small_isNotEmpty [ - +BlSubRopeExamplesTest >> testSmall_isNotEmpty [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope isNotEmpty. @@ -586,11 +619,11 @@ BlSubRopeExamples >> small_isNotEmpty [ ] { #category : #'examples - accessing' } -BlSubRopeExamples >> small_size [ - +BlSubRopeExamplesTest >> testSmall_size [ + + | aRope | - - aRope := self small. + aRope := self testSmall. self assert: aRope size equals: 5. diff --git a/src/Bloc-Examples/BlTaskAtQueueExamples.class.st b/src/Bloc-Examples/BlTaskAtQueueExamples.class.st index 7dd5c49d7..a833ad99d 100644 --- a/src/Bloc-Examples/BlTaskAtQueueExamples.class.st +++ b/src/Bloc-Examples/BlTaskAtQueueExamples.class.st @@ -1,37 +1,49 @@ Class { #name : #BlTaskAtQueueExamples, - #superclass : #BlExampleTest, + #superclass : #TestCase, #traits : 'TAssertable', #classTraits : 'TAssertable classTrait', #category : #'Bloc-Examples-Tasks' } +{ #category : #private } +BlTaskAtQueueExamples >> startTime [ + + ^ DateAndTime fromString: '2020-11-07T12:19:53.275521+01:00' +] + +{ #category : #private } +BlTaskAtQueueExamples >> taskAtQueue [ + "Answer the BlTaskAtQueue used for the examples. + The queue is configured to use a simulated clock with a fixed current time for reproduceable tests." + + ^ BlTaskAtQueue new + clock: (BlSimulatedTime new + date: self startTime) +] + { #category : #examples } -BlTaskAtQueueExamples >> runNow [ +BlTaskAtQueueExamples >> testRunNow [ "Queue a task that has a scheduled time in the past." - - | queue taskRun | + | queue taskRun | queue := self taskAtQueue. taskRun := false. - queue schedule: [ taskRun := true ] - at: self startTime. + queue schedule: [ taskRun := true ] at: self startTime. self assert: queue size equals: 1. queue processNextEntry. - self assert: taskRun. + self assert: taskRun ] { #category : #examples } -BlTaskAtQueueExamples >> runOneInOneSecond [ +BlTaskAtQueueExamples >> testRunOneInOneSecond [ "Queue a task that has a scheduled time in the past." - - | queue taskRun currentTime | + | queue taskRun currentTime | currentTime := self startTime. queue := self taskAtQueue. taskRun := false. - queue schedule: [ taskRun := true ] - at: self startTime + 1 second. + queue schedule: [ taskRun := true ] at: self startTime + 1 second. self assert: queue size equals: 1. queue processNextEntry. self deny: taskRun. @@ -39,39 +51,33 @@ BlTaskAtQueueExamples >> runOneInOneSecond [ queue clock date: (currentTime := currentTime + 1 second). queue forceProcess. queue processNextEntry. - self assert: taskRun. + self assert: taskRun ] { #category : #examples } -BlTaskAtQueueExamples >> runPastTime [ +BlTaskAtQueueExamples >> testRunPastTime [ "Queue a task that has a scheduled time in the past." - - | queue taskRun | + | queue taskRun | queue := self taskAtQueue. taskRun := false. - queue schedule: [ taskRun := true ] - at: self startTime - 1 second. + queue schedule: [ taskRun := true ] at: self startTime - 1 second. self assert: queue size equals: 1. queue processNextEntry. - self assert: taskRun. + self assert: taskRun ] { #category : #examples } -BlTaskAtQueueExamples >> runTwoOneThree [ +BlTaskAtQueueExamples >> testRunTwoOneThree [ "Queue three tasks, out of order, and confirm correct execution." - - | queue value currentTime | + | queue value currentTime | currentTime := self startTime. queue := self taskAtQueue. value := 0. - queue schedule: [ value := 2 ] - at: self startTime + 2 second. - queue schedule: [ value := 1 ] - at: self startTime + 1 second. - queue schedule: [ value := 3 ] - at: self startTime + 3 second. + queue schedule: [ value := 2 ] at: self startTime + 2 second. + queue schedule: [ value := 1 ] at: self startTime + 1 second. + queue schedule: [ value := 3 ] at: self startTime + 3 second. self assert: queue size equals: 3. queue processNextEntry. self assert: value equals: 0. @@ -89,22 +95,5 @@ BlTaskAtQueueExamples >> runTwoOneThree [ queue forceProcess. queue processNextEntry. self assert: value equals: 3. - self assert: queue size equals: 0. - -] - -{ #category : #private } -BlTaskAtQueueExamples >> startTime [ - - ^ DateAndTime fromString: '2020-11-07T12:19:53.275521+01:00' -] - -{ #category : #private } -BlTaskAtQueueExamples >> taskAtQueue [ - "Answer the BlTaskAtQueue used for the examples. - The queue is configured to use a simulated clock with a fixed current time for reproduceable tests." - - ^ BlTaskAtQueue new - clock: (BlSimulatedTime new - date: self startTime) + self assert: queue size equals: 0 ] diff --git a/src/Bloc-Examples/TBlExample.trait.st b/src/Bloc-Examples/TBlExample.trait.st deleted file mode 100644 index f4eceeb92..000000000 --- a/src/Bloc-Examples/TBlExample.trait.st +++ /dev/null @@ -1,33 +0,0 @@ -" -I contain useful helper methods that simplify creation of examples -" -Trait { - #name : #TBlExample, - #category : #'Bloc-Examples-Traits' -} - -{ #category : #opening } -TBlExample classSide >> openInWindow: anElement named: aTitleString extent: aPoint [ - "Open a given element in a window of a provided extent and specified title" - - | aSpace | - aSpace := BlSpace new - extent: aPoint; - title: aTitleString; - yourself. - - aSpace root background: self spaceBackground. - aSpace root addChild: anElement. - - aSpace root addEventHandler: - (BlEventHandler - on: BlDoubleClickEvent - do: [ :evt | BlElementSelection on: evt target ]). - - aSpace show -] - -{ #category : #opening } -TBlExample classSide >> spaceBackground [ - ^ Color white -] diff --git a/src/Bloc-Examples/TBlHandlerRegistryExamples.trait.st b/src/Bloc-Examples/TBlHandlerRegistryExamples.trait.st index 000b5a933..700f7cc51 100644 --- a/src/Bloc-Examples/TBlHandlerRegistryExamples.trait.st +++ b/src/Bloc-Examples/TBlHandlerRegistryExamples.trait.st @@ -6,115 +6,121 @@ Trait { #category : #'Bloc-Examples-EventHandling' } +{ #category : #'instance creation' } +TBlHandlerRegistryExamples >> emptyRegistry [ + + + ^ self explicitRequirement +] + { #category : #'examples - add' } -TBlHandlerRegistryExamples >> addMouseDown [ - +TBlHandlerRegistryExamples >> testAddMouseDown [ + + | aRegistry | - aRegistry := self emptyRegistry. self assert: aRegistry numberOfHandlers equals: 0. - + aRegistry add: (BlExampleLoggingEventHandler on: BlMouseDownEvent). - + self assert: aRegistry numberOfHandlers equals: 1. - + ^ aRegistry ] { #category : #'examples - add' } -TBlHandlerRegistryExamples >> addMouseDownAndMouseUp [ - - | aRegistry | +TBlHandlerRegistryExamples >> testAddMouseDownAndMouseUp [ - aRegistry := self addMouseDown. + + | aRegistry | + aRegistry := self testAddMouseDown. aRegistry add: (BlExampleLoggingEventHandler on: BlMouseUpEvent). - + self assert: aRegistry numberOfHandlers equals: 2. - + ^ aRegistry ] { #category : #'examples - add' } -TBlHandlerRegistryExamples >> addMouseDownTwice [ - +TBlHandlerRegistryExamples >> testAddMouseDownTwice [ + + | aRegistry | - - aRegistry := self addMouseDown. + aRegistry := self testAddMouseDown. aRegistry add: (BlExampleLoggingEventHandler on: BlMouseDownEvent). - + self assert: aRegistry numberOfHandlers equals: 2. - + ^ aRegistry ] { #category : #'examples - add' } -TBlHandlerRegistryExamples >> addMouseDownTwiceAndMouseUp [ - +TBlHandlerRegistryExamples >> testAddMouseDownTwiceAndMouseUp [ + + | aRegistry | - - aRegistry := self addMouseDownTwice. + aRegistry := self testAddMouseDownTwice. aRegistry add: (BlExampleLoggingEventHandler on: BlMouseUpEvent). - - self assert: aRegistry numberOfHandlers equals: 3. - - ^ aRegistry -] -{ #category : #'instance creation' } -TBlHandlerRegistryExamples >> emptyRegistry [ - + self assert: aRegistry numberOfHandlers equals: 3. - ^ self explicitRequirement + ^ aRegistry ] { #category : #'examples - remove' } -TBlHandlerRegistryExamples >> removeAllMouseDownFromTwice [ - +TBlHandlerRegistryExamples >> testRemoveAllMouseDownFromTwice [ + + | aRegistry | - - aRegistry := self addMouseDownTwice. - aRegistry removeAllSuchThat: [ :aHandler | (aHandler isKindOf: BlEventHandler) and: [ aHandler eventClass = BlMouseDownEvent ] ]. - + aRegistry := self testAddMouseDownTwice. + aRegistry removeAllSuchThat: [ :aHandler | + (aHandler isKindOf: BlEventHandler) and: [ + aHandler eventClass = BlMouseDownEvent ] ]. + self assert: aRegistry numberOfHandlers equals: 0. - + ^ aRegistry ] { #category : #'examples - remove' } -TBlHandlerRegistryExamples >> removeAllMouseDownFromTwiceLeaveUp [ - +TBlHandlerRegistryExamples >> testRemoveAllMouseDownFromTwiceLeaveUp [ + + | aRegistry | - - aRegistry := self addMouseDownTwiceAndMouseUp. - aRegistry removeAllSuchThat: [ :aHandler | (aHandler isKindOf: BlEventHandler) and: [ aHandler eventClass = BlMouseDownEvent ] ]. - + aRegistry := self testAddMouseDownTwiceAndMouseUp. + aRegistry removeAllSuchThat: [ :aHandler | + (aHandler isKindOf: BlEventHandler) and: [ + aHandler eventClass = BlMouseDownEvent ] ]. + self assert: aRegistry numberOfHandlers equals: 1. - + ^ aRegistry ] { #category : #'examples - remove' } -TBlHandlerRegistryExamples >> removeMouseDownLeaveEmpty [ - +TBlHandlerRegistryExamples >> testRemoveMouseDownLeaveEmpty [ + + | aRegistry | - - aRegistry := self removeMouseUpLeaveMouseDown. - aRegistry remove: (aRegistry handlers detect: [ :aHandler | aHandler eventClass = BlMouseDownEvent]). - + aRegistry := self testRemoveMouseUpLeaveMouseDown. + aRegistry remove: (aRegistry handlers detect: [ :aHandler | + aHandler eventClass = BlMouseDownEvent ]). + self assert: aRegistry numberOfHandlers equals: 0. - + ^ aRegistry ] { #category : #'examples - remove' } -TBlHandlerRegistryExamples >> removeMouseUpLeaveMouseDown [ - +TBlHandlerRegistryExamples >> testRemoveMouseUpLeaveMouseDown [ + + | aRegistry | - - aRegistry := self addMouseDownAndMouseUp. - aRegistry remove: (aRegistry handlers detect: [ :aHandler | aHandler eventClass = BlMouseUpEvent]). - + aRegistry := self testAddMouseDownAndMouseUp. + aRegistry remove: (aRegistry handlers detect: [ :aHandler | + aHandler eventClass = BlMouseUpEvent ]). + self assert: aRegistry numberOfHandlers equals: 1. - + ^ aRegistry ] diff --git a/src/Bloc-SVG-Tests/BlSvgExamples.class.st b/src/Bloc-SVG-Tests/BlSvgExamples.class.st index fa7f02a5a..fc80517af 100644 --- a/src/Bloc-SVG-Tests/BlSvgExamples.class.st +++ b/src/Bloc-SVG-Tests/BlSvgExamples.class.st @@ -11,15 +11,15 @@ Class { { #category : #'svg - converter' } BlSvgExamples >> circle [ - + ^ BlSvgConverter convertFromString: self circleSVG ] { #category : #'svg - string' } BlSvgExamples >> circleSVG [ - + ^ ' @@ -29,15 +29,15 @@ BlSvgExamples >> circleSVG [ { #category : #'svg - converter' } BlSvgExamples >> curveCubicBezier [ - + ^ BlSvgConverter convertFromString: self curveCubicBezierSVG ] { #category : #'svg - string' } BlSvgExamples >> curveCubicBezierSVG [ - + ^ ' ' @@ -45,15 +45,15 @@ BlSvgExamples >> curveCubicBezierSVG [ { #category : #'svg - converter' } BlSvgExamples >> curveQuadraticBezier [ - + ^ BlSvgConverter convertFromString: self curveQuadraticBezierSVG ] { #category : #'svg - string' } BlSvgExamples >> curveQuadraticBezierSVG [ - + ^ ' ' @@ -61,15 +61,15 @@ BlSvgExamples >> curveQuadraticBezierSVG [ { #category : #'svg - converter' } BlSvgExamples >> defsAndUse [ - + ^ BlSvgConverter convertFromString: self defsAndUseSVG ] { #category : #'svg - string' } BlSvgExamples >> defsAndUseSVG [ - + ^ ' @@ -82,15 +82,15 @@ BlSvgExamples >> defsAndUseSVG [ { #category : #'svg - converter' } BlSvgExamples >> ellipse [ - + ^ BlSvgConverter convertFromString: self ellipseSVG ] { #category : #'svg - string' } BlSvgExamples >> ellipseSVG [ - + ^ ' @@ -100,15 +100,15 @@ BlSvgExamples >> ellipseSVG [ { #category : #'svg - converter' } BlSvgExamples >> ellipticalArc [ - + ^ BlSvgConverter convertFromString: self ellipticalArcSVG ] { #category : #'svg - string' } BlSvgExamples >> ellipticalArcSVG [ - - + + ^ ' @@ -121,15 +121,15 @@ BlSvgExamples >> ellipticalArcSVG [ { #category : #'svg - converter' } BlSvgExamples >> group [ - + ^ BlSvgConverter convertFromString: self groupSVG ] { #category : #'svg - string' } BlSvgExamples >> groupSVG [ - + ^ ' @@ -141,15 +141,15 @@ BlSvgExamples >> groupSVG [ { #category : #'svg - converter' } BlSvgExamples >> line [ - + ^ BlSvgConverter convertFromString: self lineSVG ] { #category : #'svg - string' } BlSvgExamples >> lineSVG [ - + ^ ' @@ -158,15 +158,15 @@ BlSvgExamples >> lineSVG [ { #category : #'svg - converter' } BlSvgExamples >> linearGradient [ - + ^ BlSvgConverter convertFromString: self linearGradientSVG ] { #category : #'svg - string' } BlSvgExamples >> linearGradientSVG [ - + ^ ' @@ -178,15 +178,15 @@ BlSvgExamples >> linearGradientSVG [ { #category : #'svg - converter' } BlSvgExamples >> pathBatman [ - + ^ BlSvgConverter convertFromString: self pathBatmanSVG ] { #category : #'svg - string' } BlSvgExamples >> pathBatmanSVG [ - + ^ ' @@ -207,15 +207,15 @@ BlSvgExamples >> pathBatmanSVG [ { #category : #'svg - converter' } BlSvgExamples >> pathTiger [ - + ^ BlSvgConverter convertFromString: self pathTigerSVG ] { #category : #'svg - string' } BlSvgExamples >> pathTigerSVG [ - - + + ^ ' @@ -944,15 +944,15 @@ BlSvgExamples >> pathTigerSVG [ { #category : #'svg - converter' } BlSvgExamples >> pathTree [ - + ^ BlSvgConverter convertFromString: self pathTreeSVG ] { #category : #'svg - string' } BlSvgExamples >> pathTreeSVG [ - + ^ ' @@ -963,15 +963,15 @@ BlSvgExamples >> pathTreeSVG [ { #category : #'svg - converter' } BlSvgExamples >> polyLine [ - + ^ BlSvgConverter convertFromString: self polyLineSVG ] { #category : #'svg - string' } BlSvgExamples >> polyLineSVG [ - + ^ ' @@ -980,15 +980,15 @@ BlSvgExamples >> polyLineSVG [ { #category : #'svg - converter' } BlSvgExamples >> polygon [ - + ^ BlSvgConverter convertFromString: self polygonSVG ] { #category : #'svg - string' } BlSvgExamples >> polygonSVG [ - + ^ ' @@ -998,15 +998,15 @@ BlSvgExamples >> polygonSVG [ { #category : #'svg - converter' } BlSvgExamples >> radialGradient [ - + ^ BlSvgConverter convertFromString: self radialGradientSVG ] { #category : #'svg - string' } BlSvgExamples >> radialGradientSVG [ - + ^ ' @@ -1018,15 +1018,15 @@ BlSvgExamples >> radialGradientSVG [ { #category : #'svg - converter' } BlSvgExamples >> rectangle [ - + ^ BlSvgConverter convertFromString: self rectangleSVG ] { #category : #'svg - string' } BlSvgExamples >> rectangleSVG [ - + ^ ' @@ -1036,15 +1036,15 @@ BlSvgExamples >> rectangleSVG [ { #category : #'svg - converter' } BlSvgExamples >> svg [ - + ^ BlSvgConverter convertFromString: self svgSVG ] { #category : #'svg - string' } BlSvgExamples >> svgSVG [ - + ^ ' @@ -1056,15 +1056,15 @@ BlSvgExamples >> svgSVG [ { #category : #'svg - converter' } BlSvgExamples >> symbolAndUse [ - + ^ BlSvgConverter convertFromString: self symbolAndUseSVG ] { #category : #'svg - string' } BlSvgExamples >> symbolAndUseSVG [ - - + + ^ ' I love Bloc @@ -1108,15 +1108,15 @@ BlSvgExamples >> textSVG [ { #category : #'svg - converter' } BlSvgExamples >> transformations [ - + ^ BlSvgConverter convertFromString: self transformationsSVG ] { #category : #'svg - string' } BlSvgExamples >> transformationsSVG [ - + ^ ' @@ -1143,15 +1143,15 @@ BlSvgExamples >> transformationsSVG [ { #category : #'svg - converter' } BlSvgExamples >> useSymbolRect [ - + ^ BlSvgConverter convertFromString: self useSymbolRectSVG ] { #category : #'svg - string' } BlSvgExamples >> useSymbolRectSVG [ - + ^ ' diff --git a/src/Bloc-Scripter/BlDevElementExamples.class.st b/src/Bloc-Scripter/BlDevElementExamples.class.st index 2828ab2c0..3695492ed 100644 --- a/src/Bloc-Scripter/BlDevElementExamples.class.st +++ b/src/Bloc-Scripter/BlDevElementExamples.class.st @@ -6,12 +6,13 @@ Class { { #category : #'examples - element' } BlDevElementExamples >> container [ - + + | anElement | anElement := self element. anElement layout: BlFrameLayout new; - size: 300@300; + size: 300 @ 300; background: Color white; border: (BlBorder paint: Color blue width: 2). ^ anElement @@ -19,30 +20,32 @@ BlDevElementExamples >> container [ { #category : #'examples - element' } BlDevElementExamples >> containerWithRectangle [ - + + | anElement | anElement := self container. - anElement - addChild: self rectangle. + anElement addChild: self rectangle. ^ anElement ] { #category : #'examples - element' } BlDevElementExamples >> element [ - + + ^ BlElement new ] { #category : #'examples - element' } BlDevElementExamples >> rectangle [ - + + | anElement | anElement := self element. anElement - size: 100@100; + size: 100 @ 100; background: Color gray; border: (BlBorder paint: Color black width: 2); - constraintsDo: [ :c | + constraintsDo: [ :c | c frame vertical alignCenter. c frame horizontal alignCenter ]. ^ anElement diff --git a/src/Bloc-Scripter/BlDevScripterExamples.class.st b/src/Bloc-Scripter/BlDevScripterExamplesTest.class.st similarity index 59% rename from src/Bloc-Scripter/BlDevScripterExamples.class.st rename to src/Bloc-Scripter/BlDevScripterExamplesTest.class.st index 9c6879c32..091172944 100644 --- a/src/Bloc-Scripter/BlDevScripterExamples.class.st +++ b/src/Bloc-Scripter/BlDevScripterExamplesTest.class.st @@ -3,67 +3,69 @@ I exemplify {{gtClass:BlDevScripter}}. " Class { - #name : #BlDevScripterExamples, - #superclass : #BlExampleTest, + #name : #BlDevScripterExamplesTest, + #superclass : #TestCase, #instVars : [ 'elementExamples' ], #category : #'Bloc-Scripter-Examples' } -{ #category : #'examples - scripter' } -BlDevScripterExamples >> basicScripter [ - - | aScript | - aScript := BlDevScripter new. - self assert: aScript events class equals: BlDevScripterEvents. - self assert: aScript events isEmpty. - ^ aScript -] - { #category : #'examples - click check' } -BlDevScripterExamples >> clickCheck [ - +BlDevScripterExamplesTest >> clickCheck [ + | anElement aScript | anElement := BlDevElementExamples new containerWithRectangle. - aScript := self basicScripter element: anElement. - aScript click onChildAt: 1. - aScript check click onChildAt: 1. + aScript := self testBasicScripter element: anElement. + aScript testClick onChildAt: 1. + aScript check testClick onChildAt: 1. aScript play. ^ aScript ] { #category : #'examples - element' } -BlDevScripterExamples >> containerWithRectangle [ - +BlDevScripterExamplesTest >> containerWithRectangle [ + + ^ elementExamples containerWithRectangle ] +{ #category : #initialization } +BlDevScripterExamplesTest >> initialize [ + super initialize. + elementExamples := BlDevElementExamples new. +] + +{ #category : #'examples - scripter' } +BlDevScripterExamplesTest >> testBasicScripter [ + + + | aScript | + aScript := BlDevScripter new. + self assert: aScript events class equals: BlDevScripterEvents. + self assert: aScript events isEmpty. + ^ aScript +] + { #category : #'examples - click check' } -BlDevScripterExamples >> failingClickCheck [ - - | anElement aScripter aScriptFailed | +BlDevScripterExamplesTest >> testFailingClickCheck [ + + | anElement aScripter aScriptFailed | anElement := BlDevElementExamples new containerWithRectangle. - aScripter := self basicScripter element: anElement. + aScripter := self testBasicScripter element: anElement. - aScripter click onChildAt: 1. - aScripter check click. + aScripter testClick onChildAt: 1. + aScripter check testClick. aScriptFailed := false. - [ aScripter syncPlay ] - on: AssertionFailure + [ aScripter syncPlay ] + on: AssertionFailure do: [ :anException | aScriptFailed := true ]. self assert: aScriptFailed description: 'The script must fail'. ^ aScripter ] - -{ #category : #initialization } -BlDevScripterExamples >> initialize [ - super initialize. - elementExamples := BlDevElementExamples new. -] diff --git a/src/Bloc-Scripter/BlDevScripterMouseProcessorTarget.class.st b/src/Bloc-Scripter/BlDevScripterMouseProcessorTarget.class.st index 9e9a89086..029b6c6d1 100644 --- a/src/Bloc-Scripter/BlDevScripterMouseProcessorTarget.class.st +++ b/src/Bloc-Scripter/BlDevScripterMouseProcessorTarget.class.st @@ -6,7 +6,7 @@ Class { { #category : #searching } BlDevScripterMouseProcessorTarget >> findTargetStartingInSpace: aSpace [ - ^ aSpace mouseProcessor + ^ aSpace testMouseProcessor ] { #category : #accessing } diff --git a/src/Bloc-Scripter/TBlDevScripterActionStep.trait.st b/src/Bloc-Scripter/TBlDevScripterActionStep.trait.st index 8b1114fd4..fd4b85d57 100644 --- a/src/Bloc-Scripter/TBlDevScripterActionStep.trait.st +++ b/src/Bloc-Scripter/TBlDevScripterActionStep.trait.st @@ -8,11 +8,6 @@ Trait { #category : #'Bloc-Scripter-Scripter' } -{ #category : #'steps - interactions' } -TBlDevScripterActionStep >> click [ - ^ self addStep: (BlDevScripterClickStep new referenceSender) -] - { #category : #'steps - other' } TBlDevScripterActionStep >> do [ ^ self addStep: BlDevScripterActionStep new referenceSender @@ -115,6 +110,11 @@ TBlDevScripterActionStep >> substeps: aLabel do: anOneArgBlock [ ^ aStep ] +{ #category : #'steps - interactions' } +TBlDevScripterActionStep >> testClick [ + ^ self addStep: (BlDevScripterClickStep new referenceSender) +] + { #category : #'steps - interactions' } TBlDevScripterActionStep >> type [ ^ self addStep: BlDevScripterTypeTextStep new referenceSender diff --git a/src/Bloc-Scripter/TBlDevScripterCheckStep.trait.st b/src/Bloc-Scripter/TBlDevScripterCheckStep.trait.st index 23187600c..45c6de7bf 100644 --- a/src/Bloc-Scripter/TBlDevScripterCheckStep.trait.st +++ b/src/Bloc-Scripter/TBlDevScripterCheckStep.trait.st @@ -27,13 +27,6 @@ TBlDevScripterCheckStep >> childrenCount: aNumber [ referenceSender) ] -{ #category : #'steps - checks' } -TBlDevScripterCheckStep >> click [ - ^ self addStep: (BlDevScripterCheckFiredEventsStep new - event: BlClickEvent; - referenceSender) -] - { #category : #'steps - checks' } TBlDevScripterCheckStep >> do: anOneArgBlock [ ^ self addStep: (BlDevScripterCheckDoStep new block: anOneArgBlock; referenceSender) @@ -87,6 +80,13 @@ TBlDevScripterCheckStep >> satisfies: anOneArgBlock description: aDescriptionOne referenceSender) ] +{ #category : #'steps - checks' } +TBlDevScripterCheckStep >> testClick [ + ^ self addStep: (BlDevScripterCheckFiredEventsStep new + event: BlClickEvent; + referenceSender) +] + { #category : #'steps - checks' } TBlDevScripterCheckStep >> totalChildrenCount: aNumber [ ^ self addStep: (BlDevScripterCheckTotalChildrenCountStep new diff --git a/src/Bloc-Scripter/TBlDevScripterExamples.trait.st b/src/Bloc-Scripter/TBlDevScripterExamples.trait.st index 886a0bf46..c5c6cc9d2 100644 --- a/src/Bloc-Scripter/TBlDevScripterExamples.trait.st +++ b/src/Bloc-Scripter/TBlDevScripterExamples.trait.st @@ -5,63 +5,68 @@ Trait { { #category : #'examples - scripter' } TBlDevScripterExamples >> scripter [ - + + | aScripter | aScripter := BlDevScripter new. - + self assert: aScripter events isEmpty. - + ^ aScripter ] { #category : #'examples - scripter' } TBlDevScripterExamples >> scripter: aScripter withModel: aModelBlock [ - - ^ self - scripter: aScripter - withModel: aModelBlock - element: [ :aModel | aModel asElement ] + + + ^ self + scripter: aScripter + withModel: aModelBlock + element: [ :aModel | aModel asElement ] ] { #category : #'examples - scripter' } TBlDevScripterExamples >> scripter: aScripter withModel: aModelBlock element: anElementBlock [ - - aScripter substep: 'Initialize Model and UI' do: [ :aStep | - aStep set + + + aScripter substep: 'Initialize Model and UI' do: [ :aStep | + aStep set label: 'Initialize Model'; model: aModelBlock. - aStep set + aStep set label: 'Initialize UI'; element: anElementBlock; onModel. - aStep wait forEmptySpaceTaskQueue. - ]. + aStep wait forEmptySpaceTaskQueue ]. ^ aScripter syncContinue ] { #category : #'examples - scripter' } TBlDevScripterExamples >> scripterWithElement: anElementBlock [ - - ^ self - scripter: self scripter - withModel: [ nil ] - element: anElementBlock + + + ^ self + scripter: self scripter + withModel: [ nil ] + element: anElementBlock ] { #category : #'examples - scripter' } TBlDevScripterExamples >> scripterWithModel: aModelBlock [ - - ^ self - scripter: self scripter - withModel: aModelBlock - element: [ :aModel | aModel asElement ] + + + ^ self + scripter: self scripter + withModel: aModelBlock + element: [ :aModel | aModel asElement ] ] { #category : #'examples - scripter' } TBlDevScripterExamples >> scripterWithModel: aModelBlock element: anElementBlock [ - - ^ self - scripter: self scripter - withModel: aModelBlock - element: anElementBlock + + + ^ self + scripter: self scripter + withModel: aModelBlock + element: anElementBlock ] diff --git a/src/Bloc-Tests/BlConcatenationRopeIteratorTest.class.st b/src/Bloc-Tests/BlConcatenationRopeIteratorTest.class.st index cf6d25fb0..3ae280ca3 100644 --- a/src/Bloc-Tests/BlConcatenationRopeIteratorTest.class.st +++ b/src/Bloc-Tests/BlConcatenationRopeIteratorTest.class.st @@ -16,34 +16,12 @@ BlConcatenationRopeIteratorTest >> originClassName [ ^ 'BlConcatenationRopeIteratorExamples' ] -{ #category : 'tests' } -BlConcatenationRopeIteratorTest >> small [ - - - | aRope anIterator | - aRope := BlConcatenationRopeExamples new attributes_small_5_to_10. - anIterator := aRope iterator: 0 to: 10. - - self assert: anIterator position equals: 0. - self assert: anIterator start equals: 0. - self assert: anIterator end equals: 10. - self assert: anIterator rope == aRope. - - self assert: anIterator hasNext. - self assert: anIterator hasPrevious not. - - self assert: anIterator currentIterator rope == aRope left. - self assert: anIterator currentIterator position equals: 0. - - ^ anIterator -] - -{ #category : 'tests' } +{ #category : #tests } BlConcatenationRopeIteratorTest >> testSmall [ | aRope anIterator | - aRope := BlConcatenationRopeExamples new attributes_small_5_to_10. + aRope := BlConcatenationRopeExamplesTest new testAttributes_small_5_to_10. anIterator := aRope iterator: 0 to: 10. self assert: anIterator position equals: 0. @@ -460,7 +438,7 @@ BlConcatenationRopeIteratorTest >> testSmallNextAt1 [ BlConcatenationRopeIteratorTest >> testSmallNextAt10 [ - + "Iterator throws an error when the end is reached" | anIterator anError | anIterator := self testSmallNextAt9. @@ -682,7 +660,7 @@ BlConcatenationRopeIteratorTest >> testSmallNextSpanAt1 [ BlConcatenationRopeIteratorTest >> testSmallNextSpanAt10 [ - + "Iterator throws an error when the end is reached" | anIterator anError | anIterator := self testSmallNextAt9. @@ -852,7 +830,7 @@ BlConcatenationRopeIteratorTest >> testSmallPeekAt1 [ BlConcatenationRopeIteratorTest >> testSmallPeekAt10 [ - + "Iterator throws an error when the end is reached" | anIterator anError | anIterator := self testSmallNextAt9. @@ -1006,7 +984,7 @@ BlConcatenationRopeIteratorTest >> testSmallPeekAt9 [ BlConcatenationRopeIteratorTest >> testSmallPreviousAt0 [ - + "Iterator throws an error when the start is reached" | anIterator anError | anIterator := self testSmall. @@ -1282,7 +1260,7 @@ BlConcatenationRopeIteratorTest >> testSmallSkip10At0 [ BlConcatenationRopeIteratorTest >> testSmallSkip11At0 [ - + "Iterator throws an error when the end is reached" | anIterator anError | anIterator := self testSmall. diff --git a/src/Bloc-Tests/BlConcatenationRopeTest.class.st b/src/Bloc-Tests/BlConcatenationRopeTest.class.st index 8cfa6b98f..0985af60e 100644 --- a/src/Bloc-Tests/BlConcatenationRopeTest.class.st +++ b/src/Bloc-Tests/BlConcatenationRopeTest.class.st @@ -281,7 +281,6 @@ BlConcatenationRopeTest >> testAttributesSmall9To10 [ { #category : 'tests' } BlConcatenationRopeTest >> testReadStreamSmall [ - | rope stream | rope := self testSmall. @@ -294,10 +293,9 @@ BlConcatenationRopeTest >> testReadStreamSmall [ { #category : 'tests' } BlConcatenationRopeTest >> testSmall [ - - - + "Creates an instance of the rope of size smaller than combineLength" + + | aRope | aRope := BlConcatenationRope left: (BlCollectionRope collection: 'Hello') diff --git a/src/Bloc-Tests/BlEventTestCase.class.st b/src/Bloc-Tests/BlEventTestCase.class.st index 34ab5d17c..ddc4ec52f 100644 --- a/src/Bloc-Tests/BlEventTestCase.class.st +++ b/src/Bloc-Tests/BlEventTestCase.class.st @@ -28,7 +28,7 @@ BlEventTestCase >> child [ { #category : 'accessing' } BlEventTestCase >> firedEvents [ - ^ space mouseProcessor firedEvents + ^ space testMouseProcessor firedEvents ] { #category : 'accessing' } diff --git a/src/Bloc-Tests/BlTaskAtExamples.class.st b/src/Bloc-Tests/BlTaskAtExamplesTest.class.st similarity index 67% rename from src/Bloc-Tests/BlTaskAtExamples.class.st rename to src/Bloc-Tests/BlTaskAtExamplesTest.class.st index aa935a3ae..69a912e0e 100644 --- a/src/Bloc-Tests/BlTaskAtExamples.class.st +++ b/src/Bloc-Tests/BlTaskAtExamplesTest.class.st @@ -1,18 +1,14 @@ Class { - #name : 'BlTaskAtExamples', - #superclass : 'Object', - #category : 'Bloc-Tests-Examples', - #package : 'Bloc-Tests', - #tag : 'Examples' + #name : #BlTaskAtExamplesTest, + #superclass : #TestCase, + #category : #'Bloc-Tests-Examples' } -{ #category : 'tests' } -BlTaskAtExamples >> checkQueueOrder [ +{ #category : #tests } +BlTaskAtExamplesTest >> testCheckQueueOrder [ "Ensure that tasks are retrieved from the queue in chronological order" - | queue now entries | - queue := BlTaskAtQueue new. now := DateAndTime now. queue schedule: 1 at: now + 10 seconds. @@ -27,8 +23,5 @@ BlTaskAtExamples >> checkQueueOrder [ entries := OrderedCollection new. 5 timesRepeat: [ entries add: queue next valuable ]. - self - assert: entries asArray - equals: #(1 2 3 5 7). - + self assert: entries asArray equals: #( 1 2 3 5 7 ) ] diff --git a/src/Bloc-Text-Alexandrie-Examples/BlTextElementExamples.class.st b/src/Bloc-Text-Alexandrie-Examples/BlTextElementExamples.class.st index 5da7708e1..38b50190f 100644 --- a/src/Bloc-Text-Alexandrie-Examples/BlTextElementExamples.class.st +++ b/src/Bloc-Text-Alexandrie-Examples/BlTextElementExamples.class.st @@ -1,27 +1,27 @@ Class { #name : #BlTextElementExamples, - #superclass : #BlExampleTest, + #superclass : #TestCase, #category : #'Bloc-Text-Alexandrie-Examples' } { #category : #example } BlTextElementExamples >> helloText [ - + ^ 'mama' asRopedText fontSize: 80 ] { #category : #example } BlTextElementExamples >> loremIpsumText [ - + ^ (String loremIpsum: 50) asRopedText ] { #category : #example } BlTextElementExamples >> simpleText [ - - + + | text textElement | text := (String loremIpsum: 50) asRopedText. textElement := BlTextElement new. @@ -31,47 +31,50 @@ BlTextElementExamples >> simpleText [ ^ textElement ] +{ #category : #tests } +BlTextElementExamples >> testTextElement [ + + + | text textElement | + text := self helloText. + textElement := BlTextElement new. + textElement text: text. + textElement clipChildren: false. + self assert: textElement text equals: text. + ^ textElement +] + { #category : #example } BlTextElementExamples >> textAttributes [ - + + | text lineElements textElement | - text := ('Hello world!', String cr, 'How are you?') asRopedText. + text := ('Hello world!' , String cr , 'How are you?') asRopedText. text fontSize: 16; italic. "emphasis" (text from: 1 to: 12) - foreground: Color red "text color"; - bold "weight"; - normal "emphasis". + foreground: Color red; + "weight"bold; + "emphasis"normal. "text color" (text from: 13 to: text size) fontSize: 20; monospace. "font-family" - lineElements := Array streamContents: [ :aStream | - | anIterator | - anIterator := text iterator. - [ anIterator hasNext ] - whileTrue: [ aStream nextPut: (BlTextElement text: anIterator nextLine) ] ]. + lineElements := Array streamContents: [ :aStream | + | anIterator | + anIterator := text iterator. + [ anIterator hasNext ] whileTrue: [ + aStream nextPut: + (BlTextElement text: anIterator nextLine) ] ]. textElement := BlElement new - layout: BlLinearLayout vertical; - constraintsDo: [ :c | - c horizontal fitContent. - c vertical fitContent ]; - addChildren: lineElements; - yourself. - - ^ textElement -] + layout: BlLinearLayout vertical; + constraintsDo: [ :c | + c horizontal fitContent. + c vertical fitContent ]; + addChildren: lineElements; + yourself. -{ #category : #example } -BlTextElementExamples >> textElement [ - - | text textElement | - text := self helloText. - textElement := BlTextElement new. - textElement text: text. - textElement clipChildren: false. - self assert: textElement text equals: text. ^ textElement ] diff --git a/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementExamples.class.st b/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementExamples.class.st deleted file mode 100644 index 9cff8b0d6..000000000 --- a/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementExamples.class.st +++ /dev/null @@ -1,141 +0,0 @@ -Class { - #name : #BlTextElementMeasurementExamples, - #superclass : #BlExampleTest, - #category : #'Bloc-Text-Alexandrie-Examples' -} - -{ #category : #'font - metrics' } -BlTextElementMeasurementExamples >> ascent [ - ^ -50 -] - -{ #category : #example } -BlTextElementMeasurementExamples >> customMeasurer [ - - - ^ BATextElementMockedMeasurer new - ascent: self ascent; - descent: self descent; - glyphHeight: self glyphHeight; - glyphWidth: self glyphWidth -] - -{ #category : #'font - metrics' } -BlTextElementMeasurementExamples >> descent [ - ^ 50 -] - -{ #category : #'font - metrics' } -BlTextElementMeasurementExamples >> glyphHeight [ - ^ self ascent abs + self descent - 20 -] - -{ #category : #'font - metrics' } -BlTextElementMeasurementExamples >> glyphWidth [ - ^ 60 -] - -{ #category : #'instance creation' } -BlTextElementMeasurementExamples >> helloWorldText [ - - - ^ 'Hello world' asRopedText fontSize: 80 -] - -{ #category : #'instance creation' } -BlTextElementMeasurementExamples >> textElement [ - - - ^ BlTextElement new - border: (BlBorder paint: (Color gray alpha: 0.8) width: 2); - background: (Color gray alpha: 0.2); - text: self helloWorldText -] - -{ #category : #example } -BlTextElementMeasurementExamples >> textElementWithCustomMeasurer [ - - - ^ self textElement - measurer: self customMeasurer -] - -{ #category : #example } -BlTextElementMeasurementExamples >> unspecifiedExtent [ - - | aTextElement | - - aTextElement := self textElementWithCustomMeasurer. - aTextElement measure: (BlExtentMeasurementSpec unspecified). - - self assert: aTextElement measuredWidth equals: (self helloWorldText size * self glyphWidth). - self assert: aTextElement measuredHeight equals: (self glyphHeight). - - ^ aTextElement -] - -{ #category : #example } -BlTextElementMeasurementExamples >> unspecifiedExtentShouldRemeasure [ - - | aTextElement | - - aTextElement := self unspecifiedExtent. - - self assert: (aTextElement shouldMeasure: BlExtentMeasurementSpec unspecified) not. - - ^ aTextElement -] - -{ #category : #example } -BlTextElementMeasurementExamples >> unspecifiedExtentWithMaxHeight [ - - | aTextElement | - - aTextElement := self textElementWithCustomMeasurer. - aTextElement constraintsDo: [ :c | c maxHeight: (self ascent abs + self descent) / 2 ]. - aTextElement measure: (BlExtentMeasurementSpec unspecified). - - self assert: aTextElement measuredWidth equals: (self helloWorldText size * self glyphWidth). - self assert: aTextElement measuredHeight equals: (self ascent abs + self descent) / 2. - - ^ aTextElement -] - -{ #category : #example } -BlTextElementMeasurementExamples >> unspecifiedExtentWithMaxHeightShouldRemeasure [ - - | aTextElement | - - aTextElement := self unspecifiedExtentWithMaxHeight. - - self assert: (aTextElement shouldMeasure: BlExtentMeasurementSpec unspecified) not. - - ^ aTextElement -] - -{ #category : #example } -BlTextElementMeasurementExamples >> unspecifiedExtentWithMaxWidth [ - - | aTextElement | - - aTextElement := self textElementWithCustomMeasurer. - aTextElement constraintsDo: [ :c | c maxWidth: (self helloWorldText size * self glyphWidth) / 2 ]. - aTextElement measure: (BlExtentMeasurementSpec unspecified). - - self assert: aTextElement measuredWidth equals: (self helloWorldText size * self glyphWidth) / 2. - self assert: aTextElement measuredHeight equals: (self glyphHeight). - - ^ aTextElement -] - -{ #category : #example } -BlTextElementMeasurementExamples >> unspecifiedExtentWithMaxWidthShouldRemeasure [ - - | aTextElement | - - aTextElement := self unspecifiedExtentWithMaxWidth. - - self assert: (aTextElement shouldMeasure: BlExtentMeasurementSpec unspecified) not. - - ^ aTextElement -] diff --git a/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementExamplesTest.class.st b/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementExamplesTest.class.st new file mode 100644 index 000000000..30aa24531 --- /dev/null +++ b/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementExamplesTest.class.st @@ -0,0 +1,156 @@ +Class { + #name : #BlTextElementMeasurementExamplesTest, + #superclass : #TestCase, + #category : #'Bloc-Text-Alexandrie-Examples' +} + +{ #category : #'font - metrics' } +BlTextElementMeasurementExamplesTest >> ascent [ + ^ -50 +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> customMeasurer [ + + + ^ BATextElementMockedMeasurer new + ascent: self ascent; + descent: self descent; + glyphHeight: self glyphHeight; + glyphWidth: self glyphWidth +] + +{ #category : #'font - metrics' } +BlTextElementMeasurementExamplesTest >> descent [ + ^ 50 +] + +{ #category : #'font - metrics' } +BlTextElementMeasurementExamplesTest >> glyphHeight [ + ^ self ascent abs + self descent - 20 +] + +{ #category : #'font - metrics' } +BlTextElementMeasurementExamplesTest >> glyphWidth [ + ^ 60 +] + +{ #category : #'instance creation' } +BlTextElementMeasurementExamplesTest >> helloWorldText [ + + + ^ 'Hello world' asRopedText fontSize: 80 +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> testUnspecifiedExtent [ + + + | aTextElement | + aTextElement := self textElementWithCustomMeasurer. + aTextElement measure: BlExtentMeasurementSpec unspecified. + + self + assert: aTextElement measuredWidth + equals: self helloWorldText size * self glyphWidth. + self assert: aTextElement measuredHeight equals: self glyphHeight. + + ^ aTextElement +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> testUnspecifiedExtentShouldRemeasure [ + + + | aTextElement | + aTextElement := self testUnspecifiedExtent. + + self assert: + (aTextElement shouldMeasure: BlExtentMeasurementSpec unspecified) + not. + + ^ aTextElement +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> testUnspecifiedExtentWithMaxHeight [ + + + | aTextElement | + aTextElement := self textElementWithCustomMeasurer. + aTextElement constraintsDo: [ :c | + c maxHeight: self ascent abs + self descent / 2 ]. + aTextElement measure: BlExtentMeasurementSpec unspecified. + + self + assert: aTextElement measuredWidth + equals: self helloWorldText size * self glyphWidth. + self + assert: aTextElement measuredHeight + equals: self ascent abs + self descent / 2. + + ^ aTextElement +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> testUnspecifiedExtentWithMaxHeightShouldRemeasure [ + + + | aTextElement | + aTextElement := self testUnspecifiedExtentWithMaxHeight. + + self assert: + (aTextElement shouldMeasure: BlExtentMeasurementSpec unspecified) + not. + + ^ aTextElement +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> testUnspecifiedExtentWithMaxWidth [ + + + | aTextElement | + aTextElement := self textElementWithCustomMeasurer. + aTextElement constraintsDo: [ :c | + c maxWidth: self helloWorldText size * self glyphWidth / 2 ]. + aTextElement measure: BlExtentMeasurementSpec unspecified. + + self + assert: aTextElement measuredWidth + equals: self helloWorldText size * self glyphWidth / 2. + self assert: aTextElement measuredHeight equals: self glyphHeight. + + ^ aTextElement +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> testUnspecifiedExtentWithMaxWidthShouldRemeasure [ + + + | aTextElement | + aTextElement := self testUnspecifiedExtentWithMaxWidth. + + self assert: + (aTextElement shouldMeasure: BlExtentMeasurementSpec unspecified) + not. + + ^ aTextElement +] + +{ #category : #'instance creation' } +BlTextElementMeasurementExamplesTest >> textElement [ + + + ^ BlTextElement new + border: (BlBorder paint: (Color gray alpha: 0.8) width: 2); + background: (Color gray alpha: 0.2); + text: self helloWorldText +] + +{ #category : #example } +BlTextElementMeasurementExamplesTest >> textElementWithCustomMeasurer [ + + + ^ self textElement measurer: self customMeasurer +] diff --git a/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementStrategyExamples.class.st b/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementStrategyExamplesTest.class.st similarity index 78% rename from src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementStrategyExamples.class.st rename to src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementStrategyExamplesTest.class.st index 91120c412..808b798fc 100644 --- a/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementStrategyExamples.class.st +++ b/src/Bloc-Text-Alexandrie-Examples/BlTextElementMeasurementStrategyExamplesTest.class.st @@ -26,38 +26,43 @@ Now let's compare all text measurement strategies: " Class { - #name : #BlTextElementMeasurementStrategyExamples, - #superclass : #BlExampleTest, + #name : #BlTextElementMeasurementStrategyExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Text-Alexandrie-Examples' } { #category : #baselines } -BlTextElementMeasurementStrategyExamples >> measurementDifference [ - - | ascentTextElement boundsTextElement editorTextElement containerElement | +BlTextElementMeasurementStrategyExamplesTest >> measurementDifference [ - ascentTextElement := self textElementWithLabelMeasurement. - boundsTextElement := self textElementWithTightMeasurement. - editorTextElement := self textElementWithEditorMeasurement. + + | ascentTextElement boundsTextElement editorTextElement containerElement | + ascentTextElement := self testTextElementWithLabelMeasurement. + boundsTextElement := self testTextElementWithTightMeasurement. + editorTextElement := self testTextElementWithEditorMeasurement. containerElement := BlElement new. containerElement clipChildren: false. - containerElement layout: (BlGridLayout horizontal cellSpacing: 10; columnCount: 2). + containerElement layout: (BlGridLayout horizontal + cellSpacing: 10; + columnCount: 2). containerElement constraintsDo: [ :c | c horizontal fitContent. c vertical fitContent ]. - containerElement addChildren: { ascentTextElement . boundsTextElement . editorTextElement }. + containerElement addChildren: { + ascentTextElement. + boundsTextElement. + editorTextElement }. ^ containerElement ] { #category : #example } -BlTextElementMeasurementStrategyExamples >> textElementWithEditorMeasurement [ - +BlTextElementMeasurementStrategyExamplesTest >> testTextElementWithEditorMeasurement [ + | textElement | - textElement := BlTextElementExamples new textElement. + textElement := BlTextElementExamples new testTextElement. textElement border: (BlBorder paint: (Color red darker alpha: 0.6) width: 1). textElement text @@ -77,11 +82,11 @@ BlTextElementMeasurementStrategyExamples >> textElementWithEditorMeasurement [ ] { #category : #example } -BlTextElementMeasurementStrategyExamples >> textElementWithLabelMeasurement [ - +BlTextElementMeasurementStrategyExamplesTest >> testTextElementWithLabelMeasurement [ + | textElement | - textElement := BlTextElementExamples new textElement. + textElement := BlTextElementExamples new testTextElement. textElement border: (BlBorder paint: (Color red darker alpha: 0.6) width: 1). textElement text @@ -104,11 +109,11 @@ BlTextElementMeasurementStrategyExamples >> textElementWithLabelMeasurement [ ] { #category : #example } -BlTextElementMeasurementStrategyExamples >> textElementWithTightMeasurement [ - +BlTextElementMeasurementStrategyExamplesTest >> testTextElementWithTightMeasurement [ + | textElement | - textElement := BlTextElementExamples new textElement. + textElement := BlTextElementExamples new testTextElement. textElement border: (BlBorder paint: (Color blue darker alpha: 0.6) width: 1). textElement text diff --git a/src/Bloc-Text-Examples/BlTextIteratorExamples.class.st b/src/Bloc-Text-Examples/BlTextIteratorExamplesTest.class.st similarity index 70% rename from src/Bloc-Text-Examples/BlTextIteratorExamples.class.st rename to src/Bloc-Text-Examples/BlTextIteratorExamplesTest.class.st index d35077eab..4c0fe5638 100644 --- a/src/Bloc-Text-Examples/BlTextIteratorExamples.class.st +++ b/src/Bloc-Text-Examples/BlTextIteratorExamplesTest.class.st @@ -1,29 +1,32 @@ Class { - #name : #BlTextIteratorExamples, - #superclass : #BlExampleTest, + #name : #BlTextIteratorExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Text-Examples-Model' } { #category : #'instance creation' } -BlTextIteratorExamples >> attributed_end [ - - | aText anIterator | +BlTextIteratorExamplesTest >> testAttributed_end [ + + | aText anIterator | aText := 'EarthHelloWorld' asRopedText. - (aText from: 11 to: 15) appendingAdornment: [ BlElement new size: 10@10; background: Color lightGray ]. - + (aText from: 11 to: 15) appendingAdornment: [ + BlElement new + size: 10 @ 10; + background: Color lightGray ]. + anIterator := aText iterator. self assert: anIterator position equals: 0. - + ^ anIterator ] { #category : #'examples - attributed end' } -BlTextIteratorExamples >> attributed_end_next_attributed_end_at_1 [ - - | anIterator aStart anEnd theAdornmentAttributes| +BlTextIteratorExamplesTest >> testAttributed_end_next_attributed_end_at_1 [ - anIterator := self attributed_end. + + | anIterator aStart anEnd theAdornmentAttributes | + anIterator := self testAttributed_end. anIterator nextAttributedEnd: [ :eachAttribute | eachAttribute isAdornment ] @@ -41,11 +44,11 @@ BlTextIteratorExamples >> attributed_end_next_attributed_end_at_1 [ ] { #category : #'examples - span any' } -BlTextIteratorExamples >> attributed_end_next_span_any_at_1 [ - - | anIterator aStart anEnd hasAnyAttribute | +BlTextIteratorExamplesTest >> testAttributed_end_next_span_any_at_1 [ - anIterator := self attributed_end. + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testAttributed_end. anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] @@ -53,7 +56,7 @@ BlTextIteratorExamples >> attributed_end_next_span_any_at_1 [ aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 1. self assert: anEnd equals: 10. self assert: hasAnyAttribute not. @@ -63,11 +66,11 @@ BlTextIteratorExamples >> attributed_end_next_span_any_at_1 [ ] { #category : #'examples - span any' } -BlTextIteratorExamples >> attributed_end_next_span_any_at_10 [ - - | anIterator aStart anEnd hasAnyAttribute | +BlTextIteratorExamplesTest >> testAttributed_end_next_span_any_at_10 [ - anIterator := self attributed_end_next_span_any_at_1. + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testAttributed_end_next_span_any_at_1. anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] @@ -75,7 +78,7 @@ BlTextIteratorExamples >> attributed_end_next_span_any_at_10 [ aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 11. self assert: anEnd equals: 15. self assert: hasAnyAttribute. @@ -85,25 +88,28 @@ BlTextIteratorExamples >> attributed_end_next_span_any_at_10 [ ] { #category : #'instance creation' } -BlTextIteratorExamples >> attributed_middle [ - - | aText anIterator | +BlTextIteratorExamplesTest >> testAttributed_middle [ + + | aText anIterator | aText := 'EarthHelloWorld' asRopedText. - (aText from: 6 to: 10) appendingAdornment: [ BlElement new size: 10@10; background: Color lightGray ]. - + (aText from: 6 to: 10) appendingAdornment: [ + BlElement new + size: 10 @ 10; + background: Color lightGray ]. + anIterator := aText iterator. self assert: anIterator position equals: 0. - + ^ anIterator ] { #category : #'examples - attributed end' } -BlTextIteratorExamples >> attributed_middle_next_attributed_end_at_1 [ - - | anIterator aStart anEnd theAdornmentAttributes| +BlTextIteratorExamplesTest >> testAttributed_middle_next_attributed_end_at_1 [ - anIterator := self attributed_middle. + + | anIterator aStart anEnd theAdornmentAttributes | + anIterator := self testAttributed_middle. anIterator nextAttributedEnd: [ :eachAttribute | eachAttribute isAdornment ] @@ -111,7 +117,7 @@ BlTextIteratorExamples >> attributed_middle_next_attributed_end_at_1 [ aStart := indexStart. anEnd := indexEnd. theAdornmentAttributes := theAttributes ]. - + self assert: aStart equals: 1. self assert: anEnd equals: 10. self assert: theAdornmentAttributes size equals: 1. @@ -121,11 +127,11 @@ BlTextIteratorExamples >> attributed_middle_next_attributed_end_at_1 [ ] { #category : #'examples - attributed end' } -BlTextIteratorExamples >> attributed_middle_next_attributed_end_at_10 [ - - | anIterator aStart anEnd theAdornmentAttributes| +BlTextIteratorExamplesTest >> testAttributed_middle_next_attributed_end_at_10 [ - anIterator := self attributed_middle_next_attributed_end_at_1. + + | anIterator aStart anEnd theAdornmentAttributes | + anIterator := self testAttributed_middle_next_attributed_end_at_1. anIterator nextAttributedEnd: [ :eachAttribute | eachAttribute isAdornment ] @@ -133,7 +139,7 @@ BlTextIteratorExamples >> attributed_middle_next_attributed_end_at_10 [ aStart := indexStart. anEnd := indexEnd. theAdornmentAttributes := theAttributes ]. - + self assert: aStart equals: 11. self assert: anEnd equals: 15. self assert: theAdornmentAttributes isEmpty. @@ -143,11 +149,11 @@ BlTextIteratorExamples >> attributed_middle_next_attributed_end_at_10 [ ] { #category : #'examples - span any' } -BlTextIteratorExamples >> attributed_middle_next_span_any_at_1 [ - - | anIterator aStart anEnd hasAnyAttribute | +BlTextIteratorExamplesTest >> testAttributed_middle_next_span_any_at_1 [ - anIterator := self attributed_middle. + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testAttributed_middle. anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] @@ -155,7 +161,7 @@ BlTextIteratorExamples >> attributed_middle_next_span_any_at_1 [ aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 1. self assert: anEnd equals: 5. self assert: hasAnyAttribute not. @@ -165,11 +171,11 @@ BlTextIteratorExamples >> attributed_middle_next_span_any_at_1 [ ] { #category : #'examples - span any' } -BlTextIteratorExamples >> attributed_middle_next_span_any_at_10 [ - - | anIterator aStart anEnd hasAnyAttribute | +BlTextIteratorExamplesTest >> testAttributed_middle_next_span_any_at_10 [ - anIterator := self attributed_middle_next_span_any_at_5. + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testAttributed_middle_next_span_any_at_5. anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] @@ -177,7 +183,7 @@ BlTextIteratorExamples >> attributed_middle_next_span_any_at_10 [ aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 11. self assert: anEnd equals: 15. self assert: hasAnyAttribute not. @@ -187,11 +193,11 @@ BlTextIteratorExamples >> attributed_middle_next_span_any_at_10 [ ] { #category : #'examples - span any' } -BlTextIteratorExamples >> attributed_middle_next_span_any_at_5 [ - - | anIterator aStart anEnd hasAnyAttribute | +BlTextIteratorExamplesTest >> testAttributed_middle_next_span_any_at_5 [ - anIterator := self attributed_middle_next_span_any_at_1. + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testAttributed_middle_next_span_any_at_1. anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] @@ -199,7 +205,7 @@ BlTextIteratorExamples >> attributed_middle_next_span_any_at_5 [ aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 6. self assert: anEnd equals: 10. self assert: hasAnyAttribute. @@ -209,25 +215,28 @@ BlTextIteratorExamples >> attributed_middle_next_span_any_at_5 [ ] { #category : #'instance creation' } -BlTextIteratorExamples >> attributed_start [ - - | aText anIterator | +BlTextIteratorExamplesTest >> testAttributed_start [ + + | aText anIterator | aText := 'EarthHelloWorld' asRopedText. - (aText from: 1 to: 5) appendingAdornment: [ BlElement new size: 10@10; background: Color lightGray ]. - + (aText from: 1 to: 5) appendingAdornment: [ + BlElement new + size: 10 @ 10; + background: Color lightGray ]. + anIterator := aText iterator. self assert: anIterator position equals: 0. - + ^ anIterator ] { #category : #'examples - attributed end' } -BlTextIteratorExamples >> attributed_start_next_attributed_end_at_1 [ - - | anIterator aStart anEnd theAdornmentAttributes| +BlTextIteratorExamplesTest >> testAttributed_start_next_attributed_end_at_1 [ - anIterator := self attributed_start. + + | anIterator aStart anEnd theAdornmentAttributes | + anIterator := self testAttributed_start. anIterator nextAttributedEnd: [ :eachAttribute | eachAttribute isAdornment ] @@ -235,7 +244,7 @@ BlTextIteratorExamples >> attributed_start_next_attributed_end_at_1 [ aStart := indexStart. anEnd := indexEnd. theAdornmentAttributes := theAttributes ]. - + self assert: aStart equals: 1. self assert: anEnd equals: 5. self assert: theAdornmentAttributes size equals: 1. @@ -245,11 +254,11 @@ BlTextIteratorExamples >> attributed_start_next_attributed_end_at_1 [ ] { #category : #'examples - attributed end' } -BlTextIteratorExamples >> attributed_start_next_attributed_end_at_5 [ - - | anIterator aStart anEnd theAdornmentAttributes| +BlTextIteratorExamplesTest >> testAttributed_start_next_attributed_end_at_5 [ - anIterator := self attributed_start_next_attributed_end_at_1. + + | anIterator aStart anEnd theAdornmentAttributes | + anIterator := self testAttributed_start_next_attributed_end_at_1. anIterator nextAttributedEnd: [ :eachAttribute | eachAttribute isAdornment ] @@ -267,11 +276,11 @@ BlTextIteratorExamples >> attributed_start_next_attributed_end_at_5 [ ] { #category : #'examples - span any' } -BlTextIteratorExamples >> attributed_start_next_span_any_at_1 [ - - | anIterator aStart anEnd hasAnyAttribute | +BlTextIteratorExamplesTest >> testAttributed_start_next_span_any_at_1 [ - anIterator := self attributed_start. + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testAttributed_start. anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] @@ -279,7 +288,7 @@ BlTextIteratorExamples >> attributed_start_next_span_any_at_1 [ aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 1. self assert: anEnd equals: 5. self assert: hasAnyAttribute. @@ -289,11 +298,11 @@ BlTextIteratorExamples >> attributed_start_next_span_any_at_1 [ ] { #category : #'examples - span any' } -BlTextIteratorExamples >> attributed_start_next_span_any_at_5 [ - - | anIterator aStart anEnd hasAnyAttribute | +BlTextIteratorExamplesTest >> testAttributed_start_next_span_any_at_5 [ - anIterator := self attributed_start_next_span_any_at_1. + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testAttributed_start_next_span_any_at_1. anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] @@ -301,7 +310,7 @@ BlTextIteratorExamples >> attributed_start_next_span_any_at_5 [ aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 6. self assert: anEnd equals: 15. self assert: hasAnyAttribute not. @@ -311,34 +320,38 @@ BlTextIteratorExamples >> attributed_start_next_span_any_at_5 [ ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_beginning [ - +BlTextIteratorExamplesTest >> testFindAttribute_beginning [ + + | attribute text interval | attribute := BlTextForegroundAttribute paint: Color red. text := 'HelloWorld' asRopedText - attributes: { attribute } - from: 1 to: 5. + attributes: { attribute } + from: 1 + to: 5. text findAttribute: attribute indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval equals: (1 to: 5). - + ^ text ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_beginning_subtext_equal [ - +BlTextIteratorExamplesTest >> testFindAttribute_beginning_subtext_equal [ + + | attribute text subText interval | attribute := BlTextForegroundAttribute paint: Color red. text := 'HelloWorld' asRopedText - attributes: { attribute } - from: 1 to: 5. - + attributes: { attribute } + from: 1 + to: 5. + subText := text from: 1 to: 5. subText @@ -346,19 +359,21 @@ BlTextIteratorExamples >> findAttribute_beginning_subtext_equal [ indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval equals: (1 to: 5). - + ^ subText ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_beginning_subtext_larger [ - +BlTextIteratorExamplesTest >> testFindAttribute_beginning_subtext_larger [ + + | attribute text subText interval | attribute := BlTextForegroundAttribute paint: Color red. text := 'HelloWorld' asRopedText - attributes: { attribute } - from: 1 to: 5. + attributes: { attribute } + from: 1 + to: 5. subText := text from: 1 to: 7. @@ -367,19 +382,21 @@ BlTextIteratorExamples >> findAttribute_beginning_subtext_larger [ indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval equals: (1 to: 5). - + ^ subText ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_beginning_subtext_shifted [ - +BlTextIteratorExamplesTest >> testFindAttribute_beginning_subtext_shifted [ + + | attribute text subText interval | attribute := BlTextForegroundAttribute paint: Color red. text := 'HelloWorld' asRopedText - attributes: { attribute } - from: 1 to: 5. + attributes: { attribute } + from: 1 + to: 5. subText := text from: 3 to: 7. @@ -388,20 +405,22 @@ BlTextIteratorExamples >> findAttribute_beginning_subtext_shifted [ indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval equals: (1 to: 3). - + ^ subText ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_beginning_subtext_smaller [ - +BlTextIteratorExamplesTest >> testFindAttribute_beginning_subtext_smaller [ + + | attribute text subText interval | attribute := BlTextForegroundAttribute paint: Color red. text := 'HelloWorld' asRopedText - attributes: { attribute } - from: 1 to: 5. - + attributes: { attribute } + from: 1 + to: 5. + subText := text from: 1 to: 2. subText @@ -409,51 +428,56 @@ BlTextIteratorExamples >> findAttribute_beginning_subtext_smaller [ indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval equals: (1 to: 2). - + ^ subText ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_end [ - +BlTextIteratorExamplesTest >> testFindAttribute_end [ + + | attribute text interval | attribute := BlTextForegroundAttribute paint: Color red. text := 'HelloWorld' asRopedText - attributes: { attribute } - from: 6 to: 10. + attributes: { attribute } + from: 6 + to: 10. text findAttribute: attribute indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval equals: (6 to: 10). - + ^ text ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_middle [ - +BlTextIteratorExamplesTest >> testFindAttribute_middle [ + + | attribute text interval | attribute := BlTextForegroundAttribute paint: Color red. text := 'HelloWorld' asRopedText - attributes: { attribute } - from: 3 to: 7. + attributes: { attribute } + from: 3 + to: 7. text findAttribute: attribute indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval equals: (3 to: 7). - + ^ text ] { #category : #'examples - attribute indices' } -BlTextIteratorExamples >> findAttribute_none [ - +BlTextIteratorExamplesTest >> testFindAttribute_none [ + + | attribute text interval | attribute := BlTextForegroundAttribute paint: Color red. @@ -464,61 +488,61 @@ BlTextIteratorExamples >> findAttribute_none [ indicesDo: [ :aStart :anEnd | interval := aStart to: anEnd ]. self assert: interval isNil. - + ^ text ] { #category : #'instance creation' } -BlTextIteratorExamples >> simple [ - - | anIterator | +BlTextIteratorExamplesTest >> testSimple [ + + | anIterator | anIterator := 'HelloWorld' asRopedText iterator. self assert: anIterator position equals: 0. - + ^ anIterator ] { #category : #'examples - attributed end' } -BlTextIteratorExamples >> simple_next_attributed_end_at_0 [ - - | anIterator aStart anEnd theAdornmentAttributes| +BlTextIteratorExamplesTest >> testSimple_next_attributed_end_at_0 [ + + + | anIterator aStart anEnd theAdornmentAttributes | + anIterator := self testSimple. - anIterator := self simple. - anIterator nextAttributedEnd: [ :eachAttribute | eachAttribute isAdornment ] indicesDo: [ :indexStart :indexEnd :theAttributes | aStart := indexStart. anEnd := indexEnd. theAdornmentAttributes := theAttributes ]. - + self assert: aStart equals: 1. self assert: anEnd equals: 10. self assert: theAdornmentAttributes isEmpty. self assert: anIterator position equals: 10. - + ^ anIterator ] { #category : #'examples - span any' } -BlTextIteratorExamples >> simple_next_span_any_at_0 [ - +BlTextIteratorExamplesTest >> testSimple_next_span_any_at_0 [ + + | anIterator aStart anEnd hasAnyAttribute | + anIterator := self testSimple. - anIterator := self simple. - anIterator nextSpanAny: [ :eachAttribute | eachAttribute isAdornment ] indicesDo: [ :indexStart :indexEnd :hasAny | aStart := indexStart. anEnd := indexEnd. hasAnyAttribute := hasAny ]. - + self assert: aStart equals: 1. self assert: anEnd equals: 10. self assert: hasAnyAttribute not. self assert: anIterator position equals: 10. - + ^ anIterator ] diff --git a/src/Bloc-Text-Examples/BlTextParagraphExamples.class.st b/src/Bloc-Text-Examples/BlTextParagraphExamplesTest.class.st similarity index 59% rename from src/Bloc-Text-Examples/BlTextParagraphExamples.class.st rename to src/Bloc-Text-Examples/BlTextParagraphExamplesTest.class.st index b975c2475..6d64ebbd1 100644 --- a/src/Bloc-Text-Examples/BlTextParagraphExamples.class.st +++ b/src/Bloc-Text-Examples/BlTextParagraphExamplesTest.class.st @@ -3,228 +3,275 @@ I contain examples of a text paragraph " Class { - #name : #BlTextParagraphExamples, - #superclass : #BlExampleTest, + #name : #BlTextParagraphExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Text-Examples-Measurement' } { #category : #'font - metrics' } -BlTextParagraphExamples >> ascent [ - +BlTextParagraphExamplesTest >> ascent [ + ^ -10 ] { #category : #'font - metrics' } -BlTextParagraphExamples >> descent [ - +BlTextParagraphExamplesTest >> descent [ + ^ 5 ] { #category : #'instance creation' } -BlTextParagraphExamples >> emoji [ - +BlTextParagraphExamplesTest >> emoji [ + ^ '😃' ] { #category : #'instance creation' } -BlTextParagraphExamples >> emojiParagraph [ - - | aParagraph | +BlTextParagraphExamplesTest >> emojiParagraph [ + + | aParagraph | aParagraph := self newParagraph. aParagraph text: self emoji asRopedText. - + ^ aParagraph ] { #category : #'instance creation' } -BlTextParagraphExamples >> emptyParagraph [ - - | aParagraph | +BlTextParagraphExamplesTest >> emptyParagraph [ + + | aParagraph | aParagraph := self newParagraph. aParagraph text: BlText empty. - + ^ aParagraph ] { #category : #'font - metrics' } -BlTextParagraphExamples >> glyphWidth [ - +BlTextParagraphExamplesTest >> glyphWidth [ + ^ 10 ] { #category : #'instance creation' } -BlTextParagraphExamples >> haba [ - +BlTextParagraphExamplesTest >> haba [ + ^ 'Haba' ] { #category : #'instance creation' } -BlTextParagraphExamples >> habaParagraph [ - - | aParagraph | +BlTextParagraphExamplesTest >> habaParagraph [ + + | aParagraph | aParagraph := self newParagraph. aParagraph text: self haba asRopedText. - + ^ aParagraph ] { #category : #'font - metrics' } -BlTextParagraphExamples >> height [ - +BlTextParagraphExamplesTest >> height [ + ^ 12 ] { #category : #'instance creation' } -BlTextParagraphExamples >> helloWorldParagraph [ - - | aParagraph | +BlTextParagraphExamplesTest >> helloWorldParagraph [ + + | aParagraph | aParagraph := self newParagraph. aParagraph text: self helloWorldText. - + ^ aParagraph ] { #category : #'instance creation' } -BlTextParagraphExamples >> helloWorldText [ - - | aText | +BlTextParagraphExamplesTest >> helloWorldText [ + + | aText | aText := 'HelloWorld' asRopedText. (aText from: 1 to: 5) foreground: Color red. ^ aText ] +{ #category : #'instance creation' } +BlTextParagraphExamplesTest >> newParagraph [ + + + | aParagraph | + aParagraph := BlTextParagraph new. + ^ aParagraph +] + +{ #category : #'instance creation' } +BlTextParagraphExamplesTest >> objectPrintOnText [ + + + | aText | + aText := 'Object>>#printOn:' asRopedText. + (aText from: 1 to: 6) foreground: Color blue. + (aText from: 9 to: aText size) foreground: Color magenta. + + ^ aText +] + +{ #category : #'instance creation' } +BlTextParagraphExamplesTest >> pointWithDotText [ + + + | aText | + aText := '100@100.' asRopedText. + (aText from: 1 to: 3) foreground: Color red. + (aText from: 5 to: 7) foreground: Color red. + (aText from: 8 to: 8) bold. + + ^ aText +] + +{ #category : #'instance creation' } +BlTextParagraphExamplesTest >> realMeasurer [ + + + self error: 'TODO: migrate from Sparta' + "^ BlSpartaCanvasTextMeasurer new canvas: Bloc preferableSpartaCanvas offscreen" +] + { #category : #'geometry - HelloWorld' } -BlTextParagraphExamples >> indexAtBetweenAllCharacterInHelloWorld [ - - | aParagraph theIndices | +BlTextParagraphExamplesTest >> testIndexAtBetweenAllCharacterInHelloWorld [ - aParagraph := self measuredHelloWorld. + + | aParagraph theIndices | + aParagraph := self testMeasuredHelloWorld. - theIndices := (0 to: aParagraph text size) collect: [ :anIndex | aParagraph indexAtPosition: (self glyphWidth * anIndex) @ self ascent ]. + theIndices := (0 to: aParagraph text size) collect: [ :anIndex | + aParagraph indexAtPosition: + self glyphWidth * anIndex @ self ascent ]. self assert: theIndices equals: (0 to: aParagraph text size) asArray. ^ aParagraph ] { #category : #'geometry - Object>>#printOn:' } -BlTextParagraphExamples >> indexAtBetweenAllCharactersInObjectPrintOn [ - - | aParagraph theIndices | +BlTextParagraphExamplesTest >> testIndexAtBetweenAllCharactersInObjectPrintOn [ + + | aParagraph theIndices | aParagraph := self newParagraph. aParagraph text: self objectPrintOnText. - aParagraph measureOn: self measurer. - - theIndices := (0 to: aParagraph text size) collect: [ :anIndex | aParagraph indexAtPosition: (self glyphWidth * anIndex) @ self ascent ]. + aParagraph measureOn: self testMeasurer. + + theIndices := (0 to: aParagraph text size) collect: [ :anIndex | + aParagraph indexAtPosition: + self glyphWidth * anIndex @ self ascent ]. self assert: theIndices equals: (0 to: aParagraph text size) asArray. ^ theIndices ] { #category : #'geometry - 100@100.' } -BlTextParagraphExamples >> indexAtBetweenAllCharactersInPointWithDot [ - - | aParagraph theIndices | +BlTextParagraphExamplesTest >> testIndexAtBetweenAllCharactersInPointWithDot [ + + | aParagraph theIndices | aParagraph := self newParagraph. aParagraph text: self pointWithDotText. - aParagraph measureOn: self measurer. - + aParagraph measureOn: self testMeasurer. + theIndices := (0 to: aParagraph text size) collect: [ :anIndex | - | aPoint | - aPoint := aParagraph positionAt: anIndex. - aParagraph indexAtPosition: aPoint ]. + | aPoint | + aPoint := aParagraph positionAt: anIndex. + aParagraph indexAtPosition: aPoint ]. self assert: theIndices equals: (0 to: aParagraph text size) asArray. ^ aParagraph ] { #category : #'geometry - 100@100.' } -BlTextParagraphExamples >> indexAtBetweenAllCharactersInRealPointWithDot [ - - | aParagraph theIndices | +BlTextParagraphExamplesTest >> testIndexAtBetweenAllCharactersInRealPointWithDot [ + + | aParagraph theIndices | aParagraph := self newParagraph. aParagraph text: self pointWithDotText. aParagraph measureOn: self realMeasurer. - + theIndices := (0 to: aParagraph text size) collect: [ :anIndex | - | aPoint | - aPoint := aParagraph positionAt: anIndex. - aParagraph indexAtPosition: aPoint ]. + | aPoint | + aPoint := aParagraph positionAt: anIndex. + aParagraph indexAtPosition: aPoint ]. self assert: theIndices equals: (0 to: aParagraph text size) asArray. ^ aParagraph ] { #category : #'geometry - tab tab' } -BlTextParagraphExamples >> indexAtBetweenAllCharactersInRealTabTab [ - - | aParagraph theIndices | +BlTextParagraphExamplesTest >> testIndexAtBetweenAllCharactersInRealTabTab [ + + | aParagraph theIndices | aParagraph := self newParagraph. - aParagraph text: (String tab, String tab) asRopedText. + aParagraph text: (String tab , String tab) asRopedText. aParagraph measureOn: self realMeasurer. - + theIndices := (0 to: aParagraph text size) collect: [ :anIndex | - | aPoint | - aPoint := aParagraph positionAt: anIndex. - aParagraph indexAtPosition: aPoint ]. + | aPoint | + aPoint := aParagraph positionAt: anIndex. + aParagraph indexAtPosition: aPoint ]. self assert: theIndices equals: (0 to: aParagraph text size) asArray. ^ aParagraph ] { #category : #'geometry - tab tab' } -BlTextParagraphExamples >> indexAtBetweenAllCharactersInTabTab [ - - | aParagraph theIndices | +BlTextParagraphExamplesTest >> testIndexAtBetweenAllCharactersInTabTab [ + + | aParagraph theIndices | aParagraph := self newParagraph. - aParagraph text: (String tab, String tab) asRopedText. - aParagraph measureOn: self measurer. - + aParagraph text: (String tab , String tab) asRopedText. + aParagraph measureOn: self testMeasurer. + theIndices := (0 to: aParagraph text size) collect: [ :anIndex | - | aPoint | - aPoint := aParagraph positionAt: anIndex. - aParagraph indexAtPosition: aPoint ]. + | aPoint | + aPoint := aParagraph positionAt: anIndex. + aParagraph indexAtPosition: aPoint ]. self assert: theIndices equals: (0 to: aParagraph text size) asArray. ^ aParagraph ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtBetweenFirstAndSecondCharacterInHaba [ - - | aParagraph anIndex | +BlTextParagraphExamplesTest >> testIndexAtBetweenFirstAndSecondCharacterInHaba [ - aParagraph := self measuredHaba. + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. anIndex := aParagraph indexAtPosition: self glyphWidth @ self ascent. - + self assert: anIndex equals: 1. ^ anIndex ] { #category : #'geometry - HelloWorld' } -BlTextParagraphExamples >> indexAtBetweenFirstAndSecondCharacterInHelloWorld [ - - | aParagraph anIndex | +BlTextParagraphExamplesTest >> testIndexAtBetweenFirstAndSecondCharacterInHelloWorld [ - aParagraph := self measuredHelloWorld. - anIndex := aParagraph indexAtPosition: (self glyphWidth * 1) @ self ascent. + + | aParagraph anIndex | + aParagraph := self testMeasuredHelloWorld. + anIndex := aParagraph indexAtPosition: + self glyphWidth * 1 @ self ascent. self assert: anIndex equals: 1. @@ -232,15 +279,16 @@ BlTextParagraphExamples >> indexAtBetweenFirstAndSecondCharacterInHelloWorld [ ] { #category : #'geometry - Object>>#printOn:' } -BlTextParagraphExamples >> indexAtBetweenFirstAndSecondCharacterInObjectPrintOn [ - - | aParagraph anIndex | +BlTextParagraphExamplesTest >> testIndexAtBetweenFirstAndSecondCharacterInObjectPrintOn [ + + | aParagraph anIndex | aParagraph := self newParagraph. aParagraph text: self objectPrintOnText. - aParagraph measureOn: self measurer. - - anIndex := aParagraph indexAtPosition: (self glyphWidth * 1) @ self ascent. + aParagraph measureOn: self testMeasurer. + + anIndex := aParagraph indexAtPosition: + self glyphWidth * 1 @ self ascent. self assert: anIndex equals: 1. @@ -248,12 +296,12 @@ BlTextParagraphExamples >> indexAtBetweenFirstAndSecondCharacterInObjectPrintOn ] { #category : #'geometry - HelloWorld' } -BlTextParagraphExamples >> indexAtBetweenFirstAndSecondCharacterInRealHelloWorld [ - +BlTextParagraphExamplesTest >> testIndexAtBetweenFirstAndSecondCharacterInRealHelloWorld [ + + | aParagraph anIndex aPosition | + aParagraph := self testRealMeasuredHelloWorld. - aParagraph := self realMeasuredHelloWorld. - aPosition := aParagraph positionAt: 1. anIndex := aParagraph indexAtPosition: aPosition. @@ -263,26 +311,28 @@ BlTextParagraphExamples >> indexAtBetweenFirstAndSecondCharacterInRealHelloWorld ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtBetweenHalfsOfFirstCharacterInHaba [ - +BlTextParagraphExamplesTest >> testIndexAtBetweenHalfsOfFirstCharacterInHaba [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. + anIndex := aParagraph indexAtPosition: + self glyphWidth / 2.0 @ self ascent. - aParagraph := self measuredHaba. - anIndex := aParagraph indexAtPosition: (self glyphWidth / 2.0) @ self ascent. - self assert: anIndex equals: 0. ^ anIndex ] { #category : #'geometry - HelloWorld' } -BlTextParagraphExamples >> indexAtBetweenSeventhAndEighthCharacterInHelloWorld [ - +BlTextParagraphExamplesTest >> testIndexAtBetweenSeventhAndEighthCharacterInHelloWorld [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHelloWorld. - aParagraph := self measuredHelloWorld. - - anIndex := aParagraph indexAtPosition: (self glyphWidth * 7) @ self ascent. + anIndex := aParagraph indexAtPosition: + self glyphWidth * 7 @ self ascent. self assert: anIndex equals: 7. @@ -290,15 +340,16 @@ BlTextParagraphExamples >> indexAtBetweenSeventhAndEighthCharacterInHelloWorld [ ] { #category : #'geometry - Object>>#printOn:' } -BlTextParagraphExamples >> indexAtBetweenSeventhAndEighthCharacterInObjectPrintOn [ - - | aParagraph anIndex | +BlTextParagraphExamplesTest >> testIndexAtBetweenSeventhAndEighthCharacterInObjectPrintOn [ + + | aParagraph anIndex | aParagraph := self newParagraph. aParagraph text: self objectPrintOnText. - aParagraph measureOn: self measurer. - - anIndex := aParagraph indexAtPosition: (self glyphWidth * 7) @ self ascent. + aParagraph measureOn: self testMeasurer. + + anIndex := aParagraph indexAtPosition: + self glyphWidth * 7 @ self ascent. self assert: anIndex equals: 7. @@ -306,12 +357,12 @@ BlTextParagraphExamples >> indexAtBetweenSeventhAndEighthCharacterInObjectPrintO ] { #category : #'geometry - HelloWorld' } -BlTextParagraphExamples >> indexAtBetweenSeventhAndEighthCharacterInRealHelloWorld [ - +BlTextParagraphExamplesTest >> testIndexAtBetweenSeventhAndEighthCharacterInRealHelloWorld [ + + | aParagraph anIndex aPosition | + aParagraph := self testRealMeasuredHelloWorld. - aParagraph := self realMeasuredHelloWorld. - aPosition := aParagraph positionAt: 7. anIndex := aParagraph indexAtPosition: aPosition. @@ -321,184 +372,198 @@ BlTextParagraphExamples >> indexAtBetweenSeventhAndEighthCharacterInRealHelloWor ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> indexAtFarBottomLeftPointInEmpty [ - +BlTextParagraphExamplesTest >> testIndexAtFarBottomLeftPointInEmpty [ + + | aParagraph anIndex | + aParagraph := self testMeasuredEmpty. + anIndex := aParagraph indexAtPosition: + (self ascent * 10) negated @ (self ascent * 10). - aParagraph := self measuredEmpty. - anIndex := aParagraph indexAtPosition: (self ascent * 10) negated @ (self ascent * 10). - self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtFarBottomLeftPointInHaba [ - +BlTextParagraphExamplesTest >> testIndexAtFarBottomLeftPointInHaba [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. + anIndex := aParagraph indexAtPosition: + (self glyphWidth * self haba size * 10) negated + @ (self ascent * 10). - aParagraph := self measuredHaba. - anIndex := aParagraph indexAtPosition: (self glyphWidth * self haba size * 10) negated @ (self ascent * 10). - self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> indexAtFarBottomPointInEmpty [ - - | aParagraph anIndex | +BlTextParagraphExamplesTest >> testIndexAtFarBottomPointInEmpty [ - aParagraph := self measuredEmpty. + + | aParagraph anIndex | + aParagraph := self testMeasuredEmpty. anIndex := aParagraph indexAtPosition: 0 @ (self ascent * 10). - + self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> indexAtFarBottomRightPointInEmpty [ - +BlTextParagraphExamplesTest >> testIndexAtFarBottomRightPointInEmpty [ + + | aParagraph anIndex | + aParagraph := self testMeasuredEmpty. + anIndex := aParagraph indexAtPosition: + self ascent * 10 @ (self ascent * 10). - aParagraph := self measuredEmpty. - anIndex := aParagraph indexAtPosition: (self ascent * 10) @ (self ascent * 10). - self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> indexAtFarTopLeftPointInEmpty [ - +BlTextParagraphExamplesTest >> testIndexAtFarTopLeftPointInEmpty [ + + | aParagraph anIndex | + aParagraph := self testMeasuredEmpty. + anIndex := aParagraph indexAtPosition: + (self ascent * 10) asPoint negated. - aParagraph := self measuredEmpty. - anIndex := aParagraph indexAtPosition: (self ascent * 10) asPoint negated. - self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> indexAtFarTopPointInEmpty [ - +BlTextParagraphExamplesTest >> testIndexAtFarTopPointInEmpty [ + + | aParagraph anIndex | + aParagraph := self testMeasuredEmpty. + anIndex := aParagraph indexAtPosition: 0 @ (self ascent * 10) negated. - aParagraph := self measuredEmpty. - anIndex := aParagraph indexAtPosition: 0@(self ascent * 10) negated. - self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> indexAtFarTopRightPointInEmpty [ - +BlTextParagraphExamplesTest >> testIndexAtFarTopRightPointInEmpty [ + + | aParagraph anIndex | + aParagraph := self testMeasuredEmpty. + anIndex := aParagraph indexAtPosition: + self ascent * 10 @ (self ascent * 10) negated. - aParagraph := self measuredEmpty. - anIndex := aParagraph indexAtPosition: (self ascent * 10) @ (self ascent * 10) negated. - self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> indexAtFarZeroInEmpty [ - +BlTextParagraphExamplesTest >> testIndexAtFarZeroInEmpty [ + + | aParagraph anIndex | + aParagraph := self testMeasuredEmpty. + anIndex := aParagraph indexAtPosition: 0 @ 0. - aParagraph := self measuredEmpty. - anIndex := aParagraph indexAtPosition: 0@0. - self assert: anIndex equals: 0. - + ^ anIndex ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtLeftHalfOfFirstCharacterInHaba [ - +BlTextParagraphExamplesTest >> testIndexAtLeftHalfOfFirstCharacterInHaba [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. + anIndex := aParagraph indexAtPosition: + self glyphWidth / 3.0 @ self ascent. - aParagraph := self measuredHaba. - anIndex := aParagraph indexAtPosition: (self glyphWidth / 3.0) @ self ascent. - self assert: anIndex equals: 0. ^ anIndex ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtLeftHalfOfForthCharacterInHaba [ - +BlTextParagraphExamplesTest >> testIndexAtLeftHalfOfForthCharacterInHaba [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. + anIndex := aParagraph indexAtPosition: + self glyphWidth * 3 + (self glyphWidth / 3.0) + @ self ascent. - aParagraph := self measuredHaba. - anIndex := aParagraph indexAtPosition: ((self glyphWidth * 3) + (self glyphWidth / 3.0)) @ self ascent. - self assert: anIndex equals: 3. ^ anIndex ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtLeftHalfOfSecondCharacterInHaba [ - +BlTextParagraphExamplesTest >> testIndexAtLeftHalfOfSecondCharacterInHaba [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. + anIndex := aParagraph indexAtPosition: + self glyphWidth * 1 + (self glyphWidth / 3.0) + @ self ascent. - aParagraph := self measuredHaba. - anIndex := aParagraph indexAtPosition: ((self glyphWidth * 1) + (self glyphWidth / 3.0)) @ self ascent. - self assert: anIndex equals: 1. ^ anIndex ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtLeftHalfOfThirdCharacterInHaba [ - +BlTextParagraphExamplesTest >> testIndexAtLeftHalfOfThirdCharacterInHaba [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. + anIndex := aParagraph indexAtPosition: + self glyphWidth * 2 + (self glyphWidth / 3.0) + @ self ascent. - aParagraph := self measuredHaba. - anIndex := aParagraph indexAtPosition: ((self glyphWidth * 2) + (self glyphWidth / 3.0)) @ self ascent. - self assert: anIndex equals: 2. ^ anIndex ] { #category : #'geometry - haba' } -BlTextParagraphExamples >> indexAtRightHalfOfFirstCharacterInHaba [ - +BlTextParagraphExamplesTest >> testIndexAtRightHalfOfFirstCharacterInHaba [ + + | aParagraph anIndex | + aParagraph := self testMeasuredHaba. + anIndex := aParagraph indexAtPosition: + self glyphWidth / 1.5 @ self ascent. - aParagraph := self measuredHaba. - anIndex := aParagraph indexAtPosition: (self glyphWidth / 1.5) @ self ascent. - self assert: anIndex equals: 1. - + ^ anIndex ] { #category : #'paragraph - measuring' } -BlTextParagraphExamples >> measuredEmoji [ - +BlTextParagraphExamplesTest >> testMeasuredEmoji [ + + | aParagraph aLine aSpan | - aParagraph := self emojiParagraph. - aParagraph measureOn: self measurer. - + aParagraph measureOn: self testMeasurer. + self assert: aParagraph measuredEnd equals: 1. - + aLine := aParagraph line. self assert: aLine ascent equals: self ascent. self assert: aLine baseline equals: 0 @ self ascent abs. @@ -510,41 +575,41 @@ BlTextParagraphExamples >> measuredEmoji [ self assert: aLine to equals: 1. self assert: aLine top equals: 0. self assert: aLine width equals: self emoji size * self glyphWidth. - + aSpan := aLine spans first. self assert: aSpan advance equals: self emoji size * self glyphWidth. self assert: aSpan ascent equals: self ascent. self assert: aSpan baseline equals: 0 @ self ascent abs. self assert: aSpan descent equals: self descent. - self assert: aSpan from equals: 1. + self assert: aSpan from equals: 1. self assert: aSpan height equals: self height. self assert: aSpan left equals: 0. - self assert: aSpan spanEnd equals: 1. + self assert: aSpan spanEnd equals: 1. self assert: aSpan spanStart equals: 1. self assert: aSpan textRun equals: self emoji. self assert: aSpan textRunEnd equals: 1. self assert: aSpan textRunStart equals: 1. self assert: aSpan to equals: 1. self assert: aSpan top equals: 0. - self assert: aSpan width equals: (self emoji size * self glyphWidth). - + self assert: aSpan width equals: self emoji size * self glyphWidth. + self assert: aSpan spanLength equals: 1. self assert: aSpan textRunLength equals: 1. self assert: aSpan isSplitted not. - + ^ aParagraph ] { #category : #'paragraph - measuring' } -BlTextParagraphExamples >> measuredEmpty [ - +BlTextParagraphExamplesTest >> testMeasuredEmpty [ + + | aParagraph aLine aSpan | - aParagraph := self emptyParagraph. - aParagraph measureOn: self measurer. - + aParagraph measureOn: self testMeasurer. + self assert: aParagraph measuredEnd equals: 0. - + aLine := aParagraph line. self assert: aLine ascent equals: self ascent. self assert: aLine baseline equals: 0 @ self ascent abs. @@ -556,41 +621,41 @@ BlTextParagraphExamples >> measuredEmpty [ self assert: aLine to equals: 0. self assert: aLine top equals: 0. self assert: aLine width equals: 0. - + aSpan := aLine spans first. self assert: aSpan advance equals: 0. self assert: aSpan ascent equals: self ascent. self assert: aSpan baseline equals: 0 @ self ascent abs. self assert: aSpan descent equals: self descent. - self assert: aSpan from equals: 0. + self assert: aSpan from equals: 0. self assert: aSpan height equals: 0. self assert: aSpan left equals: 0. - self assert: aSpan spanEnd equals: 0. + self assert: aSpan spanEnd equals: 0. self assert: aSpan spanStart equals: 0. self assert: aSpan textRun equals: ''. - self assert: aSpan textRunEnd equals: 0. + self assert: aSpan textRunEnd equals: 0. self assert: aSpan textRunStart equals: 0. self assert: aSpan to equals: 0. self assert: aSpan top equals: 0. self assert: aSpan width equals: 0. - + self assert: aSpan spanLength equals: 0. self assert: aSpan textRunLength equals: 0. self assert: aSpan isSplitted not. - + ^ aParagraph ] { #category : #'paragraph - measuring' } -BlTextParagraphExamples >> measuredHaba [ - +BlTextParagraphExamplesTest >> testMeasuredHaba [ + + | aParagraph aLine aSpan | - aParagraph := self habaParagraph. - aParagraph measureOn: self measurer. - + aParagraph measureOn: self testMeasurer. + "self assert: aParagraph measuredEnd equals: 4." - + aLine := aParagraph line. self assert: aLine ascent equals: self ascent. self assert: aLine baseline equals: 0 @ self ascent abs. @@ -602,45 +667,45 @@ BlTextParagraphExamples >> measuredHaba [ self assert: aLine to equals: 4. self assert: aLine top equals: 0. self assert: aLine width equals: self haba size * self glyphWidth. - + aSpan := aLine spans first. self assert: aSpan advance equals: self haba size * self glyphWidth. self assert: aSpan ascent equals: self ascent. self assert: aSpan baseline equals: 0 @ self ascent abs. self assert: aSpan descent equals: self descent. - self assert: aSpan from equals: 1. + self assert: aSpan from equals: 1. self assert: aSpan height equals: self height. self assert: aSpan left equals: 0. - self assert: aSpan spanEnd equals: 4. + self assert: aSpan spanEnd equals: 4. self assert: aSpan spanStart equals: 1. self assert: aSpan textRun equals: self haba. self assert: aSpan textRunEnd equals: 4. self assert: aSpan textRunStart equals: 1. self assert: aSpan to equals: 4. self assert: aSpan top equals: 0. - self assert: aSpan width equals: (self haba size * self glyphWidth). - + self assert: aSpan width equals: self haba size * self glyphWidth. + self assert: aSpan spanLength equals: 4. self assert: aSpan textRunLength equals: 4. self assert: aSpan isSplitted not. - + ^ aParagraph ] { #category : #'paragraph - measuring' } -BlTextParagraphExamples >> measuredHelloWorld [ - +BlTextParagraphExamplesTest >> testMeasuredHelloWorld [ + + | aParagraph aLine aFirstSpan aSecondSpan aText aHello aWorld | - aParagraph := self helloWorldParagraph. - aParagraph measureOn: self measurer. - + aParagraph measureOn: self testMeasurer. + aText := aParagraph text. aHello := aText from: 1 to: 5. aWorld := aText from: 6 to: 10. - + self assert: aParagraph measuredEnd equals: aText size. - + aLine := aParagraph line. self assert: aLine ascent equals: self ascent. self assert: aLine baseline equals: 0 @ self ascent abs. @@ -652,272 +717,237 @@ BlTextParagraphExamples >> measuredHelloWorld [ self assert: aLine to equals: aText size. self assert: aLine top equals: 0. self assert: aLine width equals: aText size * self glyphWidth. - + "first span" aFirstSpan := aLine spans first. self assert: aFirstSpan advance equals: aHello size * self glyphWidth. self assert: aFirstSpan ascent equals: self ascent. self assert: aFirstSpan baseline equals: 0 @ self ascent abs. self assert: aFirstSpan descent equals: self descent. - self assert: aFirstSpan from equals: 1. + self assert: aFirstSpan from equals: 1. self assert: aFirstSpan to equals: aHello size. self assert: aFirstSpan height equals: self height. self assert: aFirstSpan left equals: 0. - self assert: aFirstSpan spanEnd equals: aHello size. + self assert: aFirstSpan spanEnd equals: aHello size. self assert: aFirstSpan spanStart equals: 1. self assert: aFirstSpan textRun equals: aHello asString. self assert: aFirstSpan textRunEnd equals: aHello size. self assert: aFirstSpan textRunStart equals: 1. self assert: aFirstSpan top equals: 0. - self assert: aFirstSpan width equals: (aHello size * self glyphWidth). + self assert: aFirstSpan width equals: aHello size * self glyphWidth. self assert: aFirstSpan spanLength equals: aHello size. self assert: aFirstSpan textRunLength equals: aHello size. self assert: aFirstSpan isSplitted not. - + "second span" aSecondSpan := aLine spans second. - self assert: aSecondSpan advance equals: aWorld size * self glyphWidth. + self + assert: aSecondSpan advance + equals: aWorld size * self glyphWidth. self assert: aSecondSpan ascent equals: self ascent. - self assert: aSecondSpan baseline equals: (aFirstSpan width @ self ascent abs). + self + assert: aSecondSpan baseline + equals: aFirstSpan width @ self ascent abs. self assert: aSecondSpan descent equals: self descent. - self assert: aSecondSpan from equals: aHello size + 1. + self assert: aSecondSpan from equals: aHello size + 1. self assert: aSecondSpan to equals: aHello size + aWorld size. self assert: aSecondSpan height equals: self height. self assert: aSecondSpan left equals: 0. - self assert: aSecondSpan spanEnd equals: aWorld size. + self assert: aSecondSpan spanEnd equals: aWorld size. self assert: aSecondSpan spanStart equals: 1. self assert: aSecondSpan textRun equals: aWorld asString. self assert: aSecondSpan textRunEnd equals: aWorld size. self assert: aSecondSpan textRunStart equals: 1. self assert: aSecondSpan top equals: 0. - self assert: aSecondSpan width equals: (aWorld size * self glyphWidth). + self assert: aSecondSpan width equals: aWorld size * self glyphWidth. self assert: aSecondSpan spanLength equals: aWorld size. self assert: aSecondSpan textRunLength equals: aWorld size. self assert: aSecondSpan isSplitted not. - + ^ aParagraph ] { #category : #'instance creation' } -BlTextParagraphExamples >> measurer [ - +BlTextParagraphExamplesTest >> testMeasurer [ + | aMeasurer | aMeasurer := BAMockedTextMeasurer new - ascent: self ascent; - descent: self descent; - glyphWidth: self glyphWidth; - height: self height. - + ascent: self ascent; + descent: self descent; + glyphWidth: self glyphWidth; + height: self height. + self assert: aMeasurer ascent equals: self ascent. self assert: aMeasurer descent equals: self descent. self assert: aMeasurer glyphWidth equals: self glyphWidth. self assert: aMeasurer height equals: self height. - - ^ aMeasurer -] - -{ #category : #'instance creation' } -BlTextParagraphExamples >> newParagraph [ - - | aParagraph | - - aParagraph := BlTextParagraph new. - ^ aParagraph -] - -{ #category : #'instance creation' } -BlTextParagraphExamples >> objectPrintOnText [ - - | aText | - - aText := 'Object>>#printOn:' asRopedText. - (aText from: 1 to: 6) foreground: Color blue. - (aText from: 9 to: aText size) foreground: Color magenta. - - ^ aText -] -{ #category : #'instance creation' } -BlTextParagraphExamples >> pointWithDotText [ - - | aText | - - aText := '100@100.' asRopedText. - (aText from: 1 to: 3) foreground: Color red. - (aText from: 5 to: 7) foreground: Color red. - (aText from: 8 to: 8) bold. - - ^ aText + ^ aMeasurer ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> positionAtIndexInEmpty [ - +BlTextParagraphExamplesTest >> testPositionAtIndexInEmpty [ + + | aParagraph aPoint | - - aParagraph := self measuredEmpty. + aParagraph := self testMeasuredEmpty. aPoint := aParagraph positionAt: 0. - + self assert: aPoint equals: 0 @ aParagraph baseline y. - + ^ aPoint ] { #category : #'paragraph - measuring' } -BlTextParagraphExamples >> realMeasuredHelloWorld [ - +BlTextParagraphExamplesTest >> testRealMeasuredHelloWorld [ + + | aParagraph aLine aFirstSpan aSecondSpan aText aHello aWorld | - aParagraph := self helloWorldParagraph. aParagraph measureOn: self realMeasurer. - + aText := aParagraph text. aHello := aText from: 1 to: 5. aWorld := aText from: 6 to: 10. - + self assert: aParagraph measuredEnd equals: aText size. - + aLine := aParagraph line. self assert: aLine from equals: 1. self assert: aLine spans size equals: 2. self assert: aLine to equals: aText size. - + "first span" aFirstSpan := aLine spans first. - self assert: aFirstSpan from equals: 1. + self assert: aFirstSpan from equals: 1. self assert: aFirstSpan to equals: aHello size. - self assert: aFirstSpan spanEnd equals: aHello size. + self assert: aFirstSpan spanEnd equals: aHello size. self assert: aFirstSpan spanStart equals: 1. self assert: aFirstSpan textRunEnd equals: aHello size. self assert: aFirstSpan textRunStart equals: 1. self assert: aFirstSpan spanLength equals: aHello size. self assert: aFirstSpan textRunLength equals: aHello size. self assert: aFirstSpan isSplitted not. - + "second span" aSecondSpan := aLine spans second. - self assert: aSecondSpan from equals: aHello size + 1. + self assert: aSecondSpan from equals: aHello size + 1. self assert: aSecondSpan to equals: aHello size + aWorld size. - self assert: aSecondSpan spanEnd equals: aWorld size. + self assert: aSecondSpan spanEnd equals: aWorld size. self assert: aSecondSpan spanStart equals: 1. self assert: aSecondSpan textRunEnd equals: aWorld size. self assert: aSecondSpan textRunStart equals: 1. self assert: aSecondSpan spanLength equals: aWorld size. self assert: aSecondSpan textRunLength equals: aWorld size. self assert: aSecondSpan isSplitted not. - - ^ aParagraph -] - -{ #category : #'instance creation' } -BlTextParagraphExamples >> realMeasurer [ - - self error: 'TODO: migrate from Sparta' - "^ BlSpartaCanvasTextMeasurer new canvas: Bloc preferableSpartaCanvas offscreen" + ^ aParagraph ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtFarBottomLeftPointInEmpty [ - +BlTextParagraphExamplesTest >> testSpanAtFarBottomLeftPointInEmpty [ + + | aParagraph aSpan | + aParagraph := self testMeasuredEmpty. + aSpan := aParagraph spanAtPoint: + (self ascent * 10) negated @ (self ascent * 10). - aParagraph := self measuredEmpty. - aSpan := aParagraph spanAtPoint: (self ascent * 10) negated @ (self ascent * 10). - self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtFarBottomPointInEmpty [ - - | aParagraph aSpan | +BlTextParagraphExamplesTest >> testSpanAtFarBottomPointInEmpty [ - aParagraph := self measuredEmpty. + + | aParagraph aSpan | + aParagraph := self testMeasuredEmpty. aSpan := aParagraph spanAtPoint: 0 @ (self ascent * 10). - + self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtFarBottomRightPointInEmpty [ - +BlTextParagraphExamplesTest >> testSpanAtFarBottomRightPointInEmpty [ + + | aParagraph aSpan | + aParagraph := self testMeasuredEmpty. + aSpan := aParagraph spanAtPoint: + self ascent * 10 @ (self ascent * 10). - aParagraph := self measuredEmpty. - aSpan := aParagraph spanAtPoint: (self ascent * 10) @ (self ascent * 10). - self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtFarTopLeftPointInEmpty [ - - | aParagraph aSpan | +BlTextParagraphExamplesTest >> testSpanAtFarTopLeftPointInEmpty [ - aParagraph := self measuredEmpty. + + | aParagraph aSpan | + aParagraph := self testMeasuredEmpty. aSpan := aParagraph spanAtPoint: (self ascent * 10) asPoint negated. - + self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtFarTopPointInEmpty [ - +BlTextParagraphExamplesTest >> testSpanAtFarTopPointInEmpty [ + + | aParagraph aSpan | + aParagraph := self testMeasuredEmpty. + aSpan := aParagraph spanAtPoint: 0 @ (self ascent * 10) negated. - aParagraph := self measuredEmpty. - aSpan := aParagraph spanAtPoint: 0@(self ascent * 10) negated. - self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtFarTopRightPointInEmpty [ - +BlTextParagraphExamplesTest >> testSpanAtFarTopRightPointInEmpty [ + + | aParagraph aSpan | + aParagraph := self testMeasuredEmpty. + aSpan := aParagraph spanAtPoint: + self ascent * 10 @ (self ascent * 10) negated. - aParagraph := self measuredEmpty. - aSpan := aParagraph spanAtPoint: (self ascent * 10) @ (self ascent * 10) negated. - self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtFarZeroInEmpty [ - +BlTextParagraphExamplesTest >> testSpanAtFarZeroInEmpty [ + + | aParagraph aSpan | + aParagraph := self testMeasuredEmpty. + aSpan := aParagraph spanAtPoint: 0 @ 0. - aParagraph := self measuredEmpty. - aSpan := aParagraph spanAtPoint: 0@0. - self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] { #category : #'geometry - empty' } -BlTextParagraphExamples >> spanAtIndexInEmpty [ - +BlTextParagraphExamplesTest >> testSpanAtIndexInEmpty [ + + | aParagraph aSpan | - - aParagraph := self measuredEmpty. + aParagraph := self testMeasuredEmpty. aSpan := aParagraph spanAtIndex: 0. - + self assert: aSpan equals: aParagraph line spans first. - + ^ aSpan ] diff --git a/src/Bloc-Text-Examples/BlTextUnderlineAttributeExamples.class.st b/src/Bloc-Text-Examples/BlTextUnderlineAttributeExamplesTest.class.st similarity index 68% rename from src/Bloc-Text-Examples/BlTextUnderlineAttributeExamples.class.st rename to src/Bloc-Text-Examples/BlTextUnderlineAttributeExamplesTest.class.st index 1ddf7f2d4..b0c3f42e1 100644 --- a/src/Bloc-Text-Examples/BlTextUnderlineAttributeExamples.class.st +++ b/src/Bloc-Text-Examples/BlTextUnderlineAttributeExamplesTest.class.st @@ -12,18 +12,18 @@ In addition to the simple API an underline attribute can be customized and then " Class { - #name : #BlTextUnderlineAttributeExamples, - #superclass : #BlExampleTest, + #name : #BlTextUnderlineAttributeExamplesTest, + #superclass : #TestCase, #category : #'Bloc-Text-Examples-Model' } { #category : #attribute } -BlTextUnderlineAttributeExamples >> lineOfUnderlineAttribute [ - +BlTextUnderlineAttributeExamplesTest >> lineOfUnderlineAttribute [ - self error: 'TODO: migrate from Sparta'. + + self error: 'TODO: migrate from Sparta' -" | anAttribute aCanvas aSpan aLine | + " | anAttribute aCanvas aSpan aLine | anAttribute := self underlineAttribute. aSpan := BlMockedTextParagraphSpan new @@ -40,32 +40,49 @@ BlTextUnderlineAttributeExamples >> lineOfUnderlineAttribute [ ^ aLine" ] +{ #category : #attribute } +BlTextUnderlineAttributeExamplesTest >> testUnderlineAttribute [ + + + | anAttribute | + anAttribute := BlTextDecorationAttribute new underline. + + self assert: anAttribute thickness equals: 1. + self assert: anAttribute color equals: Color black. + + ^ anAttribute +] + { #category : #accessing } -BlTextUnderlineAttributeExamples >> text [ - +BlTextUnderlineAttributeExamplesTest >> text [ - ^ 'Hello' asRopedText fontSize: 75; foreground: Color veryDarkGray + + ^ 'Hello' asRopedText + fontSize: 75; + foreground: Color veryDarkGray ] { #category : #accessing } -BlTextUnderlineAttributeExamples >> textWithUnderlineDo [ - - ^ self text - underlineDo: [ :anUnderline | - anUnderline - color: Color red; - thickness: 6 ] +BlTextUnderlineAttributeExamplesTest >> textWithUnderlineDo [ + + + ^ self text underlineDo: [ :anUnderline | + anUnderline + color: Color red; + thickness: 6 ] ] { #category : #accessing } -BlTextUnderlineAttributeExamples >> textWithUnderline_1_to_5 [ - +BlTextUnderlineAttributeExamplesTest >> textWithUnderline_1_to_5 [ + + ^ self text underlineColor: (Color red alpha: 0.5) thickness: 6 ] { #category : #accessing } -BlTextUnderlineAttributeExamples >> textWithUnderline_2_to_3 [ - +BlTextUnderlineAttributeExamplesTest >> textWithUnderline_2_to_3 [ + + | aText | aText := self text. (aText from: 2 to: 3) @@ -75,8 +92,9 @@ BlTextUnderlineAttributeExamples >> textWithUnderline_2_to_3 [ ] { #category : #accessing } -BlTextUnderlineAttributeExamples >> textWithUnderline_2_to_4 [ - +BlTextUnderlineAttributeExamplesTest >> textWithUnderline_2_to_4 [ + + | aText | aText := self text. (aText from: 2 to: 4) @@ -86,8 +104,9 @@ BlTextUnderlineAttributeExamples >> textWithUnderline_2_to_4 [ ] { #category : #accessing } -BlTextUnderlineAttributeExamples >> textWithUnderline_3_to_4 [ - +BlTextUnderlineAttributeExamplesTest >> textWithUnderline_3_to_4 [ + + | aText | aText := self text. (aText from: 3 to: 4) @@ -97,8 +116,9 @@ BlTextUnderlineAttributeExamples >> textWithUnderline_3_to_4 [ ] { #category : #accessing } -BlTextUnderlineAttributeExamples >> textWithUnderline_3_to_5 [ - +BlTextUnderlineAttributeExamplesTest >> textWithUnderline_3_to_5 [ + + | aText | aText := self text. (aText from: 3 to: 5) @@ -106,16 +126,3 @@ BlTextUnderlineAttributeExamples >> textWithUnderline_3_to_5 [ thickness: 6. ^ aText ] - -{ #category : #attribute } -BlTextUnderlineAttributeExamples >> underlineAttribute [ - - | anAttribute | - - anAttribute := BlTextDecorationAttribute new underline. - - self assert: anAttribute thickness equals: 1. - self assert: anAttribute color equals: Color black. - - ^ anAttribute -] diff --git a/src/Bloc-UnitedTests/BlExamplesMock.class.st b/src/Bloc-UnitedTests/BlExamplesMock.class.st index 79df72a78..b8a308725 100644 --- a/src/Bloc-UnitedTests/BlExamplesMock.class.st +++ b/src/Bloc-UnitedTests/BlExamplesMock.class.st @@ -5,7 +5,7 @@ See my references. " Class { #name : #BlExamplesMock, - #superclass : #BlExampleTest, + #superclass : #TestCase, #instVars : [ 'enabled' ], @@ -19,48 +19,44 @@ BlExamplesMock >> enableRunning [ ] { #category : #examples } -BlExamplesMock >> exampleError [ - +BlExamplesMock >> exampleWithArgument: arg [ - self error + ] -{ #category : #examples } -BlExamplesMock >> exampleFail [ - +{ #category : #initialization } +BlExamplesMock >> initialize [ - self fail + super initialize. + enabled := false ] -{ #category : #examples } -BlExamplesMock >> examplePass [ - +{ #category : #private } +BlExamplesMock >> performTest [ + enabled ifTrue: [ super performTest ] ] { #category : #examples } -BlExamplesMock >> exampleSkip [ - - - +BlExamplesMock >> testExampleError [ + self error ] { #category : #examples } -BlExamplesMock >> exampleWithArgument: arg [ - - -] +BlExamplesMock >> testExampleFail [ -{ #category : #initialization } -BlExamplesMock >> initialize [ + self fail +] - super initialize. - enabled := false +{ #category : #examples } +BlExamplesMock >> testExamplePass [ + + ] -{ #category : #private } -BlExamplesMock >> performTest [ +{ #category : #examples } +BlExamplesMock >> testExampleSkip [ - enabled ifTrue: [ super performTest ] + self skip ] diff --git a/src/Bloc-UnitedTests/BlSpace2Test.class.st b/src/Bloc-UnitedTests/BlSpace2Test.class.st index fd330a071..bad59a978 100644 --- a/src/Bloc-UnitedTests/BlSpace2Test.class.st +++ b/src/Bloc-UnitedTests/BlSpace2Test.class.st @@ -12,7 +12,7 @@ BlSpace2Test >> animatedElement [ background: Color blue; size: 150 @ 150; position: 100 @ 100; - addAnimation: self infiniteAnimation; + addAnimation: self testInfiniteAnimation; yourself ] @@ -134,3 +134,15 @@ BlSpace2Test >> testFirstPulse [ ^ aSpace ] + +{ #category : #'test seed' } +BlSpace2Test >> testInfiniteAnimation [ + + + | anAnimation | + anAnimation := BlSequentialAnimation new. + anAnimation add: (BlTransformAnimation scale: 2) absolute. + anAnimation add: (BlTransformAnimation scale: 0.5) absolute. + anAnimation beInfinite. + ^ anAnimation +] diff --git a/src/Bloc-UnitedTests/BlTestOfExamplesTest.class.st b/src/Bloc-UnitedTests/BlTestOfExamplesTest.class.st index 6116287eb..b471650ee 100644 --- a/src/Bloc-UnitedTests/BlTestOfExamplesTest.class.st +++ b/src/Bloc-UnitedTests/BlTestOfExamplesTest.class.st @@ -18,7 +18,7 @@ BlTestOfExamplesTest >> testAllExamplesAreConsideredTests [ self assertCollection: BlExamplesMock testSelectors - hasSameElements: #(examplePass exampleFail exampleError exampleSkip) + hasSameElements: #(#testExamplePass #testExampleFail #testExampleError #testExampleSkip) ] @@ -27,7 +27,7 @@ BlTestOfExamplesTest >> testErrors [ self assertCollection: (self examplesTestResult errors collect: [ :each | each selector ]) - hasSameElements: #(exampleError) + hasSameElements: #(#testExampleError) ] @@ -36,7 +36,7 @@ BlTestOfExamplesTest >> testFail [ self assertCollection: (self examplesTestResult failures collect: [ :each | each selector ]) - hasSameElements: #(exampleFail) + hasSameElements: #(#testExampleFail) ] @@ -45,7 +45,7 @@ BlTestOfExamplesTest >> testPass [ self assertCollection: (self examplesTestResult passed collect: [ :each | each selector ]) - hasSameElements: #(examplePass) + hasSameElements: #(#testExamplePass) ] @@ -54,6 +54,6 @@ BlTestOfExamplesTest >> testSkip [ self assertCollection: (self examplesTestResult skipped collect: [ :each | each selector ]) - hasSameElements: #(exampleSkip) + hasSameElements: #(#testExampleSkip) ] diff --git a/src/Bloc/AtomicSharedPriorityQueue.class.st b/src/Bloc/AtomicSharedPriorityQueue.class.st index e3fffee1d..f9a6441c8 100644 --- a/src/Bloc/AtomicSharedPriorityQueue.class.st +++ b/src/Bloc/AtomicSharedPriorityQueue.class.st @@ -25,14 +25,12 @@ Internal Representation and Key Implementation Points. " Class { - #name : 'AtomicSharedPriorityQueue', - #superclass : 'AtomicSharedQueue', - #category : 'Bloc-DataStructure - Priority Queue', - #package : 'Bloc', - #tag : 'DataStructure - Priority Queue' + #name : #AtomicSharedPriorityQueue, + #superclass : #AtomicSharedQueue, + #category : 'Bloc-DataStructure - Priority Queue' } -{ #category : 'accessing' } +{ #category : #accessing } AtomicSharedPriorityQueue >> next [ | result | @@ -46,7 +44,7 @@ AtomicSharedPriorityQueue >> next [ ] -{ #category : 'accessing' } +{ #category : #accessing } AtomicSharedPriorityQueue >> nextIfNone: aBlock [ "Attempt to fetch the next highest priority item from queue (0 = highest priority). Evaluate a block if attempt is failed i.e. there is no items available or queue is locked by another process" @@ -114,7 +112,7 @@ AtomicSharedPriorityQueue >> nextIfNone: aBlock [ ] repeat. ] -{ #category : 'accessing' } +{ #category : #accessing } AtomicSharedPriorityQueue >> nextOrNilSuchThat: aBlock [ "Fetch an object from queue that satisfies aBlock, skipping (but not removing) any intermediate objects. If no object has been found, answer and leave me intact. diff --git a/src/Bloc/BlActionHandler.class.st b/src/Bloc/BlActionHandler.class.st index 90df7fba1..c821b41e8 100644 --- a/src/Bloc/BlActionHandler.class.st +++ b/src/Bloc/BlActionHandler.class.st @@ -1,13 +1,11 @@ Class { - #name : 'BlActionHandler', - #superclass : 'Object', + #name : #BlActionHandler, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlActionHandler >> actionPerformed [ ] diff --git a/src/Bloc/BlAffineCompositeTransformation.class.st b/src/Bloc/BlAffineCompositeTransformation.class.st index 6c578fd06..3d3cf4745 100644 --- a/src/Bloc/BlAffineCompositeTransformation.class.st +++ b/src/Bloc/BlAffineCompositeTransformation.class.st @@ -4,36 +4,34 @@ I composite `BlAffineTransformation` objects. There can be only one transformation instance per type. " Class { - #name : 'BlAffineCompositeTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlAffineCompositeTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'transformations' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'adding' } +{ #category : #adding } BlAffineCompositeTransformation >> addTransformation: aBlAffineTransformation [ "There can be only one transformation instance per type" transformations add: aBlAffineTransformation ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlAffineCompositeTransformation >> do: aBlock [ transformations do: [ :each | each do: aBlock ] ] -{ #category : 'testing' } +{ #category : #testing } BlAffineCompositeTransformation >> hasTransformations [ ^ transformations isNotEmpty ] -{ #category : 'initialization' } +{ #category : #initialization } BlAffineCompositeTransformation >> initialize [ super initialize. @@ -41,45 +39,45 @@ BlAffineCompositeTransformation >> initialize [ transformations := OrderedCollection new ] -{ #category : 'testing' } +{ #category : #testing } BlAffineCompositeTransformation >> is2D [ ^ transformations allSatisfy: [ :each | each is2D ] ] -{ #category : 'testing' } +{ #category : #testing } BlAffineCompositeTransformation >> isIdentity [ ^ self hasTransformations not ] -{ #category : 'testing' } +{ #category : #testing } BlAffineCompositeTransformation >> isTranslation [ ^ transformations allSatisfy: [ :each | each isTranslation ] ] -{ #category : 'testing' } +{ #category : #testing } BlAffineCompositeTransformation >> multiplyOn: aBlMatrix [ transformations do: [ :each | each multiplyOn: aBlMatrix ] ] -{ #category : 'testing' } +{ #category : #testing } BlAffineCompositeTransformation >> multiplyOn: aBlMatrix in: aBlElement [ transformations do: [ :each | each multiplyOn: aBlMatrix in: aBlElement ] ] -{ #category : 'printing' } +{ #category : #printing } BlAffineCompositeTransformation >> printOn: aStream [ aStream nextPutAll: 'Composition' ] -{ #category : 'accessing' } +{ #category : #accessing } BlAffineCompositeTransformation >> transformations [ ^ transformations diff --git a/src/Bloc/BlAffineTransformation.class.st b/src/Bloc/BlAffineTransformation.class.st index 5956b7594..75dc9ecf8 100644 --- a/src/Bloc/BlAffineTransformation.class.st +++ b/src/Bloc/BlAffineTransformation.class.st @@ -6,17 +6,15 @@ https://en.wikipedia.org/wiki/Affine_transformation " Class { - #name : 'BlAffineTransformation', - #superclass : 'Object', + #name : #BlAffineTransformation, + #superclass : #Object, #instVars : [ 'origin' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'converting' } +{ #category : #converting } BlAffineTransformation >> asMatrix [ | aMatrix | @@ -30,13 +28,13 @@ BlAffineTransformation >> asMatrix [ ^ aMatrix ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlAffineTransformation >> do: aBlock [ aBlock value: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlAffineTransformation >> initialize [ super initialize. @@ -44,41 +42,41 @@ BlAffineTransformation >> initialize [ origin := BlAffineTransformationCenterOrigin defaultInstance ] -{ #category : 'testing' } +{ #category : #testing } BlAffineTransformation >> is2D [ "Return true if transformation happens in x-y plane, hence 2D" ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlAffineTransformation >> is3D [ "Return true if transformation happens in x-y-z plane, hence 3D" ^ self is2D not ] -{ #category : 'testing' } +{ #category : #testing } BlAffineTransformation >> isIdentity [ "Return true if thiss transformation is identity" ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlAffineTransformation >> isTranslation [ "Return true if this transformation is translation" ^ false ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlAffineTransformation >> multiplyOn: aBlMatrix [ self subclassResponsibility ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlAffineTransformation >> multiplyOn: aBlMatrix in: aBlElement [ | aBlVector | @@ -89,13 +87,13 @@ BlAffineTransformation >> multiplyOn: aBlMatrix in: aBlElement [ aBlMatrix translateBy: aBlVector ] -{ #category : 'accessing' } +{ #category : #accessing } BlAffineTransformation >> origin [ ^ origin ] -{ #category : 'accessing' } +{ #category : #accessing } BlAffineTransformation >> origin: aBlAffineTransformationOrigin [ origin := aBlAffineTransformationOrigin diff --git a/src/Bloc/BlAffineTransformationCenterOrigin.class.st b/src/Bloc/BlAffineTransformationCenterOrigin.class.st index 2153993dc..ff529a10b 100644 --- a/src/Bloc/BlAffineTransformationCenterOrigin.class.st +++ b/src/Bloc/BlAffineTransformationCenterOrigin.class.st @@ -3,23 +3,21 @@ I am a relative transformation origin which is attached to the center of an elem " Class { - #name : 'BlAffineTransformationCenterOrigin', - #superclass : 'BlAffineTransformationOrigin', + #name : #BlAffineTransformationCenterOrigin, + #superclass : #BlAffineTransformationOrigin, #classInstVars : [ 'defaultInstance' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'accessing' } +{ #category : #accessing } BlAffineTransformationCenterOrigin class >> defaultInstance [ ^ defaultInstance ifNil: [ defaultInstance := self new ] ] -{ #category : 'math' } +{ #category : #math } BlAffineTransformationCenterOrigin >> originIn: anElement [ ^ anElement extent / 2.0 diff --git a/src/Bloc/BlAffineTransformationLeftCenterOrigin.class.st b/src/Bloc/BlAffineTransformationLeftCenterOrigin.class.st index 2f14d6255..43db4adc5 100644 --- a/src/Bloc/BlAffineTransformationLeftCenterOrigin.class.st +++ b/src/Bloc/BlAffineTransformationLeftCenterOrigin.class.st @@ -3,14 +3,12 @@ I am a relative transformation origin which is attached to the left center of an " Class { - #name : 'BlAffineTransformationLeftCenterOrigin', - #superclass : 'BlAffineTransformationOrigin', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #BlAffineTransformationLeftCenterOrigin, + #superclass : #BlAffineTransformationOrigin, + #category : 'Bloc-Basic-Transformations' } -{ #category : 'math' } +{ #category : #math } BlAffineTransformationLeftCenterOrigin >> originIn: anElement [ ^ 0 @ (anElement height / 2.0) diff --git a/src/Bloc/BlAffineTransformationNormalizedPositionOrigin.class.st b/src/Bloc/BlAffineTransformationNormalizedPositionOrigin.class.st index 712bb2264..71725cc6b 100644 --- a/src/Bloc/BlAffineTransformationNormalizedPositionOrigin.class.st +++ b/src/Bloc/BlAffineTransformationNormalizedPositionOrigin.class.st @@ -3,17 +3,15 @@ I allow users to provide a fixed normalized location (top left is 0@0 and bottom " Class { - #name : 'BlAffineTransformationNormalizedPositionOrigin', - #superclass : 'BlAffineTransformationOrigin', + #name : #BlAffineTransformationNormalizedPositionOrigin, + #superclass : #BlAffineTransformationOrigin, #instVars : [ 'position' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlAffineTransformationNormalizedPositionOrigin class >> position: aPoint [ ^ self new @@ -21,7 +19,7 @@ BlAffineTransformationNormalizedPositionOrigin class >> position: aPoint [ yourself ] -{ #category : 'math' } +{ #category : #math } BlAffineTransformationNormalizedPositionOrigin >> originIn: anElement [ "Return a point describing an origin of a transformation within a given element. Origin can be either a 2D or 3D points and should be given in local coordinates of the element" @@ -29,13 +27,13 @@ BlAffineTransformationNormalizedPositionOrigin >> originIn: anElement [ ^ position * anElement extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlAffineTransformationNormalizedPositionOrigin >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlAffineTransformationNormalizedPositionOrigin >> position: aPoint [ position := aPoint diff --git a/src/Bloc/BlAffineTransformationOrigin.class.st b/src/Bloc/BlAffineTransformationOrigin.class.st index d9f9be13c..966152fb0 100644 --- a/src/Bloc/BlAffineTransformationOrigin.class.st +++ b/src/Bloc/BlAffineTransformationOrigin.class.st @@ -4,14 +4,12 @@ I can be very useful when users want to rotate / scale or shear an element about " Class { - #name : 'BlAffineTransformationOrigin', - #superclass : 'Object', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #BlAffineTransformationOrigin, + #superclass : #Object, + #category : 'Bloc-Basic-Transformations' } -{ #category : 'math' } +{ #category : #math } BlAffineTransformationOrigin >> originIn: anElement [ "Return a point describing an origin of a transformation within a given element. Origin can be either a 2D or 3D point (`Point` or `BlPoint3D`) and should be given in local coordinates of the element" diff --git a/src/Bloc/BlAffineTransformationPositionOrigin.class.st b/src/Bloc/BlAffineTransformationPositionOrigin.class.st index 885592de2..c987390b3 100644 --- a/src/Bloc/BlAffineTransformationPositionOrigin.class.st +++ b/src/Bloc/BlAffineTransformationPositionOrigin.class.st @@ -3,17 +3,15 @@ I allow users to provide a fixed location that should be used as transformation " Class { - #name : 'BlAffineTransformationPositionOrigin', - #superclass : 'BlAffineTransformationOrigin', + #name : #BlAffineTransformationPositionOrigin, + #superclass : #BlAffineTransformationOrigin, #instVars : [ 'position' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlAffineTransformationPositionOrigin class >> position: aPoint [ ^ self new @@ -21,19 +19,19 @@ BlAffineTransformationPositionOrigin class >> position: aPoint [ yourself ] -{ #category : 'math' } +{ #category : #math } BlAffineTransformationPositionOrigin >> originIn: anElement [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlAffineTransformationPositionOrigin >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlAffineTransformationPositionOrigin >> position: aPoint [ position := aPoint diff --git a/src/Bloc/BlAffineTransformationRightCenterOrigin.class.st b/src/Bloc/BlAffineTransformationRightCenterOrigin.class.st index 44efd2b36..bcd70dd62 100644 --- a/src/Bloc/BlAffineTransformationRightCenterOrigin.class.st +++ b/src/Bloc/BlAffineTransformationRightCenterOrigin.class.st @@ -3,14 +3,12 @@ I am a relative transformation origin which is attached to the right center of a " Class { - #name : 'BlAffineTransformationRightCenterOrigin', - #superclass : 'BlAffineTransformationOrigin', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #BlAffineTransformationRightCenterOrigin, + #superclass : #BlAffineTransformationOrigin, + #category : 'Bloc-Basic-Transformations' } -{ #category : 'math' } +{ #category : #math } BlAffineTransformationRightCenterOrigin >> originIn: anElement [ ^ anElement width @ (anElement height / 2.0) diff --git a/src/Bloc/BlAffineTransformationTopLeftOrigin.class.st b/src/Bloc/BlAffineTransformationTopLeftOrigin.class.st index 9c61ffaff..5f0e919c7 100644 --- a/src/Bloc/BlAffineTransformationTopLeftOrigin.class.st +++ b/src/Bloc/BlAffineTransformationTopLeftOrigin.class.st @@ -3,14 +3,12 @@ I am a relative transformation origin which is attached to the top left of an el " Class { - #name : 'BlAffineTransformationTopLeftOrigin', - #superclass : 'BlAffineTransformationOrigin', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #BlAffineTransformationTopLeftOrigin, + #superclass : #BlAffineTransformationOrigin, + #category : 'Bloc-Basic-Transformations' } -{ #category : 'math' } +{ #category : #math } BlAffineTransformationTopLeftOrigin >> originIn: anElement [ ^ 0 @ 0 diff --git a/src/Bloc/BlAliasCursor.class.st b/src/Bloc/BlAliasCursor.class.st index 18f755713..c1171bf12 100644 --- a/src/Bloc/BlAliasCursor.class.st +++ b/src/Bloc/BlAliasCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlAliasCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlAliasCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlAllScrollCursor.class.st b/src/Bloc/BlAllScrollCursor.class.st index 19ba477b3..1578e3993 100644 --- a/src/Bloc/BlAllScrollCursor.class.st +++ b/src/Bloc/BlAllScrollCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlAllScrollCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlAllScrollCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlAlreadyAddedAsChildError.class.st b/src/Bloc/BlAlreadyAddedAsChildError.class.st index ebff6ad66..f4c305367 100644 --- a/src/Bloc/BlAlreadyAddedAsChildError.class.st +++ b/src/Bloc/BlAlreadyAddedAsChildError.class.st @@ -3,34 +3,32 @@ I am signalled when user tries to add an {{gtClass:BlElement}}, that is already " Class { - #name : 'BlAlreadyAddedAsChildError', - #superclass : 'Error', + #name : #BlAlreadyAddedAsChildError, + #superclass : #Error, #instVars : [ 'element' ], - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #category : 'Bloc-Basic-Errors' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlAlreadyAddedAsChildError class >> element: anElement [ ^ self new element: anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlAlreadyAddedAsChildError >> description [ ^ 'Can not add child that is already added to another element!' ] -{ #category : 'accessing' } +{ #category : #accessing } BlAlreadyAddedAsChildError >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlAlreadyAddedAsChildError >> element: anElement [ element := anElement ] diff --git a/src/Bloc/BlAlternativeCombination.class.st b/src/Bloc/BlAlternativeCombination.class.st index d16d75b39..f228d5204 100644 --- a/src/Bloc/BlAlternativeCombination.class.st +++ b/src/Bloc/BlAlternativeCombination.class.st @@ -20,17 +20,15 @@ BlAlternativeCombination new " Class { - #name : 'BlAlternativeCombination', - #superclass : 'BlKeyCombination', + #name : #BlAlternativeCombination, + #superclass : #BlKeyCombination, #instVars : [ 'combinations' ], - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'comparing' } +{ #category : #comparing } BlAlternativeCombination >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -41,36 +39,36 @@ BlAlternativeCombination >> = anObject [ ^ combinations = anObject combinations ] -{ #category : 'visiting' } +{ #category : #visiting } BlAlternativeCombination >> accept: aKeyCombinationVisitor [ ^ aKeyCombinationVisitor visitAlternative: self ] -{ #category : 'converting' } +{ #category : #converting } BlAlternativeCombination >> asBufferKeys [ ^ combinations first asBufferKeys ] -{ #category : 'accessing' } +{ #category : #accessing } BlAlternativeCombination >> combinations [ ^ combinations ] -{ #category : 'comparing' } +{ #category : #comparing } BlAlternativeCombination >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ combinations hash ] -{ #category : 'testing' } +{ #category : #testing } BlAlternativeCombination >> includes: aKey [ ^ self combinations anySatisfy: [ :aCombination | aCombination includes: aKey ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlAlternativeCombination >> initialize [ super initialize. @@ -78,17 +76,17 @@ BlAlternativeCombination >> initialize [ combinations := OrderedCollection new ] -{ #category : 'testing' } +{ #category : #testing } BlAlternativeCombination >> isAlternative [ ^ true ] -{ #category : 'adding' } +{ #category : #adding } BlAlternativeCombination >> key: aKey [ self with: (BlSingleKeyCombination key: aKey) ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlAlternativeCombination >> match: aKeyboardBuffer [ @@ -97,7 +95,7 @@ BlAlternativeCombination >> match: aKeyboardBuffer [ into: [ :max :aCombination | max max: (aCombination match: aKeyboardBuffer) ] ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlAlternativeCombination >> matches: aKeyboardBuffer [ @@ -105,14 +103,14 @@ BlAlternativeCombination >> matches: aKeyboardBuffer [ anySatisfy: [ :aCombination | aCombination matches: aKeyboardBuffer ] ] -{ #category : 'controlling' } +{ #category : #controlling } BlAlternativeCombination >> or: anotherKeyCombination [ ^ self with: anotherKeyCombination ] -{ #category : 'printing' } +{ #category : #printing } BlAlternativeCombination >> printOn: aStream [ aStream nextPut: $(. @@ -124,7 +122,7 @@ BlAlternativeCombination >> printOn: aStream [ aStream nextPut: $) ] -{ #category : 'printing' } +{ #category : #printing } BlAlternativeCombination >> storeOn: aStream [ aStream nextPut: $(. @@ -142,14 +140,14 @@ BlAlternativeCombination >> storeOn: aStream [ aStream nextPut: $) ] -{ #category : 'adding' } +{ #category : #adding } BlAlternativeCombination >> with: aCombination [ aCombination isAlternative ifTrue: [ self combinations addAll: aCombination combinations ] ifFalse: [ self combinations add: aCombination ] ] -{ #category : 'adding' } +{ #category : #adding } BlAlternativeCombination >> withAll: aCollectionOfCombinations [ self combinations addAll: aCollectionOfCombinations ] diff --git a/src/Bloc/BlAnnulusSector.class.st b/src/Bloc/BlAnnulusSector.class.st index cd7274143..716465e81 100644 --- a/src/Bloc/BlAnnulusSector.class.st +++ b/src/Bloc/BlAnnulusSector.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlAnnulusSector', - #superclass : 'BlAnnulusSectorGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlAnnulusSector, + #superclass : #BlAnnulusSectorGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlAnnulusSector class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlAnnulusSectorGeometry.class.st b/src/Bloc/BlAnnulusSectorGeometry.class.st index 1c07b7612..570d3c016 100644 --- a/src/Bloc/BlAnnulusSectorGeometry.class.st +++ b/src/Bloc/BlAnnulusSectorGeometry.class.st @@ -5,41 +5,39 @@ See: https://en.wikipedia.org/wiki/Annulus_(mathematics) " Class { - #name : 'BlAnnulusSectorGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlAnnulusSectorGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'startAngle', 'endAngle', 'innerRadius', 'outerRadius' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlAnnulusSectorGeometry >> absoluteInnerRadius [ ^ self radius * innerRadius ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlAnnulusSectorGeometry >> absoluteOuterRadius [ ^ self radius * outerRadius ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlAnnulusSectorGeometry >> center [ ^ self extent / 2.0 ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlAnnulusSectorGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ "Answer whether aPoint is contained by this geometry. @@ -63,30 +61,30 @@ BlAnnulusSectorGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlE ifFalse: [ a <= n or: [ n <= b ] ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> endAngle [ ^ endAngle ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> endAngle: anAngleInDegrees [ endAngle := anAngleInDegrees. self releaseCache ] -{ #category : 'testing' } +{ #category : #testing } BlAnnulusSectorGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlAnnulusSectorGeometry >> hasJoins [ ^ true ] -{ #category : 'initialization' } +{ #category : #initialization } BlAnnulusSectorGeometry >> initialize [ super initialize. @@ -96,7 +94,7 @@ BlAnnulusSectorGeometry >> initialize [ outerRadius := 1.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> innerRadius [ "An inner radius as a fraction of the max radius of the annulus [0..1]" @@ -104,21 +102,21 @@ BlAnnulusSectorGeometry >> innerRadius [ ^ innerRadius ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> innerRadius: aNumber [ "Set inner radius as a fraction of the max radius of the annulus [0..1]" innerRadius := aNumber min: 1.0 max: 0.0. self releaseCache ] -{ #category : 'geometry' } +{ #category : #geometry } BlAnnulusSectorGeometry >> matchExtent: aPoint [ "Resize geometry to exactly match provided extent as a Point" extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> outerRadius [ "An outer radius as a fraction of the max radius of the annulus [0..1]" @@ -126,14 +124,14 @@ BlAnnulusSectorGeometry >> outerRadius [ ^ outerRadius ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> outerRadius: aNumber [ "Set outer radius as a fraction of the max radius of the annulus [0..1]" outerRadius := aNumber min: 1.0 max: 0.0. self releaseCache ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlAnnulusSectorGeometry >> pointFromAngle: anAngleInRadians andRadius: aRadius around: aCenter [ "Convert from spherical coordinates to cartesian coordinates" @@ -145,19 +143,19 @@ BlAnnulusSectorGeometry >> pointFromAngle: anAngleInRadians andRadius: aRadius a ^ aX @ aY ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlAnnulusSectorGeometry >> radius [ ^ self extent min / 2.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> startAngle [ ^ startAngle ] -{ #category : 'accessing' } +{ #category : #accessing } BlAnnulusSectorGeometry >> startAngle: anAngleInDegrees [ startAngle := anAngleInDegrees. self releaseCache diff --git a/src/Bloc/BlArrayObjectPool.class.st b/src/Bloc/BlArrayObjectPool.class.st index d26ae9f93..fd156ce4b 100644 --- a/src/Bloc/BlArrayObjectPool.class.st +++ b/src/Bloc/BlArrayObjectPool.class.st @@ -1,36 +1,34 @@ Class { - #name : 'BlArrayObjectPool', - #superclass : 'BlObjectPool', + #name : #BlArrayObjectPool, + #superclass : #BlObjectPool, #instVars : [ 'poolSize', 'pool' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'private' } +{ #category : #private } BlArrayObjectPool class >> arrayType [ ^ Array ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlArrayObjectPool class >> defaultMaxPoolSize [ ^ 10 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlArrayObjectPool class >> new [ ^ self new: self defaultMaxPoolSize ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlArrayObjectPool class >> new: anInteger [ ^ self basicNew setPool: (self arrayType new: anInteger); initialize ] -{ #category : 'pool' } +{ #category : #pool } BlArrayObjectPool >> acquire [ "Returns an object from the pool if there is one, or nil otherwise" @@ -46,14 +44,14 @@ BlArrayObjectPool >> acquire [ ifFalse: [ nil ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlArrayObjectPool >> initialize [ super initialize. poolSize := 0 ] -{ #category : 'testing' } +{ #category : #testing } BlArrayObjectPool >> isInPool: anObject [ "Return true of anObject is currently in the pool, false otherwise." @@ -64,7 +62,7 @@ BlArrayObjectPool >> isInPool: anObject [ ^ false ] -{ #category : 'pool' } +{ #category : #pool } BlArrayObjectPool >> release: anObject [ "Adds anObject to the pool and return true if successfully added, false otherwise." @@ -80,7 +78,7 @@ BlArrayObjectPool >> release: anObject [ ifFalse: [ false ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlArrayObjectPool >> setPool: anArray [ pool := anArray ] diff --git a/src/Bloc/BlArrowCursor.class.st b/src/Bloc/BlArrowCursor.class.st index abc81ea93..aacf3b11d 100644 --- a/src/Bloc/BlArrowCursor.class.st +++ b/src/Bloc/BlArrowCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlArrowCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlArrowCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlAttachedCachedSpaceReference.class.st b/src/Bloc/BlAttachedCachedSpaceReference.class.st index 676277941..99dbdcbcb 100644 --- a/src/Bloc/BlAttachedCachedSpaceReference.class.st +++ b/src/Bloc/BlAttachedCachedSpaceReference.class.st @@ -4,32 +4,30 @@ For performance reasons elements cache a reference to the space so that there is " Class { - #name : 'BlAttachedCachedSpaceReference', - #superclass : 'BlAttachedSpaceReference', + #name : #BlAttachedCachedSpaceReference, + #superclass : #BlAttachedSpaceReference, #instVars : [ 'space' ], - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #category : 'Bloc-Space' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlAttachedCachedSpaceReference class >> forSpace: aBlSpace [ ^ self new space: aBlSpace ] -{ #category : 'accessing' } +{ #category : #accessing } BlAttachedCachedSpaceReference >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlAttachedCachedSpaceReference >> space: aBlSpace [ space := aBlSpace ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlAttachedCachedSpaceReference >> spaceDo: aBlock [ "Evaluate a given block with a bloc space as an argument" diff --git a/src/Bloc/BlAttachedSpaceReference.class.st b/src/Bloc/BlAttachedSpaceReference.class.st index 1b8263478..526a4804e 100644 --- a/src/Bloc/BlAttachedSpaceReference.class.st +++ b/src/Bloc/BlAttachedSpaceReference.class.st @@ -4,27 +4,25 @@ Attached space reference {{gtClass:BlSpaceReference}} is set when an element is " Class { - #name : 'BlAttachedSpaceReference', - #superclass : 'BlSpaceReference', + #name : #BlAttachedSpaceReference, + #superclass : #BlSpaceReference, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #category : 'Bloc-Space' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlAttachedSpaceReference class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlAttachedSpaceReference class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'testing' } +{ #category : #testing } BlAttachedSpaceReference >> isAttachedToSceneGraph [ ^ true ] diff --git a/src/Bloc/BlAttributeRope.class.st b/src/Bloc/BlAttributeRope.class.st index 5212c9803..ae53fa0ed 100644 --- a/src/Bloc/BlAttributeRope.class.st +++ b/src/Bloc/BlAttributeRope.class.st @@ -4,18 +4,16 @@ I am able to add attributes to any type of rope by decorating it with attribute " Class { - #name : 'BlAttributeRope', - #superclass : 'BlRope', + #name : #BlAttributeRope, + #superclass : #BlRope, #instVars : [ 'attributes', 'rope' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'initialization' } +{ #category : #initialization } BlAttributeRope class >> attributes: anAttributeCollection rope: aRope [ | aMergedCollection aMergedRope | @@ -34,7 +32,7 @@ BlAttributeRope class >> attributes: anAttributeCollection rope: aRope [ yourself ] -{ #category : 'utilities' } +{ #category : #utilities } BlAttributeRope class >> combineAttributed: aLeftAttributeRope and: aRightAttributeRope [ ^ self @@ -42,19 +40,19 @@ BlAttributeRope class >> combineAttributed: aLeftAttributeRope and: aRightAttrib rope: (self concatenate: aLeftAttributeRope rope and: aRightAttributeRope rope) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlAttributeRope >> at: anIndex [ ^ rope at: anIndex ] -{ #category : 'accessing' } +{ #category : #accessing } BlAttributeRope >> attributes [ ^ attributes ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlAttributeRope >> attributes: anAttributesCollection from: aStart to: anEnd [ | anAttributeRope | @@ -87,19 +85,19 @@ BlAttributeRope >> attributes: anAttributesCollection from: aStart to: anEnd [ append: (self from: anEnd to: self size)) ] -{ #category : 'initialization' } +{ #category : #initialization } BlAttributeRope >> attributes: theAttributes rope: aRope [ attributes := theAttributes copyWithoutDuplicatedRopeAttributes. rope := aRope ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlAttributeRope >> children [ ^ { rope } ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlAttributeRope >> clearAttributes: aStart to: anEnd if: aBlock [ | aSubRope aClearedRope preservedAttributes anyAttributeRemoved | self assertAccessFrom: aStart to: anEnd. @@ -136,7 +134,7 @@ BlAttributeRope >> clearAttributes: aStart to: anEnd if: aBlock [ ^ (self from: 0 to: aStart) append: (aClearedRope append: (self from: anEnd to: self size)) ] -{ #category : 'rope - deleting' } +{ #category : #'rope - deleting' } BlAttributeRope >> delete: aStart to: anEnd [ self assertAccessFrom: aStart to: anEnd. @@ -149,17 +147,17 @@ BlAttributeRope >> delete: aStart to: anEnd [ rope: (rope delete: aStart to: anEnd) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlAttributeRope >> depth [ ^ rope depth ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlAttributeRope >> do: aBlock [ self rope do: aBlock ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlAttributeRope >> empty [ "Create and return an empty version of this rope" @@ -169,7 +167,7 @@ BlAttributeRope >> empty [ rope: self rope empty ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlAttributeRope >> from: aStart to: anEnd [ @@ -186,12 +184,12 @@ BlAttributeRope >> from: aStart to: anEnd [ rope: (rope from: aStart to: anEnd) ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlAttributeRope >> from: aStart to: anEnd do: aBlock [ self rope from: aStart to: anEnd do: aBlock ] -{ #category : 'rope - inserting' } +{ #category : #'rope - inserting' } BlAttributeRope >> insertItems: aCollection at: anIndex [ ^ self class attributeRope @@ -199,14 +197,14 @@ BlAttributeRope >> insertItems: aCollection at: anIndex [ rope: (rope insertItems: aCollection at: anIndex) ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlAttributeRope >> isAttributed [ ^ true ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlAttributeRope >> isEmpty [ "Attribute rope is empty then and only then when attributes and underlying rope are empty" @@ -214,28 +212,28 @@ BlAttributeRope >> isEmpty [ ^ self attributes isEmpty and: [ self rope isEmpty ] ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlAttributeRope >> isLeaf [ ^ false ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlAttributeRope >> iterator: aStart to: anEnd [ ^ BlAttributeRopeIterator rope: self from: aStart to: anEnd ] -{ #category : 'accessing' } +{ #category : #accessing } BlAttributeRope >> readStream [ ^ rope readStream ] -{ #category : 'accessing' } +{ #category : #accessing } BlAttributeRope >> rope [ ^ rope ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlAttributeRope >> simplified [ @@ -244,7 +242,7 @@ BlAttributeRope >> simplified [ rope: (rope simplified) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlAttributeRope >> size [ ^ rope size ] diff --git a/src/Bloc/BlAttributeRopeIterator.class.st b/src/Bloc/BlAttributeRopeIterator.class.st index 32673254a..aa8b97e26 100644 --- a/src/Bloc/BlAttributeRopeIterator.class.st +++ b/src/Bloc/BlAttributeRopeIterator.class.st @@ -3,17 +3,15 @@ I am a special iterator used to iterate over attribute rope " Class { - #name : 'BlAttributeRopeIterator', - #superclass : 'BlRopeIterator', + #name : #BlAttributeRopeIterator, + #superclass : #BlRopeIterator, #instVars : [ 'subIterator' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'iterator - attributes' } +{ #category : #'iterator - attributes' } BlAttributeRopeIterator >> attributes [ "Return a collection of rope attributes at a current position without duplicates" @@ -21,22 +19,22 @@ BlAttributeRopeIterator >> attributes [ rope attributes ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlAttributeRopeIterator >> hasNext [ ^ subIterator hasNext ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlAttributeRopeIterator >> hasPrevious [ ^ subIterator hasPrevious ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlAttributeRopeIterator >> next [ ^ subIterator next ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlAttributeRopeIterator >> nextSpan [ | aSpan theAttributes | @@ -48,41 +46,41 @@ BlAttributeRopeIterator >> nextSpan [ ^ aSpan attributes: theAttributes ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlAttributeRopeIterator >> peek [ ^ subIterator peek ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlAttributeRopeIterator >> peer [ ^ subIterator peer ] -{ #category : 'iterator - accessing' } +{ #category : #'iterator - accessing' } BlAttributeRopeIterator >> position [ ^ subIterator position ] -{ #category : 'copying' } +{ #category : #copying } BlAttributeRopeIterator >> postCopy [ super postCopy. subIterator := subIterator copy ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlAttributeRopeIterator >> previous [ ^ subIterator previous ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlAttributeRopeIterator >> rope: aRope from: aStart to: anEnd [ super rope: aRope from: aStart to: anEnd. subIterator := aRope rope iterator: aStart to: anEnd ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlAttributeRopeIterator >> skip: aNumber [ subIterator skip: aNumber ] diff --git a/src/Bloc/BlBackground.class.st b/src/Bloc/BlBackground.class.st index d749fc811..78bb94426 100644 --- a/src/Bloc/BlBackground.class.st +++ b/src/Bloc/BlBackground.class.st @@ -17,38 +17,36 @@ See `BlBackgroundBuilder` for the related examples. " Class { - #name : 'BlBackground', - #superclass : 'Object', + #name : #BlBackground, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'opacity' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'builder' } +{ #category : #builder } BlBackground class >> builder [ ^ BlCompositeBackgroundBuilder new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBackground class >> image: aForm [ ^ BlImageBackground image: aForm ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBackground class >> paint: aColorOrBlPaint [ ^ BlPaintBackground paint: aColorOrBlPaint ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBackground class >> transparent [ "Return a completely transparent background" @@ -56,12 +54,12 @@ BlBackground class >> transparent [ ^ BlTransparentBackground uniqueInstance ] -{ #category : 'converting' } +{ #category : #converting } BlBackground >> asBlBackground [ ^ self ] -{ #category : 'initialization' } +{ #category : #initialization } BlBackground >> defaultOpacity [ "By default background is completely opaque" @@ -69,13 +67,13 @@ BlBackground >> defaultOpacity [ ^ 1.0 ] -{ #category : 'testing' } +{ #category : #testing } BlBackground >> isColorBackground [ ^ self isPaintBackground and: [ self paint isColorPaint ] ] -{ #category : 'testing' } +{ #category : #testing } BlBackground >> isOpaque [ "Return true if the whole background is opaque" @@ -83,13 +81,13 @@ BlBackground >> isOpaque [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlBackground >> isPaintBackground [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlBackground >> isTransparent [ "Return true if background is transparent and should not be rendered, false otherwise" @@ -97,7 +95,7 @@ BlBackground >> isTransparent [ ^ self subclassResponsibility ] -{ #category : 'geometry' } +{ #category : #geometry } BlBackground >> matchExtent: anExtent [ "Resize background to match given extent. Used to adapt image or gradient backgrounds to the element's extent" @@ -105,14 +103,14 @@ BlBackground >> matchExtent: anExtent [ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlBackground >> opacity [ ^ opacity ifNil: [ self defaultOpacity ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBackground >> opacity: aNumber [ self @@ -128,7 +126,7 @@ BlBackground >> opacity: aNumber [ opacity := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlBackground >> paint [ ^ nil diff --git a/src/Bloc/BlBackgroundBuilder.class.st b/src/Bloc/BlBackgroundBuilder.class.st index 3696517e7..348eac137 100644 --- a/src/Bloc/BlBackgroundBuilder.class.st +++ b/src/Bloc/BlBackgroundBuilder.class.st @@ -1,45 +1,43 @@ Class { - #name : 'BlBackgroundBuilder', - #superclass : 'Object', + #name : #BlBackgroundBuilder, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'opacity' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'building' } +{ #category : #building } BlBackgroundBuilder >> build [ ^ self subclassResponsibility ] -{ #category : 'initialization' } +{ #category : #initialization } BlBackgroundBuilder >> initialize [ super initialize. opacity := 1.0 ] -{ #category : 'building' } +{ #category : #building } BlBackgroundBuilder >> isOpaque [ ^ self opacity closeTo: 1 ] -{ #category : 'accessing' } +{ #category : #accessing } BlBackgroundBuilder >> opacity [ ^ opacity ] -{ #category : 'accessing' } +{ #category : #accessing } BlBackgroundBuilder >> opacity: aNumber [ self assert: [ aNumber between: 0.0 and: 1.0 ] diff --git a/src/Bloc/BlBagObjectPool.class.st b/src/Bloc/BlBagObjectPool.class.st index 45490fb58..a8e288735 100644 --- a/src/Bloc/BlBagObjectPool.class.st +++ b/src/Bloc/BlBagObjectPool.class.st @@ -3,24 +3,22 @@ I am a dynamic object pool that grows to acomodate a lot of objects " Class { - #name : 'BlBagObjectPool', - #superclass : 'BlObjectPool', + #name : #BlBagObjectPool, + #superclass : #BlObjectPool, #instVars : [ 'poolSize', 'maxPoolSize', 'pool' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'private' } +{ #category : #private } BlBagObjectPool class >> arrayType [ ^ IdentitySet ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBagObjectPool class >> new [ ^ self basicNew setPool: (self arrayType new); @@ -28,7 +26,7 @@ BlBagObjectPool class >> new [ maxPoolSize: Float infinity ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBagObjectPool class >> new: anInteger [ ^ self basicNew setPool: (self arrayType new: anInteger); @@ -36,7 +34,7 @@ BlBagObjectPool class >> new: anInteger [ maxPoolSize: anInteger ] -{ #category : 'pool' } +{ #category : #pool } BlBagObjectPool >> acquire [ "Returns an object from the pool if there is one, or nil otherwise" @@ -50,7 +48,7 @@ BlBagObjectPool >> acquire [ ifFalse: [ nil ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlBagObjectPool >> initialize [ super initialize. @@ -59,7 +57,7 @@ BlBagObjectPool >> initialize [ maxPoolSize := 0 ] -{ #category : 'testing' } +{ #category : #testing } BlBagObjectPool >> isInPool: anObject [ "Return true of anObject is currently in the pool, false otherwise." @@ -67,13 +65,13 @@ BlBagObjectPool >> isInPool: anObject [ ^ pool includes: anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlBagObjectPool >> maxPoolSize: aNumber [ maxPoolSize := aNumber ] -{ #category : 'pool' } +{ #category : #pool } BlBagObjectPool >> release: anObject [ "Adds anObject to the pool and return true if successfully added, false otherwise." @@ -90,7 +88,7 @@ BlBagObjectPool >> release: anObject [ ifFalse: [ false ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlBagObjectPool >> setPool: aCollection [ pool := aCollection ] diff --git a/src/Bloc/BlBaseDragEvent.class.st b/src/Bloc/BlBaseDragEvent.class.st index ffaa79cbc..406a22165 100644 --- a/src/Bloc/BlBaseDragEvent.class.st +++ b/src/Bloc/BlBaseDragEvent.class.st @@ -1,78 +1,76 @@ Class { - #name : 'BlBaseDragEvent', - #superclass : 'BlMouseEvent', + #name : #BlBaseDragEvent, + #superclass : #BlMouseEvent, #instVars : [ 'gestureSource', 'gestureTarget', 'dragboard', 'startButtons' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'converting' } +{ #category : #converting } BlBaseDragEvent >> asDragEvent [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> dragboard [ ^ dragboard ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> dragboard: anObject [ dragboard := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> gestureSource [ ^ gestureSource ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> gestureSource: anObject [ gestureSource := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> gestureTarget [ ^ gestureTarget ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> gestureTarget: anObject [ gestureTarget := anObject ] -{ #category : 'testing' } +{ #category : #testing } BlBaseDragEvent >> isBaseDrag [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlBaseDragEvent >> isMiddleButtonDrag [ ^ startButtons = self class middleButton ] -{ #category : 'testing' } +{ #category : #testing } BlBaseDragEvent >> isPrimaryButtonDrag [ ^ startButtons = self class primaryButton ] -{ #category : 'testing' } +{ #category : #testing } BlBaseDragEvent >> isSecondaryButtonDrag [ ^ startButtons = self class secondaryButton ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> startButtons [ ^ startButtons ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseDragEvent >> startButtons: anObject [ startButtons := anObject ] diff --git a/src/Bloc/BlBaseEventProcessor.class.st b/src/Bloc/BlBaseEventProcessor.class.st index 19dfdf38e..02f9e020e 100644 --- a/src/Bloc/BlBaseEventProcessor.class.st +++ b/src/Bloc/BlBaseEventProcessor.class.st @@ -1,58 +1,56 @@ Class { - #name : 'BlBaseEventProcessor', - #superclass : 'Object', + #name : #BlBaseEventProcessor, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'space' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlBaseEventProcessor class >> space: aSpace [ ^ self new space: aSpace; yourself ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlBaseEventProcessor >> dispatchEvent: anEvent target: aTarget [ aTarget dispatchEvent: anEvent ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlBaseEventProcessor >> fireEvent: anEvent [ ^ BlEvent fireEvent: anEvent ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlBaseEventProcessor >> fireEvent: anEvent from: aTopEventTarget [ ^ BlEvent fireEvent: anEvent from: aTopEventTarget ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlBaseEventProcessor >> onSpaceClosed [ "React to space closed in order to clean up the state" ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseEventProcessor >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseEventProcessor >> space: aSpace [ space := aSpace ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseEventProcessor >> telemetry [ diff --git a/src/Bloc/BlBaseFocusEvent.class.st b/src/Bloc/BlBaseFocusEvent.class.st index 4a98ec4d9..79ae82eb2 100644 --- a/src/Bloc/BlBaseFocusEvent.class.st +++ b/src/Bloc/BlBaseFocusEvent.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlBaseFocusEvent', - #superclass : 'BlUIEvent', + #name : #BlBaseFocusEvent, + #superclass : #BlUIEvent, #instVars : [ 'reason' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'converting' } +{ #category : #converting } BlBaseFocusEvent >> asBlurEvent [ ^ BlBlurEvent new copyFrom: self; yourself ] -{ #category : 'converting' } +{ #category : #converting } BlBaseFocusEvent >> asFocusInEvent [ ^ BlFocusInEvent new copyFrom: self; @@ -24,7 +22,7 @@ BlBaseFocusEvent >> asFocusInEvent [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlBaseFocusEvent >> asFocusOutEvent [ ^ BlFocusOutEvent new copyFrom: self; @@ -32,32 +30,32 @@ BlBaseFocusEvent >> asFocusOutEvent [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlBaseFocusEvent >> initialize [ super initialize. reason := BlFocusUnknownReason uniqueInstance ] -{ #category : 'testing' } +{ #category : #testing } BlBaseFocusEvent >> isBaseFocus [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlBaseFocusEvent >> isDueToRemoval [ ^ self reason = BlFocusDueToRemovedFromParentReason uniqueInstance or: [ self reason = BlFocusDueToRemovedFromSpaceReason uniqueInstance ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseFocusEvent >> reason [ ^ reason ] -{ #category : 'accessing' } +{ #category : #accessing } BlBaseFocusEvent >> reason: aBlFocusReason [ reason := aBlFocusReason ] diff --git a/src/Bloc/BlBasicEventHandler.class.st b/src/Bloc/BlBasicEventHandler.class.st index 5f8a05ecb..01b8e0f20 100644 --- a/src/Bloc/BlBasicEventHandler.class.st +++ b/src/Bloc/BlBasicEventHandler.class.st @@ -1,24 +1,22 @@ Class { - #name : 'BlBasicEventHandler', - #superclass : 'Object', + #name : #BlBasicEventHandler, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlBasicEventHandler >> disableEventsIn: anElementEventDispatcher [ self eventsToHandle do: [ :eachEventClass | eachEventClass disableIn: anElementEventDispatcher ] ] -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlBasicEventHandler >> enableEventsIn: anElementEventDispatcher [ self eventsToHandle do: [ :eachEventClass | eachEventClass enableIn: anElementEventDispatcher ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlBasicEventHandler >> eventsToHandle [ "I return a collection of element types I may be interested in" @@ -26,11 +24,11 @@ BlBasicEventHandler >> eventsToHandle [ ^ #() ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlBasicEventHandler >> handleEvent: anEvent [ ] -{ #category : 'testing' } +{ #category : #testing } BlBasicEventHandler >> hasOwner [ "Utility #*owner message makes it possible to have a polymorphic way to visualise a tree structure of the elements" @@ -38,15 +36,15 @@ BlBasicEventHandler >> hasOwner [ ^ false ] -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlBasicEventHandler >> onInstalledIn: anObject [ ] -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlBasicEventHandler >> onUninstalledIn: anObject [ ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlBasicEventHandler >> wantsEvent: anEvent [ ^ false ] diff --git a/src/Bloc/BlBasicLayout.class.st b/src/Bloc/BlBasicLayout.class.st index 5aaf780bd..4ef7d5397 100644 --- a/src/Bloc/BlBasicLayout.class.st +++ b/src/Bloc/BlBasicLayout.class.st @@ -3,27 +3,25 @@ I am a very basic layout that supports very simple measurement and positions ele " Class { - #name : 'BlBasicLayout', - #superclass : 'BlLayout', + #name : #BlBasicLayout, + #superclass : #BlLayout, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } -{ #category : 'accessing' } +{ #category : #accessing } BlBasicLayout class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlBasicLayout class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'layout' } +{ #category : #layout } BlBasicLayout >> layout: anElement in: aRectangle context: aBlElementBoundsUpdater [ anElement children accountedByLayout do: [ :child | @@ -34,7 +32,7 @@ BlBasicLayout >> layout: anElement in: aRectangle context: aBlElementBoundsUpdat self layoutIgnored: anElement context: aBlElementBoundsUpdater ] -{ #category : 'measure' } +{ #category : #measure } BlBasicLayout >> measure: anElement with: anExtentSpec [ super measure: anElement with: anExtentSpec. diff --git a/src/Bloc/BlBasicNodeBasedLayout.class.st b/src/Bloc/BlBasicNodeBasedLayout.class.st index a250e7739..9041007cf 100644 --- a/src/Bloc/BlBasicNodeBasedLayout.class.st +++ b/src/Bloc/BlBasicNodeBasedLayout.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlBasicNodeBasedLayout', - #superclass : 'BlNodeBasedLayout', - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #name : #BlBasicNodeBasedLayout, + #superclass : #BlNodeBasedLayout, + #category : 'Bloc-Layouts-Basic' } -{ #category : 'layout' } +{ #category : #layout } BlBasicNodeBasedLayout >> layout: aParentNode [ aParentNode childrenDo: [ :eachChildNode | eachChildNode position: eachChildNode constraints position ] ] -{ #category : 'measure' } +{ #category : #measure } BlBasicNodeBasedLayout >> measure: aParentLayoutNode [ self preMeasureChildrenNodes: aParentLayoutNode ] diff --git a/src/Bloc/BlBasicShortcut.class.st b/src/Bloc/BlBasicShortcut.class.st index 79d9101d5..ef2c6e236 100644 --- a/src/Bloc/BlBasicShortcut.class.st +++ b/src/Bloc/BlBasicShortcut.class.st @@ -14,42 +14,40 @@ A shortcut can be added or removed from the element by using {{gtMethod:BlElemen " Class { - #name : 'BlBasicShortcut', - #superclass : 'Object', + #name : #BlBasicShortcut, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'combination', 'repeatable' ], - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'converting' } +{ #category : #converting } BlBasicShortcut >> asShortcut [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlBasicShortcut >> combination [ ^ combination ] -{ #category : 'accessing' } +{ #category : #accessing } BlBasicShortcut >> combination: anObject [ combination := anObject ] -{ #category : 'api - combination' } +{ #category : #'api - combination' } BlBasicShortcut >> combinationForMacOS [ ^ self combination ] -{ #category : 'api - combination' } +{ #category : #'api - combination' } BlBasicShortcut >> combinationForPlatform [ OSPlatform current isMacOS ifTrue: [ ^ self combinationForMacOS ]. @@ -63,34 +61,34 @@ BlBasicShortcut >> combinationForPlatform [ ^ self combination ] -{ #category : 'api - combination' } +{ #category : #'api - combination' } BlBasicShortcut >> combinationForUnix [ ^ self combination ] -{ #category : 'api - combination' } +{ #category : #'api - combination' } BlBasicShortcut >> combinationForWindows [ ^ self combination ] -{ #category : 'accessing' } +{ #category : #accessing } BlBasicShortcut >> description [ ^ self subclassResponsibility ] -{ #category : 'initialization' } +{ #category : #initialization } BlBasicShortcut >> initialize [ super initialize. repeatable := true ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlBasicShortcut >> match: anEventBuffer [ ^ self combinationForPlatform match: anEventBuffer ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlBasicShortcut >> matches: anKeyboardBuffer [ | aCombinationInDNF | @@ -98,22 +96,22 @@ BlBasicShortcut >> matches: anKeyboardBuffer [ ^ aCombinationInDNF matches: anKeyboardBuffer ] -{ #category : 'accessing' } +{ #category : #accessing } BlBasicShortcut >> name [ ^ self subclassResponsibility ] -{ #category : 'evaluation' } +{ #category : #evaluation } BlBasicShortcut >> performDueTo: aShortcutEvent [ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlBasicShortcut >> repeatable [ ^ repeatable ] -{ #category : 'accessing' } +{ #category : #accessing } BlBasicShortcut >> repeatable: aBoolean [ repeatable := aBoolean ] diff --git a/src/Bloc/BlBeaconLoggingTask.class.st b/src/Bloc/BlBeaconLoggingTask.class.st index c1df62256..9bbb569de 100644 --- a/src/Bloc/BlBeaconLoggingTask.class.st +++ b/src/Bloc/BlBeaconLoggingTask.class.st @@ -6,19 +6,17 @@ I should be instantiated using {{gtMethod:BlBeaconLoggingTask class>>#subtask:}} " Class { - #name : 'BlBeaconLoggingTask', - #superclass : 'BlTask', + #name : #BlBeaconLoggingTask, + #superclass : #BlTask, #instVars : [ 'name', 'subtask', 'callingMethod' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBeaconLoggingTask class >> subtask: aBlTask [ ^ self new @@ -26,38 +24,38 @@ BlBeaconLoggingTask class >> subtask: aBlTask [ callingMethod: thisContext sender sender blocMethodDefinition ] -{ #category : 'converting' } +{ #category : #converting } BlBeaconLoggingTask >> asBeaconLoggingTask [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconLoggingTask >> callingMethod [ ^ callingMethod ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconLoggingTask >> callingMethod: anObject [ callingMethod := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconLoggingTask >> maySetName: aString [ name ifNotNil: [ ^ self ]. self name: aString ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconLoggingTask >> name [ ^ name ifNil: [ '' ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconLoggingTask >> name: anObject [ name := anObject ] -{ #category : 'hooks' } +{ #category : #hooks } BlBeaconLoggingTask >> onEnqueued: aBlSpace [ "Is self when a task is enqueued in a space. It gives subclasses a possibility to synchronize time with the space" @@ -65,7 +63,7 @@ BlBeaconLoggingTask >> onEnqueued: aBlSpace [ self subtask onEnqueued: aBlSpace ] -{ #category : 'hooks' } +{ #category : #hooks } BlBeaconLoggingTask >> onEnqueuedInElement: aBlElement [ "Is sent when a task is enqueued in a element. It gives subclasses a possibility to re-enqueue themselves in the same element" @@ -73,20 +71,20 @@ BlBeaconLoggingTask >> onEnqueuedInElement: aBlElement [ self subtask onEnqueuedInElement: aBlElement ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlBeaconLoggingTask >> run [ BlBeaconTaskSignal new task: self subtask; name: self name message: #runBlocTask; callingMethod: callingMethod; emit. self subtask run. BlBeaconTaskSignal new task: self subtask; name: self name message: #doneBlocTask; callingMethod: callingMethod; emit. ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconLoggingTask >> subtask [ ^ subtask ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconLoggingTask >> subtask: aBlTask [ subtask := aBlTask ] diff --git a/src/Bloc/BlBeaconTaskSignal.class.st b/src/Bloc/BlBeaconTaskSignal.class.st index 9441fe813..9fa8e4e21 100644 --- a/src/Bloc/BlBeaconTaskSignal.class.st +++ b/src/Bloc/BlBeaconTaskSignal.class.st @@ -5,19 +5,17 @@ I inform about scheduling and executing of {{gtClass:BlTask}}. " Class { - #name : 'BlBeaconTaskSignal', - #superclass : 'BeaconSignal', + #name : #BlBeaconTaskSignal, + #superclass : #BeaconSignal, #instVars : [ 'task', 'callingMethod', 'message' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBeaconTaskSignal class >> fromSton: stonReader [ | aSignal | aSignal := self new. @@ -33,7 +31,7 @@ BlBeaconTaskSignal class >> fromSton: stonReader [ ^aSignal ] -{ #category : 'converting' } +{ #category : #converting } BlBeaconTaskSignal >> asDictionary [ ^ super asDictionary at: #callingMethod put: callingMethod; @@ -42,32 +40,32 @@ BlBeaconTaskSignal >> asDictionary [ yourself. ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconTaskSignal >> callingMethod [ ^ callingMethod ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconTaskSignal >> callingMethod: anObject [ callingMethod := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconTaskSignal >> message [ ^ message ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconTaskSignal >> message: anObject [ message := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconTaskSignal >> name: aString message: anObject [ self message: aString asString, ' ', anObject asString ] -{ #category : 'printing' } +{ #category : #printing } BlBeaconTaskSignal >> printOneLineContentsOn: stream [ message ifNotNil: [ @@ -83,12 +81,12 @@ BlBeaconTaskSignal >> printOneLineContentsOn: stream [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconTaskSignal >> task [ ^ task ] -{ #category : 'accessing' } +{ #category : #accessing } BlBeaconTaskSignal >> task: anObject [ task := anObject ] diff --git a/src/Bloc/BlBezierCurve.class.st b/src/Bloc/BlBezierCurve.class.st index 35f5cb2cc..93dea2567 100644 --- a/src/Bloc/BlBezierCurve.class.st +++ b/src/Bloc/BlBezierCurve.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlBezierCurve', - #superclass : 'BlBezierCurveGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlBezierCurve, + #superclass : #BlBezierCurveGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlBezierCurve class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlBezierCurveGeometry.class.st b/src/Bloc/BlBezierCurveGeometry.class.st index fd9344ab2..9b8cdf324 100644 --- a/src/Bloc/BlBezierCurveGeometry.class.st +++ b/src/Bloc/BlBezierCurveGeometry.class.st @@ -3,22 +3,20 @@ I define a geometry of a bezier curve with N control points (of order N) " Class { - #name : 'BlBezierCurveGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlBezierCurveGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'controlPoints' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBezierCurveGeometry class >> controlPoints: aCollection [ ^ self new controlPoints: aCollection ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlBezierCurveGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ "Answer whether aPoint is contained by this geometry. @@ -36,13 +34,13 @@ BlBezierCurveGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlEle ] -{ #category : 'accessing' } +{ #category : #accessing } BlBezierCurveGeometry >> controlPoints [ ^ controlPoints ] -{ #category : 'accessing' } +{ #category : #accessing } BlBezierCurveGeometry >> controlPoints: aCollection [ "The collection can have between 2 and 4 points." @@ -50,7 +48,7 @@ BlBezierCurveGeometry >> controlPoints: aCollection [ self releaseCache ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlBezierCurveGeometry >> geometryBounds: aBlBounds [ ^ aBlBounds rectangle: @@ -60,31 +58,31 @@ BlBezierCurveGeometry >> geometryBounds: aBlBounds [ Rectangle encompassing: theControlPoints ]) ] -{ #category : 'testing' } +{ #category : #testing } BlBezierCurveGeometry >> hasCaps [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlBezierCurveGeometry >> hasJoins [ ^ false ] -{ #category : 'initialization' } +{ #category : #initialization } BlBezierCurveGeometry >> initialize [ super initialize. controlPoints := #() ] -{ #category : 'accessing' } +{ #category : #accessing } BlBezierCurveGeometry >> matchExtent: aPoint [ extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlBezierCurveGeometry >> order [ "Return an order of a bezier curve (how many control points it has) (https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Specific_cases)" diff --git a/src/Bloc/BlBitflags.class.st b/src/Bloc/BlBitflags.class.st index caf8cb04d..957bc8c59 100644 --- a/src/Bloc/BlBitflags.class.st +++ b/src/Bloc/BlBitflags.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlBitflags', - #superclass : 'Object', + #name : #BlBitflags, + #superclass : #Object, #instVars : [ 'value' ], - #category : 'Bloc-DataStructure - Bitflags', - #package : 'Bloc', - #tag : 'DataStructure - Bitflags' + #category : 'Bloc-DataStructure - Bitflags' } -{ #category : 'private - class code' } +{ #category : #'private - class code' } BlBitflags class >> defineFlagAccessorFor: flagName [ "Define accessors as class methods" | code | @@ -23,7 +21,7 @@ BlBitflags class >> defineFlagAccessorFor: flagName [ classified: self generatedFlagsProtocolName. ] -{ #category : 'private - instance code' } +{ #category : #'private - instance code' } BlBitflags class >> defineFlagAddAccessorFor: flagName [ | code | @@ -36,7 +34,7 @@ BlBitflags class >> defineFlagAddAccessorFor: flagName [ classified: self generatedFlagsAddProtocolName ] -{ #category : 'private - instance code' } +{ #category : #'private - instance code' } BlBitflags class >> defineFlagClearAccessorFor: flagName [ | code | @@ -49,7 +47,7 @@ BlBitflags class >> defineFlagClearAccessorFor: flagName [ classified: self generatedFlagsClearProtocolName ] -{ #category : 'private - instance code' } +{ #category : #'private - instance code' } BlBitflags class >> defineFlagTestAccessorFor: flagName [ | code | @@ -62,7 +60,7 @@ BlBitflags class >> defineFlagTestAccessorFor: flagName [ classified: self generatedFlagsTestingProtocolName ] -{ #category : 'flags declaration' } +{ #category : #'flags declaration' } BlBitflags class >> flagsDecl [ " self rebuildFlagsAccessors @@ -78,7 +76,7 @@ BlBitflags class >> flagsDecl [ ^ self subclassResponsibility ] -{ #category : 'private' } +{ #category : #private } BlBitflags class >> flagsDictionary [ | decl theCurrentDeclarations | @@ -109,19 +107,19 @@ BlBitflags class >> flagsDictionary [ ^ decl ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBitflags class >> fromFlags: aBlInfiniteFlags [ ^ self fromValue: aBlInfiniteFlags value ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBitflags class >> fromValue: aNumber [ ^ self new initializeWith: aNumber; yourself ] -{ #category : 'private' } +{ #category : #private } BlBitflags class >> generateFlagName: aString [ ^ String streamContents: [ :aStream | @@ -135,32 +133,32 @@ BlBitflags class >> generateFlagName: aString [ aStream nextPutAll: eachPart capitalized ] ] ] -{ #category : 'private - instance code' } +{ #category : #'private - instance code' } BlBitflags class >> generatedFlagsAddProtocolName [ ^ 'flags - add' ] -{ #category : 'private - instance code' } +{ #category : #'private - instance code' } BlBitflags class >> generatedFlagsClearProtocolName [ ^ 'flags - clear' ] -{ #category : 'private - class code' } +{ #category : #'private - class code' } BlBitflags class >> generatedFlagsProtocolName [ ^ 'accessing - flags' ] -{ #category : 'private - instance code' } +{ #category : #'private - instance code' } BlBitflags class >> generatedFlagsTestingProtocolName [ ^ 'flags - testing' ] -{ #category : 'initialization' } +{ #category : #initialization } BlBitflags class >> initialize [ self initializeFlags ] -{ #category : 'initialization' } +{ #category : #initialization } BlBitflags class >> initializeFlags [ self flagsDictionary keysAndValuesDo: [ :eachName :eachValue | @@ -176,7 +174,7 @@ BlBitflags class >> initializeFlags [ value: flagValue ) ] ] ] -{ #category : 'private' } +{ #category : #private } BlBitflags class >> rebuildFlagsAccessors [ self flagsDictionary keysDo: [ :each | self defineFlagAccessorFor: each. @@ -185,7 +183,7 @@ BlBitflags class >> rebuildFlagsAccessors [ self defineFlagAddAccessorFor: each ] ] -{ #category : 'operations' } +{ #category : #operations } BlBitflags >> and: aFlagsOrNumber [ "Return new instance of infinite flags which is a result of bitwise and with provided flags or a number" @@ -194,7 +192,7 @@ BlBitflags >> and: aFlagsOrNumber [ ^ self class fromValue: (self value bitAnd: (aFlagsOrNumber value)) ] -{ #category : 'converting' } +{ #category : #converting } BlBitflags >> asDictionary [ ^ (self class classPool associations @@ -202,54 +200,54 @@ BlBitflags >> asDictionary [ asDictionary ] -{ #category : 'removing' } +{ #category : #removing } BlBitflags >> clear [ value := 0 ] -{ #category : 'copying' } +{ #category : #copying } BlBitflags >> copy [ ^ self class fromFlags: self ] -{ #category : 'testing' } +{ #category : #testing } BlBitflags >> has: aFlag [ ^ (value bitAnd: aFlag) ~= 0 ] -{ #category : 'testing' } +{ #category : #testing } BlBitflags >> hasNamed: aFlagName [ ^ (value bitAnd: (self class classPool at: aFlagName ifAbsent: [ self error: 'Unknown flag: ', aFlagName asString ])) ~= 0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlBitflags >> initialize [ super initialize. value := 0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlBitflags >> initializeWith: aValue [ value := aValue ] -{ #category : 'testing' } +{ #category : #testing } BlBitflags >> isEmpty [ ^ self value isZero ] -{ #category : 'removing' } +{ #category : #removing } BlBitflags >> remove: aFlag [ value := value bitAnd: (aFlag bitInvert) ] -{ #category : 'accessing' } +{ #category : #accessing } BlBitflags >> value [ ^ value ] diff --git a/src/Bloc/BlBlurAboveEffect.class.st b/src/Bloc/BlBlurAboveEffect.class.st index 787cd69af..38a5e5602 100644 --- a/src/Bloc/BlBlurAboveEffect.class.st +++ b/src/Bloc/BlBlurAboveEffect.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlBlurAboveEffect', - #superclass : 'BlBlurEffect', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #name : #BlBlurAboveEffect, + #superclass : #BlBlurEffect, + #category : 'Bloc-Effect' } diff --git a/src/Bloc/BlBlurBelowEffect.class.st b/src/Bloc/BlBlurBelowEffect.class.st index 133d31b21..b283e7f00 100644 --- a/src/Bloc/BlBlurBelowEffect.class.st +++ b/src/Bloc/BlBlurBelowEffect.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlBlurBelowEffect', - #superclass : 'BlBlurEffect', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #name : #BlBlurBelowEffect, + #superclass : #BlBlurEffect, + #category : 'Bloc-Effect' } diff --git a/src/Bloc/BlBlurEffect.class.st b/src/Bloc/BlBlurEffect.class.st index ff0ab4550..8528d6614 100644 --- a/src/Bloc/BlBlurEffect.class.st +++ b/src/Bloc/BlBlurEffect.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlBlurEffect', - #superclass : 'BlElementEffect', + #name : #BlBlurEffect, + #superclass : #BlElementEffect, #instVars : [ 'radius' ], - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'accessing' } +{ #category : #accessing } BlBlurEffect class >> radius: aNumber [ ^ self new radius: aNumber; yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlBlurEffect >> radius [ ^ radius ] -{ #category : 'accessing' } +{ #category : #accessing } BlBlurEffect >> radius: aNumber [ "Set standart deviation of gaussian blur" radius := aNumber diff --git a/src/Bloc/BlBlurEvent.class.st b/src/Bloc/BlBlurEvent.class.st index ae7d51635..1a40e7af7 100644 --- a/src/Bloc/BlBlurEvent.class.st +++ b/src/Bloc/BlBlurEvent.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlBlurEvent', - #superclass : 'BlBaseFocusEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlBlurEvent, + #superclass : #BlBaseFocusEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlBlurEvent >> isBlur [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlBlurEvent >> sendTo: anObject [ anObject blurEvent: self ] diff --git a/src/Bloc/BlBorder.class.st b/src/Bloc/BlBorder.class.st index 46d429ffa..3753e34ff 100644 --- a/src/Bloc/BlBorder.class.st +++ b/src/Bloc/BlBorder.class.st @@ -10,8 +10,8 @@ BlBorder builder " Class { - #name : 'BlBorder', - #superclass : 'Object', + #name : #BlBorder, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -23,34 +23,32 @@ Class { #classInstVars : [ 'empty' ], - #category : 'Bloc-Basic-Border', - #package : 'Bloc', - #tag : 'Basic-Border' + #category : 'Bloc-Basic-Border' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBorder class >> builder [ ^ BlBorderBuilder new ] -{ #category : 'cleanup' } +{ #category : #cleanup } BlBorder class >> cleanUp [ super cleanUp. empty := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder class >> empty [ ^ empty ifNil: [ empty := self paint: BlPaint transparent width: 0 ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBorder class >> new [ self error: 'Use one of the builder methods' ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBorder class >> paint: aPaint [ ^ self builder @@ -58,7 +56,7 @@ BlBorder class >> paint: aPaint [ build ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBorder class >> paint: aPaint width: aNumber [ ^ self builder @@ -67,7 +65,7 @@ BlBorder class >> paint: aPaint width: aNumber [ build ] -{ #category : 'comparing' } +{ #category : #comparing } BlBorder >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -80,13 +78,13 @@ BlBorder >> = anObject [ and: [ style = anObject style and: [ width = anObject width ] ] ] ] -{ #category : 'converting' } +{ #category : #converting } BlBorder >> asBlBorder [ ^ self ] -{ #category : 'copy' } +{ #category : #copy } BlBorder >> copyWithOpacity: aNumber [ ^ self class basicNew @@ -98,7 +96,7 @@ BlBorder >> copyWithOpacity: aNumber [ yourself ] -{ #category : 'copy' } +{ #category : #copy } BlBorder >> copyWithPaint: aPaint [ @@ -111,7 +109,7 @@ BlBorder >> copyWithPaint: aPaint [ yourself ] -{ #category : 'copy' } +{ #category : #copy } BlBorder >> copyWithStyle: aStrokeStyle [ ^ self class basicNew @@ -123,7 +121,7 @@ BlBorder >> copyWithStyle: aStrokeStyle [ yourself ] -{ #category : 'copy' } +{ #category : #copy } BlBorder >> copyWithWidth: aWidth [ ^ self class basicNew @@ -135,7 +133,7 @@ BlBorder >> copyWithWidth: aWidth [ yourself ] -{ #category : 'comparing' } +{ #category : #comparing } BlBorder >> hash [ "Answer an integer value that is related to the identity of the receiver." @@ -143,14 +141,14 @@ BlBorder >> hash [ bitXor: (paint hash bitXor: (style hash bitXor: width hash)) ] -{ #category : 'testing' } +{ #category : #testing } BlBorder >> isTransparent [ "Answer whether I should not be rendered," ^ width isZero or: [ opacity isZero or: [ paint isTransparent ] ] ] -{ #category : 'testing' } +{ #category : #testing } BlBorder >> isVisible [ "Return true if I am visible and should be rendered, false otherwise. Note: Non-zero border with transparent paint is still needs to be rendered, @@ -160,14 +158,14 @@ BlBorder >> isVisible [ ^ width isZero not ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> opacity [ ^ opacity ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> opacity: aNumber [ self @@ -180,14 +178,14 @@ BlBorder >> opacity: aNumber [ opacity := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> paint [ ^ paint ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> paint: aBlPaint [ paint ifNotNil: [ (BlImmutableObjectChangeError object: self) signal ]. @@ -195,7 +193,7 @@ BlBorder >> paint: aBlPaint [ paint := aBlPaint asBlPaint ] -{ #category : 'printing' } +{ #category : #printing } BlBorder >> printOn: aStream [ "Append a sequence of characters to aStream that identify the receiver." @@ -211,14 +209,14 @@ BlBorder >> printOn: aStream [ print: paint ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> style [ ^ style ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> style: aBlStrokeStyle [ style isNotNil @@ -227,14 +225,14 @@ BlBorder >> style: aBlStrokeStyle [ style := aBlStrokeStyle ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> width [ ^ width ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorder >> width: aNumber [ self assert: [ aNumber >= 0 ] diff --git a/src/Bloc/BlBorderBuilder.class.st b/src/Bloc/BlBorderBuilder.class.st index bd9197f4f..0b685bb49 100644 --- a/src/Bloc/BlBorderBuilder.class.st +++ b/src/Bloc/BlBorderBuilder.class.st @@ -8,8 +8,8 @@ BlBorder builder " Class { - #name : 'BlBorderBuilder', - #superclass : 'Object', + #name : #BlBorderBuilder, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -22,12 +22,10 @@ Class { 'dashOffset', 'opacity' ], - #category : 'Bloc-Basic-Border', - #package : 'Bloc', - #tag : 'Basic-Border' + #category : 'Bloc-Basic-Border' } -{ #category : 'builder' } +{ #category : #builder } BlBorderBuilder >> build [ ^ BlBorder basicNew initialize; @@ -38,7 +36,7 @@ BlBorderBuilder >> build [ yourself ] -{ #category : 'builder' } +{ #category : #builder } BlBorderBuilder >> buildStyle [ ^ BlStrokeStyle new lineCap: self lineCap; @@ -48,94 +46,94 @@ BlBorderBuilder >> buildStyle [ dashOffset: self dashOffset ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> capButt [ self lineCap: BlStrokeLineCap butt ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> capRound [ self lineCap: BlStrokeLineCap round ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> capSquare [ self lineCap: BlStrokeLineCap square ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> dashArray [ ^ dashArray ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> dashArray: anObject [ dashArray := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> dashOffset [ ^ dashOffset ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> dashOffset: anObject [ dashOffset := anObject ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> dashed [ dashOffset := 0. dashArray := #(6 4.2) ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> dashedSmall [ dashOffset := 0. dashArray := #(3 2) ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultDashArray [ ^ #() ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultDashOffset [ ^ 0.0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultLineCap [ ^ BlStrokeLineCap butt ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultLineJoin [ ^ BlStrokeLineJoin miter ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultMiterLimit [ ^ 4.0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultOpacity [ ^ 1.0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultPaint [ ^ BlPaint transparent ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> defaultWidth [ ^ 1.0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlBorderBuilder >> initialize [ super initialize. @@ -149,87 +147,87 @@ BlBorderBuilder >> initialize [ opacity := self defaultOpacity ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> joinBevel [ self lineJoin: BlStrokeLineJoin bevel ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> joinMiter [ self lineJoin: BlStrokeLineJoin miter ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> joinRound [ self lineJoin: BlStrokeLineJoin round ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> lineCap [ ^ lineCap ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> lineCap: aBlStrokeLineCap [ lineCap := aBlStrokeLineCap ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> lineJoin [ ^ lineJoin ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> lineJoin: aBlStrokeLineJoin [ lineJoin := aBlStrokeLineJoin ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> miterLimit [ ^ miterLimit ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> miterLimit: anObject [ miterLimit := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> opacity [ ^ opacity ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> opacity: anObject [ opacity := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> paint [ ^ paint ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> paint: anObject [ paint := anObject ] -{ #category : 'styles' } +{ #category : #styles } BlBorderBuilder >> solid [ dashOffset := 0.0. dashArray := #() ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> width [ ^ width ] -{ #category : 'accessing' } +{ #category : #accessing } BlBorderBuilder >> width: anObject [ width := anObject ] diff --git a/src/Bloc/BlBottomAlignment.class.st b/src/Bloc/BlBottomAlignment.class.st index eed8ddbc1..a63e5b5fc 100644 --- a/src/Bloc/BlBottomAlignment.class.st +++ b/src/Bloc/BlBottomAlignment.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlBottomAlignment', - #superclass : 'BlVerticalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlBottomAlignment, + #superclass : #BlVerticalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlBottomAlignment class >> initialize [ super initialize. ] -{ #category : 'factory' } +{ #category : #factory } BlBottomAlignment class >> leftToRight [ ^ self bottom ] -{ #category : 'factory' } +{ #category : #factory } BlBottomAlignment class >> rightToLeft [ ^ self bottom ] -{ #category : 'factory' } +{ #category : #factory } BlBottomAlignment >> inverted [ ^ BlElementAlignment horizontal end ] -{ #category : 'factory' } +{ #category : #factory } BlBottomAlignment >> swap [ ^ BlElementAlignment top ] -{ #category : 'translation' } +{ #category : #translation } BlBottomAlignment >> translationOf: aBounds in: aContainerBounds [ diff --git a/src/Bloc/BlBounds.class.st b/src/Bloc/BlBounds.class.st index 6c543a674..37c5dfdeb 100644 --- a/src/Bloc/BlBounds.class.st +++ b/src/Bloc/BlBounds.class.st @@ -4,20 +4,18 @@ I am very useful for chainable bounds transformations and may be transformed in- " Class { - #name : 'BlBounds', - #superclass : 'Object', + #name : #BlBounds, + #superclass : #Object, #instVars : [ 'left', 'top', 'right', 'bottom' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBounds class >> fromRectangle: aRectangle [ ^ self new @@ -25,7 +23,7 @@ BlBounds class >> fromRectangle: aRectangle [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBounds class >> left: aLeft top: aTop right: aRight bottom: aBottom [ ^ self new @@ -36,7 +34,7 @@ BlBounds class >> left: aLeft top: aTop right: aRight bottom: aBottom [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBounds class >> origin: anOrigin corner: aCorner [ ^ self new @@ -44,7 +42,7 @@ BlBounds class >> origin: anOrigin corner: aCorner [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlBounds class >> origin: anOrigin extent: aPointExtent [ "aPointExtent should satisfy #isBlocPositivePoint" @@ -56,7 +54,7 @@ BlBounds class >> origin: anOrigin extent: aPointExtent [ yourself ] -{ #category : 'comparing' } +{ #category : #comparing } BlBounds >> = aRectangle [ "Answer true if the receiver's species, origin and corner match aRectangle's." @@ -67,7 +65,7 @@ BlBounds >> = aRectangle [ and: [ left = aRectangle left ] ] ] ] ] -{ #category : 'converting' } +{ #category : #converting } BlBounds >> asRectangle [ "Convert me to immutable Rectangle. Note, that using left:right:top:bottom: is the fastest way to create @@ -76,7 +74,7 @@ BlBounds >> asRectangle [ ^ Rectangle left: left right: right top: top bottom: bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> atRandom [ "Return a random integer point within this bounds" @@ -88,41 +86,41 @@ BlBounds >> atRandom [ ^ (self topLeft + (aMaxWidth atRandom @ aMaxHeight atRandom)) asIntegerPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> bottom [ ^ bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> bottom: aNumber [ "aNumber should satify #isBlocFiniteFloat" bottom := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> bottomCenter [ "Answer the point at the center of the receiver's bottom horizontal line." ^ self center x @ self bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> bottomLeft [ "Answer the point at the left edge of the bottom horizontal line of the receiver." ^ self origin x @ self corner y ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> bottomRight [ "Answer the point at the right edge of the bottom horizontal line of the receiver." ^ self corner ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> bounds: aBlBounds [ self @@ -132,31 +130,31 @@ BlBounds >> bounds: aBlBounds [ bottom: aBlBounds bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> center [ ^ ((left / 2.0) + (right / 2.0)) @ ((top / 2.0) + (bottom / 2.0)) ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> centerLeft [ ^ self left @ self center y ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> centerRight [ ^ self right @ self center y ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlBounds >> clamp: aPoint [ ^ (aPoint min: self corner) max: self origin ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlBounds >> clockwiseEdges [ @@ -168,7 +166,7 @@ BlBounds >> clockwiseEdges [ } ] -{ #category : 'testing' } +{ #category : #testing } BlBounds >> closeTo: aBlBounds [ "Return true if I am close to the given bounds" @@ -178,14 +176,14 @@ BlBounds >> closeTo: aBlBounds [ and: [ (self bottom closeTo: aBlBounds bottom) ] ] ] ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlBounds >> closestEdgeTo: aPoint [ ^ self counterClockwiseEdges detectMin: [ :aRay | aRay distanceTo: aPoint ] ] -{ #category : 'testing' } +{ #category : #testing } BlBounds >> containedInRect: aRectangle [ "Answer whether a receiver is within a aRectangle" @@ -201,14 +199,14 @@ BlBounds >> containedInRect: aRectangle [ aBottom >= bottom ] ] ] ] -{ #category : 'testing' } +{ #category : #testing } BlBounds >> containsPoint: aPoint [ "Answer whether aPoint is within the receiver." ^ self origin <= aPoint and: [ aPoint < self corner ] ] -{ #category : 'testing' } +{ #category : #testing } BlBounds >> containsRect: aRectangle [ "Answer whether aRectangle is within the receiver" @@ -224,13 +222,13 @@ BlBounds >> containsRect: aRectangle [ aBottom <= bottom ] ] ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> corner [ ^ right @ bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> corners [ "Return an array of corner points in the clockwise order starting from top left" @@ -242,7 +240,7 @@ BlBounds >> corners [ ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlBounds >> counterClockwiseEdges [ @@ -254,7 +252,7 @@ BlBounds >> counterClockwiseEdges [ } ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> encompass [ | newLeft newTop newRight newBottom | @@ -269,7 +267,7 @@ BlBounds >> encompass [ bottom := newBottom ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> encompass: aPoint [ "Inplace encompass me so that I contain both the receiver and aPoint." @@ -280,7 +278,7 @@ BlBounds >> encompass: aPoint [ bottom: (bottom max: aPoint y) ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> expandBy: aDelta [ "Outset me by delta. Delta is a Rectangle, Point, or Number." @@ -293,7 +291,7 @@ BlBounds >> expandBy: aDelta [ ifFalse: [ self expandByMargin: aDelta ] ] ] ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> expandByLeft: aLeft top: aTop right: aRight bottom: aBottom [ "All arguments should satisfy #isBlocFinite" @@ -303,7 +301,7 @@ BlBounds >> expandByLeft: aLeft top: aTop right: aRight bottom: aBottom [ bottom := bottom + aBottom ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> expandByMargin: aMargin [ self @@ -313,7 +311,7 @@ BlBounds >> expandByMargin: aMargin [ bottom: bottom + aMargin bottom ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> expandByNumber: aNumber [ "aNumber should satisfy #isBlocFinite" @@ -323,7 +321,7 @@ BlBounds >> expandByNumber: aNumber [ bottom := bottom + aNumber ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> expandByPoint: aPoint [ self @@ -333,7 +331,7 @@ BlBounds >> expandByPoint: aPoint [ bottom: bottom + aPoint y ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> expanded [ "Transform me so that origin and corner are rounded to integers. Rounding is done by upper value on origin and lower value on corner so that @@ -345,13 +343,13 @@ BlBounds >> expanded [ bottom := bottom ceiling ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> extent [ ^ (right - left) @ (bottom - top) ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> extent: aPoint [ self @@ -361,19 +359,19 @@ BlBounds >> extent: aPoint [ bottom: top + aPoint y ] -{ #category : 'testing' } +{ #category : #testing } BlBounds >> hasPositiveExtent [ ^ right > left and: [ bottom > top ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> height [ ^ bottom - top ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> initialize [ super initialize. @@ -384,7 +382,7 @@ BlBounds >> initialize [ bottom := 0.0 ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> intersect: aRectangle ifNone: aBlock [ "Answer a Rectangle that is the area in which the receiver overlaps with aRectangle. @@ -411,7 +409,7 @@ BlBounds >> intersect: aRectangle ifNone: aBlock [ bottom: newBottom ] -{ #category : 'testing' } +{ #category : #testing } BlBounds >> intersects: aRectangle [ "Answer whether aRectangle intersects the receiver anywhere" @@ -429,20 +427,20 @@ BlBounds >> intersects: aRectangle [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> left [ ^ left ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> left: aNumber [ "aNumber should satisfy #isBlocFinite" left := aNumber ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> left: aLeft top: aTop corner: aCorner [ self @@ -452,7 +450,7 @@ BlBounds >> left: aLeft top: aTop corner: aCorner [ bottom: aCorner y ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> left: aLeft top: aTop right: aRight bottom: aBottom [ "All arguments should satisfy #isBlocFinite" @@ -462,7 +460,7 @@ BlBounds >> left: aLeft top: aTop right: aRight bottom: aBottom [ bottom := aBottom ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> merge: aRectangle [ "Merge provided rectangle into me." @@ -473,7 +471,7 @@ BlBounds >> merge: aRectangle [ bottom: aRectangle bottom ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> mergeLeft: aLeft top: aTop right: aRight bottom: aBottom [ "Merge provided rectangle into me." @@ -483,13 +481,13 @@ BlBounds >> mergeLeft: aLeft top: aTop right: aRight bottom: aBottom [ aBottom > bottom ifTrue: [ bottom := aBottom ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> origin [ ^ left @ top ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> origin: anOrigin corner: aCorner [ self @@ -499,7 +497,7 @@ BlBounds >> origin: anOrigin corner: aCorner [ bottom: aCorner y ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> origin: anOrigin extent: anExtent [ self @@ -509,7 +507,7 @@ BlBounds >> origin: anOrigin extent: anExtent [ bottom: anOrigin y + anExtent y ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlBounds >> outsideNormalCloseTo: aPoint [ @@ -521,13 +519,13 @@ BlBounds >> outsideNormalCloseTo: aPoint [ ^ BlRay from: aProjection directed: aNormal ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> position [ ^ self origin ] -{ #category : 'printing' } +{ #category : #printing } BlBounds >> printOn: aStream [ "Refer to the comment in Object|printOn:." @@ -536,7 +534,7 @@ BlBounds >> printOn: aStream [ self corner printOn: aStream ] -{ #category : 'initialization' } +{ #category : #initialization } BlBounds >> rectangle: aRectangle [ self @@ -546,27 +544,27 @@ BlBounds >> rectangle: aRectangle [ bottom: aRectangle bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> right [ ^ right ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> right: aNumber [ "aNumber should satisfy #isBlocFiniteFloat" right := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> rightCenter [ "Answer the point at the center of the receiver's right vertical line." ^ self right @ self center y ] -{ #category : 'transforming' } +{ #category : #transforming } BlBounds >> scaleBy: aFactor [ ^ aFactor isPoint @@ -576,7 +574,7 @@ BlBounds >> scaleBy: aFactor [ ifFalse: [ self scaleX: aFactor x Y: aFactor y ] ] ] -{ #category : 'transforming' } +{ #category : #transforming } BlBounds >> scaleX: aX Y: aY [ "Arguments should satisfy #isBlocFinite" @@ -586,7 +584,7 @@ BlBounds >> scaleX: aX Y: aY [ bottom := bottom * aY ] -{ #category : 'rectangle functions' } +{ #category : #'rectangle functions' } BlBounds >> shrinkByLeft: aLeft top: aTop right: aRight bottom: aBottom [ left := left + aLeft. @@ -595,7 +593,7 @@ BlBounds >> shrinkByLeft: aLeft top: aTop right: aRight bottom: aBottom [ bottom := bottom - aBottom ] -{ #category : 'printing' } +{ #category : #printing } BlBounds >> storeOn: aStream [ "printed form is good for storing too" @@ -604,47 +602,47 @@ BlBounds >> storeOn: aStream [ aStream nextPut: $). ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> top [ ^ top ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> top: aNumber [ "anNumber should satisfy #isBlocFiniteFloat" top := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> topCenter [ "Answer the point at the center of the receiver's top horizontal line." ^ self center x @ self top ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> topLeft [ "Answer the point at the top left corner of the receiver's top horizontal line" ^ left @ top ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> topRight [ "Answer the point at the top right corner of the receiver's top horizontal line." ^ self corner x @ self origin y ] -{ #category : 'transforming' } +{ #category : #transforming } BlBounds >> translateBy: aPoint [ self translateX: aPoint x Y: aPoint y ] -{ #category : 'transforming' } +{ #category : #transforming } BlBounds >> translateX: aX Y: aY [ "Arguments should satisfy #isBlocFinite" @@ -654,7 +652,7 @@ BlBounds >> translateX: aX Y: aY [ bottom := bottom + aY ] -{ #category : 'accessing' } +{ #category : #accessing } BlBounds >> width [ ^ right - left diff --git a/src/Bloc/BlBoundsCache.class.st b/src/Bloc/BlBoundsCache.class.st index 0613aa46c..c414eb807 100644 --- a/src/Bloc/BlBoundsCache.class.st +++ b/src/Bloc/BlBoundsCache.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlBoundsCache', - #superclass : 'Object', + #name : #BlBoundsCache, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -12,41 +12,39 @@ Class { 'geometryBoundsInSpace', 'invalidationBounds' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlBoundsCache class >> on: anElement [ ^ self new owner: anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> boundsInLocal [ ^ boundsInLocal ifNil: [ boundsInLocal := (self owner boundsInLocal: BlBounds new) asRectangle ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> boundsInSpace [ ^ boundsInSpace ifNil: [ boundsInSpace := (self owner boundsInSpace: BlBounds new) asRectangle ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> geometryBounds [ ^ geometryBounds ifNil: [ geometryBounds := (self owner geometryBounds: BlBounds new) asRectangle ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> geometryBoundsInSpace [ ^ geometryBoundsInSpace ifNil: [ geometryBoundsInSpace := (self owner geometryBoundsInSpace: BlBounds new) asRectangle ] ] -{ #category : 'invalidation' } +{ #category : #invalidation } BlBoundsCache >> invalidateBoundsInLocal [ "Bounds properties in local coordinates change than and only than when extent changes" @@ -57,7 +55,7 @@ BlBoundsCache >> invalidateBoundsInLocal [ self invalidateBoundsInSpace ] -{ #category : 'invalidation' } +{ #category : #invalidation } BlBoundsCache >> invalidateBoundsInSpace [ boundsInSpace := nil. @@ -68,23 +66,23 @@ BlBoundsCache >> invalidateBoundsInSpace [ anElement boundsCache invalidateBoundsInSpace ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> invalidationBounds [ ^ invalidationBounds ifNil: [ invalidationBounds := (self owner invalidationBounds: BlBounds new) asRectangle ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> owner [ ^ owner ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> owner: anElement [ owner := anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsCache >> transformedBounds [ ^ transformedBounds ifNil: [ transformedBounds := (self owner transformedBounds: BlBounds new) asRectangle ] diff --git a/src/Bloc/BlBoundsMatcher.class.st b/src/Bloc/BlBoundsMatcher.class.st index 79719e350..e2d5e0665 100644 --- a/src/Bloc/BlBoundsMatcher.class.st +++ b/src/Bloc/BlBoundsMatcher.class.st @@ -5,8 +5,8 @@ I allow users to quickly check if child bounds given by `childStart` and `childE " Class { - #name : 'BlBoundsMatcher', - #superclass : 'Object', + #name : #BlBoundsMatcher, + #superclass : #Object, #instVars : [ 'constraints', 'parentStart', @@ -14,32 +14,30 @@ Class { 'childStart', 'childEnd' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> childEnd [ ^ childEnd ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> childEnd: anObject [ childEnd := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> childStart [ ^ childStart ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> childStart: anObject [ childStart := anObject ] -{ #category : 'private' } +{ #category : #private } BlBoundsMatcher >> compare: aNumber and: anotherNumber [ aNumber > anotherNumber @@ -51,19 +49,19 @@ BlBoundsMatcher >> compare: aNumber and: anotherNumber [ ^ BlBoundsMatcherConstraints Equal ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> constraints [ ^ constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> constraints: anObject [ constraints := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlBoundsMatcher >> initialize [ super initialize. @@ -74,7 +72,7 @@ BlBoundsMatcher >> initialize [ parentEnd := 0 ] -{ #category : 'api - matcher' } +{ #category : #'api - matcher' } BlBoundsMatcher >> matches [ "Returns whether the contraints of the matcher are correct" @@ -102,22 +100,22 @@ BlBoundsMatcher >> matches [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> parentEnd [ ^ parentEnd ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> parentEnd: anObject [ parentEnd := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> parentStart [ ^ parentStart ] -{ #category : 'accessing' } +{ #category : #accessing } BlBoundsMatcher >> parentStart: anObject [ parentStart := anObject ] diff --git a/src/Bloc/BlBoundsMatcherConstraints.class.st b/src/Bloc/BlBoundsMatcherConstraints.class.st index 3cce9a689..9255ba1d4 100644 --- a/src/Bloc/BlBoundsMatcherConstraints.class.st +++ b/src/Bloc/BlBoundsMatcherConstraints.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlBoundsMatcherConstraints', - #superclass : 'BlBitflags', + #name : #BlBoundsMatcherConstraints, + #superclass : #BlBitflags, #classVars : [ 'ChildEndAndParentEnd', 'ChildEndAndParentStart', @@ -23,132 +23,130 @@ Class { 'LessThan', 'Mask' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndAndParentEnd [ "This method was automatically generated" ^ ChildEndAndParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndAndParentStart [ "This method was automatically generated" ^ ChildEndAndParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndEqualParentEnd [ "This method was automatically generated" ^ ChildEndEqualParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndEqualParentStart [ "This method was automatically generated" ^ ChildEndEqualParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndGreaterThanParentEnd [ "This method was automatically generated" ^ ChildEndGreaterThanParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndGreaterThanParentStart [ "This method was automatically generated" ^ ChildEndGreaterThanParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndLessThanParentEnd [ "This method was automatically generated" ^ ChildEndLessThanParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildEndLessThanParentStart [ "This method was automatically generated" ^ ChildEndLessThanParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartAndParentEnd [ "This method was automatically generated" ^ ChildStartAndParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartAndParentStart [ "This method was automatically generated" ^ ChildStartAndParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartEqualParentEnd [ "This method was automatically generated" ^ ChildStartEqualParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartEqualParentStart [ "This method was automatically generated" ^ ChildStartEqualParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartGreaterThanParentEnd [ "This method was automatically generated" ^ ChildStartGreaterThanParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartGreaterThanParentStart [ "This method was automatically generated" ^ ChildStartGreaterThanParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartLessThanParentEnd [ "This method was automatically generated" ^ ChildStartLessThanParentEnd value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> ChildStartLessThanParentStart [ "This method was automatically generated" ^ ChildStartLessThanParentStart value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> Equal [ "This method was automatically generated" ^ Equal value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> GreaterThan [ "This method was automatically generated" ^ GreaterThan value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> LessThan [ "This method was automatically generated" ^ LessThan value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlBoundsMatcherConstraints class >> Mask [ "This method was automatically generated" ^ Mask value ] -{ #category : 'flags declaration' } +{ #category : #'flags declaration' } BlBoundsMatcherConstraints class >> flagsDecl [ " self rebuildFlagsAccessors @@ -211,7 +209,7 @@ BlBoundsMatcherConstraints class >> flagsDecl [ } ] -{ #category : 'flags declaration' } +{ #category : #'flags declaration' } BlBoundsMatcherConstraints class >> initialize [ "this method is needed else the information is not created. This is the sign of a bad design. @@ -219,361 +217,361 @@ BlBoundsMatcherConstraints class >> initialize [ super initialize. ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndAndParentEnd [ "This method was automatically generated" value := value | ChildEndAndParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndAndParentStart [ "This method was automatically generated" value := value | ChildEndAndParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndEqualParentEnd [ "This method was automatically generated" value := value | ChildEndEqualParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndEqualParentStart [ "This method was automatically generated" value := value | ChildEndEqualParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndGreaterThanParentEnd [ "This method was automatically generated" value := value | ChildEndGreaterThanParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndGreaterThanParentStart [ "This method was automatically generated" value := value | ChildEndGreaterThanParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndLessThanParentEnd [ "This method was automatically generated" value := value | ChildEndLessThanParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildEndLessThanParentStart [ "This method was automatically generated" value := value | ChildEndLessThanParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartAndParentEnd [ "This method was automatically generated" value := value | ChildStartAndParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartAndParentStart [ "This method was automatically generated" value := value | ChildStartAndParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartEqualParentEnd [ "This method was automatically generated" value := value | ChildStartEqualParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartEqualParentStart [ "This method was automatically generated" value := value | ChildStartEqualParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartGreaterThanParentEnd [ "This method was automatically generated" value := value | ChildStartGreaterThanParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartGreaterThanParentStart [ "This method was automatically generated" value := value | ChildStartGreaterThanParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartLessThanParentEnd [ "This method was automatically generated" value := value | ChildStartLessThanParentEnd value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addChildStartLessThanParentStart [ "This method was automatically generated" value := value | ChildStartLessThanParentStart value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addEqual [ "This method was automatically generated" value := value | Equal value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addGreaterThan [ "This method was automatically generated" value := value | GreaterThan value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addLessThan [ "This method was automatically generated" value := value | LessThan value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlBoundsMatcherConstraints >> addMask [ "This method was automatically generated" value := value | Mask value ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndAndParentEnd [ "This method was automatically generated" value := value & (ChildEndAndParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndAndParentStart [ "This method was automatically generated" value := value & (ChildEndAndParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndEqualParentEnd [ "This method was automatically generated" value := value & (ChildEndEqualParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndEqualParentStart [ "This method was automatically generated" value := value & (ChildEndEqualParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndGreaterThanParentEnd [ "This method was automatically generated" value := value & (ChildEndGreaterThanParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndGreaterThanParentStart [ "This method was automatically generated" value := value & (ChildEndGreaterThanParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndLessThanParentEnd [ "This method was automatically generated" value := value & (ChildEndLessThanParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildEndLessThanParentStart [ "This method was automatically generated" value := value & (ChildEndLessThanParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartAndParentEnd [ "This method was automatically generated" value := value & (ChildStartAndParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartAndParentStart [ "This method was automatically generated" value := value & (ChildStartAndParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartEqualParentEnd [ "This method was automatically generated" value := value & (ChildStartEqualParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartEqualParentStart [ "This method was automatically generated" value := value & (ChildStartEqualParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartGreaterThanParentEnd [ "This method was automatically generated" value := value & (ChildStartGreaterThanParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartGreaterThanParentStart [ "This method was automatically generated" value := value & (ChildStartGreaterThanParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartLessThanParentEnd [ "This method was automatically generated" value := value & (ChildStartLessThanParentEnd value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearChildStartLessThanParentStart [ "This method was automatically generated" value := value & (ChildStartLessThanParentStart value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearEqual [ "This method was automatically generated" value := value & (Equal value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearGreaterThan [ "This method was automatically generated" value := value & (GreaterThan value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearLessThan [ "This method was automatically generated" value := value & (LessThan value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlBoundsMatcherConstraints >> clearMask [ "This method was automatically generated" value := value & (Mask value bitInvert) ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndAndParentEnd [ "This method was automatically generated" ^ (value & ChildEndAndParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndAndParentStart [ "This method was automatically generated" ^ (value & ChildEndAndParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndEqualParentEnd [ "This method was automatically generated" ^ (value & ChildEndEqualParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndEqualParentStart [ "This method was automatically generated" ^ (value & ChildEndEqualParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndGreaterThanParentEnd [ "This method was automatically generated" ^ (value & ChildEndGreaterThanParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndGreaterThanParentStart [ "This method was automatically generated" ^ (value & ChildEndGreaterThanParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndLessThanParentEnd [ "This method was automatically generated" ^ (value & ChildEndLessThanParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildEndLessThanParentStart [ "This method was automatically generated" ^ (value & ChildEndLessThanParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartAndParentEnd [ "This method was automatically generated" ^ (value & ChildStartAndParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartAndParentStart [ "This method was automatically generated" ^ (value & ChildStartAndParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartEqualParentEnd [ "This method was automatically generated" ^ (value & ChildStartEqualParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartEqualParentStart [ "This method was automatically generated" ^ (value & ChildStartEqualParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartGreaterThanParentEnd [ "This method was automatically generated" ^ (value & ChildStartGreaterThanParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartGreaterThanParentStart [ "This method was automatically generated" ^ (value & ChildStartGreaterThanParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartLessThanParentEnd [ "This method was automatically generated" ^ (value & ChildStartLessThanParentEnd value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasChildStartLessThanParentStart [ "This method was automatically generated" ^ (value & ChildStartLessThanParentStart value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasEqual [ "This method was automatically generated" ^ (value & Equal value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasGreaterThan [ "This method was automatically generated" ^ (value & GreaterThan value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasLessThan [ "This method was automatically generated" ^ (value & LessThan value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlBoundsMatcherConstraints >> hasMask [ "This method was automatically generated" ^ (value & Mask value) ~= 0 diff --git a/src/Bloc/BlBubblingEventDispatcher.class.st b/src/Bloc/BlBubblingEventDispatcher.class.st index e1a4a9fbf..05592a843 100644 --- a/src/Bloc/BlBubblingEventDispatcher.class.st +++ b/src/Bloc/BlBubblingEventDispatcher.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlBubblingEventDispatcher', - #superclass : 'BlDirectEventDispatcher', - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #name : #BlBubblingEventDispatcher, + #superclass : #BlDirectEventDispatcher, + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'dispatching' } +{ #category : #dispatching } BlBubblingEventDispatcher >> dispatchArrivedEvent: anEvent [ anEvent arrivedTarget: self owner. @@ -21,7 +19,7 @@ BlBubblingEventDispatcher >> dispatchArrivedEvent: anEvent [ ifTrue: [ shortcutHandler handleEvent: anEvent ] ] -{ #category : 'dispatching' } +{ #category : #dispatching } BlBubblingEventDispatcher >> dispatchBubblingEvent: anEvent [ anEvent bubblingTarget: self owner. @@ -36,7 +34,7 @@ BlBubblingEventDispatcher >> dispatchBubblingEvent: anEvent [ ifTrue: [ shortcutHandler handleEvent: anEvent ] ] -{ #category : 'dispatching' } +{ #category : #dispatching } BlBubblingEventDispatcher >> dispatchCapturingEvent: anEvent [ anEvent capturingTarget: self owner. @@ -46,7 +44,7 @@ BlBubblingEventDispatcher >> dispatchCapturingEvent: anEvent [ theFilters dispatchEvent: anEvent ] ] -{ #category : 'dispatching' } +{ #category : #dispatching } BlBubblingEventDispatcher >> dispatchEvent: anEvent next: aBlEventDispatcherChain [ @@ -72,7 +70,7 @@ BlBubblingEventDispatcher >> dispatchEvent: anEvent next: aBlEventDispatcherChai ^ anEvent ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlBubblingEventDispatcher >> type [ diff --git a/src/Bloc/BlCellCursor.class.st b/src/Bloc/BlCellCursor.class.st index 5ba38ae1e..374350909 100644 --- a/src/Bloc/BlCellCursor.class.st +++ b/src/Bloc/BlCellCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlCellCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlCellCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlChildBoundsBasedFinder.class.st b/src/Bloc/BlChildBoundsBasedFinder.class.st index 20693e104..8043df6cb 100644 --- a/src/Bloc/BlChildBoundsBasedFinder.class.st +++ b/src/Bloc/BlChildBoundsBasedFinder.class.st @@ -5,50 +5,48 @@ I help users to find a child element within its parent based on the bounds const " Class { - #name : 'BlChildBoundsBasedFinder', - #superclass : 'Object', + #name : #BlChildBoundsBasedFinder, + #superclass : #Object, #instVars : [ 'fromIndex', 'toIndex', 'preferredConstraints', 'acceptableConstraints' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> acceptableConstraints [ ^ acceptableConstraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> acceptableConstraints: aBlBoundsMatcherConstraints [ acceptableConstraints := aBlBoundsMatcherConstraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> childAt: anIndex [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> childEndOf: anElement [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> childStartOf: anElement [ ^ self subclassResponsibility ] -{ #category : 'api - finder' } +{ #category : #'api - finder' } BlChildBoundsBasedFinder >> detect [ @@ -57,7 +55,7 @@ BlChildBoundsBasedFinder >> detect [ ifNone: [ nil ] ] -{ #category : 'api - finder' } +{ #category : #'api - finder' } BlChildBoundsBasedFinder >> detectIfFound: aFoundBlock ifNone: aNoneBlock [ | aMatcher anAcceptableMatch aStep | @@ -96,49 +94,49 @@ BlChildBoundsBasedFinder >> detectIfFound: aFoundBlock ifNone: aNoneBlock [ ifNotNil: aFoundBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> fromIndex [ ^ fromIndex ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> fromIndex: anInteger [ fromIndex := anInteger ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> parentEnd [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> parentStart [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> preferredConstraints [ ^ preferredConstraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> preferredConstraints: aBlBoundsMatcherConstraints [ preferredConstraints := aBlBoundsMatcherConstraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> toIndex [ ^ toIndex ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildBoundsBasedFinder >> toIndex: anInteger [ toIndex := anInteger diff --git a/src/Bloc/BlChildDoesNotExistError.class.st b/src/Bloc/BlChildDoesNotExistError.class.st index 2b618a10a..8b1b3fcbf 100644 --- a/src/Bloc/BlChildDoesNotExistError.class.st +++ b/src/Bloc/BlChildDoesNotExistError.class.st @@ -1,26 +1,24 @@ Class { - #name : 'BlChildDoesNotExistError', - #superclass : 'Error', + #name : #BlChildDoesNotExistError, + #superclass : #Error, #instVars : [ 'parent', 'child' ], - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #category : 'Bloc-Basic-Errors' } -{ #category : 'accessing' } +{ #category : #accessing } BlChildDoesNotExistError >> child [ ^ child ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildDoesNotExistError >> child: anObject [ child := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildDoesNotExistError >> description [ ^ 'An element {1} is not a direct child of {2}' format: { @@ -29,12 +27,12 @@ BlChildDoesNotExistError >> description [ } ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildDoesNotExistError >> parent [ ^ parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildDoesNotExistError >> parent: anObject [ parent := anObject ] diff --git a/src/Bloc/BlChildren.class.st b/src/Bloc/BlChildren.class.st index 5cbb678e0..50fa5bc7e 100644 --- a/src/Bloc/BlChildren.class.st +++ b/src/Bloc/BlChildren.class.st @@ -21,23 +21,21 @@ Important API methods: " Class { - #name : 'BlChildren', - #superclass : 'Collection', + #name : #BlChildren, + #superclass : #Collection, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #category : 'Bloc-Basic-Children' } -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildren >> accountedByLayout [ ^ BlChildrenAccountedByLayout on: self ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> all [ self deprecated: 'Use asArray instead' @@ -46,7 +44,7 @@ BlChildren >> all [ ^ self asArray ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> anySatisfy: aBlock [ "Evaluate aBlock with the elements of the receiver. If aBlock returns true for any element return true. @@ -56,7 +54,7 @@ BlChildren >> anySatisfy: aBlock [ ^ false ] -{ #category : 'children - converting' } +{ #category : #'children - converting' } BlChildren >> asArray [ "Create an array containing all the children. @@ -68,7 +66,7 @@ BlChildren >> asArray [ self do: [ :anElement | aStream nextPut: anElement ] ] ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> at: anIndex [ "Return an element at a given index without taking zIndex into account" @@ -76,7 +74,7 @@ BlChildren >> at: anIndex [ ^ self subclassResponsibility ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> at: anIndex ifAbsent: exceptionBlock [ "Answer the element at my position index. If I do not contain an element at index, answer the result of evaluating the argument, exceptionBlock." @@ -86,7 +84,7 @@ BlChildren >> at: anIndex ifAbsent: exceptionBlock [ ^ exceptionBlock value ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> collect: aBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. Collect the resulting values into a collection like the receiver. Answer @@ -97,7 +95,7 @@ BlChildren >> collect: aBlock [ self do: [ :anElement | aStream nextPut: (aBlock value: anElement) ] ] ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> detect: aBlock ifFound: foundBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. If some element evaluates aBlock to true, then cull this element into @@ -112,7 +110,7 @@ BlChildren >> detect: aBlock ifFound: foundBlock [ ifNone: [ "Do nothing on purpose" ] ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> detect: aBlock ifFound: foundBlock ifNone: exceptionBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. If some element evaluates aBlock to true, then cull this element into @@ -126,7 +124,7 @@ BlChildren >> detect: aBlock ifFound: foundBlock ifNone: exceptionBlock [ ^ exceptionBlock value ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> detect: aBlock ifNone: exceptionBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. Answer the first element for which aBlock evaluates to true. If none @@ -139,33 +137,33 @@ BlChildren >> detect: aBlock ifNone: exceptionBlock [ ifNone: exceptionBlock ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> do: aBlock [ self subclassResponsibility ] -{ #category : 'private' } +{ #category : #private } BlChildren >> errorNotFound: anObject [ "Raise a NotFound exception." NotFound signalFor: anObject ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> fifth [ ^ self at: 5 ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> first [ ^ self at: 1 ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> flatCollect: aBlock [ "Evaluate aBlock for each of the receiver's elements and answer the list of all resulting values flatten one level. Assumes that aBlock returns some kind @@ -176,21 +174,21 @@ BlChildren >> flatCollect: aBlock [ self do: [ :anElement | aStream nextPutAll: (aBlock value: anElement) ] ] ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> fourth [ ^ self at: 4 ] -{ #category : 'testing' } +{ #category : #testing } BlChildren >> hasSuperset [ "I indicate whether or not the intent is to iterate over the complete set of children of an element." ^ false ] -{ #category : 'children - testing' } +{ #category : #'children - testing' } BlChildren >> ifEmpty: aBlock [ "Evaluate the given block, answering its value if the receiver is empty, otherwise answer the receiver." @@ -201,14 +199,14 @@ BlChildren >> ifEmpty: aBlock [ ifFalse: [ self ] ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildren >> ignoredByLayout [ ^ BlChildrenIgnoredByLayout on: self ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> indexOf: anElement [ "Answer the index of the first occurrence of anElement within the receiver. If the receiver does not contain anElement, answer 0." @@ -217,7 +215,7 @@ BlChildren >> indexOf: anElement [ ^ self indexOf: anElement ifAbsent: 0 ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> indexOf: anElement ifAbsent: exceptionBlock [ "Answer the index of the first occurence of anElement within the receiver. If the receiver does not contain anElement, answer the @@ -229,7 +227,7 @@ BlChildren >> indexOf: anElement ifAbsent: exceptionBlock [ ^ exceptionBlock value ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> inject: thisValue into: binaryBlock [ "Accumulate a running value associated with evaluating the argument, binaryBlock, with the current value of the argument, thisValue, and the @@ -243,38 +241,38 @@ BlChildren >> inject: thisValue into: binaryBlock [ ^ nextValue ] -{ #category : 'testing' } +{ #category : #testing } BlChildren >> isCollection [ ^ true ] -{ #category : 'children - testing' } +{ #category : #'children - testing' } BlChildren >> isEmpty [ ^ self size isZero ] -{ #category : 'children - testing' } +{ #category : #'children - testing' } BlChildren >> isNotEmpty [ ^ self size isZero not ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> last [ ^ self at: self size ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildren >> name [ ^ 'Children' ] -{ #category : 'printing' } +{ #category : #printing } BlChildren >> printOn: aStream [ aStream nextPutAll: self name; @@ -284,7 +282,7 @@ BlChildren >> printOn: aStream [ nextPut: $) ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> reject: aBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. Collect into a new collection like the receiver only those elements for @@ -294,26 +292,26 @@ BlChildren >> reject: aBlock [ ^ self select: [ :anElement | (aBlock value: anElement) == false ] ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> reverseDo: aBlock [ self reversed do: aBlock ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildren >> reversed [ ^ BlChildrenReversed on: self ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> second [ ^ self at: 2 ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> select: aBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. Collect into a new collection like the receiver, only those elements for @@ -326,7 +324,7 @@ BlChildren >> select: aBlock [ ifTrue: [ aStream nextPut: anElement ] ] ] ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> select: selectBlock thenDo: doBlock [ "Utility method to improve readability. Do not create the intermediate collection." @@ -336,47 +334,47 @@ BlChildren >> select: selectBlock thenDo: doBlock [ ifTrue: [ doBlock value: anElement ] ] ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> size [ ^ self subclassResponsibility ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildren >> sortedByElevation [ ^ BlChildrenSortedByElevation on: self ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildren >> sortedByElevationReversed [ ^ BlChildrenSortedByElevationReversed on: self ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildren >> sortedByPerimeter [ ^ BlChildrenSortedByPerimeter on: self ] -{ #category : 'private' } +{ #category : #private } BlChildren >> species [ ^ Array ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildren >> third [ ^ self at: 3 ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildren >> withIndexDo: elementAndIndexBlock [ "Just like with:do: except that the iteration index supplies the second argument to the block." | anIndex | diff --git a/src/Bloc/BlChildrenAccountedByLayout.class.st b/src/Bloc/BlChildrenAccountedByLayout.class.st index e2b484364..50f95ef70 100644 --- a/src/Bloc/BlChildrenAccountedByLayout.class.st +++ b/src/Bloc/BlChildrenAccountedByLayout.class.st @@ -6,24 +6,22 @@ I represent a subset of children that are accounted (not ignored) by layout. " Class { - #name : 'BlChildrenAccountedByLayout', - #superclass : 'BlChildrenSubset', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #name : #BlChildrenAccountedByLayout, + #superclass : #BlChildrenSubset, + #category : 'Bloc-Basic-Children' } -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildrenAccountedByLayout >> accountedByLayout [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenAccountedByLayout >> name [ ^ 'Accounted by layout' ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenAccountedByLayout >> subsetFrom: aBlChildren [ ^ aBlChildren select: [ :anElement | anElement constraints ignoredByLayout not diff --git a/src/Bloc/BlChildrenArray.class.st b/src/Bloc/BlChildrenArray.class.st index 42d81d97c..d92ceda3f 100644 --- a/src/Bloc/BlChildrenArray.class.st +++ b/src/Bloc/BlChildrenArray.class.st @@ -9,29 +9,27 @@ Examples are provided by the class {{gtClass:BlChildrenArrayExamples}} " Class { - #name : 'BlChildrenArray', - #superclass : 'BlChildrenCollection', + #name : #BlChildrenArray, + #superclass : #BlChildrenCollection, #instVars : [ 'array' ], - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #category : 'Bloc-Basic-Children' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlChildrenArray class >> from: anArrayOfChildren [ ^ self new initializeFrom: anArrayOfChildren ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenArray >> add: aChild at: anIndex [ "Adds aChild at a given index moving existing children to the right" array := array copyReplaceFrom: anIndex to: anIndex - 1 with: { aChild } ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenArray >> addAll: aSequenceableCollection [ "Add all the elements from the given collection to the children array. If the user passed an array and our current array is empty, we just replace @@ -42,7 +40,7 @@ BlChildrenArray >> addAll: aSequenceableCollection [ ifFalse: [ array, aSequenceableCollection ] ] -{ #category : 'converting' } +{ #category : #converting } BlChildrenArray >> asArray [ "Directly return the internal array used to store children. This avoids creating an extra array, as this operation can be called many times. @@ -51,7 +49,7 @@ BlChildrenArray >> asArray [ ^ array ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenArray >> at: anIndex [ "Return an element at a given index" @@ -59,46 +57,46 @@ BlChildrenArray >> at: anIndex [ ^ array at: anIndex ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildrenArray >> do: aBlock [ array do: aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenArray >> initialize [ super initialize. array := #() ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenArray >> initializeFrom: anArrayOfChildren [ array := anArrayOfChildren asArray ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenArray >> name [ ^ 'Children array' ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenArray >> removeAll: aCollectionOfBlElement [ array := array copyWithoutAll: aCollectionOfBlElement ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenArray >> removeAt: anIndex [ array := array copyReplaceFrom: anIndex to: anIndex with: #() ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenArray >> size [ ^ array size ] -{ #category : 'children - swapping' } +{ #category : #'children - swapping' } BlChildrenArray >> swapAt: aChildIndex with: anotherChildIndex [ aChildIndex = anotherChildIndex ifTrue: [ ^ self ]. diff --git a/src/Bloc/BlChildrenCollection.class.st b/src/Bloc/BlChildrenCollection.class.st index 73234bf3b..af0307290 100644 --- a/src/Bloc/BlChildrenCollection.class.st +++ b/src/Bloc/BlChildrenCollection.class.st @@ -17,49 +17,47 @@ Subclasses need to provide the implementation for methods adding and removing ch " Class { - #name : 'BlChildrenCollection', - #superclass : 'BlChildren', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #name : #BlChildrenCollection, + #superclass : #BlChildren, + #category : 'Bloc-Basic-Children' } -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenCollection >> add: anElement [ "Adds aChild as a last one in a collection" self add: anElement at: self size + 1 ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenCollection >> add: anElement at: anIndex [ "Adds anElement at a given index moving existing children to the right" self subclassResponsibility ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenCollection >> addAll: aCollectionOfBlElement [ "Add all elements from a given collection appending them to the end" self subclassResponsibility ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenCollection >> addFirst: anElement [ "Add a given element as a first item moving all existing children to the right" self add: anElement at: 1 ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenCollection >> remove: anElement [ self remove: anElement ifAbsent: [ self errorNotFound: anElement ] ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenCollection >> remove: anElement ifAbsent: anExceptionBlock [ | anIndex | @@ -70,12 +68,12 @@ BlChildrenCollection >> remove: anElement ifAbsent: anExceptionBlock [ self removeAt: anIndex ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenCollection >> removeAll: aCollectionOfBlElement [ self subclassResponsibility ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenCollection >> removeAt: anIndex [ self subclassResponsibility ] diff --git a/src/Bloc/BlChildrenIgnoredByLayout.class.st b/src/Bloc/BlChildrenIgnoredByLayout.class.st index 6862033b2..b8c923fd9 100644 --- a/src/Bloc/BlChildrenIgnoredByLayout.class.st +++ b/src/Bloc/BlChildrenIgnoredByLayout.class.st @@ -5,24 +5,22 @@ I represent a subset of children that are ignored by layout. " Class { - #name : 'BlChildrenIgnoredByLayout', - #superclass : 'BlChildrenSubset', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #name : #BlChildrenIgnoredByLayout, + #superclass : #BlChildrenSubset, + #category : 'Bloc-Basic-Children' } -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildrenIgnoredByLayout >> ignoredByLayout [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenIgnoredByLayout >> name [ ^ 'Ignored by layout' ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenIgnoredByLayout >> subsetFrom: aBlChildren [ ^ aBlChildren select: [ :anElement | anElement constraints ignoredByLayout diff --git a/src/Bloc/BlChildrenLinkedList.class.st b/src/Bloc/BlChildrenLinkedList.class.st index 22679ee3a..6ebe70445 100644 --- a/src/Bloc/BlChildrenLinkedList.class.st +++ b/src/Bloc/BlChildrenLinkedList.class.st @@ -8,17 +8,15 @@ Examples are provided by the class {{gtClass:BlChildrenLinkedListExamples}} " Class { - #name : 'BlChildrenLinkedList', - #superclass : 'BlChildrenCollection', + #name : #BlChildrenLinkedList, + #superclass : #BlChildrenCollection, #instVars : [ 'list' ], - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #category : 'Bloc-Basic-Children' } -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenLinkedList >> add: aChild at: anIndex [ "Adds aChild at a given index moving existing children to the right" | aLinkAt | @@ -32,12 +30,12 @@ BlChildrenLinkedList >> add: aChild at: anIndex [ list add: aChild afterLink: aLinkAt ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenLinkedList >> addAll: aSequenceableCollection [ list addAll: aSequenceableCollection ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenLinkedList >> at: anIndex [ "Return an element at a given index" @@ -45,29 +43,29 @@ BlChildrenLinkedList >> at: anIndex [ ^ list at: anIndex ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildrenLinkedList >> do: aBlock [ list do: aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenLinkedList >> initialize [ super initialize. list := LinkedList new ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenLinkedList >> name [ ^ 'Children linked list' ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenLinkedList >> removeAll: aCollectionOfBlElement [ list removeAll: aCollectionOfBlElement ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenLinkedList >> removeAt: anIndex [ | aLinkAt | @@ -75,7 +73,7 @@ BlChildrenLinkedList >> removeAt: anIndex [ list removeLink: aLinkAt ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenLinkedList >> size [ diff --git a/src/Bloc/BlChildrenOrderedCollection.class.st b/src/Bloc/BlChildrenOrderedCollection.class.st index 0a3ffed7b..10b17ff69 100644 --- a/src/Bloc/BlChildrenOrderedCollection.class.st +++ b/src/Bloc/BlChildrenOrderedCollection.class.st @@ -8,29 +8,27 @@ Examples are provided by the class {{gtClass:BlChildrenOrderedCollectionExamples " Class { - #name : 'BlChildrenOrderedCollection', - #superclass : 'BlChildrenCollection', + #name : #BlChildrenOrderedCollection, + #superclass : #BlChildrenCollection, #instVars : [ 'collection' ], - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #category : 'Bloc-Basic-Children' } -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenOrderedCollection >> add: aChild at: anIndex [ "Adds aChild at a given index moving existing children to the right" collection add: aChild beforeIndex: anIndex ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenOrderedCollection >> addAll: aSequenceableCollection [ collection addAll: aSequenceableCollection ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenOrderedCollection >> at: anIndex [ "Return an element at a given index" @@ -38,34 +36,34 @@ BlChildrenOrderedCollection >> at: anIndex [ ^ collection at: anIndex ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildrenOrderedCollection >> do: aBlock [ collection do: aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenOrderedCollection >> initialize [ super initialize. collection := OrderedCollection new ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenOrderedCollection >> name [ ^ 'Children ordered collection' ] -{ #category : 'removing' } +{ #category : #removing } BlChildrenOrderedCollection >> removeAll: aCollectionOfBlElement [ collection removeAll: aCollectionOfBlElement ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenOrderedCollection >> removeAt: anIndex [ collection removeAt: anIndex ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenOrderedCollection >> size [ diff --git a/src/Bloc/BlChildrenReversed.class.st b/src/Bloc/BlChildrenReversed.class.st index fad4f8eab..07f9e6c11 100644 --- a/src/Bloc/BlChildrenReversed.class.st +++ b/src/Bloc/BlChildrenReversed.class.st @@ -6,41 +6,39 @@ I reverse an underlying collection of children. " Class { - #name : 'BlChildrenReversed', - #superclass : 'BlChildrenSubset', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #name : #BlChildrenReversed, + #superclass : #BlChildrenSubset, + #category : 'Bloc-Basic-Children' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlChildrenReversed class >> on: aBlChildren [ ^ self new initializeFrom: aBlChildren ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenReversed >> at: anIndex [ ^ super at: (self size - anIndex + 1) ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildrenReversed >> do: aBlock [ subsetArray reverseDo: aBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenReversed >> name [ ^ 'Reversed' ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildrenReversed >> reversed [ ^ BlChildrenArray from: subsetArray ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenReversed >> subsetFrom: aBlChildren [ "Only convert the given collection to an array. Iteration is performed on reverse order on that array." ^ aBlChildren asArray diff --git a/src/Bloc/BlChildrenRope.class.st b/src/Bloc/BlChildrenRope.class.st index c1edb40d1..a49d1aac9 100644 --- a/src/Bloc/BlChildrenRope.class.st +++ b/src/Bloc/BlChildrenRope.class.st @@ -8,29 +8,27 @@ Examples are provided by the class {{gtClass:BlChildrenRopeExamples}} " Class { - #name : 'BlChildrenRope', - #superclass : 'BlChildrenCollection', + #name : #BlChildrenRope, + #superclass : #BlChildrenCollection, #instVars : [ 'rope' ], - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #category : 'Bloc-Basic-Children' } -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenRope >> add: aChild at: anIndex [ "Adds aChild at a given index moving existing children to the right" rope := rope insertItems: { aChild } at: anIndex - 1 ] -{ #category : 'children - adding' } +{ #category : #'children - adding' } BlChildrenRope >> addAll: aSequenceableCollection [ rope := rope insertItems: aSequenceableCollection at: rope size ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenRope >> at: anIndex [ "Return an element at a given index" @@ -38,34 +36,34 @@ BlChildrenRope >> at: anIndex [ ^ rope at: anIndex ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildrenRope >> do: aBlock [ rope do: aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenRope >> initialize [ super initialize. rope := BlCollectionRope collection: #() ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenRope >> name [ ^ 'Children rope' ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenRope >> removeAll: aCollectionOfBlElement [ aCollectionOfBlElement do: [ :aChild | self remove: aChild ] ] -{ #category : 'children - removing' } +{ #category : #'children - removing' } BlChildrenRope >> removeAt: anIndex [ rope := rope delete: anIndex - 1 to: anIndex ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenRope >> size [ diff --git a/src/Bloc/BlChildrenSortedByElevation.class.st b/src/Bloc/BlChildrenSortedByElevation.class.st index f4da89d94..f0f0ee8c8 100644 --- a/src/Bloc/BlChildrenSortedByElevation.class.st +++ b/src/Bloc/BlChildrenSortedByElevation.class.st @@ -6,24 +6,22 @@ I sort a collection of children by elevation in ascending order. " Class { - #name : 'BlChildrenSortedByElevation', - #superclass : 'BlChildrenSubset', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #name : #BlChildrenSortedByElevation, + #superclass : #BlChildrenSubset, + #category : 'Bloc-Basic-Children' } -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenSortedByElevation >> name [ ^ 'Sorted by elevation' ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildrenSortedByElevation >> sortedByElevation [ ^ self ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenSortedByElevation >> subsetFrom: aBlChildren [ "Perform the sort when the instance is created." ^ aBlChildren asArray sorted: [ :a :b | diff --git a/src/Bloc/BlChildrenSortedByElevationReversed.class.st b/src/Bloc/BlChildrenSortedByElevationReversed.class.st index 0c1fa4255..3ed23c25c 100644 --- a/src/Bloc/BlChildrenSortedByElevationReversed.class.st +++ b/src/Bloc/BlChildrenSortedByElevationReversed.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlChildrenSortedByElevationReversed', - #superclass : 'BlChildrenSubset', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #name : #BlChildrenSortedByElevationReversed, + #superclass : #BlChildrenSubset, + #category : 'Bloc-Basic-Children' } -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildrenSortedByElevationReversed >> sortedByElevationReversed [ ^ self ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenSortedByElevationReversed >> subsetFrom: aBlChildren [ "Perform the sort when the instance is created." ^ aBlChildren asArray sorted: [ :a :b | diff --git a/src/Bloc/BlChildrenSortedByPerimeter.class.st b/src/Bloc/BlChildrenSortedByPerimeter.class.st index b12c37c03..6fcf11b42 100644 --- a/src/Bloc/BlChildrenSortedByPerimeter.class.st +++ b/src/Bloc/BlChildrenSortedByPerimeter.class.st @@ -3,24 +3,22 @@ I sort a collection of children by perimeter in ascending order. " Class { - #name : 'BlChildrenSortedByPerimeter', - #superclass : 'BlChildrenSubset', - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #name : #BlChildrenSortedByPerimeter, + #superclass : #BlChildrenSubset, + #category : 'Bloc-Basic-Children' } -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenSortedByPerimeter >> name [ ^ 'Sorted by permeter' ] -{ #category : 'children - subsets' } +{ #category : #'children - subsets' } BlChildrenSortedByPerimeter >> sortedByPerimeter [ ^ self ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenSortedByPerimeter >> subsetFrom: aBlChildren [ "Perform the sort when the instance is created." ^ aBlChildren asArray sorted: [ :a :b | a measuredBounds perimeter >= b measuredBounds perimeter ] diff --git a/src/Bloc/BlChildrenSubset.class.st b/src/Bloc/BlChildrenSubset.class.st index fa90540c3..658beddc0 100644 --- a/src/Bloc/BlChildrenSubset.class.st +++ b/src/Bloc/BlChildrenSubset.class.st @@ -20,23 +20,21 @@ To preserve the composition of iterators I hold a reference to the initial {{gtC " Class { - #name : 'BlChildrenSubset', - #superclass : 'BlChildren', + #name : #BlChildrenSubset, + #superclass : #BlChildren, #instVars : [ 'subsetArray', 'supersetChildren' ], - #category : 'Bloc-Basic-Children', - #package : 'Bloc', - #tag : 'Basic-Children' + #category : 'Bloc-Basic-Children' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlChildrenSubset class >> on: aBlChildren [ ^ self new initializeFrom: aBlChildren ] -{ #category : 'adding' } +{ #category : #adding } BlChildrenSubset >> add: newObject [ "Include newObject as one of the receiver's elements. Answer newObject. ArrayedCollections cannot respond to this message." @@ -44,14 +42,14 @@ BlChildrenSubset >> add: newObject [ self shouldNotImplement ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenSubset >> at: anIndex [ ^ subsetArray at: anIndex ] -{ #category : 'children - enumerating' } +{ #category : #'children - enumerating' } BlChildrenSubset >> do: aBlock [ "Evaluate a Block on all subset items. Uses Array>>to:do: as optimization." @@ -59,14 +57,14 @@ BlChildrenSubset >> do: aBlock [ aBlock value: (subsetArray at: index) ] ] -{ #category : 'testing' } +{ #category : #testing } BlChildrenSubset >> hasSuperset [ ^ true ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenSubset >> initializeFrom: aBlChildren [ "Store the given aBlChildren parametre to keep track of how iterators are composed and also store the actual subset of elements on which this iterator will operate." @@ -74,12 +72,12 @@ BlChildrenSubset >> initializeFrom: aBlChildren [ supersetChildren := aBlChildren ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenSubset >> name [ ^ 'Subset' ] -{ #category : 'removing' } +{ #category : #removing } BlChildrenSubset >> remove: oldObject ifAbsent: anExceptionBlock [ "Remove oldObject from the receiver's elements. If several of the elements are equal to oldObject, only one is removed. If no element is @@ -90,21 +88,21 @@ BlChildrenSubset >> remove: oldObject ifAbsent: anExceptionBlock [ self shouldNotImplement ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlChildrenSubset >> size [ ^ subsetArray size ] -{ #category : 'initialization' } +{ #category : #initialization } BlChildrenSubset >> subsetFrom: aBlChildren [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlChildrenSubset >> superset [ "Return a superset of this children subset" diff --git a/src/Bloc/BlCircle.class.st b/src/Bloc/BlCircle.class.st index 1cc02c59a..d129d2f57 100644 --- a/src/Bloc/BlCircle.class.st +++ b/src/Bloc/BlCircle.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlCircle', - #superclass : 'BlCircleGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlCircle, + #superclass : #BlCircleGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlCircle class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlCircleGeometry.class.st b/src/Bloc/BlCircleGeometry.class.st index 138e235cd..3b1c20730 100644 --- a/src/Bloc/BlCircleGeometry.class.st +++ b/src/Bloc/BlCircleGeometry.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlCircleGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlCircleGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'radius', 'origin' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'comparing' } +{ #category : #comparing } BlCircleGeometry >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlCircleGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ | centerX centerY | @@ -25,7 +23,7 @@ BlCircleGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement ^ ((aPoint x - centerX) squared + (aPoint y - centerY) squared) < radius squared ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlCircleGeometry >> geometryBounds: aBlBounds [ "Load my bounds in mutable rectangle. @see #geometryBounds for more info" @@ -35,24 +33,24 @@ BlCircleGeometry >> geometryBounds: aBlBounds [ extent: (self radius * 2.0) asPoint ] -{ #category : 'testing' } +{ #category : #testing } BlCircleGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlCircleGeometry >> hasJoins [ ^ false ] -{ #category : 'comparing' } +{ #category : #comparing } BlCircleGeometry >> hash [ ^ self class hash ] -{ #category : 'initialization' } +{ #category : #initialization } BlCircleGeometry >> initialize [ super initialize. @@ -60,7 +58,7 @@ BlCircleGeometry >> initialize [ origin := 0@0 ] -{ #category : 'geometry' } +{ #category : #geometry } BlCircleGeometry >> matchExtent: anExtent [ radius := anExtent min / 2.0. origin := (anExtent - anExtent min asPoint) / 2.0. @@ -68,12 +66,12 @@ BlCircleGeometry >> matchExtent: anExtent [ self extent: anExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlCircleGeometry >> origin [ ^ origin ] -{ #category : 'accessing' } +{ #category : #accessing } BlCircleGeometry >> radius [ ^ radius ] diff --git a/src/Bloc/BlClickAvortedEvent.class.st b/src/Bloc/BlClickAvortedEvent.class.st index cce842427..001db6050 100644 --- a/src/Bloc/BlClickAvortedEvent.class.st +++ b/src/Bloc/BlClickAvortedEvent.class.st @@ -1,39 +1,37 @@ Class { - #name : 'BlClickAvortedEvent', - #superclass : 'BlMouseEvent', + #name : #BlClickAvortedEvent, + #superclass : #BlMouseEvent, #instVars : [ 'processor', 'upEvent' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlClickAvortedEvent >> processor [ ^ processor ] -{ #category : 'accessing' } +{ #category : #accessing } BlClickAvortedEvent >> processor: aMouseProcessor [ processor := aMouseProcessor ] -{ #category : 'sending' } +{ #category : #sending } BlClickAvortedEvent >> sendTo: anObject [ anObject clickAvortedEvent: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlClickAvortedEvent >> upEvent [ ^ upEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlClickAvortedEvent >> upEvent: anElement [ upEvent := anElement diff --git a/src/Bloc/BlClickEvent.class.st b/src/Bloc/BlClickEvent.class.st index ed0c888db..ee0b16e44 100644 --- a/src/Bloc/BlClickEvent.class.st +++ b/src/Bloc/BlClickEvent.class.st @@ -9,19 +9,17 @@ The order of fired events: " Class { - #name : 'BlClickEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlClickEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlClickEvent >> isClick [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlClickEvent >> sendTo: anObject [ anObject clickEvent: self ] diff --git a/src/Bloc/BlClipOutEffect.class.st b/src/Bloc/BlClipOutEffect.class.st index 0e5d28735..9bd5ec063 100644 --- a/src/Bloc/BlClipOutEffect.class.st +++ b/src/Bloc/BlClipOutEffect.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlClipOutEffect', - #superclass : 'BlElementEffect', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #name : #BlClipOutEffect, + #superclass : #BlElementEffect, + #category : 'Bloc-Effect' } diff --git a/src/Bloc/BlClipOutGeometryEffect.class.st b/src/Bloc/BlClipOutGeometryEffect.class.st index 588f6331f..754c07819 100644 --- a/src/Bloc/BlClipOutGeometryEffect.class.st +++ b/src/Bloc/BlClipOutGeometryEffect.class.st @@ -3,40 +3,38 @@ TODO needs some work to use it in dropdown to reveal the same toggle " Class { - #name : 'BlClipOutGeometryEffect', - #superclass : 'BlClipOutEffect', + #name : #BlClipOutGeometryEffect, + #superclass : #BlClipOutEffect, #instVars : [ 'geometry', 'offset' ], - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'accessing' } +{ #category : #accessing } BlClipOutGeometryEffect >> geometry [ ^ geometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlClipOutGeometryEffect >> geometry: anObject [ geometry := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlClipOutGeometryEffect >> initialize [ super initialize. geometry := (0@0 extent: 0@0) ] -{ #category : 'accessing' } +{ #category : #accessing } BlClipOutGeometryEffect >> offset: aPoint [ offset := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlClipOutGeometryEffect >> offsetFor: anElement [ ^ offset ] diff --git a/src/Bloc/BlClipOutInsetsEffect.class.st b/src/Bloc/BlClipOutInsetsEffect.class.st index a2885f623..a9bb1f11e 100644 --- a/src/Bloc/BlClipOutInsetsEffect.class.st +++ b/src/Bloc/BlClipOutInsetsEffect.class.st @@ -1,29 +1,27 @@ Class { - #name : 'BlClipOutInsetsEffect', - #superclass : 'BlClipOutEffect', + #name : #BlClipOutInsetsEffect, + #superclass : #BlClipOutEffect, #instVars : [ 'insets' ], - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'initialization' } +{ #category : #initialization } BlClipOutInsetsEffect >> initialize [ super initialize. insets := BlInsets empty ] -{ #category : 'accessing' } +{ #category : #accessing } BlClipOutInsetsEffect >> insets [ ^ insets ] -{ #category : 'accessing' } +{ #category : #accessing } BlClipOutInsetsEffect >> insets: aBlInsets [ insets := aBlInsets ] diff --git a/src/Bloc/BlCollectionRope.class.st b/src/Bloc/BlCollectionRope.class.st index 2c5d09778..108367af6 100644 --- a/src/Bloc/BlCollectionRope.class.st +++ b/src/Bloc/BlCollectionRope.class.st @@ -4,17 +4,15 @@ My recommended maximum length (size) is defined in BrRope class>>#combineLength " Class { - #name : 'BlCollectionRope', - #superclass : 'BlRope', + #name : #BlCollectionRope, + #superclass : #BlRope, #instVars : [ 'collection' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCollectionRope class >> collection: aCollection [ ^ self new @@ -22,7 +20,7 @@ BlCollectionRope class >> collection: aCollection [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCollectionRope class >> from: leftCollectionRope and: rightCollectionRope [ | aNewSpecies | @@ -36,7 +34,7 @@ BlCollectionRope class >> from: leftCollectionRope and: rightCollectionRope [ rightCollectionRope do: [ :eachItem | aStream nextPut: eachItem ] ]) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlCollectionRope >> at: anIndex [ "Return an item at a given index" @@ -44,7 +42,7 @@ BlCollectionRope >> at: anIndex [ ^ collection at: anIndex ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlCollectionRope >> attributes: anAttributesCollection from: aStart to: anEnd [ "See BlRope>>#attributes:from:to: for the detailed explanation on start and end indices" @@ -72,19 +70,19 @@ BlCollectionRope >> attributes: anAttributesCollection from: aStart to: anEnd [ ^ (self from: 0 to: aStart) append: (anAttributeRope append: (self from: anEnd to: self size)) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlCollectionRope >> children [ ^ { } ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlCollectionRope >> clearAttributes: aStart to: anEnd if: aBlock [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlCollectionRope >> collection [ "Return a collection behind this rope" @@ -92,12 +90,12 @@ BlCollectionRope >> collection [ ^ collection ] -{ #category : 'initialization' } +{ #category : #initialization } BlCollectionRope >> collection: aCollection [ collection := aCollection ] -{ #category : 'private' } +{ #category : #private } BlCollectionRope >> copyFrom: aStart to: anEnd [ self assertAccessFrom: aStart to: anEnd. @@ -108,7 +106,7 @@ BlCollectionRope >> copyFrom: aStart to: anEnd [ ^ self class collection: (collection copyFrom: aStart + 1 to: anEnd) ] -{ #category : 'rope - deleting' } +{ #category : #'rope - deleting' } BlCollectionRope >> delete: aStart to: anEnd [ | newCollection | @@ -148,7 +146,7 @@ BlCollectionRope >> delete: aStart to: anEnd [ ^ self class collection: newCollection ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlCollectionRope >> depth [ "Return the max tree height of this rope (composition depth). Collection rope is a leaf in a composition tree => depth is always 1" @@ -157,12 +155,12 @@ BlCollectionRope >> depth [ ^ 1 ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlCollectionRope >> do: aBlock [ collection do: aBlock ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlCollectionRope >> empty [ "Return an empty collection rope" @@ -170,7 +168,7 @@ BlCollectionRope >> empty [ ^ self class collection: (collection species new: 0) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlCollectionRope >> from: aStart to: anEnd [ | aNewLegnth | self assertAccessFrom: aStart to: anEnd. @@ -186,7 +184,7 @@ BlCollectionRope >> from: aStart to: anEnd [ ifFalse: [ self class subRope rope: self offset: aStart length: aNewLegnth ] ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlCollectionRope >> from: aStart to: anEnd do: aBlock [ aStart + 1 @@ -195,7 +193,7 @@ BlCollectionRope >> from: aStart to: anEnd do: aBlock [ do: [ :anIndex | aBlock value: (collection at: anIndex) ] ] -{ #category : 'rope - inserting' } +{ #category : #'rope - inserting' } BlCollectionRope >> insertItems: aCollection at: anIndex [ | anInsertionRope | @@ -219,7 +217,7 @@ BlCollectionRope >> insertItems: aCollection at: anIndex [ ^ (self from: 0 to: anIndex) append: (anInsertionRope append: (self from: anIndex to: self size)) ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlCollectionRope >> isLeaf [ "Collection rope can not contain other ropes (even if my collection consists of ropes, we don't count them and don't take into account such case)" @@ -228,12 +226,12 @@ BlCollectionRope >> isLeaf [ ^ true ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlCollectionRope >> iterator: aStart to: anEnd [ ^ BlCollectionRopeIterator rope: self from: aStart to: anEnd ] -{ #category : 'private' } +{ #category : #private } BlCollectionRope >> merge: aCollection at: anIndex [ | newCollection | newCollection := anIndex = 0 @@ -263,7 +261,7 @@ BlCollectionRope >> merge: aCollection at: anIndex [ ^ self class collectionRope collection: newCollection ] -{ #category : 'private' } +{ #category : #private } BlCollectionRope >> mergeSplit: aCollection at: anIndex [ | leftArray rightArray middle totalSize leftAmountBeforeIndex leftAmountFromCollection leftAmountAfterIndex rightAmountBeforeIndex alreadyFilledAmount alreadyFilledAmountFromCollection rightAmountFromCollection rightAmountAfterIndex | @@ -336,21 +334,21 @@ BlCollectionRope >> mergeSplit: aCollection at: anIndex [ and: (self class collectionRope collection: rightArray) ] -{ #category : 'accessing' } +{ #category : #accessing } BlCollectionRope >> readStream [ "Answer a read stream that iterates over the characters in the receiver's collection" ^ collection readStream ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlCollectionRope >> simplified [ ^ self ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlCollectionRope >> size [ "Return the amount of items in this rope, which is equal to the size of an underlying collection" diff --git a/src/Bloc/BlCollectionRopeIterator.class.st b/src/Bloc/BlCollectionRopeIterator.class.st index 4cd7b5bbb..1fa5b96ac 100644 --- a/src/Bloc/BlCollectionRopeIterator.class.st +++ b/src/Bloc/BlCollectionRopeIterator.class.st @@ -3,17 +3,15 @@ I am a special iterator used to iterate over collection rope " Class { - #name : 'BlCollectionRopeIterator', - #superclass : 'BlRopeIterator', + #name : #BlCollectionRopeIterator, + #superclass : #BlRopeIterator, #instVars : [ 'position' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'private - asserting' } +{ #category : #'private - asserting' } BlCollectionRopeIterator >> assertInvariant [ "I am a position invariant; I make sure that iterator operations do not go out of bounds" @@ -24,12 +22,12 @@ BlCollectionRopeIterator >> assertInvariant [ ifFalse: [ self error: 'Position must always be less or equal than end' ]. ] -{ #category : 'iterator - attributes' } +{ #category : #'iterator - attributes' } BlCollectionRopeIterator >> attributes [ ^ #() ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlCollectionRopeIterator >> hasNext [ self assertInvariant. @@ -37,7 +35,7 @@ BlCollectionRopeIterator >> hasNext [ ^ position < end ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlCollectionRopeIterator >> hasPrevious [ self assertInvariant. @@ -45,7 +43,7 @@ BlCollectionRopeIterator >> hasPrevious [ ^ position > start ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlCollectionRopeIterator >> next [ @@ -55,7 +53,7 @@ BlCollectionRopeIterator >> next [ ^ rope at: (position := position + 1) ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlCollectionRopeIterator >> nextSpan [ | aSpan | @@ -69,7 +67,7 @@ BlCollectionRopeIterator >> nextSpan [ ^ aSpan ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlCollectionRopeIterator >> peek [ @@ -79,7 +77,7 @@ BlCollectionRopeIterator >> peek [ ^ rope at: position + 1 ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlCollectionRopeIterator >> peer [ @@ -89,14 +87,14 @@ BlCollectionRopeIterator >> peer [ ^ rope at: position ] -{ #category : 'iterator - accessing' } +{ #category : #'iterator - accessing' } BlCollectionRopeIterator >> position [ ^ position ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlCollectionRopeIterator >> previous [ | anItem | @@ -110,7 +108,7 @@ BlCollectionRopeIterator >> previous [ ^ anItem ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCollectionRopeIterator >> rope: aRope from: aStart to: anEnd [ super rope: aRope from: aStart to: anEnd. @@ -118,7 +116,7 @@ BlCollectionRopeIterator >> rope: aRope from: aStart to: anEnd [ self assertInvariant ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlCollectionRopeIterator >> skip: aNumber [ | newPosition | diff --git a/src/Bloc/BlColorPaint.class.st b/src/Bloc/BlColorPaint.class.st index 8dc0e2978..000228255 100644 --- a/src/Bloc/BlColorPaint.class.st +++ b/src/Bloc/BlColorPaint.class.st @@ -5,22 +5,20 @@ Color paint is transparent then and only then when underlying color's alpha chan " Class { - #name : 'BlColorPaint', - #superclass : 'BlPaint', + #name : #BlColorPaint, + #superclass : #BlPaint, #instVars : [ 'color' ], - #category : 'Bloc-Paint', - #package : 'Bloc', - #tag : 'Paint' + #category : 'Bloc-Paint' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlColorPaint class >> color: aColor [ ^ self new color: aColor ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlColorPaint class >> transparent [ "Return an instance of a paint with transparent color" @@ -28,7 +26,7 @@ BlColorPaint class >> transparent [ ^ BlTransparentPaint uniqueInstance ] -{ #category : 'comparing' } +{ #category : #comparing } BlColorPaint >> = anotherObject [ self == anotherObject ifTrue: [ ^ true ]. @@ -38,7 +36,7 @@ BlColorPaint >> = anotherObject [ ^ anotherObject color = self color ] -{ #category : 'accessing' } +{ #category : #accessing } BlColorPaint >> color [ "Return paint's underlying color. color can not be nil" @@ -51,7 +49,7 @@ BlColorPaint >> color [ ^ color ] -{ #category : 'accessing' } +{ #category : #accessing } BlColorPaint >> color: aColor [ "Initialize me with a given Color" self @@ -61,18 +59,18 @@ BlColorPaint >> color: aColor [ color := aColor ] -{ #category : 'comparing' } +{ #category : #comparing } BlColorPaint >> hash [ ^ self color hash ] -{ #category : 'testing' } +{ #category : #testing } BlColorPaint >> isColorPaint [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlColorPaint >> isOpaque [ "Color paint is opaque when underlying color is opaque @see BlPaint>>#isOpaque" @@ -81,7 +79,7 @@ BlColorPaint >> isOpaque [ ^ color isOpaque ] -{ #category : 'testing' } +{ #category : #testing } BlColorPaint >> isTransparent [ "Color paint is transparent when underlying color is transparent @see BlPaint>>#isTransparent" @@ -90,7 +88,7 @@ BlColorPaint >> isTransparent [ ^ color isTransparent ] -{ #category : 'geometry' } +{ #category : #geometry } BlColorPaint >> matchExtent: anExtent [ "do nothing for color paint" ] diff --git a/src/Bloc/BlCompositeAlignment.class.st b/src/Bloc/BlCompositeAlignment.class.st index 32f2a329d..100ccd704 100644 --- a/src/Bloc/BlCompositeAlignment.class.st +++ b/src/Bloc/BlCompositeAlignment.class.st @@ -1,59 +1,57 @@ Class { - #name : 'BlCompositeAlignment', - #superclass : 'BlElementAlignment', + #name : #BlCompositeAlignment, + #superclass : #BlElementAlignment, #instVars : [ 'vertical', 'horizontal', 'direction' ], - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCompositeAlignment class >> horizontal: aHorizontalAlignent vertical: aVerticalAlignment [ ^ self new horizontal: aHorizontalAlignent vertical: aVerticalAlignment; yourself ] -{ #category : 'factory' } +{ #category : #factory } BlCompositeAlignment >> directed: aBlLayoutDirection [ direction := aBlLayoutDirection ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeAlignment >> horizontal [ ^ horizontal ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeAlignment >> horizontal: aHorizontalAlignent vertical: aVerticalAlignment [ horizontal := aHorizontalAlignent. vertical := aVerticalAlignment ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeAlignment >> initialize [ super initialize. self leftToRight ] -{ #category : 'factory' } +{ #category : #factory } BlCompositeAlignment >> inverted [ ^ (self class horizontal: (vertical inverted directed: direction) vertical: (horizontal directed: direction) inverted) directed: direction; yourself ] -{ #category : 'factory' } +{ #category : #factory } BlCompositeAlignment >> leftToRight [ direction := BlLayoutDirection leftToRight ] -{ #category : 'printing' } +{ #category : #printing } BlCompositeAlignment >> printOn: aStream [ aStream nextPut: $(. horizontal printOn: aStream. @@ -65,19 +63,19 @@ BlCompositeAlignment >> printOn: aStream [ aStream nextPut: $) ] -{ #category : 'factory' } +{ #category : #factory } BlCompositeAlignment >> rightToLeft [ direction := BlLayoutDirection rightToLeft ] -{ #category : 'factory' } +{ #category : #factory } BlCompositeAlignment >> swap [ ^ (self class horizontal: horizontal swap vertical: vertical swap) directed: direction; yourself ] -{ #category : 'translation' } +{ #category : #translation } BlCompositeAlignment >> translationOf: aBounds in: aContainerBounds [ | h v | h := (horizontal directed: direction) translationOf: aBounds in: aContainerBounds. @@ -85,7 +83,7 @@ BlCompositeAlignment >> translationOf: aBounds in: aContainerBounds [ ^ h + v ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeAlignment >> vertical [ ^ vertical ] diff --git a/src/Bloc/BlCompositeBackground.class.st b/src/Bloc/BlCompositeBackground.class.st index 10acabf4c..5b9e36a03 100644 --- a/src/Bloc/BlCompositeBackground.class.st +++ b/src/Bloc/BlCompositeBackground.class.st @@ -24,48 +24,46 @@ Opacity example: " Class { - #name : 'BlCompositeBackground', - #superclass : 'BlBackground', + #name : #BlCompositeBackground, + #superclass : #BlBackground, #instVars : [ 'backgrounds' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCompositeBackground class >> withAll: aCollectionOfBackground [ ^ self new withAll: aCollectionOfBackground ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeBackground >> backgrounds [ ^ backgrounds ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeBackground >> initialize [ super initialize. backgrounds := Array new ] -{ #category : 'testing' } +{ #category : #testing } BlCompositeBackground >> isTransparent [ ^ (self opacity closeTo: 0.0) or: [ backgrounds allSatisfy: #isTransparent ] ] -{ #category : 'geometry' } +{ #category : #geometry } BlCompositeBackground >> matchExtent: anExtent [ backgrounds do: [ :aBackground | aBackground matchExtent: anExtent ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeBackground >> withAll: aCollectionOfBackgrounds [ self diff --git a/src/Bloc/BlCompositeBackgroundBuilder.class.st b/src/Bloc/BlCompositeBackgroundBuilder.class.st index b3b3a9fc2..fe562a416 100644 --- a/src/Bloc/BlCompositeBackgroundBuilder.class.st +++ b/src/Bloc/BlCompositeBackgroundBuilder.class.st @@ -3,20 +3,18 @@ I am a BlBackground builder. " Class { - #name : 'BlCompositeBackgroundBuilder', - #superclass : 'BlBackgroundBuilder', + #name : #BlCompositeBackgroundBuilder, + #superclass : #BlBackgroundBuilder, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'backgrounds', 'builders' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'builder' } +{ #category : #builder } BlCompositeBackgroundBuilder >> build [ self @@ -33,7 +31,7 @@ BlCompositeBackgroundBuilder >> build [ ifFalse: [ (BlCompositeBackground withAll: (builders collect: #build)) opacity: self opacity ] ] ] ] -{ #category : 'builder' } +{ #category : #builder } BlCompositeBackgroundBuilder >> image [ | aBuilder | @@ -43,19 +41,19 @@ BlCompositeBackgroundBuilder >> image [ ^ aBuilder ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeBackgroundBuilder >> image: aForm [ builders add: (BlImageBackgroundBuilder new form: aForm) ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeBackgroundBuilder >> initialize [ super initialize. builders := OrderedCollection new ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeBackgroundBuilder >> opacity: aNumber [ "Change opacity of previously added background" @@ -66,7 +64,7 @@ BlCompositeBackgroundBuilder >> opacity: aNumber [ backgrounds last opacity: aNumber ] -{ #category : 'builder' } +{ #category : #builder } BlCompositeBackgroundBuilder >> paint [ | aBuilder | @@ -76,7 +74,7 @@ BlCompositeBackgroundBuilder >> paint [ ^ aBuilder ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeBackgroundBuilder >> paint: aColorOrBlPaint [ builders add: (BlPaintBackgroundBuilder new paint: aColorOrBlPaint) ] diff --git a/src/Bloc/BlCompositeEffect.class.st b/src/Bloc/BlCompositeEffect.class.st index 2c6116077..e05318f0f 100644 --- a/src/Bloc/BlCompositeEffect.class.st +++ b/src/Bloc/BlCompositeEffect.class.st @@ -1,41 +1,39 @@ Class { - #name : 'BlCompositeEffect', - #superclass : 'BlElementEffect', + #name : #BlCompositeEffect, + #superclass : #BlElementEffect, #instVars : [ 'effects' ], - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlCompositeEffect class >> effects: aCollection [ ^ self new addAll: aCollection; yourself ] -{ #category : 'adding' } +{ #category : #adding } BlCompositeEffect >> addAll: aCollection [ effects addAll: aCollection ] -{ #category : 'geometry' } +{ #category : #geometry } BlCompositeEffect >> computeBounds: aBlBounds [ effects do: [ :each | each computeBounds: aBlBounds ]. ^ aBlBounds ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeEffect >> initialize [ super initialize. effects := OrderedCollection new ] -{ #category : 'testing' } +{ #category : #testing } BlCompositeEffect >> wantsCompositionLayer [ ^ effects anySatisfy: [ :each | each wantsCompositionLayer ] diff --git a/src/Bloc/BlCompositeErrorHandler.class.st b/src/Bloc/BlCompositeErrorHandler.class.st index e628f0d77..bb1e970ce 100644 --- a/src/Bloc/BlCompositeErrorHandler.class.st +++ b/src/Bloc/BlCompositeErrorHandler.class.st @@ -1,50 +1,48 @@ Class { - #name : 'BlCompositeErrorHandler', - #superclass : 'BlErrorHandler', + #name : #BlCompositeErrorHandler, + #superclass : #BlErrorHandler, #instVars : [ 'errors', 'errorHandlers' ], - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #category : 'Bloc-Basic-Errors' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCompositeErrorHandler class >> withAll: aCollectionOfErrorHandlers [ ^ self new addErrorHandlers: aCollectionOfErrorHandlers ] -{ #category : 'adding' } +{ #category : #adding } BlCompositeErrorHandler >> addErrorHandler: anErrorHandler [ self errorHandlers add: anErrorHandler ] -{ #category : 'adding' } +{ #category : #adding } BlCompositeErrorHandler >> addErrorHandlers: aCollectionOfErrorHandlers [ self errorHandlers addAll: aCollectionOfErrorHandlers ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeErrorHandler >> errorHandlers [ ^ errorHandlers ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeErrorHandler >> errors [ ^ errors ] -{ #category : 'testing' } +{ #category : #testing } BlCompositeErrorHandler >> hasError [ ^ self errors isNotEmpty ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeErrorHandler >> initialize [ super initialize. @@ -52,12 +50,12 @@ BlCompositeErrorHandler >> initialize [ errors := OrderedCollection new ] -{ #category : 'testing' } +{ #category : #testing } BlCompositeErrorHandler >> matches: aFramePhase [ ^ self errorHandlers anySatisfy: [ :anErrorHandler | anErrorHandler matches: aFramePhase ] ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlCompositeErrorHandler >> processError: aHandledError [ self errorHandlers detect: [ :anErrorHandler | anErrorHandler matches: aHandledError framePhase ] @@ -65,7 +63,7 @@ BlCompositeErrorHandler >> processError: aHandledError [ ifNone: [ self handleCriticalError: aHandledError ] ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlCompositeErrorHandler >> registerError: aHandledError [ self errors add: aHandledError ] diff --git a/src/Bloc/BlCompositeSelection.class.st b/src/Bloc/BlCompositeSelection.class.st index fe4334def..49b2c381c 100644 --- a/src/Bloc/BlCompositeSelection.class.st +++ b/src/Bloc/BlCompositeSelection.class.st @@ -3,17 +3,15 @@ I am a composite text selection consisting of multiple independent non-overlappi " Class { - #name : 'BlCompositeSelection', - #superclass : 'BlSelection', + #name : #BlCompositeSelection, + #superclass : #BlSelection, #instVars : [ 'selections' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCompositeSelection class >> fromIndices: aCollectionOfIndices [ | aBlSelection | @@ -24,7 +22,7 @@ BlCompositeSelection class >> fromIndices: aCollectionOfIndices [ ^ aBlSelection ] -{ #category : 'comparing' } +{ #category : #comparing } BlCompositeSelection >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -34,19 +32,19 @@ BlCompositeSelection >> = anObject [ ^ self selections = anObject selections ] -{ #category : 'private - adding / removing' } +{ #category : #'private - adding / removing' } BlCompositeSelection >> add: aMonotoneTextSelection [ selections insert: aMonotoneTextSelection ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeSelection >> children [ ^ #() ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlCompositeSelection >> contains: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -54,7 +52,7 @@ BlCompositeSelection >> contains: anIndex [ ^ selections contains: anIndex ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlCompositeSelection >> containsIndex: anIndex [ "Return true if selection indices include a given index, false otherwise. I am conceptually same as (self indices includes: anIndex)" @@ -63,7 +61,7 @@ BlCompositeSelection >> containsIndex: anIndex [ ^ selections containsIndex: anIndex ] -{ #category : 'copying' } +{ #category : #copying } BlCompositeSelection >> copyFrom: aStartIndex to: anEndIndex [ | aNewSelection | @@ -74,26 +72,26 @@ BlCompositeSelection >> copyFrom: aStartIndex to: anEndIndex [ ^ aNewSelection ] -{ #category : 'api - selection' } +{ #category : #'api - selection' } BlCompositeSelection >> deselect: aSelection [ "Remove a given selection" aSelection do: [ :aMonotoneSelection | self remove: aMonotoneSelection ] ] -{ #category : 'api - selection' } +{ #category : #'api - selection' } BlCompositeSelection >> deselect: aFromIndex to: aToIndex [ "Remove a monotone selection within provided indices" self remove: (BlSelection from: aFromIndex to: aToIndex) ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlCompositeSelection >> do: aBlock [ selections do: aBlock ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlCompositeSelection >> from [ "Return the minimum selected index which is the `from` index of the first sub-selection" @@ -101,12 +99,12 @@ BlCompositeSelection >> from [ ^ selections first selection from ] -{ #category : 'comparing' } +{ #category : #comparing } BlCompositeSelection >> hash [ ^ self class hash bitXor: self selections hash ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlCompositeSelection >> ifEmpty: aBlock [ "Evaluate the given block with the receiver as argument, answering its value unless the receiver is empty, in which case answer the receiver." @@ -116,7 +114,7 @@ BlCompositeSelection >> ifEmpty: aBlock [ ifFalse: [ self ] ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlCompositeSelection >> ifEmpty: emptyBlock ifNotEmpty: notEmptyBlock [ "Evaluate emptyBlock if I'm empty, notEmptyBlock otherwise" "If the notEmptyBlock has an argument, eval with the receiver as its argument" @@ -126,7 +124,7 @@ BlCompositeSelection >> ifEmpty: emptyBlock ifNotEmpty: notEmptyBlock [ ifFalse: [ notEmptyBlock cull: self ] ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlCompositeSelection >> ifNotEmpty: aBlock [ "Evaluate the given block with the receiver as argument, answering its value unless the receiver is empty, in which case answer the receiver." @@ -136,72 +134,72 @@ BlCompositeSelection >> ifNotEmpty: aBlock [ ifFalse: [ aBlock cull: self ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompositeSelection >> initialize [ super initialize. selections := BlSelectionTree new ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlCompositeSelection >> isEmpty [ ^ selections isEmpty ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlCompositeSelection >> isNotEmpty [ ^ selections isNotEmpty ] -{ #category : 'copying' } +{ #category : #copying } BlCompositeSelection >> postCopy [ selections := selections copy ] -{ #category : 'printing' } +{ #category : #printing } BlCompositeSelection >> printOn: aStream [ selections printOn: aStream ] -{ #category : 'private - adding / removing' } +{ #category : #'private - adding / removing' } BlCompositeSelection >> remove: aMonotoneTextSelection [ selections delete: aMonotoneTextSelection ] -{ #category : 'private - adding / removing' } +{ #category : #'private - adding / removing' } BlCompositeSelection >> removeAll [ selections := BlSelectionTree new ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlCompositeSelection >> reverseDo: aBlock [ "Evaluate a given block with all recorded selection intervals in reverse direction" selections reverseDo: aBlock ] -{ #category : 'api - selection' } +{ #category : #'api - selection' } BlCompositeSelection >> select: aSelection [ "Add a given selection" aSelection do: [ :aMonotoneSelection | self add: aMonotoneSelection ] ] -{ #category : 'api - selection' } +{ #category : #'api - selection' } BlCompositeSelection >> select: aFromIndex to: aToIndex [ "Add a new monotone selection merging it with existing ones within provided indices" self add: (BlSelection from: (aFromIndex max: 0) to: aToIndex) ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompositeSelection >> selections [ ^ selections ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlCompositeSelection >> to [ "Return the maximum selected index which is the `to` index of the last sub-selection" diff --git a/src/Bloc/BlCompositingMode.class.st b/src/Bloc/BlCompositingMode.class.st index 9ebc67358..d4641513d 100644 --- a/src/Bloc/BlCompositingMode.class.st +++ b/src/Bloc/BlCompositingMode.class.st @@ -1,25 +1,23 @@ Class { - #name : 'BlCompositingMode', - #superclass : 'Object', + #name : #BlCompositingMode, + #superclass : #Object, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlCompositingMode class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'testing' } +{ #category : #testing } BlCompositingMode >> wantsBufferedLayer [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlCompositingMode >> wantsCompositionLayer [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlCompositingSeparateLayerMode.class.st b/src/Bloc/BlCompositingSeparateLayerMode.class.st index 52a04f123..f54078234 100644 --- a/src/Bloc/BlCompositingSeparateLayerMode.class.st +++ b/src/Bloc/BlCompositingSeparateLayerMode.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlCompositingSeparateLayerMode', - #superclass : 'BlCompositingWithLayerMode', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #name : #BlCompositingSeparateLayerMode, + #superclass : #BlCompositingWithLayerMode, + #category : 'Bloc-Basic-Support' } -{ #category : 'testing' } +{ #category : #testing } BlCompositingSeparateLayerMode >> wantsBufferedLayer [ ^ false ] diff --git a/src/Bloc/BlCompositingSingleLayerMode.class.st b/src/Bloc/BlCompositingSingleLayerMode.class.st index f6274f431..3dfbcfe6d 100644 --- a/src/Bloc/BlCompositingSingleLayerMode.class.st +++ b/src/Bloc/BlCompositingSingleLayerMode.class.st @@ -4,14 +4,12 @@ This may be useful for complex elements that rarely change, for example visualis " Class { - #name : 'BlCompositingSingleLayerMode', - #superclass : 'BlCompositingWithLayerMode', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #name : #BlCompositingSingleLayerMode, + #superclass : #BlCompositingWithLayerMode, + #category : 'Bloc-Basic-Support' } -{ #category : 'testing' } +{ #category : #testing } BlCompositingSingleLayerMode >> wantsBufferedLayer [ ^ true ] diff --git a/src/Bloc/BlCompositingWithLayerMode.class.st b/src/Bloc/BlCompositingWithLayerMode.class.st index 09c702267..6f649af03 100644 --- a/src/Bloc/BlCompositingWithLayerMode.class.st +++ b/src/Bloc/BlCompositingWithLayerMode.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlCompositingWithLayerMode', - #superclass : 'BlCompositingMode', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #name : #BlCompositingWithLayerMode, + #superclass : #BlCompositingMode, + #category : 'Bloc-Basic-Support' } -{ #category : 'testing' } +{ #category : #testing } BlCompositingWithLayerMode >> wantsCompositionLayer [ ^ true ] diff --git a/src/Bloc/BlCompositingWithoutLayerMode.class.st b/src/Bloc/BlCompositingWithoutLayerMode.class.st index 8bc3da893..651ce1bf5 100644 --- a/src/Bloc/BlCompositingWithoutLayerMode.class.st +++ b/src/Bloc/BlCompositingWithoutLayerMode.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlCompositingWithoutLayerMode', - #superclass : 'BlCompositingMode', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #name : #BlCompositingWithoutLayerMode, + #superclass : #BlCompositingMode, + #category : 'Bloc-Basic-Support' } -{ #category : 'testing' } +{ #category : #testing } BlCompositingWithoutLayerMode >> wantsBufferedLayer [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlCompositingWithoutLayerMode >> wantsCompositionLayer [ ^ false ] diff --git a/src/Bloc/BlCompulsoryCombination.class.st b/src/Bloc/BlCompulsoryCombination.class.st index c955a2202..4951bfe9d 100644 --- a/src/Bloc/BlCompulsoryCombination.class.st +++ b/src/Bloc/BlCompulsoryCombination.class.st @@ -18,17 +18,15 @@ BlCompulsoryCombination new " Class { - #name : 'BlCompulsoryCombination', - #superclass : 'BlKeyCombination', + #name : #BlCompulsoryCombination, + #superclass : #BlKeyCombination, #instVars : [ 'combinations' ], - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'comparing' } +{ #category : #comparing } BlCompulsoryCombination >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -39,60 +37,60 @@ BlCompulsoryCombination >> = anObject [ ^ combinations = anObject combinations ] -{ #category : 'visiting' } +{ #category : #visiting } BlCompulsoryCombination >> accept: aKeyCombinationVisitor [ ^ aKeyCombinationVisitor visitCompulsory: self ] -{ #category : 'controlling' } +{ #category : #controlling } BlCompulsoryCombination >> and: anotherKeyCombination [ ^ self with: anotherKeyCombination ] -{ #category : 'converting' } +{ #category : #converting } BlCompulsoryCombination >> asBufferKeys [ ^ combinations flatCollect: [ :eachCombination | eachCombination asBufferKeys ] as: Set ] -{ #category : 'accessing' } +{ #category : #accessing } BlCompulsoryCombination >> combinations [ ^ combinations ] -{ #category : 'comparing' } +{ #category : #comparing } BlCompulsoryCombination >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ combinations hash ] -{ #category : 'testing' } +{ #category : #testing } BlCompulsoryCombination >> includes: aKey [ ^ self combinations anySatisfy: [ :aCombination | aCombination includes: aKey ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlCompulsoryCombination >> initialize [ super initialize. combinations := OrderedCollection new ] -{ #category : 'testing' } +{ #category : #testing } BlCompulsoryCombination >> isCompulsory [ ^ true ] -{ #category : 'adding' } +{ #category : #adding } BlCompulsoryCombination >> key: aKey [ self with: (BlSingleKeyCombination key: aKey) ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlCompulsoryCombination >> match: aKeyboardBuffer [ @@ -101,7 +99,7 @@ BlCompulsoryCombination >> match: aKeyboardBuffer [ into: [ :aResult :aCombination | aResult + (aCombination match: aKeyboardBuffer) ] ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlCompulsoryCombination >> matches: aKeyboardBuffer [ "Please note, I must be in DNF form!" @@ -111,7 +109,7 @@ BlCompulsoryCombination >> matches: aKeyboardBuffer [ ifNotEmpty: [ :theCombinations | aKeyboardBuffer hasExactlyAll: (theCombinations collect: #key) ] ] -{ #category : 'printing' } +{ #category : #printing } BlCompulsoryCombination >> printOn: aStream [ aStream nextPut: $(. @@ -123,7 +121,7 @@ BlCompulsoryCombination >> printOn: aStream [ aStream nextPut: $). ] -{ #category : 'printing' } +{ #category : #printing } BlCompulsoryCombination >> storeOn: aStream [ aStream nextPut: $(. @@ -141,7 +139,7 @@ BlCompulsoryCombination >> storeOn: aStream [ aStream nextPut: $) ] -{ #category : 'adding' } +{ #category : #adding } BlCompulsoryCombination >> with: aCombination [ aCombination isCompulsory @@ -149,7 +147,7 @@ BlCompulsoryCombination >> with: aCombination [ ifFalse: [ self combinations add: aCombination ] ] -{ #category : 'adding' } +{ #category : #adding } BlCompulsoryCombination >> withAll: aCollectionOfCombinations [ aCollectionOfCombinations do: [ :aCombination | self with: aCombination ] ] diff --git a/src/Bloc/BlConcatenationRope.class.st b/src/Bloc/BlConcatenationRope.class.st index 314f06864..04206c95f 100644 --- a/src/Bloc/BlConcatenationRope.class.st +++ b/src/Bloc/BlConcatenationRope.class.st @@ -3,19 +3,17 @@ I am a special type of rope that plays a role of a node in a binary tree and con " Class { - #name : 'BlConcatenationRope', - #superclass : 'BlRope', + #name : #BlConcatenationRope, + #superclass : #BlRope, #instVars : [ 'left', 'right', 'length' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlConcatenationRope class >> left: aLeftRope right: aRightRope [ ^ self new @@ -23,7 +21,7 @@ BlConcatenationRope class >> left: aLeftRope right: aRightRope [ yourself ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlConcatenationRope >> at: anIndex [ | leftSize | @@ -34,7 +32,7 @@ BlConcatenationRope >> at: anIndex [ ifFalse: [ right at: anIndex - leftSize ] ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlConcatenationRope >> attributes: anAttributesCollection from: aStart to: anEnd [ | leftSize newLeft newRight | @@ -69,12 +67,12 @@ BlConcatenationRope >> attributes: anAttributesCollection from: aStart to: anEnd and: newRight ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlConcatenationRope >> children [ ^ { left . right } ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlConcatenationRope >> clearAttributes: aStart to: anEnd if: aBlock [ | leftSize newLeft newRight | @@ -118,13 +116,13 @@ BlConcatenationRope >> clearAttributes: aStart to: anEnd if: aBlock [ and: newRight ] ] -{ #category : 'copying' } +{ #category : #copying } BlConcatenationRope >> copyFrom: startIndex to: endIndex [ ^ self from: startIndex-1 to: endIndex ] -{ #category : 'rope - deleting' } +{ #category : #'rope - deleting' } BlConcatenationRope >> delete: aStart to: anEnd [ self assertAccessFrom: aStart to: anEnd. @@ -149,20 +147,20 @@ BlConcatenationRope >> delete: aStart to: anEnd [ ifFalse: [ self from: 0 to: aStart ] ] ] ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlConcatenationRope >> depth [ ^ (left depth max: right depth) + 1 ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlConcatenationRope >> do: aBlock [ left do: aBlock. right do: aBlock ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlConcatenationRope >> empty [ "Create and return an empty version of this rope" @@ -170,7 +168,7 @@ BlConcatenationRope >> empty [ ^ self left empty ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlConcatenationRope >> from: aStart to: anEnd [ | leftSize | @@ -191,7 +189,7 @@ BlConcatenationRope >> from: aStart to: anEnd [ and: (right from: 0 to: anEnd - leftSize) ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlConcatenationRope >> from: aStart to: anEnd do: aBlock [ | leftSize isReversed | @@ -213,7 +211,7 @@ BlConcatenationRope >> from: aStart to: anEnd do: aBlock [ ifTrue: [ right from: ((aStart - leftSize) max: 0) to: anEnd - leftSize do: aBlock ] ] ] -{ #category : 'rope - inserting' } +{ #category : #'rope - inserting' } BlConcatenationRope >> insertItems: aCollection at: anIndex [ | leftSize aNewLeft aNewRight | self assertIndexForInsert: anIndex. @@ -231,42 +229,42 @@ BlConcatenationRope >> insertItems: aCollection at: anIndex [ ^ self class concatenate: aNewLeft and: aNewRight ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlConcatenationRope >> isConcatenation [ ^ true ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlConcatenationRope >> isLeaf [ ^ false ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlConcatenationRope >> iterator: aStart to: anEnd [ ^ BlConcatenationRopeIterator rope: self from: aStart to: anEnd ] -{ #category : 'accessing' } +{ #category : #accessing } BlConcatenationRope >> left [ ^ left ] -{ #category : 'initialization' } +{ #category : #initialization } BlConcatenationRope >> left: aLeftRope right: aRightRope [ left := aLeftRope. right := aRightRope. length := left size + right size ] -{ #category : 'accessing' } +{ #category : #accessing } BlConcatenationRope >> readStream [ ^ ReadStream on: self ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlConcatenationRope >> replaceFrom: aStart to: anEnd with: aCollection [ "Replace a piece of the rope with a given collection of items" @@ -299,14 +297,14 @@ BlConcatenationRope >> replaceFrom: aStart to: anEnd with: aCollection [ ^ (self delete: aStart to: anEnd) insertItems: aCollection at: aStart ] -{ #category : 'accessing' } +{ #category : #accessing } BlConcatenationRope >> right [ ^ right ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlConcatenationRope >> simplified [ @@ -315,7 +313,7 @@ BlConcatenationRope >> simplified [ and: right simplified ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlConcatenationRope >> size [ ^ length ] diff --git a/src/Bloc/BlConcatenationRopeIterator.class.st b/src/Bloc/BlConcatenationRopeIterator.class.st index 57c29eb5f..b173cdd18 100644 --- a/src/Bloc/BlConcatenationRopeIterator.class.st +++ b/src/Bloc/BlConcatenationRopeIterator.class.st @@ -3,18 +3,16 @@ I am a special iterator used to iterate over concatenation rope " Class { - #name : 'BlConcatenationRopeIterator', - #superclass : 'BlRopeIterator', + #name : #BlConcatenationRopeIterator, + #superclass : #BlRopeIterator, #instVars : [ 'position', 'currentIterator' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'private - asserting' } +{ #category : #'private - asserting' } BlConcatenationRopeIterator >> assertInvariant [ "I am a position invariant; I make sure that iterator operations do not go out of bounds" @@ -26,14 +24,14 @@ BlConcatenationRopeIterator >> assertInvariant [ ifFalse: [ self error: 'Position must always be less or equal than end' ] ] -{ #category : 'iterator - attributes' } +{ #category : #'iterator - attributes' } BlConcatenationRopeIterator >> attributes [ ^ currentIterator attributes ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> backwardIteratorAt: aPosition [ @@ -42,14 +40,14 @@ BlConcatenationRopeIterator >> backwardIteratorAt: aPosition [ isForward: false ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> currentIterator [ ^ currentIterator ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> forwardIteratorAt: aPosition [ @@ -58,7 +56,7 @@ BlConcatenationRopeIterator >> forwardIteratorAt: aPosition [ isForward: true ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlConcatenationRopeIterator >> hasNext [ self assertInvariant. @@ -66,7 +64,7 @@ BlConcatenationRopeIterator >> hasNext [ ^ position < end ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlConcatenationRopeIterator >> hasPrevious [ self assertInvariant. @@ -74,12 +72,12 @@ BlConcatenationRopeIterator >> hasPrevious [ ^ position > start ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> moveBackward [ self moveBackward: 1 ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> moveBackward: aNumber [ "!!! I do not alter the position of the sub-iterator, it must be done right before calling me" @@ -97,12 +95,12 @@ BlConcatenationRopeIterator >> moveBackward: aNumber [ ifFalse: [ currentIterator := self backwardIteratorAt: position ] ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> moveForward [ self moveForward: 1 ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> moveForward: aNumber [ "!!! I do not alter the position of the sub-iterator, it must be done right before calling me" @@ -120,7 +118,7 @@ BlConcatenationRopeIterator >> moveForward: aNumber [ ifTrue: [ currentIterator := self forwardIteratorAt: position ] ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlConcatenationRopeIterator >> next [ | anItem | @@ -137,7 +135,7 @@ BlConcatenationRopeIterator >> next [ ^ anItem ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlConcatenationRopeIterator >> nextSpan [ | theAttributes aStart anEnd | @@ -158,7 +156,7 @@ BlConcatenationRopeIterator >> nextSpan [ ^ rope from: aStart to: anEnd ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlConcatenationRopeIterator >> peek [ @@ -171,7 +169,7 @@ BlConcatenationRopeIterator >> peek [ ^ currentIterator peek ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlConcatenationRopeIterator >> peer [ @@ -184,21 +182,21 @@ BlConcatenationRopeIterator >> peer [ ^ currentIterator peer ] -{ #category : 'iterator - accessing' } +{ #category : #'iterator - accessing' } BlConcatenationRopeIterator >> position [ ^ position ] -{ #category : 'copying' } +{ #category : #copying } BlConcatenationRopeIterator >> postCopy [ super postCopy. currentIterator := currentIterator copy ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlConcatenationRopeIterator >> previous [ | anItem | @@ -215,7 +213,7 @@ BlConcatenationRopeIterator >> previous [ ^ anItem ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlConcatenationRopeIterator >> rope: aRope from: aStart to: anEnd [ super rope: aRope from: aStart to: anEnd. @@ -223,7 +221,7 @@ BlConcatenationRopeIterator >> rope: aRope from: aStart to: anEnd [ currentIterator := self forwardIteratorAt: aStart ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlConcatenationRopeIterator >> skip: aNumber [ | newPosition | @@ -247,7 +245,7 @@ BlConcatenationRopeIterator >> skip: aNumber [ ifFalse: [ self backwardIteratorAt: position ] ] ] -{ #category : 'private - enumeration' } +{ #category : #'private - enumeration' } BlConcatenationRopeIterator >> subIteratorAt: aPosition isForward: isForward [ | aCurrentRope aCurrentPosition aCurrentEnd | diff --git a/src/Bloc/BlContextMenuCursor.class.st b/src/Bloc/BlContextMenuCursor.class.st index 754a1675e..d4904b44b 100644 --- a/src/Bloc/BlContextMenuCursor.class.st +++ b/src/Bloc/BlContextMenuCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlContextMenuCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlContextMenuCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlCopyCursor.class.st b/src/Bloc/BlCopyCursor.class.st index d6eedc71e..86c25fdac 100644 --- a/src/Bloc/BlCopyCursor.class.st +++ b/src/Bloc/BlCopyCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlCopyCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlCopyCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlCornerRadii.class.st b/src/Bloc/BlCornerRadii.class.st index 7b298c51f..b44561c28 100644 --- a/src/Bloc/BlCornerRadii.class.st +++ b/src/Bloc/BlCornerRadii.class.st @@ -7,8 +7,8 @@ Negative values are not allowed. " Class { - #name : 'BlCornerRadii', - #superclass : 'Object', + #name : #BlCornerRadii, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -20,12 +20,10 @@ Class { #classInstVars : [ 'empty' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlCornerRadii class >> cleanUp [ super cleanUp. @@ -33,19 +31,19 @@ BlCornerRadii class >> cleanUp [ empty := nil ] -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlCornerRadii class >> empty [ ^ empty ifNil: [ empty := self radius: 0 ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCornerRadii class >> radius: aNumber [ ^ self new radius: aNumber; yourself ] -{ #category : 'comparing' } +{ #category : #comparing } BlCornerRadii >> = aBlCornerRadii [ self species == aBlCornerRadii species ifFalse: [ ^ false ]. @@ -56,7 +54,7 @@ BlCornerRadii >> = aBlCornerRadii [ and: [ self topRight = aBlCornerRadii topRight ] ] ] ] -{ #category : 'converting' } +{ #category : #converting } BlCornerRadii >> asArray [ ^ { @@ -67,7 +65,7 @@ BlCornerRadii >> asArray [ } ] -{ #category : 'converting' } +{ #category : #converting } BlCornerRadii >> asNonOverlappingCornerRadiiToFitWidth: aWidth height: aHeight [ "Answer either self or an adapted copy of self where corner curves do not overlap for the specified extent. This follows the specification of 'Corner Overlap' subsection of 'CSS Backgrounds and Borders Module Level 3'. @@ -83,12 +81,12 @@ BlCornerRadii >> asNonOverlappingCornerRadiiToFitWidth: aWidth height: aHeight [ ifFalse: [ self ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> bottomLeft [ ^ bottomLeft ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> bottomLeft: aNumber [ "Initialize bottom left corner radius with a given number. It can be done only once" @@ -100,18 +98,18 @@ BlCornerRadii >> bottomLeft: aNumber [ bottomLeft := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> bottomRadii [ ^ bottomLeft + bottomRight ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> bottomRight [ ^ bottomRight ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> bottomRight: aNumber [ "Initialize bottom right corner radius with a given number. It can be done only once" @@ -123,7 +121,7 @@ BlCornerRadii >> bottomRight: aNumber [ bottomRight := aNumber ] -{ #category : 'converting' } +{ #category : #converting } BlCornerRadii >> copyExpandedBy: aNumber [ "Answer a copy of myself with radii expanded by aNumber (or reduced, if negative). Do not touch the radius if it's zero." @@ -136,7 +134,7 @@ BlCornerRadii >> copyExpandedBy: aNumber [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlCornerRadii >> dividedByScalar: aNumber [ ^ self species new @@ -147,27 +145,27 @@ BlCornerRadii >> dividedByScalar: aNumber [ yourself ] -{ #category : 'comparing' } +{ #category : #comparing } BlCornerRadii >> hash [ ^ bottomLeft hash bitXor: (bottomRight hash bitXor: (topLeft hash bitXor: topLeft)) ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> leftRadii [ ^ topLeft + bottomLeft ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlCornerRadii >> max [ "Return the biggest corner radius among top left, top right, bottom left and bottom right" ^ topLeft max: (topRight max: (bottomLeft max: bottomRight)) ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> maxOverlappingFactorForWidth: aWidth height: aHeight [ "Answer the 1/f as defined in 'Corner Overlap' subsection of 'CSS Backgrounds and Borders Module Level 3'. See: https://w3c.github.io/csswg-drafts/css-backgrounds-3/#corner-overlap" @@ -178,19 +176,19 @@ BlCornerRadii >> maxOverlappingFactorForWidth: aWidth height: aHeight [ (self leftRadii / aHeight) ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlCornerRadii >> min [ "Return the smallest corner radius among top left, top right, bottom left and bottom right" ^ topLeft min: (topRight min: (bottomLeft min: bottomRight)) ] -{ #category : 'private' } +{ #category : #private } BlCornerRadii >> radius: aNumber [ topLeft := topRight := bottomLeft := bottomRight := aNumber ] -{ #category : 'private' } +{ #category : #private } BlCornerRadii >> radius: aRadius expandedBy: aNumber [ "Answer aRadius expanded by aNumber (or reduced if negative). Do not touch if aRadius is zero." @@ -199,18 +197,18 @@ BlCornerRadii >> radius: aRadius expandedBy: aNumber [ ifTrue: [ (aRadius + aNumber) max: 0.0 ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> rightRadii [ ^ topRight + bottomRight ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> topLeft [ ^ topLeft ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> topLeft: aNumber [ "Initialize top left corner radius with a given number. It can be done only once" @@ -222,18 +220,18 @@ BlCornerRadii >> topLeft: aNumber [ topLeft := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> topRadii [ ^ topLeft + topRight ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> topRight [ ^ topRight ] -{ #category : 'accessing' } +{ #category : #accessing } BlCornerRadii >> topRight: aNumber [ "Initialize top right corner radius with a given number. It can be done only once" diff --git a/src/Bloc/BlCosineInterpolator.class.st b/src/Bloc/BlCosineInterpolator.class.st index 3fc16c643..0ebbed8de 100644 --- a/src/Bloc/BlCosineInterpolator.class.st +++ b/src/Bloc/BlCosineInterpolator.class.st @@ -5,24 +5,22 @@ I am a cosinus interpolator defined by the following function: " Class { - #name : 'BlCosineInterpolator', - #superclass : 'BlInterpolator', + #name : #BlCosineInterpolator, + #superclass : #BlInterpolator, #instVars : [ 'range' ], - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'initialization' } +{ #category : #initialization } BlCosineInterpolator >> initialize [ super initialize. range := 2 * Float pi ] -{ #category : 'interpolation' } +{ #category : #interpolation } BlCosineInterpolator >> interpolate: aNumber [ "f(x) = cos(x)" @@ -30,14 +28,14 @@ BlCosineInterpolator >> interpolate: aNumber [ ^ (aNumber * self range) cos ] -{ #category : 'accessing' } +{ #category : #accessing } BlCosineInterpolator >> range [ ^ range ] -{ #category : 'accessing' } +{ #category : #accessing } BlCosineInterpolator >> range: aNumberInRadians [ range := aNumberInRadians ] diff --git a/src/Bloc/BlCrosshairCursor.class.st b/src/Bloc/BlCrosshairCursor.class.st index b8361e58c..12a291e97 100644 --- a/src/Bloc/BlCrosshairCursor.class.st +++ b/src/Bloc/BlCrosshairCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlCrosshairCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlCrosshairCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlCrosshairCursor >> asForm [ ^ Cursor crossHair ] diff --git a/src/Bloc/BlCursor.class.st b/src/Bloc/BlCursor.class.st index 6e6cbd7a9..2baaec79b 100644 --- a/src/Bloc/BlCursor.class.st +++ b/src/Bloc/BlCursor.class.st @@ -5,26 +5,24 @@ There are two general types of a cursor: {{gtClass:BlNamedCursor}} and {{gtClass " Class { - #name : 'BlCursor', - #superclass : 'Object', + #name : #BlCursor, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #category : 'Bloc-Space - Cursor' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> crosshair [ ^ BlCrosshairCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> default [ ^ BlDefaultCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> hand [ ^ BlHandCursor new @@ -40,72 +38,72 @@ BlCursor class >> overEditableText [ ^ BlTextCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeBottom [ ^ BlResizeBottomCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeBottomLeft [ ^ BlResizeBottomLeftCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeBottomRight [ ^ BlResizeBottomRightCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeLeft [ ^ BlResizeLeftCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeRight [ ^ BlResizeRightCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeTop [ ^ BlResizeTopCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeTopLeft [ ^ BlResizeTopLeftCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> resizeTopRight [ ^ BlResizeTopRightCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> wait [ ^ BlWaitCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> zoomIn [ ^ BlZoomInCursor new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlCursor class >> zoomOut [ ^ BlZoomOutCursor new ] -{ #category : 'api - cursor' } +{ #category : #'api - cursor' } BlCursor >> activateOn: aSpace [ aSpace updateCursor: self ] -{ #category : 'converting' } +{ #category : #converting } BlCursor >> asForm [ ^ self subclassResponsibility ] -{ #category : 'api - cursor' } +{ #category : #'api - cursor' } BlCursor >> deactivateOn: aSpace [ ] diff --git a/src/Bloc/BlCustomEventHandler.class.st b/src/Bloc/BlCustomEventHandler.class.st index 6e1142793..ee550b604 100644 --- a/src/Bloc/BlCustomEventHandler.class.st +++ b/src/Bloc/BlCustomEventHandler.class.st @@ -4,25 +4,23 @@ Then for each interesting event a user should implement a corresponding event ha " Class { - #name : 'BlCustomEventHandler', - #superclass : 'BlBasicEventHandler', - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #name : #BlCustomEventHandler, + #superclass : #BlBasicEventHandler, + #category : 'Bloc-Events-Handler' } -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlCustomEventHandler >> eventsToHandle [ ^ self subclassResponsibility ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlCustomEventHandler >> handleEvent: anEvent [ anEvent sendTo: self ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlCustomEventHandler >> wantsEvent: anEvent [ ^ self eventsToHandle anySatisfy: [ :eachEventClass | anEvent isKindOf: eachEventClass ] ] diff --git a/src/Bloc/BlCustomVisuals.class.st b/src/Bloc/BlCustomVisuals.class.st index c94f5e6af..0915ccb97 100644 --- a/src/Bloc/BlCustomVisuals.class.st +++ b/src/Bloc/BlCustomVisuals.class.st @@ -13,8 +13,8 @@ BlElement >> effect: anEffect ``` " Class { - #name : 'BlCustomVisuals', - #superclass : 'BlElementVisuals', + #name : #BlCustomVisuals, + #superclass : #BlElementVisuals, #instVars : [ 'geometry', 'border', @@ -30,17 +30,15 @@ Class { 'focused', 'mouseCursor' ], - #category : 'Bloc-Basic', - #package : 'Bloc', - #tag : 'Basic' + #category : 'Bloc-Basic' } -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> background [ ^ background ifNil: [ self defaultBackground ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> background: aBlBackground [ "Change the background and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -48,12 +46,12 @@ BlCustomVisuals >> background: aBlBackground [ background := aBlBackground ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> border [ ^ border ifNil: [ self defaultBorder ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> border: aBlBorder [ "Change the border and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -61,12 +59,12 @@ BlCustomVisuals >> border: aBlBorder [ border := aBlBorder ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> clipChildren [ ^ clipChildren ifNil: [ self defaultClipChildren ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> clipChildren: aBoolean [ "Change if children should be clipped and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -74,12 +72,12 @@ BlCustomVisuals >> clipChildren: aBoolean [ clipChildren := aBoolean ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> compositingMode [ ^ compositingMode ifNil: [ self defaultCompositingMode ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> compositingMode: aBlCompositingMode [ "Change the compositing mode and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -87,12 +85,12 @@ BlCustomVisuals >> compositingMode: aBlCompositingMode [ compositingMode := aBlCompositingMode ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> effect [ ^ effect ifNil: [ self defaultEffect ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> effect: aBlElementEffect [ "Change the effect and return new visuals to be used instead of the previous one (not necessarily a new instance)." @@ -100,12 +98,12 @@ BlCustomVisuals >> effect: aBlElementEffect [ effect := aBlElementEffect ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> elevation [ ^ elevation ifNil: [ self defaultElevation ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> elevation: aBlElevation [ "Change the elevation and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -113,12 +111,12 @@ BlCustomVisuals >> elevation: aBlElevation [ elevation := aBlElevation ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> focusability [ ^ focusability ifNil: [ self defaultFocusability ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> focusability: aBlFocusability [ "Change the focusability and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -126,12 +124,12 @@ BlCustomVisuals >> focusability: aBlFocusability [ focusability := aBlFocusability ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> focused [ ^ focused ifNil: [ self defaultFocused ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> focused: aBoolean [ "Change focused state and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -139,12 +137,12 @@ BlCustomVisuals >> focused: aBoolean [ focused := aBoolean ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> geometry [ ^ geometry ifNil: [ self defaultGeometry ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> geometry: aBlElementGeometry [ "Change the geometry and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -152,12 +150,12 @@ BlCustomVisuals >> geometry: aBlElementGeometry [ geometry := aBlElementGeometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> mouseCursor [ ^ mouseCursor ifNil: [ self defaultMouseCursor ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> mouseCursor: aBlCursor [ "Change the mouse cursor and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -165,12 +163,12 @@ BlCustomVisuals >> mouseCursor: aBlCursor [ mouseCursor := aBlCursor ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> opacity [ ^ opacity ifNil: [ self defaultOpacity ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> opacity: aNumber [ "Change the opacity and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -178,12 +176,12 @@ BlCustomVisuals >> opacity: aNumber [ opacity := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> outskirts [ ^ outskirts ifNil: [ self defaultOutskirts ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> outskirts: aBlOutskirts [ "Change the outskirts and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -191,12 +189,12 @@ BlCustomVisuals >> outskirts: aBlOutskirts [ outskirts := aBlOutskirts ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> visibility [ ^ visibility ifNil: [ self defaultVisibility ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlCustomVisuals >> visibility: aBlVisibility [ "Change the visibility and return new visuals to be used instead of the previous one (not necessarily a new instance)" diff --git a/src/Bloc/BlDecelerateInterpolator.class.st b/src/Bloc/BlDecelerateInterpolator.class.st index 47b99ca64..314c49e70 100644 --- a/src/Bloc/BlDecelerateInterpolator.class.st +++ b/src/Bloc/BlDecelerateInterpolator.class.st @@ -10,17 +10,15 @@ I meant to be immutable, therefore factor can be only set using factory method # " Class { - #name : 'BlDecelerateInterpolator', - #superclass : 'BlInterpolator', + #name : #BlDecelerateInterpolator, + #superclass : #BlInterpolator, #instVars : [ 'factor' ], - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlDecelerateInterpolator class >> factor: aNumber [ "Creates an instance of decelerate interpolator with custom factor number" @@ -30,26 +28,26 @@ BlDecelerateInterpolator class >> factor: aNumber [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlDecelerateInterpolator >> defaultFactor [ ^ 1 ] -{ #category : 'accessing' } +{ #category : #accessing } BlDecelerateInterpolator >> factor [ ^ factor ] -{ #category : 'initialization' } +{ #category : #initialization } BlDecelerateInterpolator >> initialize [ super initialize. factor := self defaultFactor ] -{ #category : 'initialization' } +{ #category : #initialization } BlDecelerateInterpolator >> initializeWith: aFactor [ self @@ -59,7 +57,7 @@ BlDecelerateInterpolator >> initializeWith: aFactor [ factor := aFactor ] -{ #category : 'interpolation' } +{ #category : #interpolation } BlDecelerateInterpolator >> interpolate: aNumber [ "f(x) = 1 - (1 - x)^n, where n = 2 * factor" diff --git a/src/Bloc/BlDefaultCursor.class.st b/src/Bloc/BlDefaultCursor.class.st index 71e08b83d..ce84c1edf 100644 --- a/src/Bloc/BlDefaultCursor.class.st +++ b/src/Bloc/BlDefaultCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlDefaultCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlDefaultCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlDefaultCursor >> asForm [ ^ Cursor normal ] diff --git a/src/Bloc/BlDefaultVisuals.class.st b/src/Bloc/BlDefaultVisuals.class.st index 0feab408f..44cdc5398 100644 --- a/src/Bloc/BlDefaultVisuals.class.st +++ b/src/Bloc/BlDefaultVisuals.class.st @@ -45,32 +45,30 @@ The result could have been achieved by having an instance variable and a classVa " Class { - #name : 'BlDefaultVisuals', - #superclass : 'BlElementVisuals', + #name : #BlDefaultVisuals, + #superclass : #BlElementVisuals, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic', - #package : 'Bloc', - #tag : 'Basic' + #category : 'Bloc-Basic' } -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> background [ ^ self defaultBackground ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> background: aBlBackground [ "Change the background and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -78,12 +76,12 @@ BlDefaultVisuals >> background: aBlBackground [ ^ BlCustomVisuals new background: aBlBackground ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> border [ ^ self defaultBorder ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> border: aBlBorder [ "Change the border and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -91,12 +89,12 @@ BlDefaultVisuals >> border: aBlBorder [ ^ BlCustomVisuals new border: aBlBorder ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> clipChildren [ ^ self defaultClipChildren ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> clipChildren: aBoolean [ "Change if children should be clipped and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -104,12 +102,12 @@ BlDefaultVisuals >> clipChildren: aBoolean [ ^ BlCustomVisuals new clipChildren: aBoolean ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> compositingMode [ ^ self defaultCompositingMode ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> compositingMode: aBlCompositingMode [ "Change the compositing mode and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -117,12 +115,12 @@ BlDefaultVisuals >> compositingMode: aBlCompositingMode [ ^ BlCustomVisuals new compositingMode: aBlCompositingMode ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> effect [ ^ self defaultEffect ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> effect: aBlElementEffect [ "Change the effect and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -130,12 +128,12 @@ BlDefaultVisuals >> effect: aBlElementEffect [ ^ BlCustomVisuals new effect: aBlElementEffect ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> elevation [ ^ self defaultElevation ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> elevation: aBlElevation [ "Change the elevation and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -144,12 +142,12 @@ BlDefaultVisuals >> elevation: aBlElevation [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> focusability [ ^ self defaultFocusability ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> focusability: aBlFocusability [ "Change the focusability and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -157,12 +155,12 @@ BlDefaultVisuals >> focusability: aBlFocusability [ ^ BlCustomVisuals new focusability: aBlFocusability ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> focused [ ^ self defaultFocused ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> focused: aBoolean [ "Change focused state and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -170,12 +168,12 @@ BlDefaultVisuals >> focused: aBoolean [ ^ BlCustomVisuals new focused: aBoolean ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> geometry [ ^ self defaultGeometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> geometry: aBlElementGeometry [ "Change the geometry and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -183,12 +181,12 @@ BlDefaultVisuals >> geometry: aBlElementGeometry [ ^ BlCustomVisuals new geometry: aBlElementGeometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> mouseCursor [ ^ self defaultMouseCursor ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> mouseCursor: aBlCursor [ "Change the mouse cursor and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -196,12 +194,12 @@ BlDefaultVisuals >> mouseCursor: aBlCursor [ ^ BlCustomVisuals new mouseCursor: aBlCursor ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> opacity [ ^ self defaultOpacity ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> opacity: aNumber [ "Change the opacity and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -209,12 +207,12 @@ BlDefaultVisuals >> opacity: aNumber [ ^ BlCustomVisuals new opacity: aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> outskirts [ ^ self defaultOutskirts ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> outskirts: aBlOutskirts [ "Change the outskirts and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -222,12 +220,12 @@ BlDefaultVisuals >> outskirts: aBlOutskirts [ ^ BlCustomVisuals new outskirts: aBlOutskirts ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> visibility [ ^ self defaultVisibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlDefaultVisuals >> visibility: aBlVisibility [ "Change the visibility and return new visuals to be used instead of the previous one (not necessarily a new instance)" diff --git a/src/Bloc/BlDelayPulsesTask.class.st b/src/Bloc/BlDelayPulsesTask.class.st index b1eeb2f43..a76bbc5d1 100644 --- a/src/Bloc/BlDelayPulsesTask.class.st +++ b/src/Bloc/BlDelayPulsesTask.class.st @@ -17,53 +17,51 @@ Public API and Key Messages " Class { - #name : 'BlDelayPulsesTask', - #superclass : 'BlTask', + #name : #BlDelayPulsesTask, + #superclass : #BlTask, #instVars : [ 'element', 'count', 'requeue' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlDelayPulsesTask >> count [ ^ count ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayPulsesTask >> count: anObject [ count := anObject ] -{ #category : 'private' } +{ #category : #private } BlDelayPulsesTask >> dequeue [ self element dequeueTask: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayPulsesTask >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayPulsesTask >> element: aBlElement [ element := aBlElement ] -{ #category : 'private' } +{ #category : #private } BlDelayPulsesTask >> enqueue [ self element enqueueTask: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlDelayPulsesTask >> initialize [ super initialize. @@ -71,24 +69,24 @@ BlDelayPulsesTask >> initialize [ requeue := false. ] -{ #category : 'hooks' } +{ #category : #hooks } BlDelayPulsesTask >> onEnqueuedInElement: aBlElement [ self element: aBlElement ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayPulsesTask >> onRun [ "Override me to implement a custom action" ] -{ #category : 'private - testing' } +{ #category : #'private - testing' } BlDelayPulsesTask >> requeueTaskAfterExecution [ "Answer a boolean indicating whether the receiver should be requeued after execution." ^ requeue ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayPulsesTask >> run [ "If count is greater than 0, decrement and requeue" @@ -100,7 +98,7 @@ BlDelayPulsesTask >> run [ ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayPulsesTask >> start [ self assert: [ element isNotNil ] @@ -113,7 +111,7 @@ BlDelayPulsesTask >> start [ self enqueue ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayPulsesTask >> stop [ "Stop the task by dequeuing it" self dequeue. diff --git a/src/Bloc/BlDelayedPulsesTaskAction.class.st b/src/Bloc/BlDelayedPulsesTaskAction.class.st index bb0d1cfe7..20afe619a 100644 --- a/src/Bloc/BlDelayedPulsesTaskAction.class.st +++ b/src/Bloc/BlDelayedPulsesTaskAction.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlDelayedPulsesTaskAction', - #superclass : 'BlDelayPulsesTask', + #name : #BlDelayedPulsesTaskAction, + #superclass : #BlDelayPulsesTask, #instVars : [ 'action' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedPulsesTaskAction >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedPulsesTaskAction >> action: aBlock [ action := aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlDelayedPulsesTaskAction >> initialize [ super initialize. action := [ :optionalThisTask | ] ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayedPulsesTaskAction >> onRun [ self action isClosure ifTrue: [ self action cull: self ] diff --git a/src/Bloc/BlDelayedTask.class.st b/src/Bloc/BlDelayedTask.class.st index 3e7f7f0e1..16cf414d6 100644 --- a/src/Bloc/BlDelayedTask.class.st +++ b/src/Bloc/BlDelayedTask.class.st @@ -19,8 +19,8 @@ The task state is currently not thread-safe, so the time between checking the ta " Class { - #name : 'BlDelayedTask', - #superclass : 'BlTask', + #name : #BlDelayedTask, + #superclass : #BlTask, #instVars : [ 'delay', 'element', @@ -29,24 +29,22 @@ Class { 'startTime', 'requeue' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTask >> delay [ ^ delay ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTask >> delay: aDuration [ delay := aDuration ] -{ #category : 'private' } +{ #category : #private } BlDelayedTask >> dequeue [ self @@ -56,19 +54,19 @@ BlDelayedTask >> dequeue [ self element dequeueTask: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTask >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTask >> element: aBlElement [ element := aBlElement ] -{ #category : 'private' } +{ #category : #private } BlDelayedTask >> enqueue [ self @@ -78,7 +76,7 @@ BlDelayedTask >> enqueue [ self element enqueueTask: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlDelayedTask >> initialize [ super initialize. @@ -88,14 +86,14 @@ BlDelayedTask >> initialize [ requeue := false. ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlDelayedTask >> isRunning [ ^ isRunning ] -{ #category : 'hooks' } +{ #category : #hooks } BlDelayedTask >> onEnqueued: aBlSpace [ super onEnqueued: aBlSpace. @@ -106,24 +104,24 @@ BlDelayedTask >> onEnqueued: aBlSpace [ ifNil: [ startTime := self time now ] ] -{ #category : 'hooks' } +{ #category : #hooks } BlDelayedTask >> onEnqueuedInElement: aBlElement [ self element: aBlElement ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayedTask >> onRun [ "Override me to implement a custom action" ] -{ #category : 'private - testing' } +{ #category : #'private - testing' } BlDelayedTask >> requeueTaskAfterExecution [ "Answer a boolean indicating whether the receiver should be requeued after execution." ^ requeue ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayedTask >> run [ self isRunning ifFalse: [ ^ self ]. @@ -136,7 +134,7 @@ BlDelayedTask >> run [ self stop ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayedTask >> start [ self assert: [ element isNotNil ] @@ -151,7 +149,7 @@ BlDelayedTask >> start [ self enqueue ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayedTask >> startOrRestart [ "Ensure that the receiver is running and enqueued. If already running, reset the start time (there is always the possibility that this will be called just after the task has started running, so will continue rather than waiting the full delay)." @@ -167,7 +165,7 @@ BlDelayedTask >> startOrRestart [ ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayedTask >> stop [ "Stop the task by dequeuing it" (element isNotNil and: [ self isRunning ]) @@ -178,14 +176,14 @@ BlDelayedTask >> stop [ requeue := false ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTask >> time [ ^ time ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTask >> time: aBlTime [ time := aBlTime ] diff --git a/src/Bloc/BlDelayedTaskAction.class.st b/src/Bloc/BlDelayedTaskAction.class.st index dd5fe8bcf..cf3680b07 100644 --- a/src/Bloc/BlDelayedTaskAction.class.st +++ b/src/Bloc/BlDelayedTaskAction.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlDelayedTaskAction', - #superclass : 'BlDelayedTask', + #name : #BlDelayedTaskAction, + #superclass : #BlDelayedTask, #instVars : [ 'action' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTaskAction >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlDelayedTaskAction >> action: aBlock [ action := aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlDelayedTaskAction >> initialize [ super initialize. action := [ :optionalThisTask | ] ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlDelayedTaskAction >> onRun [ self action isClosure ifTrue: [ self action cull: self ] diff --git a/src/Bloc/BlDetachedSpaceReference.class.st b/src/Bloc/BlDetachedSpaceReference.class.st index f4fa28bc2..6e90c441e 100644 --- a/src/Bloc/BlDetachedSpaceReference.class.st +++ b/src/Bloc/BlDetachedSpaceReference.class.st @@ -4,27 +4,25 @@ Detached space reference {{gtClass:BlSpaceReference}} is set when an element is " Class { - #name : 'BlDetachedSpaceReference', - #superclass : 'BlSpaceReference', + #name : #BlDetachedSpaceReference, + #superclass : #BlSpaceReference, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #category : 'Bloc-Space' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlDetachedSpaceReference class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlDetachedSpaceReference class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'testing' } +{ #category : #testing } BlDetachedSpaceReference >> isDetachedFromSceneGraph [ ^ true ] diff --git a/src/Bloc/BlDirectEventDispatcher.class.st b/src/Bloc/BlDirectEventDispatcher.class.st index 7e295d422..dc078e59c 100644 --- a/src/Bloc/BlDirectEventDispatcher.class.st +++ b/src/Bloc/BlDirectEventDispatcher.class.st @@ -10,25 +10,23 @@ BlDirectEventDispatcher on: BlElement new " Class { - #name : 'BlDirectEventDispatcher', - #superclass : 'BlEventDispatcher', + #name : #BlDirectEventDispatcher, + #superclass : #BlEventDispatcher, #instVars : [ 'owner', 'filters', 'handlers', 'shortcutHandler' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlDirectEventDispatcher class >> new [ self error: 'Do not create an instance of ', self name, ' using new. Please use #on: instead' ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlDirectEventDispatcher class >> on: aTBlEventTarget [ @@ -38,7 +36,7 @@ BlDirectEventDispatcher class >> on: aTBlEventTarget [ yourself ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> addEventFilter: aFilter [ "Event filters receive events before general event handlers. Their main goal is to prevent some specific events from being handled by basic handlers. @@ -53,7 +51,7 @@ BlDirectEventDispatcher >> addEventFilter: aFilter [ aFilter onInstalledIn: self owner ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> addEventHandler: aHandler [ "It is not very common to have event handlers so we initialize registry lazily" @@ -65,24 +63,24 @@ BlDirectEventDispatcher >> addEventHandler: aHandler [ aHandler onInstalledIn: self owner ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> addShortcut: aBlShortcut [ shortcutHandler := shortcutHandler addShortcut: aBlShortcut ] -{ #category : 'initialization' } +{ #category : #initialization } BlDirectEventDispatcher >> defaultFilterRegistry [ ^ BlHandlerRegistry preferableHandlerRegistryClass new ] -{ #category : 'initialization' } +{ #category : #initialization } BlDirectEventDispatcher >> defaultHandlerRegistry [ ^ BlHandlerRegistry preferableHandlerRegistryClass new ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlDirectEventDispatcher >> dispatchEvent: anEvent next: aBlEventDispatcherChain [ @@ -114,21 +112,21 @@ BlDirectEventDispatcher >> dispatchEvent: anEvent next: aBlEventDispatcherChain ^ anEvent ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlDirectEventDispatcher >> filtersDo: aBlock [ "Evaulate a given block with every event filter as an argument" filters ifNotNil: [ :aRegistry | aRegistry handlers do: aBlock ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlDirectEventDispatcher >> handlersDo: aBlock [ "Evaulate a given block with every event handler as an argument" handlers ifNotNil: [ :aRegistry | aRegistry handlers do: aBlock ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlDirectEventDispatcher >> hasEventFilterSuchThat: aBlock [ @@ -139,21 +137,21 @@ BlDirectEventDispatcher >> hasEventFilterSuchThat: aBlock [ ^ false ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlDirectEventDispatcher >> hasFilter: anEventHandler [ ^ filters ifNil: [ false ] ifNotNil: [ filters hasHandler: anEventHandler ] ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlDirectEventDispatcher >> hasHandler: anEventHandler [ ^ handlers ifNil: [ false ] ifNotNil: [ handlers hasHandler: anEventHandler ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlDirectEventDispatcher >> initialize [ super initialize. @@ -168,7 +166,7 @@ BlDirectEventDispatcher >> initialize [ shortcutHandler := BlShortcutHandlerWithoutShortcuts uniqueInstance ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlDirectEventDispatcher >> owner [ @@ -179,23 +177,23 @@ BlDirectEventDispatcher >> owner [ ^ owner ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlDirectEventDispatcher >> owner: aTBlEventTarget [ owner := aTBlEventTarget ] -{ #category : 'printing' } +{ #category : #printing } BlDirectEventDispatcher >> printOn: aStream [ aStream nextPutAll: self type, ' event dispatcher for '. self owner printOn: aStream ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> removeAllShortcutsWithCombination: aBlKeyCombination [ shortcutHandler := shortcutHandler removeAllWithCombination: aBlKeyCombination ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> removeEventFilter: aFilter [ (self hasFilter: aFilter) ifFalse: [ ^ self ]. @@ -210,7 +208,7 @@ BlDirectEventDispatcher >> removeEventFilter: aFilter [ aFilter onUninstalledIn: self owner ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> removeEventFiltersSuchThat: aBlock [ "remove all event handlers for those aBlock returns true" | toBeRemoved | @@ -224,7 +222,7 @@ BlDirectEventDispatcher >> removeEventFiltersSuchThat: aBlock [ toBeRemoved do: [ :aHandler | aHandler onUninstalledIn: self owner ] ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> removeEventHandler: anHandler [ (self hasHandler: anHandler) ifFalse: [ ^ self ]. @@ -239,7 +237,7 @@ BlDirectEventDispatcher >> removeEventHandler: anHandler [ anHandler onUninstalledIn: self owner ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> removeEventHandlers [ "Remove all my event handlers" | oldHandlers | @@ -253,7 +251,7 @@ BlDirectEventDispatcher >> removeEventHandlers [ oldHandlers do: [ :eachHandler | eachHandler onUninstalledIn: self owner ] ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> removeEventHandlersSuchThat: aBlock [ "remove all event handlers for those aBlock returns true" | toBeRemoved | @@ -267,24 +265,24 @@ BlDirectEventDispatcher >> removeEventHandlersSuchThat: aBlock [ toBeRemoved do: [ :aHandler | aHandler onUninstalledIn: self owner ] ] -{ #category : 'api - adding/removing' } +{ #category : #'api - adding/removing' } BlDirectEventDispatcher >> removeShortcut: aBlShortcut [ shortcutHandler := shortcutHandler removeShortcut: aBlShortcut ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlDirectEventDispatcher >> shortcutHandler [ ^ shortcutHandler ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlDirectEventDispatcher >> type [ ^ 'Direct' ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlDirectEventDispatcher >> wantsEvent: anEvent [ "Return true if there are any filters or handlers interesting in a given event, false otherwise" diff --git a/src/Bloc/BlDoubleClickEvent.class.st b/src/Bloc/BlDoubleClickEvent.class.st index 06c42ec53..7d507f0b9 100644 --- a/src/Bloc/BlDoubleClickEvent.class.st +++ b/src/Bloc/BlDoubleClickEvent.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlDoubleClickEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlDoubleClickEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlDoubleClickEvent >> isDoubleClick [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlDoubleClickEvent >> sendTo: anObject [ anObject doubleClickEvent: self ] diff --git a/src/Bloc/BlDragEndEvent.class.st b/src/Bloc/BlDragEndEvent.class.st index aeec5970c..20c49cc3d 100644 --- a/src/Bloc/BlDragEndEvent.class.st +++ b/src/Bloc/BlDragEndEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlDragEndEvent', - #superclass : 'BlBaseDragEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlDragEndEvent, + #superclass : #BlBaseDragEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlDragEndEvent >> sendTo: anObject [ anObject dragEndEvent: self ] diff --git a/src/Bloc/BlDragEnterEvent.class.st b/src/Bloc/BlDragEnterEvent.class.st index 878239113..2776b5973 100644 --- a/src/Bloc/BlDragEnterEvent.class.st +++ b/src/Bloc/BlDragEnterEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlDragEnterEvent', - #superclass : 'BlBaseDragEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlDragEnterEvent, + #superclass : #BlBaseDragEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlDragEnterEvent >> sendTo: anObject [ anObject dragEnterEvent: self ] diff --git a/src/Bloc/BlDragEvent.class.st b/src/Bloc/BlDragEvent.class.st index 37b1acf45..a95746fe5 100644 --- a/src/Bloc/BlDragEvent.class.st +++ b/src/Bloc/BlDragEvent.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlDragEvent', - #superclass : 'BlBaseDragEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlDragEvent, + #superclass : #BlBaseDragEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlDragEvent >> isDrag [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlDragEvent >> sendTo: anObject [ anObject dragEvent: self ] diff --git a/src/Bloc/BlDragLeaveEvent.class.st b/src/Bloc/BlDragLeaveEvent.class.st index 2f5d9fa6d..d372011d6 100644 --- a/src/Bloc/BlDragLeaveEvent.class.st +++ b/src/Bloc/BlDragLeaveEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlDragLeaveEvent', - #superclass : 'BlBaseDragEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlDragLeaveEvent, + #superclass : #BlBaseDragEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlDragLeaveEvent >> sendTo: anObject [ anObject dragLeaveEvent: self ] diff --git a/src/Bloc/BlDragStartEvent.class.st b/src/Bloc/BlDragStartEvent.class.st index c58e576ba..efc0a59bf 100644 --- a/src/Bloc/BlDragStartEvent.class.st +++ b/src/Bloc/BlDragStartEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlDragStartEvent', - #superclass : 'BlBaseDragEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlDragStartEvent, + #superclass : #BlBaseDragEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlDragStartEvent >> sendTo: anObject [ anObject dragStartEvent: self ] diff --git a/src/Bloc/BlDrawingErrorHandler.class.st b/src/Bloc/BlDrawingErrorHandler.class.st index 33b907804..0beafaa71 100644 --- a/src/Bloc/BlDrawingErrorHandler.class.st +++ b/src/Bloc/BlDrawingErrorHandler.class.st @@ -5,19 +5,17 @@ To not completely break the UI thread we should catch the error and prevent the " Class { - #name : 'BlDrawingErrorHandler', - #superclass : 'BlSingleErrorHandler', - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #name : #BlDrawingErrorHandler, + #superclass : #BlSingleErrorHandler, + #category : 'Bloc-Basic-Errors' } -{ #category : 'testing' } +{ #category : #testing } BlDrawingErrorHandler >> matches: aFramePhase [ ^ aFramePhase isDrawingPhase ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlDrawingErrorHandler >> processError: aHandledError [ aHandledError element diff --git a/src/Bloc/BlDropEvent.class.st b/src/Bloc/BlDropEvent.class.st index c5ed10232..6c473b14c 100644 --- a/src/Bloc/BlDropEvent.class.st +++ b/src/Bloc/BlDropEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlDropEvent', - #superclass : 'BlBaseDragEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlDropEvent, + #superclass : #BlBaseDragEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlDropEvent >> sendTo: anObject [ anObject dropEvent: self ] diff --git a/src/Bloc/BlEasing.class.st b/src/Bloc/BlEasing.class.st index 6b097fa61..a65fe78a6 100644 --- a/src/Bloc/BlEasing.class.st +++ b/src/Bloc/BlEasing.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlEasing', - #superclass : 'BlInterpolator', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlEasing, + #superclass : #BlInterpolator, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'factory' } +{ #category : #factory } BlEasing class >> bounceIn [ ^ BlEasingBounceIn default ] -{ #category : 'factory' } +{ #category : #factory } BlEasing class >> bounceInOut [ ^ BlEasingBounceInOut default ] -{ #category : 'factory' } +{ #category : #factory } BlEasing class >> bounceOut [ ^ BlEasingBounceOut default ] -{ #category : 'factory' } +{ #category : #factory } BlEasing class >> linear [ ^ BlLinearInterpolator default ] -{ #category : 'interpolation' } +{ #category : #interpolation } BlEasing >> deltaByProgress: aProgress [ ^ self interpolate: aProgress ] diff --git a/src/Bloc/BlEasingBaseBounce.class.st b/src/Bloc/BlEasingBaseBounce.class.st index 630491327..8938e3431 100644 --- a/src/Bloc/BlEasingBaseBounce.class.st +++ b/src/Bloc/BlEasingBaseBounce.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEasingBaseBounce', - #superclass : 'BlEasing', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlEasingBaseBounce, + #superclass : #BlEasing, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlEasingBaseBounce >> computeBounce: aProgress [ | a b | a := 0. diff --git a/src/Bloc/BlEasingBounceIn.class.st b/src/Bloc/BlEasingBounceIn.class.st index c2ad0666e..9ac6352e8 100644 --- a/src/Bloc/BlEasingBounceIn.class.st +++ b/src/Bloc/BlEasingBounceIn.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEasingBounceIn', - #superclass : 'BlEasingBaseBounce', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlEasingBounceIn, + #superclass : #BlEasingBaseBounce, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlEasingBounceIn >> interpolate: aProgress [ ^ self computeBounce: aProgress ] diff --git a/src/Bloc/BlEasingBounceInOut.class.st b/src/Bloc/BlEasingBounceInOut.class.st index 2d4a3fe68..9adea3d44 100644 --- a/src/Bloc/BlEasingBounceInOut.class.st +++ b/src/Bloc/BlEasingBounceInOut.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEasingBounceInOut', - #superclass : 'BlEasingBaseBounce', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlEasingBounceInOut, + #superclass : #BlEasingBaseBounce, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlEasingBounceInOut >> interpolate: aProgress [ aProgress <= 0.5 ifTrue: [ ^ (self computeBounce: 2 * aProgress) / 2 ]. diff --git a/src/Bloc/BlEasingBounceOut.class.st b/src/Bloc/BlEasingBounceOut.class.st index 2f72fcccb..1887d95ce 100644 --- a/src/Bloc/BlEasingBounceOut.class.st +++ b/src/Bloc/BlEasingBounceOut.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEasingBounceOut', - #superclass : 'BlEasingBaseBounce', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlEasingBounceOut, + #superclass : #BlEasingBaseBounce, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlEasingBounceOut >> interpolate: aProgress [ ^ 1-(self computeBounce:(1-aProgress)) ] diff --git a/src/Bloc/BlEasingElastic.class.st b/src/Bloc/BlEasingElastic.class.st index 32d3c5196..41bac121f 100644 --- a/src/Bloc/BlEasingElastic.class.st +++ b/src/Bloc/BlEasingElastic.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEasingElastic', - #superclass : 'BlEasing', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlEasingElastic, + #superclass : #BlEasing, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlEasingElastic >> interpolate: aProgress [ ^ (2 raisedTo: (10 * (aProgress - 1))) * ((20 * Float pi * 1.5 / 3 * aProgress) cos) ] diff --git a/src/Bloc/BlEasingQuad.class.st b/src/Bloc/BlEasingQuad.class.st index 68190e74a..44d056649 100644 --- a/src/Bloc/BlEasingQuad.class.st +++ b/src/Bloc/BlEasingQuad.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEasingQuad', - #superclass : 'BlEasing', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlEasingQuad, + #superclass : #BlEasing, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlEasingQuad >> interpolate: aProgress [ ^ aProgress raisedTo: 2 ] diff --git a/src/Bloc/BlElement.class.st b/src/Bloc/BlElement.class.st index c25a719fe..f2d4a4b03 100644 --- a/src/Bloc/BlElement.class.st +++ b/src/Bloc/BlElement.class.st @@ -44,8 +44,8 @@ You can learn Bloc following a memory game tutorial: [00-memory-game.pillar](fil " Class { - #name : 'BlElement', - #superclass : 'Object', + #name : #BlElement, + #superclass : #Object, #traits : 'TBlTransformable + TBlEventTarget + TBlDebug', #classTraits : 'TBlTransformable classTrait + TBlEventTarget classTrait + TBlDebug classTrait', #instVars : [ @@ -65,37 +65,35 @@ Class { 'visuals', 'flags' ], - #category : 'Bloc-Basic', - #package : 'Bloc', - #tag : 'Basic' + #category : 'Bloc-Basic' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElement class >> epsilon [ ^ 0.01 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElement class >> id: aStringOrSymbol [ ^ self new id: aStringOrSymbol ] -{ #category : 'api - animations' } +{ #category : #'api - animations' } BlElement >> addAnimation: aBlBaseAnimation [ aBlBaseAnimation target: self. self enqueueTask: aBlBaseAnimation ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement [ "Add anElement as my last direct child and request layout update." self addChild: anElement at: self childrenCount + 1 ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement after: anotherElement [ "Add anElement as my direct child right after anotherElement. @@ -114,7 +112,7 @@ BlElement >> addChild: anElement after: anotherElement [ self addChild: anElement at: (anotherElementIndex + 1) ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement as: aBlElementId [ "Add a given element to my children and make it a named container, so that we could add children in that container" @@ -133,7 +131,7 @@ BlElement >> addChild: anElement as: aBlElementId [ self addChild: anElement ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement at: anIndex [ "Add anElement at an index moving other children to the right. @@ -168,7 +166,7 @@ BlElement >> addChild: anElement at: anIndex [ anElement requestLayout. ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement at: anIndex as: aContainerName [ "Add a given element to my children at an index moving other children to the right and make it a named container, so that we could add children in that container" @@ -187,7 +185,7 @@ BlElement >> addChild: anElement at: anIndex as: aContainerName [ self addChild: anElement at: anIndex ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement before: anotherElement [ "Add anElement as my direct child right before anotherElement. @@ -206,7 +204,7 @@ BlElement >> addChild: anElement before: anotherElement [ self addChild: anElement at: anotherElementIndex ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement in: aContainerName [ "Add a given element to a named container that must already exist" @@ -216,7 +214,7 @@ BlElement >> addChild: anElement in: aContainerName [ ifNone: [ self error: 'Container named ', aContainerName asString, ' is not found!' ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChild: anElement in: aContainerName as: aChildContainerName [ "Add a given element to a named container that must already exist and mark the added child as container too" @@ -227,14 +225,14 @@ BlElement >> addChild: anElement in: aContainerName as: aChildContainerName [ ifNone: [ self error: 'Container named #', aContainerName asString, ' does not exist' ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChildFirst: anElement [ "Add anElement as my first direct child and request layout update." self addChild: anElement at: 1 ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChildFirst: anElement as: aContainerId [ "Add a given element as my first child and make it a named container, so that we could add children in that container" @@ -243,7 +241,7 @@ BlElement >> addChildFirst: anElement as: aContainerId [ self addChildFirst: anElement ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChildren: aListOfElements [ "Add elements from aListOfElements as my rearmost(last) direct children and request layout update. @@ -270,7 +268,7 @@ BlElement >> addChildren: aListOfElements [ aListOfElements do: [ :anElement | anElement requestLayout ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> addChildren: aListOfElements in: aContainerName [ "Add given elements to a named container that must already exist" @@ -280,7 +278,7 @@ BlElement >> addChildren: aListOfElements in: aContainerName [ ifNone: [ self error: 'Container named ', aContainerName asString, ' is not found!' ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> allChildrenBreadthFirstDetect: aBlock ifFound: ifFoundBlock [ ^ self allChildrenBreadthFirstDetect: aBlock @@ -288,7 +286,7 @@ BlElement >> allChildrenBreadthFirstDetect: aBlock ifFound: ifFoundBlock [ ifNone: [ nil ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> allChildrenBreadthFirstDetect: aBlock ifFound: ifFoundBlock ifNone: ifNoneBlock [ self allChildrenBreadthFirstDo: [ :aChild | (aBlock value: aChild) @@ -296,13 +294,13 @@ BlElement >> allChildrenBreadthFirstDetect: aBlock ifFound: ifFoundBlock ifNone: ^ ifNoneBlock value ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> allChildrenBreadthFirstDo: aBlock [ self childrenDo: aBlock. self childrenDo: [ :each | each allChildrenBreadthFirstDo: aBlock ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> allChildrenBreadthFirstDo: elementAndDepthBlock withDepth: aDepth [ " same as allChildrenBreadthFirstDo: except that @@ -312,7 +310,7 @@ BlElement >> allChildrenBreadthFirstDo: elementAndDepthBlock withDepth: aDepth [ self childrenDo: [ :each | each allChildrenBreadthFirstDo: elementAndDepthBlock withDepth: aDepth + 1] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> allChildrenBreadthFirstSelect: aBlock [ | selectedChildren | selectedChildren := OrderedCollection new. @@ -321,7 +319,7 @@ BlElement >> allChildrenBreadthFirstSelect: aBlock [ ^ selectedChildren ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> allChildrenBreadthFirstWithDepthDo: elementAndDepthBlock [ " same as allChildrenBreadthFirstDo: except that @@ -330,13 +328,13 @@ BlElement >> allChildrenBreadthFirstWithDepthDo: elementAndDepthBlock [ self allChildrenBreadthFirstDo: elementAndDepthBlock withDepth: 1 ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> allChildrenDepthFirstDo: aBlock [ self childrenDo: [ :each | each allChildrenDepthFirstDo: aBlock ]. self childrenDo: aBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> allParents [ "Return a collection of all parents starting with my parent and ending with the top most parent" @@ -344,7 +342,7 @@ BlElement >> allParents [ self allParentsDo: [ :eachParent | aStream nextPut: eachParent ] ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> allParentsDetect: aBlock ifFound: ifFoundBlock ifNone: ifNoneBlock [ self allParentsDo: [ :aParent | (aBlock value: aParent) @@ -352,7 +350,7 @@ BlElement >> allParentsDetect: aBlock ifFound: ifFoundBlock ifNone: ifNoneBlock ^ ifNoneBlock value ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> allParentsDo: aBlock [ "Evaluate a block with my every parent as an argument starting from my direct parent up to the top most parent (excluding myself). @@ -367,7 +365,7 @@ BlElement >> allParentsDo: aBlock [ ^ self ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> allParentsReverseDo: aBlock [ "Evaluate a block with my every parent as an argument starting from my top most parent up to my direct parent (excluding myself). If no parent, then ignore." @@ -376,7 +374,7 @@ BlElement >> allParentsReverseDo: aBlock [ self parent withAllParentsReverseDo: aBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> allParentsTo: aParentElement do: aBlock [ "Evaluate a block with each of my parents as an argument starting from my direct parent up to the given parent element (excluding myself). @@ -388,14 +386,14 @@ BlElement >> allParentsTo: aParentElement do: aBlock [ ifTrue: [ ^ self ] ] ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> allowChildrenMouseEvents [ "Allow my children to receive mouse events" flags addShouldChildrenHandleMouseEvents ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> allowMeAndChildrenMouseEvents [ "Allow me and my children to receive mouse events" @@ -403,7 +401,7 @@ BlElement >> allowMeAndChildrenMouseEvents [ flags addShouldChildrenHandleMouseEvents ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> allowMouseEvents [ "Allow *me* to handle mouse events. It does not influence the ability of the children to handle events, hence I am a local property" @@ -411,18 +409,18 @@ BlElement >> allowMouseEvents [ flags addShouldHandleMouseEvents. ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> allowMousePickOutsideEvent [ self userData at: #shouldHandleMousePickOutsideEvent put: true ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> applyLayoutIn: aBlBounds [ ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> applyLayoutIn: aBlBounds context: aBlElementBoundsUpdateContext [ self errorHandler with: self @@ -430,7 +428,7 @@ BlElement >> applyLayoutIn: aBlBounds context: aBlElementBoundsUpdateContext [ failed: [ self applyLayoutThatFailedIn: aBlBounds context: aBlElementBoundsUpdateContext ] ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> applyLayoutSafelyIn: aRectangle context: aBlElementBoundsUpdateContext [ "Layout me and my children within aRectangle in my local coordinates. Note: aRectangle may be a temporary or mutable rectangle, so you must not @@ -465,7 +463,7 @@ BlElement >> applyLayoutSafelyIn: aRectangle context: aBlElementBoundsUpdateCont self privateRequestingLayout: false ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> applyLayoutThatFailedIn: aRectangle context: aBlElementBoundsUpdater [ "Perform fallback safe action when layout computation failed" NonInteractiveTranscript stdout nextPutAll: 'Layout failed in ', self class name; cr. @@ -475,23 +473,23 @@ BlElement >> applyLayoutThatFailedIn: aRectangle context: aBlElementBoundsUpdate self privateRequestingLayout: false ] -{ #category : 'converting' } +{ #category : #converting } BlElement >> asBlocResolvedElementsFrom: anElement [ ^ { self } ] -{ #category : 'converting' } +{ #category : #converting } BlElement >> asElement [ ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlElement >> asForm [ ^ BlHostRenderer preferableClass newFormFrom: self ] -{ #category : 'converting' } +{ #category : #converting } BlElement >> asScrollableElement [ | scrollable | self removeFromParent. @@ -503,7 +501,7 @@ BlElement >> asScrollableElement [ ^ scrollable ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> attachChild: anElement [ "Attaches previously detached element as my last direct child. @see #attachChild:at: for more info" @@ -511,7 +509,7 @@ BlElement >> attachChild: anElement [ self attachChild: anElement at: self childrenCount + 1 ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> attachChild: anElement at: anIndex [ "Attach an element making it my direct child. Attaching an element assigns me as the parent and puts an element in the list of children so that it can be retrieved by `children at:`. @@ -544,7 +542,7 @@ BlElement >> attachChild: anElement at: anIndex [ eachElement onAddedToSceneGraph ] ] ] ] -{ #category : 'api - space' } +{ #category : #'api - space' } BlElement >> attachSpace [ spaceReference := BlAttachedSpaceReference uniqueInstance. @@ -569,7 +567,7 @@ BlElement >> attachSpace [ ifTrue: [ self markNeedsPaintFrom: self ] ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> background [ "Return my current background. Background can not be nil" @@ -578,7 +576,7 @@ BlElement >> background [ ^ visuals background ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> background: aBlBackground [ "Change my background to a given one. Color and Form can be used as background - they will be converted to an appropriate background object. @@ -598,7 +596,7 @@ BlElement >> background: aBlBackground [ self invalidate ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> baselineOffset [ "Return the offset of the element's text baseline from the element's top boundary. If I don't not support baseline alignment, BlElement>>#supportsBaseline return false" @@ -607,53 +605,53 @@ BlElement >> baselineOffset [ ^ 0 ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> beInSeparateCompositionLayer [ "Make me that I want to be rendered in a separate compositing layer" self compositingMode: BlCompositingSeparateLayerMode uniqueInstance ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> beInSingleCompositionLayer [ "Make me and my children be rendered in a single compositing layer" self compositingMode: BlCompositingSingleLayerMode uniqueInstance ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> beOutskirtsCentered [ self outskirts: BlOutskirts centered ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> beOutskirtsInside [ self outskirts: BlOutskirts inside ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> beOutskirtsOutside [ self outskirts: BlOutskirts outside ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> beWithoutCompositionLayer [ "Make me and my children be rendered without compositing layer" self compositingMode: BlCompositingWithoutLayerMode uniqueInstance ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> border [ ^ visuals border ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> border: aBlBorder [ "Change my border and invalidate me. aBlBorder can be created using BlBorderBuilder. Raises BlElementBorderChangedEvent" @@ -669,33 +667,33 @@ BlElement >> border: aBlBorder [ self invalidate ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> bounds [ ^ bounds ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> bounds: aBounds [ self position: aBounds position. self size: aBounds extent ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElement >> boundsCache [ ^ boundsCache ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> boundsInLocal [ ^ boundsCache boundsInLocal ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> boundsInLocal: aBounds [ "I load my local bounds in the given mutable bounds and return it. I do not rely on cache and always provide actual bounds. @@ -708,14 +706,14 @@ BlElement >> boundsInLocal: aBounds [ ^ self bounds boundsInLocal: aBounds ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> boundsInParent [ self deprecated: 'Use `element bounds inParent` instead'. ^ self bounds inParent asRectangle ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> boundsInParent: aBounds [ @@ -724,12 +722,12 @@ BlElement >> boundsInParent: aBounds [ ^ self localBoundsToParent: (self boundsInLocal: aBounds) ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> boundsInSpace [ ^ boundsCache boundsInSpace ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> boundsInSpace: aBounds [ "I load my bounds in space in a given mutable rectangle and return provided one. I do not rely on cache and always provide actual bounds. @@ -741,26 +739,26 @@ BlElement >> boundsInSpace: aBounds [ ^ aBounds ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> boundsInWindow [ ^ self isAttachedToSceneGraph ifTrue: [ boundsCache boundsInSpace scaleBy: self space windowScale ] ifFalse: [ boundsCache boundsInSpace ] ] -{ #category : 'updating' } +{ #category : #updating } BlElement >> changed [ self error: 'Never use me, instead invalidate only what is needed' ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childAt: anIndex [ ^ self children at: anIndex ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childIndexOf: anElement [ "Answer the index of the first occurrence of anElement within the receiver. If the receiver does not contain anElement, answer 0." @@ -769,7 +767,7 @@ BlElement >> childIndexOf: anElement [ ^ self children indexOf: anElement ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childNamed: aChildName [ @@ -780,7 +778,7 @@ BlElement >> childNamed: aChildName [ ^ self childWithId: aChildName ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childNamed: aContainerName ifFound: ifFoundBlock [ @@ -793,7 +791,7 @@ BlElement >> childNamed: aContainerName ifFound: ifFoundBlock [ ifFound: ifFoundBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childNamed: aContainerName ifFound: ifFoundBlock ifNone: ifNoneBlock [ @@ -807,7 +805,7 @@ BlElement >> childNamed: aContainerName ifFound: ifFoundBlock ifNone: ifNoneBloc ifNone: ifNoneBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childWithId: aBlElementId [ @@ -817,7 +815,7 @@ BlElement >> childWithId: aBlElementId [ ifNone: [ self error: 'Children with id ', aBlElementId asString, ' does not exist' ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childWithId: aBlElementId ifFound: ifFoundBlock [ "Find (deeply) the first child element with a given id and evaluate a ifFoundBlock if such child exists and return the result of the evaluation. Return nil otherwise." @@ -829,7 +827,7 @@ BlElement >> childWithId: aBlElementId ifFound: ifFoundBlock [ ifNone: [ nil ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childWithId: aStringOrSymbol ifFound: ifFoundBlock ifNone: ifNoneBlock [ | targetId | @@ -843,7 +841,7 @@ BlElement >> childWithId: aStringOrSymbol ifFound: ifFoundBlock ifNone: ifNoneBl ^ ifNoneBlock value ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childWithId: aBlElementId ifNone: ifNoneBlock [ "Find (deeply) the first child element with a given id and evaluate a ifNoneBlock if such child does not exists and return the result of the evaluation. Return nil otherwise." @@ -855,7 +853,7 @@ BlElement >> childWithId: aBlElementId ifNone: ifNoneBlock [ ifNone: ifNoneBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> children [ "Return an array of all my direct children. children can not be nil" @@ -864,7 +862,7 @@ BlElement >> children [ ^ children ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> childrenAt: aPoint do: aBlock [ "Evaluate a given Block with my directs children under a given point provided in *my* local coordinates sorted in the order they are displayed (children reversed + elevation based). @@ -893,7 +891,7 @@ BlElement >> childrenAt: aPoint do: aBlock [ ^ anyChildFound ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> childrenBoundsToLocal: aBounds [ "In-place transform bounds from my childrens' coordinates to my local coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -904,7 +902,7 @@ BlElement >> childrenBoundsToLocal: aBounds [ ^ aBounds ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> childrenCount [ "Return amount of my direct children" @@ -912,7 +910,7 @@ BlElement >> childrenCount [ ^ self children size ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> childrenDo: aBlock [ "Evaluate aBlock with each of my direct children as argument. aBlock can not be nil. @@ -921,7 +919,7 @@ BlElement >> childrenDo: aBlock [ self children do: aBlock ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> childrenPointToLocal: aPoint [ "Transform a given point from the local coordinates of my children to my local coordinates" @@ -929,14 +927,14 @@ BlElement >> childrenPointToLocal: aPoint [ ^ aPoint ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> clipChildren [ ^ visuals clipChildren ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> clipChildren: aBoolean [ self clipChildren = aBoolean ifTrue: [ ^ self ]. @@ -945,14 +943,14 @@ BlElement >> clipChildren: aBoolean [ self invalidateChildren. ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> compositingMode [ ^ visuals compositingMode ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> compositingMode: aBlCompositingMode [ "Establish the compositing mode, and invalidate myself except if it's not a change." @@ -963,7 +961,7 @@ BlElement >> compositingMode: aBlCompositingMode [ self invalidate. ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> compositionDepth [ | aDepth | @@ -972,7 +970,7 @@ BlElement >> compositionDepth [ ^ aDepth ] -{ #category : 'api - painting' } +{ #category : #'api - painting' } BlElement >> compositionLayer [ "Return my composition layer if I have one or nil otherwise" @@ -981,7 +979,7 @@ BlElement >> compositionLayer [ ifAbsent: [ nil ] ] -{ #category : 'api - painting' } +{ #category : #'api - painting' } BlElement >> compositionLayer: aCompositionLayer [ "Assign a given composition layer to me" @@ -990,7 +988,7 @@ BlElement >> compositionLayer: aCompositionLayer [ put: aCompositionLayer ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> computeLayout [ "Private! Never use me outside of #forceLayout" | relayoutCounter maxRelayoutCount aBlElementBoundsUpdateContext | @@ -1029,7 +1027,7 @@ BlElement >> computeLayout [ ifFalse: [ self dispatchLayoutDone ] ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElement >> constraints [ "Return layout constraints object which is used by the layout strategy. constraints can not be nil. @@ -1040,7 +1038,7 @@ BlElement >> constraints [ ^ constraints ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElement >> constraints: aLayoutConstraints [ "Set new layout constraints and request layout update. aLayoutConstraints must not be nil" @@ -1049,7 +1047,7 @@ BlElement >> constraints: aLayoutConstraints [ self requestLayout ] -{ #category : 'api - layout' } +{ #category : #'api - layout' } BlElement >> constraintsDo: aBlock [ "Perform aBlock with my constraints as argument. Note: After evaluation I request a layout update! @@ -1060,7 +1058,7 @@ BlElement >> constraintsDo: aBlock [ self requestLayout ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> containerName [ @@ -1069,7 +1067,7 @@ BlElement >> containerName [ ^ self id ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> containerName: aSymbol [ "Give this element a container name (a Symbol) which can be used to find an element by its name" @@ -1078,14 +1076,14 @@ BlElement >> containerName: aSymbol [ self id: aSymbol ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlElement >> containsGlobalPoint: aPoint [ (self geometryBoundsInSpace containsPoint: aPoint) ifFalse: [ ^ false ]. ^ self containsPoint: (self globalPointToLocal: aPoint) ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlElement >> containsPoint: aPoint [ "Return true if a given point provided in local coordinates is inside of my geometry, false otherwise." @@ -1097,7 +1095,7 @@ BlElement >> containsPoint: aPoint [ alreadyInGeometryBoundsOf: self ] -{ #category : 'copying' } +{ #category : #copying } BlElement >> copy [ "Visual elements can not be copied. The reason for that is unpredictable amount of conflicting copying behaviours. @@ -1111,14 +1109,14 @@ BlElement >> copy [ self shouldNotImplement ] -{ #category : 'copying' } +{ #category : #copying } BlElement >> deepCopy [ "See method comment of #copy" self shouldNotImplement ] -{ #category : 'focus accessing' } +{ #category : #'focus accessing' } BlElement >> deepestFocusedChild [ "Return a child that is focused, if any. I may return nil of there is no such child" @@ -1134,7 +1132,7 @@ BlElement >> deepestFocusedChild [ ^ nil ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultBackground [ "Return an object that should be used as element's background by default. Note: it may be any object that implements #asBlBackground" @@ -1143,7 +1141,7 @@ BlElement >> defaultBackground [ ^ BlBackground transparent ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultBorder [ "Return an instance of BlBorder that should be my default border" @@ -1151,14 +1149,14 @@ BlElement >> defaultBorder [ ^ BlBorder empty ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultElevation [ ^ BlRelativeElevation zero ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultErrorHandler [ ^ BlCompositeErrorHandler withAll: { BlDrawingErrorHandler new. @@ -1166,49 +1164,49 @@ BlElement >> defaultErrorHandler [ } ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultFocusability [ ^ BlFocusability before ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultGeometry [ ^ BlRectangleGeometry new ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultLayout [ ^ BlBasicLayout uniqueInstance ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultLayoutCommonConstraints [ ^ BlLayoutCommonConstraints new ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultOutskirts [ ^ BlOutskirts inside ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultTransformation [ "Return an instance of `BlElementTransformation` that plays a role of my default transformation." ^ BlElementIdentityTransformation uniqueInstance ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> defaultVisibility [ ^ BlVisibility visible ] -{ #category : 'api - tasks' } +{ #category : #'api - tasks' } BlElement >> dequeueTask: aBlTask [ self isAttachedToSceneGraph @@ -1216,7 +1214,7 @@ BlElement >> dequeueTask: aBlTask [ ifFalse: [ self taskQueue dequeue: aBlTask ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> detachChild: anElement [ "Detaches anElement from myself. Detaching an element should be followed either by attachChild: or removeDetachedChild: Detachment should only be temporary; reattachment or removal should happen within the same drawing cycle as detachment. @@ -1236,7 +1234,7 @@ BlElement >> detachChild: anElement [ ifTrue: [ eachElement detachSpace ] ]. ] -{ #category : 'api - painting' } +{ #category : #'api - painting' } BlElement >> detachCompositionLayer [ "Detach my composition layer if any" @@ -1245,7 +1243,7 @@ BlElement >> detachCompositionLayer [ self compositionLayer: nil ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> detachFromParentPreservingElevationWhile: aBlock [ "Detach myself from a parent while evaluating a given block. I attach myself at the same position as before. @@ -1262,7 +1260,7 @@ BlElement >> detachFromParentPreservingElevationWhile: aBlock [ [ aBlock value ] ensure: [ aParentElement attachChild: self at: aChildIndex ] ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> detachFromParentWhile: aBlock [ "Detach myself from a parent while evaluating a given block. Directly evaluate a block if I don't have a parent" @@ -1276,7 +1274,7 @@ BlElement >> detachFromParentWhile: aBlock [ [ aBlock value ] ensure: [ aParentElement attachChild: self] ] ] -{ #category : 'api - space' } +{ #category : #'api - space' } BlElement >> detachSpace [ self assert: [ self isAttachedToSceneGraph ] @@ -1285,7 +1283,7 @@ BlElement >> detachSpace [ spaceReference := BlDetachedSpaceReference uniqueInstance ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> directChildNamed: aContainerName ifFound: ifFoundBlock ifNone: ifNoneBlock [ @@ -1296,7 +1294,7 @@ BlElement >> directChildNamed: aContainerName ifFound: ifFoundBlock ifNone: ifNo ^ self directChildWithId: aContainerName ifFound: ifFoundBlock ifNone: ifNoneBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> directChildWithId: aStringOrSymbol ifFound: ifFoundBlock ifNone: ifNoneBlock [ @@ -1307,14 +1305,14 @@ BlElement >> directChildWithId: aStringOrSymbol ifFound: ifFoundBlock ifNone: if ^ ifNoneBlock value ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> disableEventType: anEventClass while: aBlock [ self eventDispatcher disableEventType: anEventClass while: aBlock ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlElement >> dispatchAddedToParent [ "Sent after I was added to another element as direct child. I dispatch or fire all necessary events, clean internal caches and send a corresponding hooks" @@ -1323,7 +1321,7 @@ BlElement >> dispatchAddedToParent [ self eventDispatcher dispatchAddedToParent ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlElement >> dispatchAddedToSceneGraph [ "Sent after any of my parents or I was added to scene graph. I dispatch or fire all necessary events, clean internal caches and send a corresponding hooks" @@ -1341,7 +1339,7 @@ BlElement >> dispatchAddedToSceneGraph [ anElement dispatchAddedToSceneGraph ] ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlElement >> dispatchChildAdded: anElement [ "First send hook to myself" @@ -1357,7 +1355,7 @@ BlElement >> dispatchChildAdded: anElement [ anElement dispatchAddedToParent ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlElement >> dispatchChildRemoved: anElement [ "First send hook to myself" @@ -1375,7 +1373,7 @@ BlElement >> dispatchChildRemoved: anElement [ ifTrue: [ anElement dispatchRemovedFromSceneGraph ] ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> dispatchLayoutDone [ "Is sent when layout is done. Normally I am triggered by the space as soon as layout process is completed. @@ -1387,7 +1385,7 @@ BlElement >> dispatchLayoutDone [ self children do: [ :aChildElement | aChildElement dispatchLayoutDone ] ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> dispatchMousePickedOutside: aMouseOutsideEvent [ " I am triggered by the space as soon as a mouse down or up occurs. @@ -1404,7 +1402,7 @@ BlElement >> dispatchMousePickedOutside: aMouseOutsideEvent [ self dispatchEvent: aMouseOutsideEvent ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlElement >> dispatchRemovedFromParent: aParentElement [ "Sent after I was removed from my parent and is not longer its direct child. I dispatch or fire all necessary events, clean internal caches and send a corresponding hooks" @@ -1413,7 +1411,7 @@ BlElement >> dispatchRemovedFromParent: aParentElement [ self eventDispatcher dispatchRemovedFromParent ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlElement >> dispatchRemovedFromSceneGraph [ "Sent after any of my parents or I was removed from scene graph. I dispatch or fire all necessary events, clean internal caches and send a corresponding hooks" @@ -1423,7 +1421,7 @@ BlElement >> dispatchRemovedFromSceneGraph [ self childrenDo: [ :anElement | anElement dispatchRemovedFromSceneGraph ] ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> distanceTo: aPoint [ "Compute the euclidian distance from my closest edge to a provided point both given in my parent coordinates" @@ -1435,7 +1433,7 @@ BlElement >> distanceTo: aPoint [ ^ aClampedPoint distanceTo: aPoint ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> distanceToX: aPoint [ "Compute the horizontal distance from my closest edge to a provided x coordinate of a point both given in my parent coordinates" @@ -1447,7 +1445,7 @@ BlElement >> distanceToX: aPoint [ ^ (aClampedCoordinate - aPoint x) abs ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> distanceToY: aPoint [ "Compute the vertical distance from my closest edge to a provided y coordinate of a point both given in my parent coordinates" @@ -1459,7 +1457,7 @@ BlElement >> distanceToY: aPoint [ ^ (aClampedCoordinate - aPoint y) abs ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> effect [ "Return currently applied effect. Note: I return an instance of BlNullEffect when there is no effect applied. @@ -1469,7 +1467,7 @@ BlElement >> effect [ ^ visuals effect ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> effect: aBlEffect [ "Change my effect to a given one requesting draw area invalidations. anEffect must not be nil but an instance of subclasses of BlEffect." @@ -1480,37 +1478,37 @@ BlElement >> effect: aBlEffect [ self invalidate. ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> effectBounds [ ^ (self effectBounds: BlBounds new) asRectangle ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> effectBounds: aBlBounds [ ^ self effect effectBounds: aBlBounds of: self ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElement >> elementId [ ^ self userData at: #elementId ifAbsent: [ BlElementId noId ] ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElement >> elementId: aBlElementId [ self userData at: #elementId put: aBlElementId ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> elevation [ ^ visuals elevation ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> elevation: aBlElevation [ visuals := visuals elevation: aBlElevation. @@ -1520,7 +1518,7 @@ BlElement >> elevation: aBlElevation [ ifTrue: [ self parent invalidate ] ] -{ #category : 'api - tasks' } +{ #category : #'api - tasks' } BlElement >> enqueueTask: aBlTask [ "Queue the supplied task to be executed in the next frame. If you want the task executed in the UI process as soon as possible, use #inUIProcessDo:. @@ -1532,14 +1530,14 @@ BlElement >> enqueueTask: aBlTask [ ifFalse: [ self taskQueue enqueue: aBlTask ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> errorHandler [ ^ errorHandler ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } BlElement >> eventDispatcher [ "Return an object responsible for event dispatching" @@ -1547,7 +1545,7 @@ BlElement >> eventDispatcher [ ^ eventDispatcher ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> extent [ "Return my extent as it was computed during previous layout pass. Extent is a point with `x` component representing my width @@ -1560,7 +1558,7 @@ BlElement >> extent [ ^ self bounds extent ] -{ #category : 'geometry extent' } +{ #category : #'geometry extent' } BlElement >> extent: aPoint [ self deprecated: 'Use size: instead' @@ -1569,7 +1567,7 @@ BlElement >> extent: aPoint [ ^ self size: aPoint ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> findMouseEventTargetAt: aPoint [ "Return the deepest child element among all my children or myself that may be a target for mouse event at provided location. The coordinate point is given in space coordinates. @@ -1604,14 +1602,14 @@ BlElement >> findMouseEventTargetAt: aPoint [ ifFalse: [ nil ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> firstChild [ "return the first child " self hasChildren ifFalse: [ ^ self error: 'Must have at least one child' ]. ^ self children first ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> firstCommonParent: anElement ifFound: aFoundBlock ifNone: aNoneBlock [ "Find the first common parent of a receiver and a given element. Evaluate aFoundBlock with that parent if there is one and aNoneBlock otherwise" @@ -1629,14 +1627,14 @@ BlElement >> firstCommonParent: anElement ifFound: aFoundBlock ifNone: aNoneBloc ^ aNoneBlock value ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> focusability [ ^ visuals focusability ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> focusability: aFocusability [ self focusability = aFocusability ifTrue: [ ^ self ]. @@ -1644,7 +1642,7 @@ BlElement >> focusability: aFocusability [ visuals := visuals focusability: aFocusability ] -{ #category : 'focus accessing' } +{ #category : #'focus accessing' } BlElement >> focusables: aBlFocusFinderCandidates along: aBlFocusSearchDirection [ "Add focusable elements that are descendants of this element (possibly including me) to anOrderedCollection depending on my focusability strategy" @@ -1655,24 +1653,24 @@ BlElement >> focusables: aBlFocusFinderCandidates along: aBlFocusSearchDirection of: self ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElement >> focused [ ^ visuals focused ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElement >> focused: aBoolean [ visuals := visuals focused: aBoolean ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> focusedBounds [ ^ (self focusedBounds: BlBounds new) asRectangle ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> focusedBounds: aBlBounds [ "Store my focused area in the given bounds and return it. Focused area is used to search next focusable element. By default focused bounds property @@ -1683,7 +1681,7 @@ BlElement >> focusedBounds: aBlBounds [ ^ self boundsInLocal: aBlBounds ] -{ #category : 'focus accessing' } +{ #category : #'focus accessing' } BlElement >> focusedChild [ "Return my direct child that is focused or contains a focused child, if any. The child may have or contain focus. I may return nil of there is no such child" @@ -1694,7 +1692,7 @@ BlElement >> focusedChild [ ifNone: [ nil ] ] -{ #category : 'layout utilities' } +{ #category : #'layout utilities' } BlElement >> forceLayout [ "Do not use me, I am a private / debug utility method to force layout computation. The main usage of this method is for testing purposes where we want to update layout @@ -1706,7 +1704,7 @@ BlElement >> forceLayout [ self topMostParent computeLayout ] -{ #category : 'layout utilities' } +{ #category : #'layout utilities' } BlElement >> forceLocalLayout [ "Use me with care only if you know what you are doing. See #forceLayout comment to understand the context and why I can be problematic." @@ -1714,7 +1712,7 @@ BlElement >> forceLocalLayout [ self computeLayout ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> geometry [ "Return my geometry used to clip/fill/stroke me and to clip my children during rendering. geometry can not be nil." @@ -1723,7 +1721,7 @@ BlElement >> geometry [ ^ visuals geometry ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> geometry: aBlGeometry [ "clean the cache of the old geometry" @@ -1743,12 +1741,12 @@ BlElement >> geometry: aBlGeometry [ self requestLayout ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> geometryBounds [ ^ boundsCache geometryBounds ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> geometryBounds: aBlBounds [ "I load my geometry bounds in a given mutable rectangle and return provided one. By default it is nothing else than a rectangle with origin point set to @@ -1759,7 +1757,7 @@ BlElement >> geometryBounds: aBlBounds [ ^ self geometry geometryBounds: aBlBounds of: self ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> geometryBoundsInSpace [ "Return bounds of my geometry in space coordinates. Note, that geometry bounds may differ from #boundsInSpace for the case of non-trivial geometry. @@ -1770,7 +1768,7 @@ BlElement >> geometryBoundsInSpace [ ^ boundsCache geometryBoundsInSpace ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> geometryBoundsInSpace: aBlBounds [ self geometryBounds: aBlBounds. @@ -1778,7 +1776,7 @@ BlElement >> geometryBoundsInSpace: aBlBounds [ ^ aBlBounds ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> globalBoundsToLocal: aBounds [ "In-place transform bounds from global space coordinates to local coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -1800,7 +1798,7 @@ BlElement >> globalBoundsToLocal: aBounds [ ^ aBounds ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> globalBoundsToMine: aBlBounds fromParent: aParentElement [ "In-place transform provided bounds from coordinate system of a given parent to my local coordinates and return a result" @@ -1828,7 +1826,7 @@ BlElement >> globalBoundsToMine: aBlBounds fromParent: aParentElement [ ^ aBlBounds ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> globalPointToChildren: aPoint [ "Transform a given point from the coordinates of my top most parent to my children coordinates" @@ -1836,7 +1834,7 @@ BlElement >> globalPointToChildren: aPoint [ ^ self localPointToChildren: (self globalPointToLocal: aPoint) ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> globalPointToLocal: aPoint [ "Transform a given point from the coordinates of my root most parent to my local coordinates" @@ -1849,7 +1847,7 @@ BlElement >> globalPointToLocal: aPoint [ ^ self parentPointToLocal: pt ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> globalPointToParent: aPoint [ "Transform a given point from the coordinates of my root most parent to my parent's coordinates" @@ -1859,7 +1857,7 @@ BlElement >> globalPointToParent: aPoint [ ifFalse: [ aPoint ] ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> globalPointToParentChildren: aPoint [ "Transform a given point from the coordinates of my top most parent to my parent's children coordinates" @@ -1872,7 +1870,7 @@ BlElement >> globalPointToParentChildren: aPoint [ ^ pt ] -{ #category : 'geometry transform' } +{ #category : #'geometry transform' } BlElement >> globalScale [ "Return a scale factor from " @@ -1887,7 +1885,7 @@ BlElement >> globalScale [ ^ (aGlobalOrigin distanceTo: aGlobalCorner) / (anOrigin distanceTo: aCorner) ] -{ #category : 'children testing' } +{ #category : #'children testing' } BlElement >> hasAnyInParentChain: aCollection [ "Return true if any one in the given collection in my parent chain (including myself) " @@ -1896,14 +1894,14 @@ BlElement >> hasAnyInParentChain: aCollection [ ^ aCollection anySatisfy: [ :e | self hasInParentChain: e ] ] -{ #category : 'children testing' } +{ #category : #'children testing' } BlElement >> hasChild: anElement [ ^ anElement parent == self ] -{ #category : 'children testing' } +{ #category : #'children testing' } BlElement >> hasChildren [ "Return true if I have at least one direct child, false otherwise" @@ -1912,13 +1910,13 @@ BlElement >> hasChildren [ ^ self children notEmpty ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> hasCompositionLayer [ ^ self compositionLayer isNotNil and: [ self compositionLayer isValid ] ] -{ #category : 'focus testing' } +{ #category : #'focus testing' } BlElement >> hasFocus [ "Return true if an element is focused or contains a focused element, false otherwise" @@ -1927,7 +1925,7 @@ BlElement >> hasFocus [ self children anySatisfy: [ :anElement | anElement hasFocus ] ] ] -{ #category : 'focus testing' } +{ #category : #'focus testing' } BlElement >> hasFocusable [ "Returns true if I am focusable or if I contain a reachable child for which #hasFocusable returns true, false otherwise" @@ -1937,7 +1935,7 @@ BlElement >> hasFocusable [ self children anySatisfy: [ :anElement | anElement hasFocusable ] ] ] -{ #category : 'children testing' } +{ #category : #'children testing' } BlElement >> hasInParentChain: anElement [ "Return true if I have a given element in my parent chain, or if I am anElement " @@ -1945,7 +1943,7 @@ BlElement >> hasInParentChain: anElement [ ^ anElement = self or: [ self hasParent: anElement ] ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } BlElement >> hasNextEventTarget [ "Return true if this event target has a logical successor within a dispatch chain. For example, in case of visual components next event target is a parent, meaning @@ -1956,14 +1954,14 @@ BlElement >> hasNextEventTarget [ ^ self hasParent ] -{ #category : 'children testing' } +{ #category : #'children testing' } BlElement >> hasOwner [ ^ self hasParent ] -{ #category : 'children testing' } +{ #category : #'children testing' } BlElement >> hasParent [ "Return true if I have a parent, otherwise false. Being added as direct child to other element does not necessary @@ -1973,7 +1971,7 @@ BlElement >> hasParent [ ^ self parent isNotNil ] -{ #category : 'children testing' } +{ #category : #'children testing' } BlElement >> hasParent: anElement [ "Return true if I have a given element in my parent chain, false otherwise" @@ -1985,12 +1983,12 @@ BlElement >> hasParent: anElement [ ^ false ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> height [ ^ self extent y ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> height: aNumber [ | aLayoutConstraints | @@ -2004,7 +2002,7 @@ BlElement >> height: aNumber [ c vertical exact: aNumber ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> id [ "Return an id of this element if it was defined" @@ -2012,14 +2010,14 @@ BlElement >> id [ ^ self elementId asSymbol ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> id: aStringOrSymbol [ "Give this element an id which can be used to query this element" self elementId: aStringOrSymbol asBlocElementId ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> ignoreRequestLayoutDuring: aBlock [ | wasIgnored | @@ -2031,7 +2029,7 @@ BlElement >> ignoreRequestLayoutDuring: aBlock [ ifFalse: [ flags clearShouldIgnoreLayoutRequests ] ] ] -{ #category : 'api - space' } +{ #category : #'api - space' } BlElement >> inSpace [ "Add self to a new BlSpace. Answer such space." | sp | @@ -2041,7 +2039,7 @@ BlElement >> inSpace [ ] -{ #category : 'processing' } +{ #category : #processing } BlElement >> inUIProcessDo: aBlock [ "Run the supplied block in the UI process. If the active process is already the UI process, evaluate immediately. @@ -2059,7 +2057,7 @@ BlElement >> inUIProcessDo: aBlock [ yourself) ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> initialize [ super initialize. @@ -2091,12 +2089,12 @@ BlElement >> initialize [ errorHandler := self defaultErrorHandler ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> insets [ ^ self padding ] -{ #category : 'change reporting' } +{ #category : #'change reporting' } BlElement >> invalidRect: aBlBounds [ "Invalidate a dirty rectangle of the display. The bounds must be given in my own coordinates." @@ -2104,7 +2102,7 @@ BlElement >> invalidRect: aBlBounds [ self invalidRect: aBlBounds from: self ] -{ #category : 'change reporting' } +{ #category : #'change reporting' } BlElement >> invalidRect: aBlBounds from: anElement [ "Translate dirty reports from an Element. A rectangle is given in my own coordinates" @@ -2119,7 +2117,7 @@ BlElement >> invalidRect: aBlBounds from: anElement [ ifFalse: [ self space invalidRect: aBlBounds from: anElement ] ] -{ #category : 'change reporting' } +{ #category : #'change reporting' } BlElement >> invalidate [ "I mark my bounds as damaged area that should be redrawn on next rendering pass. Note, that #invalidate might be sent frequently, so keep implementation simple and performant. @@ -2133,7 +2131,7 @@ BlElement >> invalidate [ self markNeedsPaintFrom: self ] -{ #category : 'change reporting' } +{ #category : #'change reporting' } BlElement >> invalidateAfterRelocateFrom: aPreviousPosition to: aNewPosition [ "Invalidate due to relocation by a given offset" @@ -2145,19 +2143,19 @@ BlElement >> invalidateAfterRelocateFrom: aPreviousPosition to: aNewPosition [ self hasParent ifTrue: [ self parent invalidate ] ] -{ #category : 'api - look' } +{ #category : #'api - look' } BlElement >> invalidateChildren [ self childrenDo: [ :each | each invalidate ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> invalidationBounds [ ^ boundsCache invalidationBounds ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> invalidationBounds: aBounds [ "Compute the bounds of self, including my children recursively, in my local coordinates that would be invalidated if #invalidate would be sent to me." @@ -2176,14 +2174,14 @@ BlElement >> invalidationBounds: aBounds [ ^ anInvalidationBounds ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> invalidationBoundsInSpace [ ^ self localBoundsToGlobal: (BlBounds fromRectangle: self invalidationBounds) ] -{ #category : 'api - space' } +{ #category : #'api - space' } BlElement >> isAttachedToSceneGraph [ "Return true if I am inside of a scene graph, e.g. I have a space's root element as my top-most parent, false otherwise" @@ -2192,7 +2190,7 @@ BlElement >> isAttachedToSceneGraph [ ^ spaceReference isAttachedToSceneGraph ] -{ #category : 'api - space' } +{ #category : #'api - space' } BlElement >> isDetachedFromSceneGraph [ "Return true if I am detached from the scene graph" @@ -2200,14 +2198,14 @@ BlElement >> isDetachedFromSceneGraph [ ^ spaceReference isDetachedFromSceneGraph ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> isFirstChild [ "return true if the receiver is the first child of its parent" self hasParent ifFalse: [ ^ self error: 'Must have a parent' ]. ^ (self parent childIndexOf: self) = 1 ] -{ #category : 'focus testing' } +{ #category : #'focus testing' } BlElement >> isFocusable [ "Return true if I am able to take focus, false otherwise" @@ -2218,7 +2216,7 @@ BlElement >> isFocusable [ and: [ self focusability ~= BlFocusability ignore ] ] ] ] -{ #category : 'focus testing' } +{ #category : #'focus testing' } BlElement >> isFocused [ "Returns true if I am focused, false otherwise. Note: It is possible that an element has focus but is not focused by itself" @@ -2227,7 +2225,7 @@ BlElement >> isFocused [ ^ self focused ] -{ #category : 'testing' } +{ #category : #testing } BlElement >> isFullyVisibleInSpace [ "Return true if I am in fully visible in the area of a space (window), false otherwise. Note, that this visibility is computed only based on bounds. @@ -2242,14 +2240,14 @@ BlElement >> isFullyVisibleInSpace [ ^ intersection asRectangle = myBounds ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> isLastChild [ "return true if the receiver is the first child of its parent" self hasParent ifFalse: [ ^ self error: 'Must have a parent' ]. ^ (self parent childIndexOf: self) = self parent children size ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> isLayoutBoundary [ "Return true if I am a layout boundary, e.g. the layout recomputation requests should not be propagated up in the hierarchy. Imagine an element matches parent in both directions or has a fixed size, in this case even if my children request layout update @@ -2260,7 +2258,7 @@ BlElement >> isLayoutBoundary [ and: [ self constraints vertical resizer isExact or: [ self constraints vertical resizer isMatchParent ] ] ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> isLayoutRequested [ "Indicates whether or not this elements's layout will be requested during the next hierarchy layout pass. Return true if the layout will be forced during next layout pass, false otherwise" @@ -2269,7 +2267,7 @@ BlElement >> isLayoutRequested [ ^ flags hasNeedsLayout ] -{ #category : 'testing' } +{ #category : #testing } BlElement >> isOpaque [ "Return true if I am completely opaque (my opacity is 1)" @@ -2277,7 +2275,7 @@ BlElement >> isOpaque [ ^ self opacity = 1.0 ] -{ #category : 'api - space' } +{ #category : #'api - space' } BlElement >> isRemovedFromSceneGraph [ "Return true if I am not in the scene graph" @@ -2285,7 +2283,7 @@ BlElement >> isRemovedFromSceneGraph [ ^ spaceReference isNull ] -{ #category : 'testing' } +{ #category : #testing } BlElement >> isRoot [ "Return true if I am a root element of a space, false otherwise" @@ -2293,7 +2291,7 @@ BlElement >> isRoot [ ^ self isAttachedToSceneGraph and: [ self space root = self ] ] -{ #category : 'testing' } +{ #category : #testing } BlElement >> isTranslucent [ "Return true if I am semi-transparent (opacity is 0 < opacity < 1)" @@ -2301,7 +2299,7 @@ BlElement >> isTranslucent [ ^ self opacity > 0 and: [ self opacity < 1 ] ] -{ #category : 'testing' } +{ #category : #testing } BlElement >> isTransparent [ "Return true if I am completely transparent (my opacity is 0)" @@ -2309,7 +2307,7 @@ BlElement >> isTransparent [ ^ self opacity isZero ] -{ #category : 'testing' } +{ #category : #testing } BlElement >> isVisible [ "Return true if I should be visible, false otherwise. Note, that I am not the same as isTransparent/isOpaque, those @@ -2320,7 +2318,7 @@ BlElement >> isVisible [ ^ self visibility isVisible ] -{ #category : 'testing' } +{ #category : #testing } BlElement >> isVisibleInSpace [ "Return true if I am in a visible area of a space (window), false otherwise. Note, that this visibility is computed only based on bounds. @@ -2332,7 +2330,7 @@ BlElement >> isVisibleInSpace [ self bounds inSpace bounds intersects: (0@0 extent: self space extent) ] ]. ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> labeled: aString [ self id: aString asSymbol ] @@ -2351,7 +2349,7 @@ BlElement >> layout [ ^ layout ] -{ #category : 'api - layout' } +{ #category : #'api - layout' } BlElement >> layout: aBlLayout [ "Change my current layout to a given one, instance of subclasses of BlLayout. After the layout change I request the layout recomputation. @@ -2368,7 +2366,7 @@ BlElement >> layout: aBlLayout [ self requestLayout ] -{ #category : 'api - layout' } +{ #category : #'api - layout' } BlElement >> layoutDo: aBlock [ "Perform aBlock with my layout as argument. Nite: After evaluation I request a layout update. @@ -2379,7 +2377,7 @@ BlElement >> layoutDo: aBlock [ self requestLayout ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> localBoundsToChildren: aBounds [ "In-place transform bounds from my local coordinates to my childrens' coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -2390,7 +2388,7 @@ BlElement >> localBoundsToChildren: aBounds [ ^ aBounds ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> localBoundsToGlobal: aBounds [ "In-place transform bounds from local coordinates to global space coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -2412,7 +2410,7 @@ BlElement >> localBoundsToGlobal: aBounds [ ^ aBounds ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> localBoundsToMine: aBlBounds fromChild: anElement [ "In-place transform provided bounds from coordinate system of a given descendant element to my local coordinates and return a result" @@ -2429,7 +2427,7 @@ BlElement >> localBoundsToMine: aBlBounds fromChild: anElement [ ^ aBlBounds ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> localBoundsToParent: aBounds [ "In-place transform bounds from local coordinates to my parent's coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -2450,7 +2448,7 @@ BlElement >> localBoundsToParent: aBounds [ ^ aBounds ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> localBoundsToWindow: aBounds [ "In-place transform bounds from local coordinates to device window coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -2472,7 +2470,7 @@ BlElement >> localBoundsToWindow: aBounds [ ^ aBounds ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> localPointToChildren: aPoint [ "Transform a given point from my local coordinates to the local coordinates of my children." @@ -2480,7 +2478,7 @@ BlElement >> localPointToChildren: aPoint [ ^ aPoint ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> localPointToGlobal: aPoint [ "Transform a given point from my local coordinates to the coordinates of the root most parent" @@ -2493,7 +2491,7 @@ BlElement >> localPointToGlobal: aPoint [ ifFalse: [ pt ] ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> localPointToMine: aPoint fromChild: anElement [ "compute a point from provided point from coordinate system of a given descendant element to my local coordinates" @@ -2510,7 +2508,7 @@ BlElement >> localPointToMine: aPoint fromChild: anElement [ ^ pt ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> localPointToParent: aPoint [ "Transform a given point from my local coordinates to local coordinates of my parent. Since this transfortmation does not actually involve my parent, it can be performed @@ -2529,7 +2527,7 @@ BlElement >> localPointToParent: aPoint [ ^ pt ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> looseFocus [ self deprecated: 'Use #loseFocus instead.' @@ -2538,7 +2536,7 @@ BlElement >> looseFocus [ self loseFocus ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> looseFocus: aChildElement [ self deprecated: 'Please use loseFocus: instead.' @@ -2549,7 +2547,7 @@ BlElement >> looseFocus: aChildElement [ self loseFocus: aChildElement ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> loseFocus [ | anElementToLooseFocus | @@ -2566,7 +2564,7 @@ BlElement >> loseFocus [ ifFalse: [ anElementToLooseFocus focused: false ] ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> loseFocus: aChildElement [ "Propagate focus loss up in the scene graph with an original element that looses focus" @@ -2580,7 +2578,7 @@ BlElement >> loseFocus: aChildElement [ ifFalse: [ self space loseFocusFor: aChildElement ] ] -{ #category : 'api - layout' } +{ #category : #'api - layout' } BlElement >> margin [ "Return my current margin - a space outside around my bounds. Layouts that support margin may want to expand children such that there is a space gap around them" @@ -2589,7 +2587,7 @@ BlElement >> margin [ ^ self constraints margin ] -{ #category : 'api - layout' } +{ #category : #'api - layout' } BlElement >> margin: aBlInsets [ self margin = aBlInsets @@ -2597,13 +2595,13 @@ BlElement >> margin: aBlInsets [ self constraintsDo: [ :c | c margin: aBlInsets ] ] -{ #category : 'api - painting' } +{ #category : #'api - painting' } BlElement >> markDoesNotNeedPaint [ flags clearNeedsPaint ] -{ #category : 'api - painting' } +{ #category : #'api - painting' } BlElement >> markNeedsPaintFrom: anElement [ "Make me as dirty and request renderer to re-paint me. anElement is the element from which the re-painting request originates" @@ -2627,7 +2625,7 @@ BlElement >> markNeedsPaintFrom: anElement [ self space markNeedsPaint: self from: anElement ] ] ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> measure: anExtentMeasurementSpec [ @@ -2639,7 +2637,7 @@ BlElement >> measure: anExtentMeasurementSpec [ ^ self measuredExtent ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> measureSafely: anExtentMeasurementSpec [ "Measure my extent based on extent specifications represented by anExtentMeasurementSpec. Subclasses should not override me, instead override onMeasure: @@ -2666,14 +2664,14 @@ BlElement >> measureSafely: anExtentMeasurementSpec [ self onMeasure: anExtentMeasurementSpec ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> measureThatFailed: anExtentMeasurementSpec [ flags clearWaitingLayout. self privatePreviousMeasurementSpec: anExtentMeasurementSpec ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> measuredBounds [ "Return my measured bounds where origin is my current position and extent is measured extent. @@ -2683,7 +2681,7 @@ BlElement >> measuredBounds [ ^ measuredBounds ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> measuredExtent [ "Return my measured extent (as a Point) used during layout by layout strategies. It is being computed during measuring step. @@ -2694,7 +2692,7 @@ BlElement >> measuredExtent [ ^ self measuredBounds extent ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> measuredExtent: anExtentPoint [ "Set newly measured extent (should respect #isBlocFiniteFloatPoint and #isBlocPositivePoint). @see `BlElement>>#measuredExtent` for more info @@ -2703,7 +2701,7 @@ BlElement >> measuredExtent: anExtentPoint [ self measuredBounds extent: anExtentPoint ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> measuredHeight [ "Return my measured height. @see BlElement>>#measuredExtent for more info" @@ -2712,7 +2710,7 @@ BlElement >> measuredHeight [ ^ self measuredBounds height ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> measuredPosition [ "Return my measured position used during layout by layout strategies. It is being computed during measuring step. @@ -2723,7 +2721,7 @@ BlElement >> measuredPosition [ ^ self measuredBounds position ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> measuredWidth [ "Return my measured width. @see BlElement>>#measuredExtent for more info" @@ -2732,43 +2730,43 @@ BlElement >> measuredWidth [ ^ self measuredBounds width ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> mouseCursor [ ^ visuals mouseCursor ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> mouseCursor: aCursor [ visuals := visuals mouseCursor: aCursor ] -{ #category : 'api - painting' } +{ #category : #'api - painting' } BlElement >> needsPaint [ "Return true if I am marked as dirty and am waiting to be re-painted" ^ flags hasNeedsPaint ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } BlElement >> needsPropertiesComputation [ ^ self properties needsPropertiesComputation ] -{ #category : 'api - style' } +{ #category : #'api - style' } BlElement >> needsStyle [ ^ self styles needsStyle ] -{ #category : 'converting' } +{ #category : #converting } BlElement >> newScrollableParent [ ^ BlScrollableElement new ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } BlElement >> nextEventTarget [ "Return next event target that should be contained in dispatch chain. Bloc elements build a composition tree, so we want my parent plays a role of the next @@ -2778,7 +2776,7 @@ BlElement >> nextEventTarget [ ^ self parent ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> nextSiblingDo: aBlock [ "Evaluate aBlock with the next child in my parent after me if there is one" ^ self @@ -2786,7 +2784,7 @@ BlElement >> nextSiblingDo: aBlock [ do: aBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> nextSiblingSuchThat: aSelectionBlock do: aBlock [ "Evaluate aBlock with the next child in my parent that satisfies aSelectionBlock after me if there is one" @@ -2805,7 +2803,7 @@ BlElement >> nextSiblingSuchThat: aSelectionBlock do: aBlock [ ifTrue: [ ^ aBlock value: aSiblingChild ] ] ] -{ #category : 'geometry hooks' } +{ #category : #'geometry hooks' } BlElement >> notifyExtentChanged [ "Notify element event listeners that my extent changed. Custom event handlers should subscribe to BlElementExtentChangedEvent" @@ -2813,7 +2811,7 @@ BlElement >> notifyExtentChanged [ self eventDispatcher dispatchExtentChanged ] -{ #category : 'geometry hooks' } +{ #category : #'geometry hooks' } BlElement >> notifyPositionChanged [ "Notify element event listeners that my position within a parent changed. Custom event handlers should subscribe to BlElementPositionChangedEvent" @@ -2821,7 +2819,7 @@ BlElement >> notifyPositionChanged [ self eventDispatcher dispatchPositionChanged ] -{ #category : 'geometry hooks' } +{ #category : #'geometry hooks' } BlElement >> notifyPositionInSpaceChanged [ "Notify element event listeners that my position in space coordinates changed. Custom event handlers should subscribe to BlElementPositionInSpaceChangedEvent" @@ -2829,14 +2827,14 @@ BlElement >> notifyPositionInSpaceChanged [ self eventDispatcher dispatchPositionInSpaceChanged ] -{ #category : 'hooks - children' } +{ #category : #'hooks - children' } BlElement >> onAddedToParent [ "I am sent after I am added to other element which is my direct parent now. You can access my parent by sending #parent to myself. Note: Always send onAddedToParent to super class if you override me!" ] -{ #category : 'hooks - children' } +{ #category : #'hooks - children' } BlElement >> onAddedToSceneGraph [ "Sent after one of my parents or I was added to scene graph, e.g. root element. At this point #isAttachedToSceneGraph results in true. @@ -2849,19 +2847,19 @@ BlElement >> onAddedToSceneGraph [ self eventDispatcher dispatchAddedToSceneGraph ] -{ #category : 'hooks - children' } +{ #category : #'hooks - children' } BlElement >> onChildAdded: anElement [ "I am sent after anElement was added to me as my direct child. Note: Always send onChildAdded: to super class if you override me!" ] -{ #category : 'hooks - children' } +{ #category : #'hooks - children' } BlElement >> onChildRemoved: anElement [ "I am sent after anElement was ramoved from me and is no longer my direct child. Note: Always send onChildRemoved: to super class if you override me!" ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlElement >> onChildToBeRemoved: anElement [ "Is sent right before a given child element is about to be removed" @@ -2877,7 +2875,7 @@ BlElement >> onChildToBeRemoved: anElement [ aPreviousFocusOwner focused: true ]. ] -{ #category : 'hooks - geometry' } +{ #category : #'hooks - geometry' } BlElement >> onExtentChanged [ "Is sent when my extent changed" @@ -2896,7 +2894,7 @@ BlElement >> onExtentChanged [ self notifyExtentChanged ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> onLayout: aBounds context: aBlElementBoundsUpdateContext [ "I am sent then and only then when my extent changed as the result of a layout" "By default let layout strategy do the layouting job. @@ -2907,7 +2905,7 @@ BlElement >> onLayout: aBounds context: aBlElementBoundsUpdateContext [ self layout layout: self in: aBounds context: aBlElementBoundsUpdateContext ] -{ #category : 'hooks - layout' } +{ #category : #'hooks - layout' } BlElement >> onLayoutDone [ "Is sent after layout is completely computed. All layout changes done within this hook will be performed during the next frame. @@ -2916,7 +2914,7 @@ BlElement >> onLayoutDone [ self eventDispatcher dispatchLayoutComputed ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> onMeasure: anExtentMeasurementSpec [ "By default let layout strategy do the measuring job. If needed override this method to do some additional @@ -2925,14 +2923,14 @@ BlElement >> onMeasure: anExtentMeasurementSpec [ self layout measure: self with: anExtentMeasurementSpec ] -{ #category : 'hooks - geometry' } +{ #category : #'hooks - geometry' } BlElement >> onPositionChanged [ "Is sent when my position changed within a parent" self notifyPositionChanged ] -{ #category : 'hooks - geometry' } +{ #category : #'hooks - geometry' } BlElement >> onPositionChangedFrom: aPreviousPosition to: aNewPosition [ "Is sent when my position changed within a parent" @@ -2940,7 +2938,7 @@ BlElement >> onPositionChangedFrom: aPreviousPosition to: aNewPosition [ self onPositionChanged ] -{ #category : 'hooks - geometry' } +{ #category : #'hooks - geometry' } BlElement >> onPositionInSpaceChanged [ "Is sent when my position in space changed because I or any of my parents moved. Override me to perform additional actions, always send #onPositionInSpaceChanged super. @@ -2949,14 +2947,14 @@ BlElement >> onPositionInSpaceChanged [ self notifyPositionInSpaceChanged ] -{ #category : 'hooks - children' } +{ #category : #'hooks - children' } BlElement >> onRemovedFromParent: aParentElement [ "I am sent after I was removed from my parent. At this point sending #parent to myself will result in nil. Note: Always send onRemovedFromParent to super class if you override me!" ] -{ #category : 'hooks - children' } +{ #category : #'hooks - children' } BlElement >> onRemovedFromSceneGraph [ "Sent after one of my parents or I was removed from scene graph, e.g. root element. At this point #isAttachedToSceneGraph results in false. @@ -2967,7 +2965,7 @@ BlElement >> onRemovedFromSceneGraph [ self layout onCleanUp: self ] -{ #category : 'hooks - session' } +{ #category : #'hooks - session' } BlElement >> onSessionChanged: aNewSession [ "Is sent when a Session is changed, for example if the program is closed and re-opened. When this happens the external heap memory (FFI Objects) is no longer valid. @@ -2976,7 +2974,7 @@ BlElement >> onSessionChanged: aNewSession [ self childrenDo: [ :eachChild | eachChild onSessionChanged: aNewSession ] ] -{ #category : 'hooks - geometry' } +{ #category : #'hooks - geometry' } BlElement >> onTransformationChanged [ "Is sent when my transformation changed" @@ -2984,7 +2982,7 @@ BlElement >> onTransformationChanged [ self onTransformationInSpaceChanged ] -{ #category : 'hooks - geometry' } +{ #category : #'hooks - geometry' } BlElement >> onTransformationInSpaceChanged [ "Is sent when my transformation in space changed, it may be that my own transformation changed or of my parent" @@ -2992,7 +2990,7 @@ BlElement >> onTransformationInSpaceChanged [ self children do: [ :eachChild | eachChild onTransformationInSpaceChanged ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> opacity [ "Return my transparency degree. @see BlElement>>#opacity: for more information" @@ -3001,7 +2999,7 @@ BlElement >> opacity [ ^ visuals opacity ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> opacity: aNumber [ "Set my opacity and request invalidation. Opacity is a visual property independent from visibility, which also influences layout and event handling. Transparent elements @@ -3031,7 +3029,7 @@ BlElement >> opacity: aNumber [ self invalidate ] -{ #category : 'convenience' } +{ #category : #convenience } BlElement >> openInNewSpace [ "Add self to a new BlSpace and show it. Answer such space." @@ -3042,7 +3040,7 @@ BlElement >> openInNewSpace [ ^ aSpace ] -{ #category : 'convenience' } +{ #category : #convenience } BlElement >> openInOBlSpace [ "Add self to a new BlSpace and show it. Answer such space." @@ -3054,7 +3052,7 @@ BlElement >> openInOBlSpace [ ] -{ #category : 'convenience' } +{ #category : #convenience } BlElement >> openInSpace [ "Add self to a new BlSpace and show it. Answer such space." | sp | @@ -3064,19 +3062,19 @@ BlElement >> openInSpace [ ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> outsets [ ^ self margin ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> outskirts [ ^ visuals outskirts ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> outskirts: aBlOutskirts [ "Change my outskirts - the way the border is interpreted. See BlOutskirts for more information" @@ -3089,14 +3087,14 @@ BlElement >> outskirts: aBlOutskirts [ self invalidate ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> owner [ ^ self parent ] -{ #category : 'api - layout' } +{ #category : #'api - layout' } BlElement >> padding [ "Return my current padding - a space inside of me around my content. Layouts that support padding may want to offset children such that they are within my bounds inset by padding" @@ -3105,7 +3103,7 @@ BlElement >> padding [ ^ self constraints padding ] -{ #category : 'api - layout' } +{ #category : #'api - layout' } BlElement >> padding: aBlInsets [ self padding = aBlInsets @@ -3114,18 +3112,18 @@ BlElement >> padding: aBlInsets [ self constraintsDo: [ :c | c padding: aBlInsets ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> parent [ ^ parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> parent: anElement [ parent := anElement ] -{ #category : 'geometry bounds convertion' } +{ #category : #'geometry bounds convertion' } BlElement >> parentBoundsToLocal: aBounds [ "In-place transform bounds from my parent's coordinates to local coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -3146,7 +3144,7 @@ BlElement >> parentBoundsToLocal: aBounds [ ^ aBounds ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> parentDo: aBlock [ "Evaluate a block with my direct parent as an argument If I don't have a parent - does nothing" @@ -3155,7 +3153,7 @@ BlElement >> parentDo: aBlock [ ^ aBlock value: self parent ] -{ #category : 'geometry position convertion' } +{ #category : #'geometry position convertion' } BlElement >> parentPointToLocal: aPoint [ "Transform a given point from parent to my local coordinates" @@ -3170,14 +3168,14 @@ BlElement >> parentPointToLocal: aPoint [ ^ aLocalPoint ] -{ #category : 'geometry position' } +{ #category : #'geometry position' } BlElement >> position [ ^ self bounds position ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> position: aPoint [ "Request position change in parent coordinates that will happen on the next frame or next layout pass triggered by #forceLayout. @@ -3197,7 +3195,7 @@ BlElement >> position: aPoint [ self requestParentLayout ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> position: aPosition extent: anExtent context: aBlElementBoundsUpdater [ "I do the hard work of changing my position and extent. @@ -3239,7 +3237,7 @@ BlElement >> position: aPosition extent: anExtent context: aBlElementBoundsUpdat boundsCache invalidateBoundsInLocal ] -{ #category : 'geometry position' } +{ #category : #'geometry position' } BlElement >> positionInSpace [ "Return my position in space coordinates. Note: If I don't have a parent I return position that was previously set by #relocate:" @@ -3248,14 +3246,14 @@ BlElement >> positionInSpace [ ^ self localPointToGlobal: 0@0 ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> preventChildrenMouseEvents [ "Prevent my children from receiving mouse events" flags clearShouldChildrenHandleMouseEvents ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> preventMeAndChildrenMouseEvents [ "Prevent me and my children from receiving mouse events" @@ -3263,7 +3261,7 @@ BlElement >> preventMeAndChildrenMouseEvents [ flags clearShouldChildrenHandleMouseEvents ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> preventMouseEvents [ "Prevent *me* from handling mouse events. It does not influence the ability of the children to handle events, hence I am a local property" @@ -3271,13 +3269,13 @@ BlElement >> preventMouseEvents [ flags clearShouldHandleMouseEvents. ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> preventMousePickOutsideEvent [ self userData at: #shouldHandleMousePickOutsideEvent put: false ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> previousSiblingDo: aBlock [ "Evaluate aBlock with the previous child in my parent before me if there is one" @@ -3286,7 +3284,7 @@ BlElement >> previousSiblingDo: aBlock [ do: aBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> previousSiblingSuchThat: aSelectionBlock do: aBlock [ "Evaluate aBlock with the previous child in my parent that satisfies aSelectionBlock after me if there is one" @@ -3305,7 +3303,7 @@ BlElement >> previousSiblingSuchThat: aSelectionBlock do: aBlock [ ifTrue: [ ^ aBlock value: aSiblingChild ] ] ] -{ #category : 'printing' } +{ #category : #printing } BlElement >> printOn: aStream [ aStream nextPutAll: self class name; @@ -3321,21 +3319,21 @@ BlElement >> printOn: aStream [ nextPut: $) ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> privatePreviousMeasurementSpec [ ^ self userData at: #blocPreviousMeasurementSpec ifAbsent: [ nil ] ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> privatePreviousMeasurementSpec: anObject [ self userData at: #blocPreviousMeasurementSpec put: anObject ] -{ #category : 'private - layout' } +{ #category : #'private - layout' } BlElement >> privateRequestingLayout: aBoolean [ aBoolean ifTrue: [ flags addWaitingLayout ] @@ -3350,7 +3348,7 @@ BlElement >> privateRequestingLayout: aBoolean [ ifFalse: [ flags clearNeedsLayout ] ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } BlElement >> properties [ ^ self userData @@ -3361,7 +3359,7 @@ BlElement >> properties [ yourself ] ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> relocate: aPoint [ self @@ -3370,7 +3368,7 @@ BlElement >> relocate: aPoint [ self position: aPoint ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChild: anElement [ "Request layout and redraw an area occupied by anElement. As result anElement sends BlElementRemovedEvent @@ -3391,7 +3389,7 @@ BlElement >> removeChild: anElement [ self requestLayout. ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChild: anElement in: aContainerName [ self @@ -3400,7 +3398,7 @@ BlElement >> removeChild: anElement in: aContainerName [ ifNone: [ self error: 'Container named ', aContainerName asString, ' is not found!' ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChildAt: anIndex [ "Remove my direct child at a specified index. Request layout and redraw an area occupied by anElement. @@ -3425,7 +3423,7 @@ BlElement >> removeChildAt: anIndex [ self requestLayout ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChildNamed: aContainerName [ self @@ -3435,7 +3433,7 @@ BlElement >> removeChildNamed: aContainerName [ self removeChildWithId: aContainerName ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChildWithId: aStringOrSymbol [ self @@ -3444,7 +3442,7 @@ BlElement >> removeChildWithId: aStringOrSymbol [ ifNone: [ "do nothing, no need to raise an exception" ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChildren [ | oldChildren | "Remove all my direct children, request layout update and redraw." @@ -3471,7 +3469,7 @@ BlElement >> removeChildren [ self requestLayout ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChildren: aListOfElements [ "Remove all elements listed in aListOfElements from my direct children. All elements must be my direct children (i.e., anElement parent == self). @@ -3491,7 +3489,7 @@ BlElement >> removeChildren: aListOfElements [ self requestLayout ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeChildrenIn: aContainerName [ self @@ -3500,7 +3498,7 @@ BlElement >> removeChildrenIn: aContainerName [ ifNone: [ self error: 'Container named ', aContainerName asString, ' is not found!' ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeDetachedChild: anElement [ "Finish the removal of a detached child. I will dispatch the remove event and notify the hierarchy changes. I am intended to be lightweight and make no assumptions about whether the parent or child should be redrawn. @@ -3513,7 +3511,7 @@ BlElement >> removeDetachedChild: anElement [ self dispatchChildRemoved: anElement ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> removeFromParent [ "Remove me from parent if I have one" @@ -3523,7 +3521,7 @@ BlElement >> removeFromParent [ self parent removeChild: self ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> replaceChild: aChildElement with: anotherElement [ "Replace a given child element with another element preserving the children order. Request layout and redraw an area occupied by anElement. @@ -3544,7 +3542,7 @@ BlElement >> replaceChild: aChildElement with: anotherElement [ ifNil: [ self addChild: anotherElement at: aChildIndex ] ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> replaceChild: aChildElement with: anotherElement as: aSymbol [ "Replace a given child element with another element preserving the children order. Request layout and redraw an area occupied by aChildElement. @@ -3559,7 +3557,7 @@ BlElement >> replaceChild: aChildElement with: anotherElement as: aSymbol [ self addChild: anotherElement at: aChildIndex as: aSymbol ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> requestFocus [ "Request a focus for this element. If I am not added to the scene graph mark me as focused in order to re-try focus @@ -3568,7 +3566,7 @@ BlElement >> requestFocus [ self requestFocusDueTo: BlFocusUnknownReason uniqueInstance ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> requestFocus: aChildElement [ "Propagate focus request up in the scene graph with an original element that requested focus" @@ -3576,7 +3574,7 @@ BlElement >> requestFocus: aChildElement [ self requestFocus: aChildElement dueTo: BlFocusUnknownReason uniqueInstance ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> requestFocus: aChildElement dueTo: aFocusReason [ "Propagate focus request up in the scene graph with an original element that requested focus" @@ -3590,7 +3588,7 @@ BlElement >> requestFocus: aChildElement dueTo: aFocusReason [ ifFalse: [ self space requestFocusFor: aChildElement dueTo: aFocusReason ] ] -{ #category : 'focus requesting' } +{ #category : #'focus requesting' } BlElement >> requestFocusDueTo: aFocusReason [ "Request a focus for this element. If I am not added to the scene graph mark me as focused in order to re-try focus @@ -3604,7 +3602,7 @@ BlElement >> requestFocusDueTo: aFocusReason [ ifFalse: [ self focused: true ] ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> requestLayout [ "Request invalidation of layout on next space pulse @see #requestLayout: for more information" @@ -3612,7 +3610,7 @@ BlElement >> requestLayout [ self requestLayout: self ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> requestLayout: aSourceElement [ "Request invalidation of layout on next space pulse originally emitted by a given element. @@ -3646,7 +3644,7 @@ BlElement >> requestLayout: aSourceElement [ ifNotNil: [ :aSpace | aSpace requestNextPulse ] ] ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> requestParentLayout [ "Request invalidation of my parent's (if I have one) layout on next space pulse" @@ -3657,7 +3655,7 @@ BlElement >> requestParentLayout [ self parent requestLayout ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } BlElement >> requestPropertiesComputation [ self properties markDirty. @@ -3666,7 +3664,7 @@ BlElement >> requestPropertiesComputation [ ifFalse: [ ]. ] -{ #category : 'api - style' } +{ #category : #'api - style' } BlElement >> requestStyle [ self styles markDirty. @@ -3675,7 +3673,7 @@ BlElement >> requestStyle [ ifFalse: [ ]. ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> requestedHeight [ " return the exact height. Use it only if you know what your are doing. see BlElement>>requestedSize comment" @@ -3683,7 +3681,7 @@ BlElement >> requestedHeight [ ^ self constraints requestedHeightIn: self ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> requestedSize [ "Normally, one shoud wait for the layouting to measure myself exactly. @@ -3696,7 +3694,7 @@ BlElement >> requestedSize [ ^ self constraints requestedSizeIn: self ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> requestedWidth [ " return the exact width. Use it only if you know what your are doing. see BlElement>>requestedSize comment" @@ -3704,12 +3702,12 @@ BlElement >> requestedWidth [ ^ self constraints requestedWidthIn: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlElement >> resetChildrenArray [ children := Bloc preferableChildrenDataStructure new ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> selectChildrenWithId: aStringOrSymbol [ | targetId | @@ -3720,7 +3718,7 @@ BlElement >> selectChildrenWithId: aStringOrSymbol [ aChild id = targetId ifTrue: [ stream nextPut: aChild ] ] ] ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> shouldChildrenHandleMouseEvents [ "Return true if my children are allowed to handle mouse events. Preventing my children from handling mouse event does not stop me from handling them" @@ -3729,7 +3727,7 @@ BlElement >> shouldChildrenHandleMouseEvents [ ^ flags hasShouldChildrenHandleMouseEvents ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> shouldHandleMouseEvents [ "Return true if I am allowed to handle mouse events. Preventing me from handling mouse event does not stop my children from doing so" @@ -3738,13 +3736,13 @@ BlElement >> shouldHandleMouseEvents [ ^ flags hasShouldHandleMouseEvents ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> shouldHandleMousePickOutsideEvent [ ^ self userData at: #shouldHandleMousePickOutsideEvent ifAbsentPut: [ false ] ] -{ #category : 'api - opening' } +{ #category : #'api - opening' } BlElement >> showSpace: aSpace [ self hasParent ifTrue: [ self parent showSpace: aSpace ] @@ -3754,7 +3752,7 @@ BlElement >> showSpace: aSpace [ ifFalse: [ aSpace show ] ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> siblingsDo: aBlock [ " Evaluate aBlock with all my siblings " @@ -3763,12 +3761,12 @@ BlElement >> siblingsDo: aBlock [ child ~= self ifTrue: [ aBlock value: child ] ] ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> size [ ^ self extent ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> size: aPoint [ | aLayoutConstraints | @@ -3785,7 +3783,7 @@ BlElement >> size: aPoint [ c vertical exact: aPoint y ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> space [ "Return space to which I belong, or nil of I don't belong to any space. Direct reference boosts performance. @@ -3805,7 +3803,7 @@ BlElement >> space [ ^ nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> space: aSpace [ "**I am internal Bloc api, do not use me directly!** Set space to be accessed directly from my multiple methods. @@ -3816,20 +3814,20 @@ BlElement >> space: aSpace [ self childrenDo: [ :each | each space: aSpace ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> spaceDo: aBlock [ self space ifNotNil: aBlock ] -{ #category : 'text input' } +{ #category : #'text input' } BlElement >> startTextInput [ ] -{ #category : 'text input' } +{ #category : #'text input' } BlElement >> startTextInputAtRectangle: aRectangle [ ] -{ #category : 'api - style' } +{ #category : #'api - style' } BlElement >> states [ "Style and properties computation are not used and will be removed" @@ -3840,11 +3838,11 @@ BlElement >> states [ ifAbsentPut: [ BlElementStates new element: self ]" ] -{ #category : 'text input' } +{ #category : #'text input' } BlElement >> stopTextInput [ ] -{ #category : 'api - style' } +{ #category : #'api - style' } BlElement >> style [ self deprecated: 'Please use #styles instead' @@ -3853,7 +3851,7 @@ BlElement >> style [ ^ self styles ] -{ #category : 'api - style' } +{ #category : #'api - style' } BlElement >> styles [ "Return current element styles. See ${class:BlStyles}$ to learn more about styles" @@ -3866,7 +3864,7 @@ BlElement >> styles [ ifAbsentPut: [ BlElementStyles new element: self ]" ] -{ #category : 'layout' } +{ #category : #layout } BlElement >> supportsBaseline [ "Return true if I support baseline alignment" @@ -3874,27 +3872,27 @@ BlElement >> supportsBaseline [ ^ false ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> swapChild: aChildElement with: anotherChildElement [ self swapChildAt: (self childIndexOf: aChildElement) with: (self childIndexOf: anotherChildElement) ] -{ #category : 'children add/remove' } +{ #category : #'children add/remove' } BlElement >> swapChildAt: aChildIndex with: anotherChildIndex [ self children swapAt: aChildIndex with: anotherChildIndex. self requestLayout ] -{ #category : 'api - tasks' } +{ #category : #'api - tasks' } BlElement >> taskQueue [ ^ taskQueue ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> telemetry [ @@ -3903,7 +3901,7 @@ BlElement >> telemetry [ ifNotNil: [ :aSpace | aSpace telemetry ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> topMostParent [ "Return a topmost parent in a scene graph. A topmost parent is an element that does not have a parent of its own" @@ -3914,7 +3912,7 @@ BlElement >> topMostParent [ ifFalse: [ self ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> topMostParentSuchThat: aConditionBlock ifFound: ifFoundBlock ifNone: ifNoneBlock [ "Find the topmost parent in a scene graph that satisfies a given condition." | aTargetParent | @@ -3930,7 +3928,7 @@ BlElement >> topMostParentSuchThat: aConditionBlock ifFound: ifFoundBlock ifNone ifNotNil: ifFoundBlock ] -{ #category : 'transformations' } +{ #category : #transformations } BlElement >> transformation [ "Return an object that represents a description of my transformation. It can either be a local transformation being a composition of affine transformations or @@ -3940,7 +3938,7 @@ BlElement >> transformation [ ^ transformation ] -{ #category : 'transformations' } +{ #category : #transformations } BlElement >> transformation: anElementTransformation [ transformation := anElementTransformation asCachedTransformation @@ -3959,28 +3957,28 @@ BlElement >> transformation: anElementTransformation [ self onTransformationChanged ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> transformedBounds [ ^ boundsCache transformedBounds ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> transformedBounds: aBlBounds [ ^ transformation transformBounds: (self boundsInLocal: aBlBounds) ] -{ #category : 'change reporting' } +{ #category : #'change reporting' } BlElement >> updateBackground [ self background matchExtent: self extent ] -{ #category : 'change reporting' } +{ #category : #'change reporting' } BlElement >> updateGeometry [ self geometry matchElement: self ] -{ #category : 'transformations' } +{ #category : #transformations } BlElement >> updateTransformationBounds [ "Update the bounds of the cached transformation in order to recompute its matrix @@ -3989,7 +3987,7 @@ BlElement >> updateTransformationBounds [ transformation boundingRectangle: self bounds inLocal asRectangle ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> userData [ "Returns a Dictionary that holds application dependent and temporary objects. Be careful to limit the use of such facility and prefer clean instance variables when it is possible to define them." @@ -3997,14 +3995,14 @@ BlElement >> userData [ ^ userData ifNil: [ userData := IdentityDictionary new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> visibility [ ^ visuals visibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> visibility: aVisibility [ "Change the visibility of the element and request layout if needed" | shouldRequestLayout | @@ -4029,7 +4027,7 @@ BlElement >> visibility: aVisibility [ ifTrue: [ self parent invalidate ] ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElement >> visualBounds [ "Visual bounds represent a high precision area of rendered geometry, including border. By default, visual bounds of `inside` outskits equal to geometry bounds since border @@ -4038,7 +4036,7 @@ BlElement >> visualBounds [ ^ (self geometry strokedBounds: BlBounds new of: self) asRectangle ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlElement >> wantsMouseEventAt: aPoint [ "Return true if I can be picked as target for mouse event at given location specified in space coordinates. By default elements can handle mouse events if they are visible and not transparent for mouse events" @@ -4047,7 +4045,7 @@ BlElement >> wantsMouseEventAt: aPoint [ ^ self isVisible and: [ self containsGlobalPoint: aPoint ] ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElement >> wantsSeparateCompositingLayer [ (self compositingMode wantsCompositionLayer or: [ @@ -4059,24 +4057,24 @@ BlElement >> wantsSeparateCompositingLayer [ ^ true ] -{ #category : 'geometry hooks' } +{ #category : #'geometry hooks' } BlElement >> whenLayoutedDo: aBlock [ self when: BlElementLayoutComputedEvent do: [ :event | aBlock cull: event ]. ] -{ #category : 'geometry hooks' } +{ #category : #'geometry hooks' } BlElement >> whenLayoutedDoOnce: aBlock [ self when: BlElementLayoutComputedEvent doOnce: [ :event | aBlock cull: event ]. ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> width [ ^ self extent x ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElement >> width: aNumber [ | aLayoutConstraints | @@ -4090,14 +4088,14 @@ BlElement >> width: aNumber [ c horizontal exact: aNumber ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> withAllChildrenAt: aPoint [ ^ Array streamContents: [ :aStream | self withAllChildrenAt: aPoint do: [ :eachElement | aStream nextPut: eachElement ] ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> withAllChildrenAt: aPoint do: aBlock [ "Evaluate a given Block with all elements under a given point provided in *my* local coordinates sorted in the order they are displayed (children reversed + elevation based). @@ -4137,7 +4135,7 @@ BlElement >> withAllChildrenAt: aPoint do: aBlock [ ^ anyChildFound ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> withAllChildrenBreadthFirst [ @@ -4146,20 +4144,20 @@ BlElement >> withAllChildrenBreadthFirst [ self allChildrenBreadthFirstDo: [ :eachElement | aStream nextPut: eachElement ] ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> withAllChildrenBreadthFirstDo: aBlock [ aBlock value: self. self allChildrenBreadthFirstDo: aBlock ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> withAllLeafChildrenAt: aPoint [ ^ Array streamContents: [ :aStream | self withAllLeafChildrenAt: aPoint do: [ :eachElement | aStream nextPut: eachElement ] ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlElement >> withAllLeafChildrenAt: aPoint do: aBlock [ "Evaluate a given Block with all leaf elements under a given point provided in *my* local coordinates sorted in the order they are displayed (children reversed + elevation based). @@ -4199,7 +4197,7 @@ BlElement >> withAllLeafChildrenAt: aPoint do: aBlock [ ^ anyChildFound ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> withAllParents [ "Return a collection of all parents including myself starting with me and ending with the top most parent" @@ -4207,7 +4205,7 @@ BlElement >> withAllParents [ ^ Array streamContents: [ :aStream | self withAllParentsDo: [ :eachParent | aStream nextPut: eachParent ] ] ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> withAllParentsDetect: aBlock ifFound: ifFoundBlock ifNone: ifNoneBlock [ self withAllParentsDo: [ :aParent | (aBlock value: aParent) @@ -4215,7 +4213,7 @@ BlElement >> withAllParentsDetect: aBlock ifFound: ifFoundBlock ifNone: ifNoneBl ^ ifNoneBlock value ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> withAllParentsDo: aBlock [ "Evaluate a block with me and all my parents as an argument starting from me up to the top most parent" @@ -4224,7 +4222,7 @@ BlElement >> withAllParentsDo: aBlock [ self allParentsDo: aBlock ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> withAllParentsReverseDo: aBlock [ "Evaluate a block with me and all my parents as an argument starting from top most parent, up to me." @@ -4232,7 +4230,7 @@ BlElement >> withAllParentsReverseDo: aBlock [ aBlock value: self ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> withAllParentsUpTo: aParentElement detect: aBlock ifFound: ifFoundBlock ifNone: ifNoneBlock [ "Evaluate a block with each of my parents as an argument starting from myself up to but excluding the given parent element and evaluate ifFoundBlock if for any any of the parents aBlock returned true" @@ -4245,7 +4243,7 @@ BlElement >> withAllParentsUpTo: aParentElement detect: aBlock ifFound: ifFoundB ^ ifNoneBlock value ] -{ #category : 'children accessing' } +{ #category : #'children accessing' } BlElement >> withAllParentsUpTo: aParentElement do: aBlock [ "Evaluate a block with each of my parents as an argument starting from myself up to but excluding the given parent element" @@ -4255,14 +4253,14 @@ BlElement >> withAllParentsUpTo: aParentElement do: aBlock [ aBlock value: eachParent ] ] -{ #category : 'converting' } +{ #category : #converting } BlElement >> writePngTo: aFileReference [ "Draw me into a PNG at the specified location." BlHostRenderer preferableClass write: self asPngTo: aFileReference ] -{ #category : 'accessing' } +{ #category : #accessing } BlElement >> zIndex: aNumber [ self elevation: (BlRelativeElevation elevation: aNumber) ] diff --git a/src/Bloc/BlElementAbsoluteTransformation.class.st b/src/Bloc/BlElementAbsoluteTransformation.class.st index f3f841453..b18bd9d88 100644 --- a/src/Bloc/BlElementAbsoluteTransformation.class.st +++ b/src/Bloc/BlElementAbsoluteTransformation.class.st @@ -3,17 +3,15 @@ I represent an absolute transformation defined only by transformation matrix " Class { - #name : 'BlElementAbsoluteTransformation', - #superclass : 'BlElementTransformation', + #name : #BlElementAbsoluteTransformation, + #superclass : #BlElementTransformation, #instVars : [ 'matrix' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementAbsoluteTransformation class >> matrix: aBlMatrix [ ^ self basicNew @@ -21,13 +19,13 @@ BlElementAbsoluteTransformation class >> matrix: aBlMatrix [ yourself ] -{ #category : 'computation' } +{ #category : #computation } BlElementAbsoluteTransformation >> computeMatrix: aBlMatrix in: aRectangle [ aBlMatrix multiplyBy: matrix ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementAbsoluteTransformation >> initializeWithMatrix: aBlMatrix [ self initialize. @@ -35,41 +33,41 @@ BlElementAbsoluteTransformation >> initializeWithMatrix: aBlMatrix [ matrix := aBlMatrix ] -{ #category : 'testing' } +{ #category : #testing } BlElementAbsoluteTransformation >> is2D [ "Return true if my current transformation is in 2D space, false otherwise" ^ matrix is2D ] -{ #category : 'testing' } +{ #category : #testing } BlElementAbsoluteTransformation >> is3D [ "Return true if my current transformation is in 3D space, false otherwise" ^ matrix is3D ] -{ #category : 'testing' } +{ #category : #testing } BlElementAbsoluteTransformation >> isIdentity [ "Return true if I represent an identity transformation, false otherwise" ^ matrix isIdentity ] -{ #category : 'testing' } +{ #category : #testing } BlElementAbsoluteTransformation >> isPureTranslation [ "Return true if the receiver specifies no rotation or scaling and represents only translation in xy 2D plane" ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementAbsoluteTransformation >> matrix [ ^ matrix ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementAbsoluteTransformation >> matrix: aBlMatrix [ matrix := aBlMatrix diff --git a/src/Bloc/BlElementAddedToParentEvent.class.st b/src/Bloc/BlElementAddedToParentEvent.class.st index 61d3e4f66..9ba249b3b 100644 --- a/src/Bloc/BlElementAddedToParentEvent.class.st +++ b/src/Bloc/BlElementAddedToParentEvent.class.st @@ -17,29 +17,27 @@ parent addChild: child. " Class { - #name : 'BlElementAddedToParentEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementAddedToParentEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementAddedToParentEvent class >> disableIn: anObject [ anObject disableAddedToParent ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementAddedToParentEvent class >> enableIn: anObject [ anObject enableAddedToParent ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementAddedToParentEvent class >> wantedIn: anObject [ ^ anObject wantsAddedToParent ] -{ #category : 'sending' } +{ #category : #sending } BlElementAddedToParentEvent >> sendTo: anObject [ anObject elementAddedToParentEvent: self ] diff --git a/src/Bloc/BlElementAddedToSceneGraphEvent.class.st b/src/Bloc/BlElementAddedToSceneGraphEvent.class.st index 198fcfc77..dbb5389d7 100644 --- a/src/Bloc/BlElementAddedToSceneGraphEvent.class.st +++ b/src/Bloc/BlElementAddedToSceneGraphEvent.class.st @@ -3,29 +3,27 @@ I inform that an element was attached to a scene. I can be added to any Bloc ele " Class { - #name : 'BlElementAddedToSceneGraphEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementAddedToSceneGraphEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementAddedToSceneGraphEvent class >> disableIn: anObject [ anObject disableAddedToSceneGraph ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementAddedToSceneGraphEvent class >> enableIn: anObject [ anObject enableAddedToSceneGraph ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementAddedToSceneGraphEvent class >> wantedIn: anObject [ ^ anObject wantsAddedToSceneGraph ] -{ #category : 'sending' } +{ #category : #sending } BlElementAddedToSceneGraphEvent >> sendTo: anObject [ anObject elementAddedToSceneGraphEvent: self ] diff --git a/src/Bloc/BlElementAlignment.class.st b/src/Bloc/BlElementAlignment.class.st index fb1942164..417c6894a 100644 --- a/src/Bloc/BlElementAlignment.class.st +++ b/src/Bloc/BlElementAlignment.class.st @@ -16,8 +16,8 @@ both element and allowed bounds should be in element's parent coordinate system " Class { - #name : 'BlElementAlignment', - #superclass : 'Object', + #name : #BlElementAlignment, + #superclass : #Object, #classInstVars : [ 'end', 'horizontal', @@ -26,32 +26,30 @@ Class { 'start', 'vertical' ], - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> bottom [ ^ self vertical end ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> center [ ^ self middle ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> end [ ^ end ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> horizontal [ ^ horizontal ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlElementAlignment class >> initialize [ super initialize. @@ -63,68 +61,68 @@ BlElementAlignment class >> initialize [ vertical := BlVerticalAlignment new ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> left [ ^ self horizontal class left ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> middle [ ^ middle ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> null [ ^ null ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> right [ ^ self horizontal class right ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> start [ ^ start ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> top [ ^ self vertical start ] -{ #category : 'factory' } +{ #category : #factory } BlElementAlignment class >> vertical [ ^ vertical ] -{ #category : 'composition' } +{ #category : #composition } BlElementAlignment >> + anElementAlignment [ ^ self subclassResponsibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementAlignment >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementAlignment >> hash [ ^ self class hash ] -{ #category : 'testing' } +{ #category : #testing } BlElementAlignment >> ifNotNull: aBlock [ aBlock value ] -{ #category : 'testing' } +{ #category : #testing } BlElementAlignment >> ifNull: aBlock [ "not null" ] -{ #category : 'translation' } +{ #category : #translation } BlElementAlignment >> translationOf: aBounds in: aContainerBounds [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlElementBackgroundChangedEvent.class.st b/src/Bloc/BlElementBackgroundChangedEvent.class.st index b465de0bb..3f8603ade 100644 --- a/src/Bloc/BlElementBackgroundChangedEvent.class.st +++ b/src/Bloc/BlElementBackgroundChangedEvent.class.st @@ -13,29 +13,27 @@ element background: Color blue " Class { - #name : 'BlElementBackgroundChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementBackgroundChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementBackgroundChangedEvent class >> disableIn: anObject [ anObject disableBackgroundChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementBackgroundChangedEvent class >> enableIn: anObject [ anObject enableBackgroundChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementBackgroundChangedEvent class >> wantedIn: anObject [ ^ anObject wantsBackgroundChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementBackgroundChangedEvent >> sendTo: anObject [ anObject elementBackgroundChangedEvent: self ] diff --git a/src/Bloc/BlElementBackgroundProperty.class.st b/src/Bloc/BlElementBackgroundProperty.class.st index 8952138bf..83b2713e1 100644 --- a/src/Bloc/BlElementBackgroundProperty.class.st +++ b/src/Bloc/BlElementBackgroundProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementBackgroundProperty', - #superclass : 'BlElementProperty', + #name : #BlElementBackgroundProperty, + #superclass : #BlElementProperty, #instVars : [ 'background' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementBackgroundProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,34 +18,34 @@ BlElementBackgroundProperty >> = anObject [ ^ background = anObject background ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementBackgroundProperty >> applyOnElement: anElement [ anElement background: self background ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBackgroundProperty >> background [ ^ background ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBackgroundProperty >> background: anObject [ background := anObject ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementBackgroundProperty >> cleanUpOnElement: anElement [ anElement background: BlElementVisuals defaultBackground ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementBackgroundProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ background hash ] -{ #category : 'printing' } +{ #category : #printing } BlElementBackgroundProperty >> printOn: aStream [ aStream nextPutAll: 'Background - '; diff --git a/src/Bloc/BlElementBorderChangedEvent.class.st b/src/Bloc/BlElementBorderChangedEvent.class.st index 0b390430c..c44ac26a0 100644 --- a/src/Bloc/BlElementBorderChangedEvent.class.st +++ b/src/Bloc/BlElementBorderChangedEvent.class.st @@ -13,29 +13,27 @@ element border: (BlBorder paint: Color blue width: 20) " Class { - #name : 'BlElementBorderChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementBorderChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementBorderChangedEvent class >> disableIn: anObject [ anObject disableBorderChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementBorderChangedEvent class >> enableIn: anObject [ anObject enableBorderChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementBorderChangedEvent class >> wantedIn: anObject [ ^ anObject wantsBorderChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementBorderChangedEvent >> sendTo: anObject [ anObject elementBorderChangedEvent: self diff --git a/src/Bloc/BlElementBorderProperty.class.st b/src/Bloc/BlElementBorderProperty.class.st index c2713f146..fc6a3da00 100644 --- a/src/Bloc/BlElementBorderProperty.class.st +++ b/src/Bloc/BlElementBorderProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementBorderProperty', - #superclass : 'BlElementProperty', + #name : #BlElementBorderProperty, + #superclass : #BlElementProperty, #instVars : [ 'border' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementBorderProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,34 +18,34 @@ BlElementBorderProperty >> = anObject [ ^ border = anObject border ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementBorderProperty >> applyOnElement: anElement [ anElement border: self border ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBorderProperty >> border [ ^ border ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBorderProperty >> border: anObject [ border := anObject ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementBorderProperty >> cleanUpOnElement: anElement [ anElement border: BlElementVisuals defaultBorder ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementBorderProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ border hash ] -{ #category : 'printing' } +{ #category : #printing } BlElementBorderProperty >> printOn: aStream [ aStream nextPutAll: 'Border - '; diff --git a/src/Bloc/BlElementBounds.class.st b/src/Bloc/BlElementBounds.class.st index f39ec7f8f..4a661506a 100644 --- a/src/Bloc/BlElementBounds.class.st +++ b/src/Bloc/BlElementBounds.class.st @@ -6,61 +6,59 @@ The reference element always corresponds to the element which was used to comput " Class { - #name : 'BlElementBounds', - #superclass : 'Object', + #name : #BlElementBounds, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'referenceElement' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'converting' } +{ #category : #converting } BlElementBounds >> asRectangle [ ^ self subclassResponsibility ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> bottom [ ^ self bounds bottom ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> bottomCenter [ ^ self bounds bottomCenter ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> bottomLeft [ ^ self bounds bottomLeft ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> bottomRight [ ^ self right @ self bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBounds >> bounds [ ^ self subclassResponsibility ] -{ #category : 'bounds conversion' } +{ #category : #'bounds conversion' } BlElementBounds >> boundsInLocal: aBlBounds [ "I load my local bounds in the given mutable bounds and return it. I do not rely on cache and always provide actual bounds. @@ -77,7 +75,7 @@ BlElementBounds >> boundsInLocal: aBlBounds [ yourself ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> center [ "Return a point representing a geometrical center of this bounds" @@ -85,21 +83,21 @@ BlElementBounds >> center [ ^ self bounds center ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> centerLeft [ ^ self bounds centerLeft ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> centerRight [ ^ self bounds centerRight ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBounds >> extent [ "Return extent of current bounds" @@ -107,56 +105,56 @@ BlElementBounds >> extent [ ^ self subclassResponsibility ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> height [ ^ self extent y ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBounds >> inChild: anElement [ ^ self subclassResponsibility ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBounds >> inLocal [ ^ self subclassResponsibility ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBounds >> inParent [ ^ self subclassResponsibility ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBounds >> inParent: anElement [ ^ self subclassResponsibility ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBounds >> inSpace [ ^ self subclassResponsibility ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> left [ ^ self bounds left ] -{ #category : 'bounds conversion' } +{ #category : #'bounds conversion' } BlElementBounds >> localBoundsToParent: aBounds [ "In-place transform bounds from local coordinates to my parent's coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -174,7 +172,7 @@ BlElementBounds >> localBoundsToParent: aBounds [ ^ aBounds ] -{ #category : 'bounds conversion' } +{ #category : #'bounds conversion' } BlElementBounds >> localBoundsToSpace: aBounds [ "In-place transform bounds from local coordinates to space coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -203,7 +201,7 @@ BlElementBounds >> localBoundsToSpace: aBounds [ ^ aBounds ] -{ #category : 'bounds conversion' } +{ #category : #'bounds conversion' } BlElementBounds >> localBoundsToTransformed: aBounds [ "In-place transform bounds from local coordinates to my parent's coordinates. Note, that I do not return a new rectangle and instead mutate provided one, @@ -217,12 +215,12 @@ BlElementBounds >> localBoundsToTransformed: aBounds [ ^ aBounds ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> perimeter [ ^ (self width + self height) * 2 ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBounds >> position [ "Return bounds position (an origin) as a Point" @@ -232,12 +230,12 @@ BlElementBounds >> position [ ] -{ #category : 'printing' } +{ #category : #printing } BlElementBounds >> printOn: aStream [ aStream print: self asRectangle ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBounds >> referenceElement [ "Return a reference element that defines a coordinate system in which bounds are local. Reference element can not be nil" @@ -249,54 +247,54 @@ BlElementBounds >> referenceElement [ ^ referenceElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBounds >> referenceElement: aBlElement [ referenceElement := aBlElement ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> right [ ^ self bounds right ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> top [ ^ self bounds top ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> topCenter [ ^ self bounds topCenter ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> topLeft [ ^ self bounds topLeft ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> topRight [ ^ self bounds topRight ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBounds >> transformed [ ^ self subclassResponsibility ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementBounds >> width [ diff --git a/src/Bloc/BlElementBoundsInChild.class.st b/src/Bloc/BlElementBoundsInChild.class.st index a349e719b..698dc84e9 100644 --- a/src/Bloc/BlElementBoundsInChild.class.st +++ b/src/Bloc/BlElementBoundsInChild.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementBoundsInChild', - #superclass : 'BlElementComputedBounds', + #name : #BlElementBoundsInChild, + #superclass : #BlElementComputedBounds, #instVars : [ 'originalElement' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInChild >> inParent [ @@ -23,7 +21,7 @@ BlElementBoundsInChild >> inParent [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInChild >> inSpace [ @@ -33,14 +31,14 @@ BlElementBoundsInChild >> inSpace [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsInChild >> originalElement [ ^ originalElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsInChild >> originalElement: anElement [ originalElement := anElement ] diff --git a/src/Bloc/BlElementBoundsInLocal.class.st b/src/Bloc/BlElementBoundsInLocal.class.st index 4955265a0..a5c95b7ae 100644 --- a/src/Bloc/BlElementBoundsInLocal.class.st +++ b/src/Bloc/BlElementBoundsInLocal.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlElementBoundsInLocal', - #superclass : 'BlElementComputedBounds', - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #name : #BlElementBoundsInLocal, + #superclass : #BlElementComputedBounds, + #category : 'Bloc-Basic-Bounds' } -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInLocal >> inParent [ @@ -17,7 +15,7 @@ BlElementBoundsInLocal >> inParent [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInLocal >> inSpace [ diff --git a/src/Bloc/BlElementBoundsInParent.class.st b/src/Bloc/BlElementBoundsInParent.class.st index ad7c13313..f6e42cc9c 100644 --- a/src/Bloc/BlElementBoundsInParent.class.st +++ b/src/Bloc/BlElementBoundsInParent.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementBoundsInParent', - #superclass : 'BlElementComputedBounds', + #name : #BlElementBoundsInParent, + #superclass : #BlElementComputedBounds, #instVars : [ 'originalElement' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInParent >> inChild: anElement [ | aParentElement | @@ -25,7 +23,7 @@ BlElementBoundsInParent >> inChild: anElement [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInParent >> inParent [ @@ -39,14 +37,14 @@ BlElementBoundsInParent >> inParent [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsInParent >> originalElement [ ^ originalElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsInParent >> originalElement: anElement [ originalElement := anElement ] diff --git a/src/Bloc/BlElementBoundsInSpace.class.st b/src/Bloc/BlElementBoundsInSpace.class.st index 1d4d3a3b8..248f43895 100644 --- a/src/Bloc/BlElementBoundsInSpace.class.st +++ b/src/Bloc/BlElementBoundsInSpace.class.st @@ -3,14 +3,12 @@ I represent bounds in space " Class { - #name : 'BlElementBoundsInSpace', - #superclass : 'BlElementComputedBounds', - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #name : #BlElementBoundsInSpace, + #superclass : #BlElementComputedBounds, + #category : 'Bloc-Basic-Bounds' } -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInSpace >> inChild: anElement [ @@ -21,12 +19,12 @@ BlElementBoundsInSpace >> inChild: anElement [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInSpace >> inParent [ ^ self ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementBoundsInSpace >> inSpace [ ^ self ] diff --git a/src/Bloc/BlElementBoundsUpdater.class.st b/src/Bloc/BlElementBoundsUpdater.class.st index f7c36ef18..a0909f873 100644 --- a/src/Bloc/BlElementBoundsUpdater.class.st +++ b/src/Bloc/BlElementBoundsUpdater.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementBoundsUpdater', - #superclass : 'Object', + #name : #BlElementBoundsUpdater, + #superclass : #Object, #instVars : [ 'changes' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdater >> changeExtentFrom: aPreviousExtent to: aNewExtent of: anElement [ (changes at: anElement @@ -17,7 +15,7 @@ BlElementBoundsUpdater >> changeExtentFrom: aPreviousExtent to: aNewExtent of: a changeExtentFrom: aPreviousExtent to: aNewExtent ] -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdater >> changePositionFrom: aPreviousPosition to: aNewPosition of: anElement [ (changes at: anElement @@ -25,7 +23,7 @@ BlElementBoundsUpdater >> changePositionFrom: aPreviousPosition to: aNewPosition changePositionFrom: aPreviousPosition to: aNewPosition ] -{ #category : 'change reporting' } +{ #category : #'change reporting' } BlElementBoundsUpdater >> commitChanges [ | theAssociations theElements theRoots | @@ -54,25 +52,25 @@ BlElementBoundsUpdater >> commitChanges [ ] -{ #category : 'testing' } +{ #category : #testing } BlElementBoundsUpdater >> hasChanges [ ^ changes notEmpty ] -{ #category : 'testing' } +{ #category : #testing } BlElementBoundsUpdater >> hasExtentChanges [ ^ changes anySatisfy: [ :c | c isExtentChanged ] ] -{ #category : 'testing' } +{ #category : #testing } BlElementBoundsUpdater >> hasPositionChanges [ ^ changes anySatisfy: [ :c | c isPositionChanged ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementBoundsUpdater >> initialize [ super initialize. diff --git a/src/Bloc/BlElementBoundsUpdaterChange.class.st b/src/Bloc/BlElementBoundsUpdaterChange.class.st index a7130f153..41654f2f3 100644 --- a/src/Bloc/BlElementBoundsUpdaterChange.class.st +++ b/src/Bloc/BlElementBoundsUpdaterChange.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlElementBoundsUpdaterChange', - #superclass : 'Object', + #name : #BlElementBoundsUpdaterChange, + #superclass : #Object, #instVars : [ 'element', 'previousPosition', @@ -9,30 +9,28 @@ Class { 'newExtent', 'compositionDepth' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdaterChange >> changeExtentFrom: aPreviousExtent to: aNewExtent [ previousExtent ifNil: [ previousExtent := aPreviousExtent ]. newExtent := aNewExtent ] -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdaterChange >> changePositionFrom: aPreviousPosition to: aNewPosition [ previousPosition ifNil: [ previousPosition := aPreviousPosition ]. newPosition := aNewPosition ] -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdaterChange >> commitLocalChanges [ self commitLocalExtentChange. self commitLocalPositionChange ] -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdaterChange >> commitLocalExtentChange [ | aPreviousExtent | @@ -47,7 +45,7 @@ BlElementBoundsUpdaterChange >> commitLocalExtentChange [ self element onExtentChanged ] -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdaterChange >> commitLocalPositionChange [ | aPreviousPosition | newPosition @@ -61,23 +59,23 @@ BlElementBoundsUpdaterChange >> commitLocalPositionChange [ self element onPositionChangedFrom: aPreviousPosition to: newPosition ] -{ #category : 'api - compositing' } +{ #category : #'api - compositing' } BlElementBoundsUpdaterChange >> compositionDepth [ ^ compositionDepth ifNil: [ compositionDepth := element compositionDepth ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> element: anObject [ element := anObject ] -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdaterChange >> isExtentChanged [ | aPreviousExtent | @@ -88,7 +86,7 @@ BlElementBoundsUpdaterChange >> isExtentChanged [ ^ (newExtent closeTo: aPreviousExtent epsilon: BlElement epsilon) not ] -{ #category : 'api - changes' } +{ #category : #'api - changes' } BlElementBoundsUpdaterChange >> isPositionChanged [ | aPreviousPosition | @@ -99,42 +97,42 @@ BlElementBoundsUpdaterChange >> isPositionChanged [ ^ (newPosition closeTo: aPreviousPosition epsilon: BlElement epsilon) not ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> newExtent [ ^ newExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> newExtent: anObject [ newExtent := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> newPosition [ ^ newPosition ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> newPosition: anObject [ newPosition := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> previousExtent [ ^ previousExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> previousExtent: anObject [ previousExtent := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> previousPosition [ ^ previousPosition ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementBoundsUpdaterChange >> previousPosition: anObject [ previousPosition := anObject ] diff --git a/src/Bloc/BlElementCachedExplicitTransformation.class.st b/src/Bloc/BlElementCachedExplicitTransformation.class.st index fa0e597a2..65d8c2490 100644 --- a/src/Bloc/BlElementCachedExplicitTransformation.class.st +++ b/src/Bloc/BlElementCachedExplicitTransformation.class.st @@ -3,19 +3,17 @@ I cache a `BlElementTransformation`. " Class { - #name : 'BlElementCachedExplicitTransformation', - #superclass : 'BlElementCachedTransformation', + #name : #BlElementCachedExplicitTransformation, + #superclass : #BlElementCachedTransformation, #instVars : [ 'matrix', 'elementTransformation', 'boundingRectangle' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementCachedExplicitTransformation class >> forTransformation: aBlElementTransformation [ ^ self basicNew @@ -23,26 +21,26 @@ BlElementCachedExplicitTransformation class >> forTransformation: aBlElementTran yourself ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlElementCachedExplicitTransformation >> asElementTransformation [ ^ elementTransformation ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> boundingRectangle [ ^ boundingRectangle ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedExplicitTransformation >> boundingRectangle: aRectangle [ boundingRectangle := aRectangle. self invalidateMatrix ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> bounds [ self @@ -52,20 +50,20 @@ BlElementCachedExplicitTransformation >> bounds [ ^ boundingRectangle ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> elementTransformation [ ^ elementTransformation ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> ensureMatrix [ matrix ifNil: [ matrix := elementTransformation asMatrix: boundingRectangle ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementCachedExplicitTransformation >> initializeWith: aBlElementTransformation [ self initialize. @@ -74,7 +72,7 @@ BlElementCachedExplicitTransformation >> initializeWith: aBlElementTransformatio elementTransformation := aBlElementTransformation ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> invalidateMatrix [ "Matrix is computed out of affine transformation composition which may contain transformations that depend on element's properties @@ -84,7 +82,7 @@ BlElementCachedExplicitTransformation >> invalidateMatrix [ matrix := nil ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedExplicitTransformation >> inverseTransformBounds: aBlBounds [ "Transform the given bounds according to inverse of my cached transformation. (Global to local transformation.)" @@ -92,7 +90,7 @@ BlElementCachedExplicitTransformation >> inverseTransformBounds: aBlBounds [ ^ self matrix inverted transformBounds: aBlBounds ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedExplicitTransformation >> inverseTransformPoint: aPoint [ "Answer the `Point` that results from applying the inversed transformation on a given point. Signal `BlSingularMatrixError` if the underlying matrix is singular." @@ -100,38 +98,38 @@ BlElementCachedExplicitTransformation >> inverseTransformPoint: aPoint [ ^ self matrix inverted transformPoint: aPoint ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> invert [ matrix := self matrix inverted ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> inverted [ ^ self copy invert ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlElementCachedExplicitTransformation >> isIdentity [ ^ elementTransformation isIdentity ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCachedExplicitTransformation >> isPureTranslation [ ^ elementTransformation isPureTranslation ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedExplicitTransformation >> matrix [ self ensureMatrix. ^ matrix ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedExplicitTransformation >> transformBounds: aBlBounds [ "Transform the given bounds according to my cached transformation. (Local to global transformation.)" @@ -139,7 +137,7 @@ BlElementCachedExplicitTransformation >> transformBounds: aBlBounds [ ^ self matrix transformBounds: aBlBounds ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedExplicitTransformation >> transformPoint: aPoint [ "Transform a given 2D point according to my cached transformation. (Local to global transformation.)" @@ -147,7 +145,7 @@ BlElementCachedExplicitTransformation >> transformPoint: aPoint [ ^ self matrix transformPoint: aPoint ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlElementCachedExplicitTransformation >> transformation [ self diff --git a/src/Bloc/BlElementCachedIdentityTransformation.class.st b/src/Bloc/BlElementCachedIdentityTransformation.class.st index d4da845aa..4fc91a8ca 100644 --- a/src/Bloc/BlElementCachedIdentityTransformation.class.st +++ b/src/Bloc/BlElementCachedIdentityTransformation.class.st @@ -2,38 +2,36 @@ I cache a `BlElementIdentityTransformation` and provide a singleton instance. " Class { - #name : 'BlElementCachedIdentityTransformation', - #superclass : 'BlElementCachedTransformation', + #name : #BlElementCachedIdentityTransformation, + #superclass : #BlElementCachedTransformation, #instVars : [ 'identityMatrix' ], #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlElementCachedIdentityTransformation class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCachedIdentityTransformation class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlElementCachedIdentityTransformation >> asElementTransformation [ ^ BlElementIdentityTransformation uniqueInstance ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedIdentityTransformation >> boundingRectangle: aRectangle [ "The actual transformation matrix may depend on the element bounds due to potential non-zero transformation origin. This message allows cached transformation to recompute the transformation matrix when bounds change. @@ -41,7 +39,7 @@ BlElementCachedIdentityTransformation >> boundingRectangle: aRectangle [ ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementCachedIdentityTransformation >> initialize [ super initialize. @@ -50,7 +48,7 @@ BlElementCachedIdentityTransformation >> initialize [ identityMatrix beReadOnlyObject ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedIdentityTransformation >> inverseTransformBounds: aBlBounds [ "Transform the given bounds according to inverse of my cached transformation. (Global to local transformation.)" @@ -58,26 +56,26 @@ BlElementCachedIdentityTransformation >> inverseTransformBounds: aBlBounds [ ^ aBlBounds ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedIdentityTransformation >> inverseTransformPoint: aPoint [ "Answer the `Point` that results from applying the inversed transformation on a given point." ^ aPoint ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlElementCachedIdentityTransformation >> isIdentity [ ^ true ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedIdentityTransformation >> matrix [ ^ identityMatrix ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedIdentityTransformation >> transformBounds: aBlBounds [ "Transform the given bounds according to my cached transformation. (Local to global transformation.)" @@ -85,7 +83,7 @@ BlElementCachedIdentityTransformation >> transformBounds: aBlBounds [ ^ aBlBounds ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedIdentityTransformation >> transformPoint: aPoint [ "Transform a given 2D point according to my cached transformation. (Local to global transformation.)" diff --git a/src/Bloc/BlElementCachedTransformation.class.st b/src/Bloc/BlElementCachedTransformation.class.st index a34e97b7b..8a6d8c8c5 100644 --- a/src/Bloc/BlElementCachedTransformation.class.st +++ b/src/Bloc/BlElementCachedTransformation.class.st @@ -9,26 +9,24 @@ Hence the separation between my subclasses. " Class { - #name : 'BlElementCachedTransformation', - #superclass : 'Object', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #BlElementCachedTransformation, + #superclass : #Object, + #category : 'Bloc-Basic-Transformations' } -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlElementCachedTransformation >> asCachedTransformation [ ^ self ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlElementCachedTransformation >> asElementTransformation [ ^ self subclassResponsibility ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedTransformation >> boundingRectangle: aRectangle [ "The actual transformation matrix may depend on the element bounds due to potential non-zero transformation origin. This message allows cached transformation to recompute the transformation matrix when bounds change." @@ -36,7 +34,7 @@ BlElementCachedTransformation >> boundingRectangle: aRectangle [ self subclassResponsibility ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedTransformation >> bounds: aRectangle [ "The actual transformation matrix may depends on the element bounds due to potential non zero transformation origin. @@ -49,7 +47,7 @@ BlElementCachedTransformation >> bounds: aRectangle [ self boundingRectangle: aRectangle ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedTransformation >> inverseTransformBounds: aBlBounds [ "Transform the given bounds according to inverse of my cached transformation. (Global to local transformation.)" @@ -57,7 +55,7 @@ BlElementCachedTransformation >> inverseTransformBounds: aBlBounds [ ^ self subclassResponsibility ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedTransformation >> inverseTransformPoint: aPoint [ "Answer the point that results from applying my inverted transformation to a given point. May signal `BlSingularMatrixError` if the underlying matrix is singular." @@ -65,19 +63,19 @@ BlElementCachedTransformation >> inverseTransformPoint: aPoint [ ^ self subclassResponsibility ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlElementCachedTransformation >> isIdentity [ ^ self subclassResponsibility ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedTransformation >> matrix [ ^ self subclassResponsibility ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedTransformation >> transformBounds: aBlBounds [ "Transform the given bounds according to my cached transformation. (Local to global transformation.)" @@ -85,7 +83,7 @@ BlElementCachedTransformation >> transformBounds: aBlBounds [ ^ self subclassResponsibility ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlElementCachedTransformation >> transformPoint: aPoint [ "Transform a given 2D point according to my cached transformation. (Local to global transformation.)" diff --git a/src/Bloc/BlElementCompositeState.class.st b/src/Bloc/BlElementCompositeState.class.st index c20e6c0de..d82a161db 100644 --- a/src/Bloc/BlElementCompositeState.class.st +++ b/src/Bloc/BlElementCompositeState.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlElementCompositeState', - #superclass : 'BlElementState', + #name : #BlElementCompositeState, + #superclass : #BlElementState, #instVars : [ 'left', 'right' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementCompositeState >> = anotherState [ anotherState == self ifTrue: [ ^ true ]. @@ -22,48 +20,48 @@ BlElementCompositeState >> = anotherState [ and: [ self right = anotherState right ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementCompositeState >> hash [ ^ (self class hash bitXor: self left hash) bitXor: self right hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeState >> left [ ^ left ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeState >> left: anObject [ left := anObject ] -{ #category : 'testing' } +{ #category : #testing } BlElementCompositeState >> matches: aSetOfStates [ ^ self subclassResponsibility ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementCompositeState >> optionalEventHandlerDo: aBlock [ left optionalEventHandlerDo: aBlock. right optionalEventHandlerDo: aBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeState >> priority [ ^ left priority max: right priority ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeState >> right [ ^ right ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeState >> right: anObject [ right := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeState >> type [ "Composition state can not be element state, so this method should not be implemented" diff --git a/src/Bloc/BlElementCompositeTransformation.class.st b/src/Bloc/BlElementCompositeTransformation.class.st index 14032c9be..d477661a9 100644 --- a/src/Bloc/BlElementCompositeTransformation.class.st +++ b/src/Bloc/BlElementCompositeTransformation.class.st @@ -3,30 +3,28 @@ I am a composite transformation that consists of other element transformations, " Class { - #name : 'BlElementCompositeTransformation', - #superclass : 'BlElementDynamicTransformation', + #name : #BlElementCompositeTransformation, + #superclass : #BlElementDynamicTransformation, #instVars : [ 'elementTransformations' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'adding' } +{ #category : #adding } BlElementCompositeTransformation >> add: aBlElementTransformation [ elementTransformations add: aBlElementTransformation ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementCompositeTransformation >> affineTransformationsDo: aBlockClosure [ elementTransformations do: [ :each | each affineTransformationsDo: aBlockClosure ] ] -{ #category : 'computation' } +{ #category : #computation } BlElementCompositeTransformation >> computeMatrix: aBlMatrix in: aRectangle [ elementTransformations reverseDo: [ :each | @@ -36,47 +34,47 @@ BlElementCompositeTransformation >> computeMatrix: aBlMatrix in: aRectangle [ since multiplyBy: is a right multiplication we should iterate in reversed order" ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeTransformation >> elementTransformations [ ^ elementTransformations ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementCompositeTransformation >> initialize [ super initialize. elementTransformations := OrderedCollection new ] -{ #category : 'testing' } +{ #category : #testing } BlElementCompositeTransformation >> is2D [ "Return true if my current transformation is in 2D space, false otherwise" ^ elementTransformations allSatisfy: [ :each | each is2D ] ] -{ #category : 'testing' } +{ #category : #testing } BlElementCompositeTransformation >> is3D [ ^ elementTransformations anySatisfy: [ :each | each is3D ] ] -{ #category : 'testing' } +{ #category : #testing } BlElementCompositeTransformation >> isIdentity [ "Return true if I represent an identity transformation, false otherwise" ^ elementTransformations allSatisfy: [ :each | each isIdentity ] ] -{ #category : 'testing' } +{ #category : #testing } BlElementCompositeTransformation >> isPureTranslation [ "Return true if I represent an pure translation, false otherwise" ^ elementTransformations allSatisfy: [ :each | each isPureTranslation ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCompositeTransformation >> transformations [ self diff --git a/src/Bloc/BlElementComputedBounds.class.st b/src/Bloc/BlElementComputedBounds.class.st index faa78c92f..c2022a118 100644 --- a/src/Bloc/BlElementComputedBounds.class.st +++ b/src/Bloc/BlElementComputedBounds.class.st @@ -3,44 +3,42 @@ I am a special type of element bounds with an ability to be in-place converted b " Class { - #name : 'BlElementComputedBounds', - #superclass : 'BlElementBounds', + #name : #BlElementComputedBounds, + #superclass : #BlElementBounds, #instVars : [ 'bounds' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'converting' } +{ #category : #converting } BlElementComputedBounds >> asRectangle [ ^ self bounds asRectangle ] -{ #category : 'asserting' } +{ #category : #asserting } BlElementComputedBounds >> assertNotOriginal [ self assert: [ self referenceElement bounds ~~ self ] description: [ 'Can not modify original reference element bounds' ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementComputedBounds >> bounds [ ^ bounds ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementComputedBounds >> bounds: aBlBounds [ bounds := aBlBounds ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementComputedBounds >> center [ "Return a point representing a geometrical center of this bounds. I am an optimised version that benefits by optimisations of underlying bounds object" @@ -49,7 +47,7 @@ BlElementComputedBounds >> center [ ^ self bounds center ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementComputedBounds >> extent [ "Return extent of current bounds" @@ -57,7 +55,7 @@ BlElementComputedBounds >> extent [ ^ self bounds extent ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementComputedBounds >> inChild: anElement [ @@ -68,12 +66,12 @@ BlElementComputedBounds >> inChild: anElement [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementComputedBounds >> inLocal [ ^ self ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementComputedBounds >> inParent [ self assertNotOriginal. @@ -88,7 +86,7 @@ BlElementComputedBounds >> inParent [ referenceElement := self referenceElement parent ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementComputedBounds >> inParent: anElement [ | subParent | @@ -105,7 +103,7 @@ BlElementComputedBounds >> inParent: anElement [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementComputedBounds >> inSpace [ self assertNotOriginal. @@ -120,7 +118,7 @@ BlElementComputedBounds >> inSpace [ referenceElement := self referenceElement topMostParent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementComputedBounds >> position [ "Return bounds position (an origin) as a Point" @@ -128,7 +126,7 @@ BlElementComputedBounds >> position [ ^ self bounds origin ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementComputedBounds >> transformed [ self assertNotOriginal. diff --git a/src/Bloc/BlElementConjunctionState.class.st b/src/Bloc/BlElementConjunctionState.class.st index 4e20a6041..0a15bb8e7 100644 --- a/src/Bloc/BlElementConjunctionState.class.st +++ b/src/Bloc/BlElementConjunctionState.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlElementConjunctionState', - #superclass : 'BlElementCompositeState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementConjunctionState, + #superclass : #BlElementCompositeState, + #category : 'Bloc-Basic-State' } -{ #category : 'testing' } +{ #category : #testing } BlElementConjunctionState >> matches: aSetOfStates [ ^ (self left matches: aSetOfStates) and: [ self right matches: aSetOfStates ] ] -{ #category : 'printing' } +{ #category : #printing } BlElementConjunctionState >> printOn: aStream [ aStream nextPut: $(; diff --git a/src/Bloc/BlElementCurrentProperties.class.st b/src/Bloc/BlElementCurrentProperties.class.st index 1718b1108..63d2af523 100644 --- a/src/Bloc/BlElementCurrentProperties.class.st +++ b/src/Bloc/BlElementCurrentProperties.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlElementCurrentProperties', - #superclass : 'BlElementProperties', + #name : #BlElementCurrentProperties, + #superclass : #BlElementProperties, #traits : 'TBlElementProperties', #classTraits : 'TBlElementProperties classTrait', #instVars : [ @@ -9,12 +9,10 @@ Class { 'isDirty', 'resolvedProperties' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementCurrentProperties >> addProperties: aCollectionOfElementProperties [ | anythingChanged | @@ -24,20 +22,20 @@ BlElementCurrentProperties >> addProperties: aCollectionOfElementProperties [ anythingChanged ifTrue: [ self onPropertiesChanged ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementCurrentProperties >> addProperty: aBlElementProperty [ (self basicAddProperty: aBlElementProperty) ifTrue: [ self onPropertiesChanged ] ] -{ #category : 'converting' } +{ #category : #converting } BlElementCurrentProperties >> asArray [ ^ properties asArray ] -{ #category : 'private' } +{ #category : #private } BlElementCurrentProperties >> basicAddProperty: aBlElementProperty [ "Return true if properties changed, false otherwise." @@ -64,7 +62,7 @@ BlElementCurrentProperties >> basicAddProperty: aBlElementProperty [ ^ true ] -{ #category : 'private' } +{ #category : #private } BlElementCurrentProperties >> basicRemoveProperty: aBlElementProperty [ "We do not actually remove a property, we simply mark it as to be removed. This will later give a property a chance to clean up the element" @@ -78,19 +76,19 @@ BlElementCurrentProperties >> basicRemoveProperty: aBlElementProperty [ ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCurrentProperties >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCurrentProperties >> element: aBlElement [ element := aBlElement ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementCurrentProperties >> flushPropertiesToRemove [ properties := properties reject: [ :eachPropertyWithStatus | @@ -98,7 +96,7 @@ BlElementCurrentProperties >> flushPropertiesToRemove [ self maybeResolvedProperties flushPropertiesToRemove ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementCurrentProperties >> initialize [ super initialize. @@ -107,44 +105,44 @@ BlElementCurrentProperties >> initialize [ isDirty := false ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCurrentProperties >> markClean [ isDirty := false ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCurrentProperties >> markDirty [ isDirty := true. resolvedProperties := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCurrentProperties >> maybeResolvedProperties [ ^ resolvedProperties ifNil: [ BlElementUnresolvedProperties new ] ] -{ #category : 'testing' } +{ #category : #testing } BlElementCurrentProperties >> needsPropertiesComputation [ ^ resolvedProperties isNil ] -{ #category : 'private' } +{ #category : #private } BlElementCurrentProperties >> onPropertiesChanged [ self element requestPropertiesComputation ] -{ #category : 'copying' } +{ #category : #copying } BlElementCurrentProperties >> postCopy [ properties := properties copy ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCurrentProperties >> properties [ "Answer a `Dictionary` with the properties" @@ -152,14 +150,14 @@ BlElementCurrentProperties >> properties [ eachPropertyWithStatus property ] ] -{ #category : 'converting' } +{ #category : #converting } BlElementCurrentProperties >> propertiesWithoutStatusAsArray [ ^ Array streamContents: [ :aStream | properties valuesDo: [ :eachPropertyWithStatus | aStream nextPut: eachPropertyWithStatus property ] ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementCurrentProperties >> removeProperties: aCollectionOfElementProperties [ | anythingChanged | @@ -169,13 +167,13 @@ BlElementCurrentProperties >> removeProperties: aCollectionOfElementProperties [ ifTrue: [ self onPropertiesChanged ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementCurrentProperties >> removeProperty: aBlElementProperty [ (self basicRemoveProperty: aBlElementProperty) ifTrue: [ self onPropertiesChanged ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementCurrentProperties >> resolveWithParentProperties: theParentProperties orGlobal: theGlobalProperties [ | theResolvedPropertiesWithStatus | diff --git a/src/Bloc/BlElementDefaultState.class.st b/src/Bloc/BlElementDefaultState.class.st index b4fa9e4c3..9569352d7 100644 --- a/src/Bloc/BlElementDefaultState.class.st +++ b/src/Bloc/BlElementDefaultState.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlElementDefaultState', - #superclass : 'BlElementUniqueState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementDefaultState, + #superclass : #BlElementUniqueState, + #category : 'Bloc-Basic-State' } -{ #category : 'testing' } +{ #category : #testing } BlElementDefaultState >> matches: aSetOfStates [ ^ true ] -{ #category : 'printing' } +{ #category : #printing } BlElementDefaultState >> printOn: aStream [ aStream nextPutAll: 'default' ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementDefaultState >> priority [ ^ 0 ] diff --git a/src/Bloc/BlElementDisabledState.class.st b/src/Bloc/BlElementDisabledState.class.st index 1f3e300ad..6f5da1d01 100644 --- a/src/Bloc/BlElementDisabledState.class.st +++ b/src/Bloc/BlElementDisabledState.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlElementDisabledState', - #superclass : 'BlElementUniqueState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementDisabledState, + #superclass : #BlElementUniqueState, + #category : 'Bloc-Basic-State' } -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementDisabledState >> optionalEventHandlerDo: aBlock [ aBlock value: BlElementDisabledStateEventHandler uniqueInstance ] -{ #category : 'printing' } +{ #category : #printing } BlElementDisabledState >> printOn: aStream [ aStream nextPutAll: 'disabled' ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementDisabledState >> priority [ ^ 100 ] diff --git a/src/Bloc/BlElementDisabledStateEventHandler.class.st b/src/Bloc/BlElementDisabledStateEventHandler.class.st index 273191324..798bd49c6 100644 --- a/src/Bloc/BlElementDisabledStateEventHandler.class.st +++ b/src/Bloc/BlElementDisabledStateEventHandler.class.st @@ -1,24 +1,22 @@ Class { - #name : 'BlElementDisabledStateEventHandler', - #superclass : 'BlElementStateEventHandler', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementDisabledStateEventHandler, + #superclass : #BlElementStateEventHandler, + #category : 'Bloc-Basic-State' } -{ #category : 'private' } +{ #category : #private } BlElementDisabledStateEventHandler >> element: anElement enabled: aBoolean [ aBoolean ifTrue: [ anElement states removeState: BlElementState disabled ] ifFalse: [ anElement states addState: BlElementState disabled ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlElementDisabledStateEventHandler >> eventsToHandle [ ^ { BlElementDisabledStateWish } ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementDisabledStateEventHandler >> handleEvent: aBlElementDisabledStateWish [ self element: aBlElementDisabledStateWish currentTarget diff --git a/src/Bloc/BlElementDisabledStateWish.class.st b/src/Bloc/BlElementDisabledStateWish.class.st index 76115d789..126003b06 100644 --- a/src/Bloc/BlElementDisabledStateWish.class.st +++ b/src/Bloc/BlElementDisabledStateWish.class.st @@ -1,20 +1,18 @@ Class { - #name : 'BlElementDisabledStateWish', - #superclass : 'BlElementStateWish', + #name : #BlElementDisabledStateWish, + #superclass : #BlElementStateWish, #instVars : [ 'enabled' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementDisabledStateWish >> enabled [ ^ enabled ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementDisabledStateWish >> enabled: anObject [ enabled := anObject ] diff --git a/src/Bloc/BlElementDisjunctionState.class.st b/src/Bloc/BlElementDisjunctionState.class.st index eb2dd4162..9c63083da 100644 --- a/src/Bloc/BlElementDisjunctionState.class.st +++ b/src/Bloc/BlElementDisjunctionState.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlElementDisjunctionState', - #superclass : 'BlElementCompositeState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementDisjunctionState, + #superclass : #BlElementCompositeState, + #category : 'Bloc-Basic-State' } -{ #category : 'testing' } +{ #category : #testing } BlElementDisjunctionState >> matches: aSetOfStates [ ^ (self left matches: aSetOfStates) or: [ self right matches: aSetOfStates ] ] -{ #category : 'printing' } +{ #category : #printing } BlElementDisjunctionState >> printOn: aStream [ aStream nextPut: $(; diff --git a/src/Bloc/BlElementDynamicProperty.class.st b/src/Bloc/BlElementDynamicProperty.class.st index bf99b9818..ccbffaff2 100644 --- a/src/Bloc/BlElementDynamicProperty.class.st +++ b/src/Bloc/BlElementDynamicProperty.class.st @@ -1,46 +1,44 @@ Class { - #name : 'BlElementDynamicProperty', - #superclass : 'BlElementProperty', + #name : #BlElementDynamicProperty, + #superclass : #BlElementProperty, #instVars : [ 'applyAction', 'cleanAction' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementDynamicProperty >> applyAction [ ^ applyAction ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementDynamicProperty >> applyAction: anObject [ applyAction := anObject ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementDynamicProperty >> applyOnElement: anElement [ self applyAction cull: anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementDynamicProperty >> cleanAction [ ^ cleanAction ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementDynamicProperty >> cleanAction: anObject [ cleanAction := anObject ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementDynamicProperty >> cleanUpOnElement: anElement [ self cleanAction cull: anElement ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementDynamicProperty >> initialize [ super initialize. @@ -48,7 +46,7 @@ BlElementDynamicProperty >> initialize [ cleanAction := [ :anElement | ] ] -{ #category : 'generated' } +{ #category : #generated } BlElementDynamicProperty >> type [ ^ { self applyAction . self cleanAction } ] diff --git a/src/Bloc/BlElementDynamicTransformation.class.st b/src/Bloc/BlElementDynamicTransformation.class.st index 2ca562dc4..9c9b3af03 100644 --- a/src/Bloc/BlElementDynamicTransformation.class.st +++ b/src/Bloc/BlElementDynamicTransformation.class.st @@ -6,9 +6,7 @@ This also means that the matrix dimension (2D or 3D) should be determined dynami " Class { - #name : 'BlElementDynamicTransformation', - #superclass : 'BlElementTransformation', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #BlElementDynamicTransformation, + #superclass : #BlElementTransformation, + #category : 'Bloc-Basic-Transformations' } diff --git a/src/Bloc/BlElementEffect.class.st b/src/Bloc/BlElementEffect.class.st index 5011fd6db..8a79ab9ed 100644 --- a/src/Bloc/BlElementEffect.class.st +++ b/src/Bloc/BlElementEffect.class.st @@ -6,16 +6,14 @@ I can influence the bounds of my owner (used to clip my owner). " Class { - #name : 'BlElementEffect', - #superclass : 'Object', + #name : #BlElementEffect, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'geometry' } +{ #category : #geometry } BlElementEffect >> computeBounds: aBlBounds [ "Compute effect bounds based on provided geometry bounds. Default implementation simply returns given bounds" @@ -24,21 +22,21 @@ BlElementEffect >> computeBounds: aBlBounds [ ^ aBlBounds ] -{ #category : 'geometry' } +{ #category : #geometry } BlElementEffect >> effectBounds: aBlBounds of: anElement [ ^ self computeBounds: (aBlBounds rectangle: anElement visualBounds) ] -{ #category : 'testing' } +{ #category : #testing } BlElementEffect >> isNullEffect [ ^ false ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementEffect >> on: anElement [ ] -{ #category : 'testing' } +{ #category : #testing } BlElementEffect >> wantsCompositionLayer [ ^ false ] diff --git a/src/Bloc/BlElementEffectProperty.class.st b/src/Bloc/BlElementEffectProperty.class.st index fc17d9fe9..41e5f6a54 100644 --- a/src/Bloc/BlElementEffectProperty.class.st +++ b/src/Bloc/BlElementEffectProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementEffectProperty', - #superclass : 'BlElementProperty', + #name : #BlElementEffectProperty, + #superclass : #BlElementProperty, #instVars : [ 'effect' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementEffectProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,27 +18,27 @@ BlElementEffectProperty >> = anObject [ ^ effect = anObject effect ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementEffectProperty >> applyOnElement: anElement [ anElement effect: self effect ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementEffectProperty >> cleanUpOnElement: anElement [ anElement effect: BlNullEffect new ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementEffectProperty >> effect [ ^ effect ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementEffectProperty >> effect: anObject [ effect := anObject ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementEffectProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." diff --git a/src/Bloc/BlElementEvent.class.st b/src/Bloc/BlElementEvent.class.st index 6401db35e..44a351f88 100644 --- a/src/Bloc/BlElementEvent.class.st +++ b/src/Bloc/BlElementEvent.class.st @@ -5,29 +5,27 @@ See `BlElementEventExamples` for related examples. " Class { - #name : 'BlElementEvent', - #superclass : 'BlEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementEvent, + #superclass : #BlEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementEvent class >> disableIn: anEventDispatcher [ self subclassResponsibility ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementEvent class >> enableIn: anEventDispatcher [ self subclassResponsibility ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementEvent class >> wantedIn: anEventDispatcher [ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlElementEvent >> isElementEvent [ ^ true ] diff --git a/src/Bloc/BlElementEventDispatcher.class.st b/src/Bloc/BlElementEventDispatcher.class.st index f97807bd5..6660897cc 100644 --- a/src/Bloc/BlElementEventDispatcher.class.st +++ b/src/Bloc/BlElementEventDispatcher.class.st @@ -3,18 +3,16 @@ I am a special event dispatcher designed for high frequency events such as ""pos " Class { - #name : 'BlElementEventDispatcher', - #superclass : 'BlBubblingEventDispatcher', + #name : #BlElementEventDispatcher, + #superclass : #BlBubblingEventDispatcher, #instVars : [ 'activatedElementEvents', 'activatedGeneralEvents' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'adding' } +{ #category : #adding } BlElementEventDispatcher >> addEventHandler: aHandler [ "It is not very common to have event handlers so we initialize registry lazily" @@ -28,37 +26,37 @@ BlElementEventDispatcher >> addEventHandler: aHandler [ aHandler onInstalledIn: self owner ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableAddedToParent [ activatedElementEvents clearAddedToParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableAddedToSceneGraph [ activatedElementEvents clearAddedToSceneGraph ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableAddedToSuperParent [ activatedElementEvents clearAddedToSuperParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableBackgroundChanged [ activatedElementEvents clearBackgroundChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableBorderChanged [ activatedElementEvents clearBorderChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementEventDispatcher >> disableEventType: anEventClass [ anEventClass disableIn: self ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementEventDispatcher >> disableEventType: anEventClass while: aBlock [ self disableEventType: anEventClass. @@ -67,12 +65,12 @@ BlElementEventDispatcher >> disableEventType: anEventClass while: aBlock [ ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableExtentChanged [ activatedElementEvents clearExtentChanged ] -{ #category : 'api - general events' } +{ #category : #'api - general events' } BlElementEventDispatcher >> disableGeneralEventType: anEventClass [ activatedGeneralEvents ifNil: [ ^ self ]. @@ -81,139 +79,139 @@ BlElementEventDispatcher >> disableGeneralEventType: anEventClass [ ifEmpty: [ activatedGeneralEvents := nil ] ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableLayoutChanged [ activatedElementEvents clearLayoutChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableLayoutComputed [ activatedElementEvents clearLayoutComputed ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableMousePickedOutside [ activatedElementEvents clearMousePickedOutside ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disablePositionChanged [ activatedElementEvents clearPositionChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disablePositionInSpaceChanged [ activatedElementEvents clearPositionInSpaceChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableRemovedFromParent [ activatedElementEvents clearRemovedFromParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableRemovedFromSceneGraph [ activatedElementEvents clearRemovedFromSceneGraph ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableScrolledEvent [ activatedElementEvents clearScrolledEvent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableSelectionAcquired [ activatedElementEvents clearSelectionAcquired ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableSelectionLost [ activatedElementEvents clearSelectionLost ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableTransformationChanged [ activatedElementEvents clearTransformationChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> disableTransformationInSpaceChanged [ activatedElementEvents clearTransformationInSpaceChanged ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchAddedToParent [ activatedElementEvents hasAddedToParent ifTrue: [ self dispatchEvent: (BlElementAddedToParentEvent from: self owner) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchAddedToSceneGraph [ activatedElementEvents hasAddedToSceneGraph ifTrue: [ self dispatchEvent: (BlElementAddedToSceneGraphEvent from: self owner) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchBackgroundChanged [ activatedElementEvents hasBackgroundChanged ifTrue: [ self dispatchEvent: (BlElementBackgroundChangedEvent from: self) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchBorderChanged [ activatedElementEvents hasBorderChanged ifTrue: [ self dispatchEvent: (BlElementBorderChangedEvent from: self) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchExtentChanged [ activatedElementEvents hasExtentChanged ifTrue: [ self dispatchEvent: (BlElementExtentChangedEvent from: self owner) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchLayoutChanged [ activatedElementEvents hasLayoutChanged ifTrue: [ self dispatchEvent: (BlElementLayoutChangedEvent from: self) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchLayoutComputed [ activatedElementEvents hasLayoutComputed ifTrue: [ self dispatchEvent: (BlElementLayoutComputedEvent from: self) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchPositionChanged [ activatedElementEvents hasPositionChanged ifTrue: [ self dispatchEvent: (BlElementPositionChangedEvent from: self owner) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchPositionInSpaceChanged [ activatedElementEvents hasPositionInSpaceChanged ifTrue: [ self dispatchEvent: (BlElementPositionInSpaceChangedEvent from: self owner) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchRemovedFromParent [ activatedElementEvents hasRemovedFromParent ifTrue: [ self dispatchEvent: (BlElementRemovedFromParentEvent from: self owner) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchRemovedFromSceneGraph [ activatedElementEvents hasRemovedFromSceneGraph ifTrue: [ self dispatchEvent: (BlElementRemovedFromSceneGraphEvent from: self) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchScrolled: aDelta [ activatedElementEvents hasScrolledEvent ifTrue: [ self dispatchEvent: ((BlElementScrolledEvent from: self) delta: aDelta) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchSelectionAcquired: theBounds [ @@ -226,127 +224,127 @@ BlElementEventDispatcher >> dispatchSelectionAcquired: theBounds [ ifFalse: [ false ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchSelectionLost [ activatedElementEvents hasSelectionLost ifTrue: [ self dispatchEvent: (BlElementSelectionLostEvent from: self) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchTransformationChanged [ activatedElementEvents hasTransformationChanged ifTrue: [ self dispatchEvent: (BlElementTransformationChangedEvent from: self owner) ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementEventDispatcher >> dispatchTransformationInSpaceChanged [ activatedElementEvents hasTransformationInSpaceChanged ifTrue: [ self dispatchEvent: (BlElementTransformationInSpaceChangedEvent from: self owner) ] ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableAddedToParent [ activatedElementEvents addAddedToParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableAddedToSceneGraph [ activatedElementEvents addAddedToSceneGraph ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableAddedToSuperParent [ activatedElementEvents addAddedToSuperParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableBackgroundChanged [ activatedElementEvents addBackgroundChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableBorderChanged [ activatedElementEvents addBorderChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementEventDispatcher >> enableEventType: anEventClass [ anEventClass enableIn: self ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableExtentChanged [ activatedElementEvents addExtentChanged ] -{ #category : 'api - general events' } +{ #category : #'api - general events' } BlElementEventDispatcher >> enableGeneralEventType: anEventClass [ activatedGeneralEvents ifNil: [ activatedGeneralEvents := self newActivatedGeneralEvents ]. activatedGeneralEvents add: anEventClass ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableLayoutChanged [ activatedElementEvents addLayoutChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableLayoutComputed [ activatedElementEvents addLayoutComputed ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableMousePickedOutside [ activatedElementEvents addMousePickedOutside ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enablePositionChanged [ activatedElementEvents addPositionChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enablePositionInSpaceChanged [ activatedElementEvents addPositionInSpaceChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableRemovedFromParent [ activatedElementEvents addRemovedFromParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableRemovedFromSceneGraph [ activatedElementEvents addRemovedFromSceneGraph ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableScrolledEvent [ activatedElementEvents addScrolledEvent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableSelectionAcquired [ activatedElementEvents addSelectionAcquired ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableSelectionLost [ activatedElementEvents addSelectionLost ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableTransformationChanged [ activatedElementEvents addTransformationChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> enableTransformationInSpaceChanged [ activatedElementEvents addTransformationInSpaceChanged ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementEventDispatcher >> initialize [ super initialize. @@ -357,109 +355,109 @@ BlElementEventDispatcher >> initialize [ activatedGeneralEvents := nil ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementEventDispatcher >> newActivatedGeneralEvents [ ^ IdentitySet new ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsAddedToParent [ ^ activatedElementEvents hasAddedToParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsAddedToSceneGraph [ ^ activatedElementEvents hasAddedToSceneGraph ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsAddedToSuperParent [ ^ activatedElementEvents hasAddedToSuperParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsBackgroundChanged [ ^ activatedElementEvents hasBackgroundChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsBorderChanged [ ^ activatedElementEvents hasBorderChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementEventDispatcher >> wantsEventType: anEventClass [ ^ anEventClass wantedIn: self ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsExtentChanged [ ^ activatedElementEvents hasExtentChanged ] -{ #category : 'api - general events' } +{ #category : #'api - general events' } BlElementEventDispatcher >> wantsGeneralEventType: anEventClass [ ^ activatedGeneralEvents ifNil: [ false ] ifNotNil: [ :theActivatedEvents | theActivatedEvents includes: anEventClass ] ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsLayoutChanged [ ^ activatedElementEvents hasLayoutChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsLayoutComputed [ ^ activatedElementEvents hasLayoutComputed ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsMousePickedOutside [ ^ activatedElementEvents hasMousePickedOutside ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsPositionChanged [ ^ activatedElementEvents hasPositionChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsPositionInSpaceChanged [ ^ activatedElementEvents hasPositionInSpaceChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsRemovedFromParent [ ^ activatedElementEvents hasRemovedFromParent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsRemovedFromSceneGraph [ ^ activatedElementEvents hasRemovedFromSceneGraph ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsScrolledEvent [ ^ activatedElementEvents hasScrolledEvent ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsSelectionAcquired [ ^ activatedElementEvents hasSelectionAcquired ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsSelectionLost [ ^ activatedElementEvents hasSelectionLost ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsTransformationChanged [ ^ activatedElementEvents hasTransformationChanged ] -{ #category : 'api - element events' } +{ #category : #'api - element events' } BlElementEventDispatcher >> wantsTransformationInSpaceChanged [ ^ activatedElementEvents hasTransformationInSpaceChanged ] diff --git a/src/Bloc/BlElementEventDispatcherActivatedEvents.class.st b/src/Bloc/BlElementEventDispatcherActivatedEvents.class.st index a6e910772..a9319f585 100644 --- a/src/Bloc/BlElementEventDispatcherActivatedEvents.class.st +++ b/src/Bloc/BlElementEventDispatcherActivatedEvents.class.st @@ -3,8 +3,8 @@ I let event dispatcher know which events are enabled and which are not " Class { - #name : 'BlElementEventDispatcherActivatedEvents', - #superclass : 'BlBitflags', + #name : #BlElementEventDispatcherActivatedEvents, + #superclass : #BlBitflags, #classVars : [ 'AddedToParent', 'AddedToSceneGraph', @@ -25,120 +25,118 @@ Class { 'TransformationChanged', 'TransformationInSpaceChanged' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> AddedToParent [ "This method was automatically generated" ^ AddedToParent value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> AddedToSceneGraph [ "This method was automatically generated" ^ AddedToSceneGraph value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> AddedToSuperParent [ "This method was automatically generated" ^ AddedToSuperParent value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> BackgroundChanged [ "This method was automatically generated" ^ BackgroundChanged value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> BorderChanged [ "This method was automatically generated" ^ BorderChanged value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> ExtentChanged [ "This method was automatically generated" ^ ExtentChanged value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> LayoutChanged [ "This method was automatically generated" ^ LayoutChanged value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> LayoutComputed [ "This method was automatically generated" ^ LayoutComputed value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> MousePickedOutside [ "This method was automatically generated" ^ MousePickedOutside value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> PositionChanged [ "This method was automatically generated" ^ PositionChanged value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> PositionInSpaceChanged [ "This method was automatically generated" ^ PositionInSpaceChanged value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> RemovedFromParent [ "This method was automatically generated" ^ RemovedFromParent value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> RemovedFromSceneGraph [ "This method was automatically generated" ^ RemovedFromSceneGraph value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> ScrolledEvent [ "This method was automatically generated" ^ ScrolledEvent value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> SelectionAcquired [ "This method was automatically generated" ^ SelectionAcquired value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> SelectionLost [ "This method was automatically generated" ^ SelectionLost value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> TransformationChanged [ "This method was automatically generated" ^ TransformationChanged value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementEventDispatcherActivatedEvents class >> TransformationInSpaceChanged [ "This method was automatically generated" ^ TransformationInSpaceChanged value ] -{ #category : 'flags declaration' } +{ #category : #'flags declaration' } BlElementEventDispatcherActivatedEvents class >> flagsDecl [ " self rebuildFlagsAccessors @@ -168,7 +166,7 @@ BlElementEventDispatcherActivatedEvents class >> flagsDecl [ ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementEventDispatcherActivatedEvents class >> initialize [ "this method is needed else the information is not created. This is the sign of a bad design. @@ -176,325 +174,325 @@ BlElementEventDispatcherActivatedEvents class >> initialize [ super initialize. ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addAddedToParent [ "This method was automatically generated" value := value | AddedToParent value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addAddedToSceneGraph [ "This method was automatically generated" value := value | AddedToSceneGraph value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addAddedToSuperParent [ "This method was automatically generated" value := value | AddedToSuperParent value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addBackgroundChanged [ "This method was automatically generated" value := value | BackgroundChanged value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addBorderChanged [ "This method was automatically generated" value := value | BorderChanged value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addExtentChanged [ "This method was automatically generated" value := value | ExtentChanged value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addLayoutChanged [ "This method was automatically generated" value := value | LayoutChanged value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addLayoutComputed [ "This method was automatically generated" value := value | LayoutComputed value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addMousePickedOutside [ "This method was automatically generated" value := value | MousePickedOutside value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addPositionChanged [ "This method was automatically generated" value := value | PositionChanged value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addPositionInSpaceChanged [ "This method was automatically generated" value := value | PositionInSpaceChanged value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addRemovedFromParent [ "This method was automatically generated" value := value | RemovedFromParent value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addRemovedFromSceneGraph [ "This method was automatically generated" value := value | RemovedFromSceneGraph value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addScrolledEvent [ "This method was automatically generated" value := value | ScrolledEvent value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addSelectionAcquired [ "This method was automatically generated" value := value | SelectionAcquired value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addSelectionLost [ "This method was automatically generated" value := value | SelectionLost value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addTransformationChanged [ "This method was automatically generated" value := value | TransformationChanged value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementEventDispatcherActivatedEvents >> addTransformationInSpaceChanged [ "This method was automatically generated" value := value | TransformationInSpaceChanged value ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearAddedToParent [ "This method was automatically generated" value := value & (AddedToParent value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearAddedToSceneGraph [ "This method was automatically generated" value := value & (AddedToSceneGraph value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearAddedToSuperParent [ "This method was automatically generated" value := value & (AddedToSuperParent value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearBackgroundChanged [ "This method was automatically generated" value := value & (BackgroundChanged value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearBorderChanged [ "This method was automatically generated" value := value & (BorderChanged value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearExtentChanged [ "This method was automatically generated" value := value & (ExtentChanged value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearLayoutChanged [ "This method was automatically generated" value := value & (LayoutChanged value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearLayoutComputed [ "This method was automatically generated" value := value & (LayoutComputed value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearMousePickedOutside [ "This method was automatically generated" value := value & (MousePickedOutside value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearPositionChanged [ "This method was automatically generated" value := value & (PositionChanged value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearPositionInSpaceChanged [ "This method was automatically generated" value := value & (PositionInSpaceChanged value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearRemovedFromParent [ "This method was automatically generated" value := value & (RemovedFromParent value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearRemovedFromSceneGraph [ "This method was automatically generated" value := value & (RemovedFromSceneGraph value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearScrolledEvent [ "This method was automatically generated" value := value & (ScrolledEvent value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearSelectionAcquired [ "This method was automatically generated" value := value & (SelectionAcquired value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearSelectionLost [ "This method was automatically generated" value := value & (SelectionLost value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearTransformationChanged [ "This method was automatically generated" value := value & (TransformationChanged value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementEventDispatcherActivatedEvents >> clearTransformationInSpaceChanged [ "This method was automatically generated" value := value & (TransformationInSpaceChanged value bitInvert) ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasAddedToParent [ "This method was automatically generated" ^ (value & AddedToParent value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasAddedToSceneGraph [ "This method was automatically generated" ^ (value & AddedToSceneGraph value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasAddedToSuperParent [ "This method was automatically generated" ^ (value & AddedToSuperParent value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasBackgroundChanged [ "This method was automatically generated" ^ (value & BackgroundChanged value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasBorderChanged [ "This method was automatically generated" ^ (value & BorderChanged value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasExtentChanged [ "This method was automatically generated" ^ (value & ExtentChanged value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasLayoutChanged [ "This method was automatically generated" ^ (value & LayoutChanged value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasLayoutComputed [ "This method was automatically generated" ^ (value & LayoutComputed value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasMousePickedOutside [ "This method was automatically generated" ^ (value & MousePickedOutside value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasPositionChanged [ "This method was automatically generated" ^ (value & PositionChanged value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasPositionInSpaceChanged [ "This method was automatically generated" ^ (value & PositionInSpaceChanged value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasRemovedFromParent [ "This method was automatically generated" ^ (value & RemovedFromParent value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasRemovedFromSceneGraph [ "This method was automatically generated" ^ (value & RemovedFromSceneGraph value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasScrolledEvent [ "This method was automatically generated" ^ (value & ScrolledEvent value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasSelectionAcquired [ "This method was automatically generated" ^ (value & SelectionAcquired value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasSelectionLost [ "This method was automatically generated" ^ (value & SelectionLost value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasTransformationChanged [ "This method was automatically generated" ^ (value & TransformationChanged value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementEventDispatcherActivatedEvents >> hasTransformationInSpaceChanged [ "This method was automatically generated" ^ (value & TransformationInSpaceChanged value) ~= 0 diff --git a/src/Bloc/BlElementExtentChangedEvent.class.st b/src/Bloc/BlElementExtentChangedEvent.class.st index c3f58fffd..882ad0ba5 100644 --- a/src/Bloc/BlElementExtentChangedEvent.class.st +++ b/src/Bloc/BlElementExtentChangedEvent.class.st @@ -3,29 +3,27 @@ Is sent when element's extent in local coordinates changes. " Class { - #name : 'BlElementExtentChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementExtentChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementExtentChangedEvent class >> disableIn: anObject [ anObject disableExtentChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementExtentChangedEvent class >> enableIn: anObject [ anObject enableExtentChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementExtentChangedEvent class >> wantedIn: anObject [ ^ anObject wantsExtentChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementExtentChangedEvent >> sendTo: anObject [ anObject elementExtentChangedEvent: self ] diff --git a/src/Bloc/BlElementFlags.class.st b/src/Bloc/BlElementFlags.class.st index a496d0b28..f59eef0cb 100644 --- a/src/Bloc/BlElementFlags.class.st +++ b/src/Bloc/BlElementFlags.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlElementFlags', - #superclass : 'BlBitflags', + #name : #BlElementFlags, + #superclass : #BlBitflags, #classVars : [ 'NeedsLayout', 'NeedsPaint', @@ -9,48 +9,46 @@ Class { 'ShouldIgnoreLayoutRequests', 'WaitingLayout' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementFlags class >> NeedsLayout [ "This method was automatically generated" ^ NeedsLayout value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementFlags class >> NeedsPaint [ "This method was automatically generated" ^ NeedsPaint value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementFlags class >> ShouldChildrenHandleMouseEvents [ "This method was automatically generated" ^ ShouldChildrenHandleMouseEvents value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementFlags class >> ShouldHandleMouseEvents [ "This method was automatically generated" ^ ShouldHandleMouseEvents value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementFlags class >> ShouldIgnoreLayoutRequests [ "This method was automatically generated" ^ ShouldIgnoreLayoutRequests value ] -{ #category : 'accessing - flags' } +{ #category : #'accessing - flags' } BlElementFlags class >> WaitingLayout [ "This method was automatically generated" ^ WaitingLayout value ] -{ #category : 'flags declaration' } +{ #category : #'flags declaration' } BlElementFlags class >> flagsDecl [ " self rebuildFlagsAccessors @@ -66,7 +64,7 @@ BlElementFlags class >> flagsDecl [ } ] -{ #category : 'flags declaration' } +{ #category : #'flags declaration' } BlElementFlags class >> initialize [ "this method is needed else the information is not created. This is the sign of a bad design. @@ -74,109 +72,109 @@ BlElementFlags class >> initialize [ super initialize. ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementFlags >> addNeedsLayout [ "This method was automatically generated" value := value | NeedsLayout value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementFlags >> addNeedsPaint [ "This method was automatically generated" value := value | NeedsPaint value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementFlags >> addShouldChildrenHandleMouseEvents [ "This method was automatically generated" value := value | ShouldChildrenHandleMouseEvents value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementFlags >> addShouldHandleMouseEvents [ "This method was automatically generated" value := value | ShouldHandleMouseEvents value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementFlags >> addShouldIgnoreLayoutRequests [ "This method was automatically generated" value := value | ShouldIgnoreLayoutRequests value ] -{ #category : 'flags - add' } +{ #category : #'flags - add' } BlElementFlags >> addWaitingLayout [ "This method was automatically generated" value := value | WaitingLayout value ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementFlags >> clearNeedsLayout [ "This method was automatically generated" value := value & (NeedsLayout value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementFlags >> clearNeedsPaint [ "This method was automatically generated" value := value & (NeedsPaint value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementFlags >> clearShouldChildrenHandleMouseEvents [ "This method was automatically generated" value := value & (ShouldChildrenHandleMouseEvents value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementFlags >> clearShouldHandleMouseEvents [ "This method was automatically generated" value := value & (ShouldHandleMouseEvents value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementFlags >> clearShouldIgnoreLayoutRequests [ "This method was automatically generated" value := value & (ShouldIgnoreLayoutRequests value bitInvert) ] -{ #category : 'flags - clear' } +{ #category : #'flags - clear' } BlElementFlags >> clearWaitingLayout [ "This method was automatically generated" value := value & (WaitingLayout value bitInvert) ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementFlags >> hasNeedsLayout [ "This method was automatically generated" ^ (value & NeedsLayout value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementFlags >> hasNeedsPaint [ "This method was automatically generated" ^ (value & NeedsPaint value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementFlags >> hasShouldChildrenHandleMouseEvents [ "This method was automatically generated" ^ (value & ShouldChildrenHandleMouseEvents value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementFlags >> hasShouldHandleMouseEvents [ "This method was automatically generated" ^ (value & ShouldHandleMouseEvents value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementFlags >> hasShouldIgnoreLayoutRequests [ "This method was automatically generated" ^ (value & ShouldIgnoreLayoutRequests value) ~= 0 ] -{ #category : 'flags - testing' } +{ #category : #'flags - testing' } BlElementFlags >> hasWaitingLayout [ "This method was automatically generated" ^ (value & WaitingLayout value) ~= 0 diff --git a/src/Bloc/BlElementFocusedState.class.st b/src/Bloc/BlElementFocusedState.class.st index 623130c9f..0f1567e64 100644 --- a/src/Bloc/BlElementFocusedState.class.st +++ b/src/Bloc/BlElementFocusedState.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlElementFocusedState', - #superclass : 'BlElementUniqueState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementFocusedState, + #superclass : #BlElementUniqueState, + #category : 'Bloc-Basic-State' } -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementFocusedState >> optionalEventHandlerDo: aBlock [ aBlock value: BlElementFocusedStateEventHandler uniqueInstance ] -{ #category : 'printing' } +{ #category : #printing } BlElementFocusedState >> printOn: aStream [ aStream nextPutAll: 'focused' ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementFocusedState >> priority [ ^ 60 ] diff --git a/src/Bloc/BlElementFocusedStateEventHandler.class.st b/src/Bloc/BlElementFocusedStateEventHandler.class.st index dc9a9c303..c259b0c99 100644 --- a/src/Bloc/BlElementFocusedStateEventHandler.class.st +++ b/src/Bloc/BlElementFocusedStateEventHandler.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlElementFocusedStateEventHandler', - #superclass : 'BlElementStateEventHandler', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementFocusedStateEventHandler, + #superclass : #BlElementStateEventHandler, + #category : 'Bloc-Basic-State' } -{ #category : 'private' } +{ #category : #private } BlElementFocusedStateEventHandler >> element: anElement focused: aBoolean [ aBoolean ifTrue: [ anElement states addState: BlElementState focused ] ifFalse: [ anElement states removeState: BlElementState focused ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlElementFocusedStateEventHandler >> eventsToHandle [ ^ { BlFocusInEvent. @@ -21,12 +19,12 @@ BlElementFocusedStateEventHandler >> eventsToHandle [ } ] -{ #category : 'focus handlers' } +{ #category : #'focus handlers' } BlElementFocusedStateEventHandler >> focusInEvent: anEvent [ self element: anEvent currentTarget focused: true ] -{ #category : 'focus handlers' } +{ #category : #'focus handlers' } BlElementFocusedStateEventHandler >> focusOutEvent: anEvent [ self element: anEvent currentTarget focused: false ] diff --git a/src/Bloc/BlElementForegroundProperty.class.st b/src/Bloc/BlElementForegroundProperty.class.st index e05982dc1..3be045490 100644 --- a/src/Bloc/BlElementForegroundProperty.class.st +++ b/src/Bloc/BlElementForegroundProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementForegroundProperty', - #superclass : 'BlElementProperty', + #name : #BlElementForegroundProperty, + #superclass : #BlElementProperty, #instVars : [ 'foreground' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementForegroundProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,23 +18,23 @@ BlElementForegroundProperty >> = anObject [ ^ foreground = anObject foreground ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementForegroundProperty >> applyOnElement: anElement [ (anElement respondsTo: #foreground:) ifTrue: [ anElement foreground: self foreground ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementForegroundProperty >> foreground [ ^ foreground ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementForegroundProperty >> foreground: anObject [ foreground := anObject ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementForegroundProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." diff --git a/src/Bloc/BlElementForwardedStyle.class.st b/src/Bloc/BlElementForwardedStyle.class.st index fa2ce9336..c2dd1493f 100644 --- a/src/Bloc/BlElementForwardedStyle.class.st +++ b/src/Bloc/BlElementForwardedStyle.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementForwardedStyle', - #superclass : 'BlElementStyle', + #name : #BlElementForwardedStyle, + #superclass : #BlElementStyle, #instVars : [ 'targetObject' ], - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #category : 'Bloc-Basic-Style' } -{ #category : 'actions' } +{ #category : #actions } BlElementForwardedStyle >> applyOnElement: anElement [ (targetObject asBlocResolvedElementsFrom: anElement) @@ -17,7 +15,7 @@ BlElementForwardedStyle >> applyOnElement: anElement [ eachTargetObject properties addProperties: self properties ] ] -{ #category : 'converting' } +{ #category : #converting } BlElementForwardedStyle >> asForwarded: aTargetObject [ ^ targetObject == aTargetObject @@ -25,7 +23,7 @@ BlElementForwardedStyle >> asForwarded: aTargetObject [ ifFalse: [ super asForwarded: aTargetObject ] ] -{ #category : 'actions' } +{ #category : #actions } BlElementForwardedStyle >> cleanUpOnElement: anElement [ (targetObject asBlocResolvedElementsFrom: anElement) @@ -33,19 +31,19 @@ BlElementForwardedStyle >> cleanUpOnElement: anElement [ eachTargetObject properties removeProperties: self properties ] ] -{ #category : 'testing' } +{ #category : #testing } BlElementForwardedStyle >> isForwarded [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementForwardedStyle >> targetObject [ ^ targetObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementForwardedStyle >> targetObject: anObject [ targetObject := anObject diff --git a/src/Bloc/BlElementGeometry.class.st b/src/Bloc/BlElementGeometry.class.st index 2fcef00ac..ddd738875 100644 --- a/src/Bloc/BlElementGeometry.class.st +++ b/src/Bloc/BlElementGeometry.class.st @@ -1,14 +1,12 @@ Class { - #name : 'BlElementGeometry', - #superclass : 'Object', + #name : #BlElementGeometry, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'converting' } +{ #category : #converting } BlElementGeometry >> asElement [ "Answer an element with me as its geometry, with appropriate default values." @@ -30,7 +28,7 @@ BlElementGeometry >> asElement [ ^ anElement ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlElementGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ "Answer whether aPoint is contained by this geometry. Assume aPoint is already inside the geometry bounds rectangle." @@ -38,7 +36,7 @@ BlElementGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement ^ self subclassResponsibility ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElementGeometry >> geometryBounds: aBounds of: aBlElement [ "Load my geometry bounds for a given element in a mutable rectangle. @see #geometryBounds for more info" @@ -47,43 +45,43 @@ BlElementGeometry >> geometryBounds: aBounds of: aBlElement [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlElementGeometry >> hasCaps [ "Answer whether my path has caps, i.e. if I include an open line." ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlElementGeometry >> hasJoins [ "Answer whether I have joins, i.e. my path presents edges between a segment and another." ^ self subclassResponsibility ] -{ #category : 'geometry' } +{ #category : #geometry } BlElementGeometry >> matchElement: anElement [ "Adapt me to match the size of a given element" self subclassResponsibility ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlElementGeometry >> releaseCache [ self subclassResponsibility ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlElementGeometry >> releaseStrokedBoundsCache [ self subclassResponsibility ] -{ #category : 'serialization' } +{ #category : #serialization } BlElementGeometry >> storeOn: aStream [ aStream nextPutAll: self class name; space; nextPutAll: 'new' ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlElementGeometry >> strokedBounds: aBlBounds of: anElement [ "Return stroked bounds of a geometry if it would be stroked according to element's border configuration. Dispatch through outskirts first" diff --git a/src/Bloc/BlElementGeometryProperty.class.st b/src/Bloc/BlElementGeometryProperty.class.st index b7bab5f74..355c9fbef 100644 --- a/src/Bloc/BlElementGeometryProperty.class.st +++ b/src/Bloc/BlElementGeometryProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementGeometryProperty', - #superclass : 'BlElementProperty', + #name : #BlElementGeometryProperty, + #superclass : #BlElementProperty, #instVars : [ 'geometry' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementGeometryProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,34 +18,34 @@ BlElementGeometryProperty >> = anObject [ ^ geometry = anObject geometry ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementGeometryProperty >> applyOnElement: anElement [ anElement geometry: self geometry ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementGeometryProperty >> cleanUpOnElement: anElement [ anElement geometry: BlElementVisuals defaultGeometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementGeometryProperty >> geometry [ ^ geometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementGeometryProperty >> geometry: anObject [ geometry := anObject ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementGeometryProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ geometry hash ] -{ #category : 'printing' } +{ #category : #printing } BlElementGeometryProperty >> printOn: aStream [ aStream nextPutAll: 'Geometry - '; diff --git a/src/Bloc/BlElementHoveredEvent.class.st b/src/Bloc/BlElementHoveredEvent.class.st index a7d24fee3..6b0d909cf 100644 --- a/src/Bloc/BlElementHoveredEvent.class.st +++ b/src/Bloc/BlElementHoveredEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlElementHoveredEvent', - #superclass : 'BlElementStateEvent', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementHoveredEvent, + #superclass : #BlElementStateEvent, + #category : 'Bloc-Basic-State' } diff --git a/src/Bloc/BlElementHoveredState.class.st b/src/Bloc/BlElementHoveredState.class.st index 22724a30c..eb0c4f8e0 100644 --- a/src/Bloc/BlElementHoveredState.class.st +++ b/src/Bloc/BlElementHoveredState.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlElementHoveredState', - #superclass : 'BlElementUniqueState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementHoveredState, + #superclass : #BlElementUniqueState, + #category : 'Bloc-Basic-State' } -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementHoveredState >> optionalEventHandlerDo: aBlock [ aBlock value: BlElementHoveredStateEventHandler uniqueInstance ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementHoveredState >> optionalOnAddedTo: anElement [ anElement dispatchEvent: (BlElementHoveredEvent new element: anElement) ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementHoveredState >> optionalOnRemovedFrom: anElement [ anElement dispatchEvent: (BlElementUnhoveredEvent new element: anElement) ] -{ #category : 'printing' } +{ #category : #printing } BlElementHoveredState >> printOn: aStream [ aStream nextPutAll: 'hovered' ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementHoveredState >> priority [ ^ 10 ] diff --git a/src/Bloc/BlElementHoveredStateEventHandler.class.st b/src/Bloc/BlElementHoveredStateEventHandler.class.st index 27aae181b..27669129d 100644 --- a/src/Bloc/BlElementHoveredStateEventHandler.class.st +++ b/src/Bloc/BlElementHoveredStateEventHandler.class.st @@ -1,29 +1,27 @@ Class { - #name : 'BlElementHoveredStateEventHandler', - #superclass : 'BlElementStateEventHandler', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementHoveredStateEventHandler, + #superclass : #BlElementStateEventHandler, + #category : 'Bloc-Basic-State' } -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementHoveredStateEventHandler >> dragEnterEvent: anEvent [ self element: anEvent currentTarget hovered: true ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementHoveredStateEventHandler >> dragLeaveEvent: anEvent [ self element: anEvent currentTarget hovered: false ] -{ #category : 'private' } +{ #category : #private } BlElementHoveredStateEventHandler >> element: anElement hovered: aBoolean [ aBoolean ifTrue: [ anElement states addState: BlElementState hovered ] ifFalse: [ anElement states removeState: BlElementState hovered ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlElementHoveredStateEventHandler >> eventsToHandle [ ^ { BlDragEnterEvent. @@ -33,12 +31,12 @@ BlElementHoveredStateEventHandler >> eventsToHandle [ } ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementHoveredStateEventHandler >> mouseEnterEvent: anEvent [ self element: anEvent currentTarget hovered: true ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementHoveredStateEventHandler >> mouseLeaveEvent: anEvent [ self element: anEvent currentTarget hovered: false ] diff --git a/src/Bloc/BlElementId.class.st b/src/Bloc/BlElementId.class.st index c4db4a4c2..b3d90b0a0 100644 --- a/src/Bloc/BlElementId.class.st +++ b/src/Bloc/BlElementId.class.st @@ -5,35 +5,33 @@ Allows to assign id to {{gtClass:BlElement}}. This allows us query a tree of ele " Class { - #name : 'BlElementId', - #superclass : 'Object', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #name : #BlElementId, + #superclass : #Object, + #category : 'Bloc-Basic-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementId class >> named: aSymbol [ ^ BlElementNamedId new identifier: aSymbol asSymbol ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementId class >> noId [ ^ BlElementNoId uniqueInstance ] -{ #category : 'converting' } +{ #category : #converting } BlElementId >> asBlocElementId [ ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlElementId >> asSymbol [ ^ self subclassResponsibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementId >> hash [ "Hash must always be based on the symbolm to support proper comparison between ids that are just constructed differently but have same symbolic id" @@ -41,7 +39,7 @@ BlElementId >> hash [ ^ self asSymbol hash ] -{ #category : 'converting' } +{ #category : #converting } BlElementId >> indexed: anIndex [ "Convert me to an indexed id with a given index" @@ -51,23 +49,23 @@ BlElementId >> indexed: anIndex [ index: anIndex ] -{ #category : 'converting' } +{ #category : #converting } BlElementId >> isBlocElementId [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlElementId >> isIndexed [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlElementId >> isNoId [ ^ false ] -{ #category : 'printing' } +{ #category : #printing } BlElementId >> printOn: aStream [ self class isAbstract ifTrue: [ aStream print: self ] diff --git a/src/Bloc/BlElementIdentityTransformation.class.st b/src/Bloc/BlElementIdentityTransformation.class.st index 7c817d18f..a6a3766a3 100644 --- a/src/Bloc/BlElementIdentityTransformation.class.st +++ b/src/Bloc/BlElementIdentityTransformation.class.st @@ -4,66 +4,64 @@ I'm an element's identity transformation: a stateless transformation object that I provide a singleton instance. " Class { - #name : 'BlElementIdentityTransformation', - #superclass : 'BlElementTransformation', + #name : #BlElementIdentityTransformation, + #superclass : #BlElementTransformation, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementIdentityTransformation class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementIdentityTransformation class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementIdentityTransformation >> affineTransformationsDo: aBlockClosure [ "Do nothing" ] -{ #category : 'converting' } +{ #category : #converting } BlElementIdentityTransformation >> asCachedTransformation [ ^ BlElementCachedIdentityTransformation uniqueInstance ] -{ #category : 'computation' } +{ #category : #computation } BlElementIdentityTransformation >> computeMatrix: aBlMatrix in: aRectangle [ ^ aBlMatrix ] -{ #category : 'testing' } +{ #category : #testing } BlElementIdentityTransformation >> is2D [ "Return true if my current transformation is in 2D space, false otherwise" ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlElementIdentityTransformation >> is3D [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlElementIdentityTransformation >> isIdentity [ "Return true if I represent an identity transformation, false otherwise" ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlElementIdentityTransformation >> isPureTranslation [ "Return true if the receiver specifies no rotation or scaling and represents only translation in xy 2D plane" diff --git a/src/Bloc/BlElementIndexedId.class.st b/src/Bloc/BlElementIndexedId.class.st index e7af6b68e..86af2f968 100644 --- a/src/Bloc/BlElementIndexedId.class.st +++ b/src/Bloc/BlElementIndexedId.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlElementIndexedId', - #superclass : 'BlElementId', + #name : #BlElementIndexedId, + #superclass : #BlElementId, #instVars : [ 'prefixId', 'index' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementIndexedId >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -25,7 +23,7 @@ BlElementIndexedId >> = anObject [ ^ self asSymbol = anObject asSymbol ] -{ #category : 'converting' } +{ #category : #converting } BlElementIndexedId >> asSymbol [ ^ Symbol streamContents: [ :aStream | aStream @@ -34,31 +32,31 @@ BlElementIndexedId >> asSymbol [ print: self index ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementIndexedId >> index [ ^ index ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementIndexedId >> index: aNumber [ index := aNumber ] -{ #category : 'testing' } +{ #category : #testing } BlElementIndexedId >> isIndexed [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementIndexedId >> prefixId [ ^ prefixId ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementIndexedId >> prefixId: aBlElementId [ prefixId := aBlElementId ] diff --git a/src/Bloc/BlElementIntendedProperties.class.st b/src/Bloc/BlElementIntendedProperties.class.st index d1f3e70f2..d9ed5161d 100644 --- a/src/Bloc/BlElementIntendedProperties.class.st +++ b/src/Bloc/BlElementIntendedProperties.class.st @@ -1,49 +1,47 @@ Class { - #name : 'BlElementIntendedProperties', - #superclass : 'BlElementProperties', + #name : #BlElementIntendedProperties, + #superclass : #BlElementProperties, #instVars : [ 'properties' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'adding' } +{ #category : #adding } BlElementIntendedProperties >> addProperties: aCollectionOfBlElementProperty [ aCollectionOfBlElementProperty do: [ :eachProperty | self addProperty: eachProperty ] ] -{ #category : 'adding' } +{ #category : #adding } BlElementIntendedProperties >> addProperty: aBlElementProperty [ properties at: aBlElementProperty type put: aBlElementProperty ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementIntendedProperties >> initialize [ super initialize. properties := IdentityDictionary new ] -{ #category : 'copying' } +{ #category : #copying } BlElementIntendedProperties >> postCopy [ properties := properties copy ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementIntendedProperties >> properties [ ^ properties ] -{ #category : 'removing' } +{ #category : #removing } BlElementIntendedProperties >> removeProperties: aCollectionOfElementProperties [ aCollectionOfElementProperties do: [ :eachProperty | self removeProperty: eachProperty ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementIntendedProperties >> removeProperty: aBlElementProperty [ properties removeKey: aBlElementProperty type diff --git a/src/Bloc/BlElementLayoutChangedEvent.class.st b/src/Bloc/BlElementLayoutChangedEvent.class.st index 4b04b0c07..dc7bb3f66 100644 --- a/src/Bloc/BlElementLayoutChangedEvent.class.st +++ b/src/Bloc/BlElementLayoutChangedEvent.class.st @@ -13,29 +13,27 @@ element layout: BlBasicLayout new " Class { - #name : 'BlElementLayoutChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementLayoutChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementLayoutChangedEvent class >> disableIn: anObject [ anObject disableLayoutChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementLayoutChangedEvent class >> enableIn: anObject [ anObject enableLayoutChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementLayoutChangedEvent class >> wantedIn: anObject [ ^ anObject wantsLayoutChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementLayoutChangedEvent >> sendTo: anObject [ anObject elementLayoutChangedEvent: self ] diff --git a/src/Bloc/BlElementLayoutComputedEvent.class.st b/src/Bloc/BlElementLayoutComputedEvent.class.st index 263e99858..8774e04de 100644 --- a/src/Bloc/BlElementLayoutComputedEvent.class.st +++ b/src/Bloc/BlElementLayoutComputedEvent.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlElementLayoutComputedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementLayoutComputedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementLayoutComputedEvent class >> disableIn: anObject [ anObject disableLayoutComputed ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementLayoutComputedEvent class >> enableIn: anObject [ anObject enableLayoutComputed ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementLayoutComputedEvent class >> wantedIn: anObject [ ^ anObject wantsLayoutComputed ] -{ #category : 'sending' } +{ #category : #sending } BlElementLayoutComputedEvent >> sendTo: anObject [ anObject elementLayoutComputedEvent: self ] diff --git a/src/Bloc/BlElementLayoutHorizontalResizerProperty.class.st b/src/Bloc/BlElementLayoutHorizontalResizerProperty.class.st index 32033fb16..da0596798 100644 --- a/src/Bloc/BlElementLayoutHorizontalResizerProperty.class.st +++ b/src/Bloc/BlElementLayoutHorizontalResizerProperty.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlElementLayoutHorizontalResizerProperty', - #superclass : 'BlElementLayoutResizerProperty', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlElementLayoutHorizontalResizerProperty, + #superclass : #BlElementLayoutResizerProperty, + #category : 'Bloc-Basic-Properties' } -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementLayoutHorizontalResizerProperty >> applyOnElement: anElement [ anElement constraints horizontal resizer = self resizer ifTrue: [ ^ self ]. @@ -14,7 +12,7 @@ BlElementLayoutHorizontalResizerProperty >> applyOnElement: anElement [ anElement constraintsDo: [ :c | c horizontal resizer: self resizer ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLayoutHorizontalResizerProperty >> printOn: aStream [ aStream nextPutAll: 'Vertical resizer - '; diff --git a/src/Bloc/BlElementLayoutProperty.class.st b/src/Bloc/BlElementLayoutProperty.class.st index c55d7c2da..f597cc1cd 100644 --- a/src/Bloc/BlElementLayoutProperty.class.st +++ b/src/Bloc/BlElementLayoutProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementLayoutProperty', - #superclass : 'BlElementProperty', + #name : #BlElementLayoutProperty, + #superclass : #BlElementProperty, #instVars : [ 'layout' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementLayoutProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,29 +18,29 @@ BlElementLayoutProperty >> = anObject [ ^ layout = anObject layout ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementLayoutProperty >> applyOnElement: anElement [ anElement layout: self layout ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementLayoutProperty >> cleanUpOnElement: anElement [ anElement layout: anElement defaultLayout ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementLayoutProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ layout hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLayoutProperty >> layout [ ^ layout ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLayoutProperty >> layout: anObject [ layout := anObject ] diff --git a/src/Bloc/BlElementLayoutResizerProperty.class.st b/src/Bloc/BlElementLayoutResizerProperty.class.st index c100d5114..fb6fe0601 100644 --- a/src/Bloc/BlElementLayoutResizerProperty.class.st +++ b/src/Bloc/BlElementLayoutResizerProperty.class.st @@ -1,40 +1,38 @@ Class { - #name : 'BlElementLayoutResizerProperty', - #superclass : 'BlElementProperty', + #name : #BlElementLayoutResizerProperty, + #superclass : #BlElementProperty, #instVars : [ 'resizer' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'api - layout resizeable' } +{ #category : #'api - layout resizeable' } BlElementLayoutResizerProperty >> exact: aNumber [ self resizer: (BlLayoutResizer exact: aNumber) ] -{ #category : 'api - layout resizeable' } +{ #category : #'api - layout resizeable' } BlElementLayoutResizerProperty >> fitContent [ self resizer: BlLayoutResizer fitContent ] -{ #category : 'api - layout resizeable' } +{ #category : #'api - layout resizeable' } BlElementLayoutResizerProperty >> fitContentLimited [ self resizer: BlLayoutResizer fitContentLimited ] -{ #category : 'api - layout resizeable' } +{ #category : #'api - layout resizeable' } BlElementLayoutResizerProperty >> matchParent [ self resizer: BlLayoutResizer matchParent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLayoutResizerProperty >> resizer [ ^ resizer ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLayoutResizerProperty >> resizer: anObject [ resizer := anObject ] diff --git a/src/Bloc/BlElementLayoutVerticalResizerProperty.class.st b/src/Bloc/BlElementLayoutVerticalResizerProperty.class.st index fadb75079..c00ea5948 100644 --- a/src/Bloc/BlElementLayoutVerticalResizerProperty.class.st +++ b/src/Bloc/BlElementLayoutVerticalResizerProperty.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlElementLayoutVerticalResizerProperty', - #superclass : 'BlElementLayoutResizerProperty', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlElementLayoutVerticalResizerProperty, + #superclass : #BlElementLayoutResizerProperty, + #category : 'Bloc-Basic-Properties' } -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementLayoutVerticalResizerProperty >> applyOnElement: anElement [ anElement constraints vertical resizer = self resizer ifTrue: [ ^ self ]. @@ -14,7 +12,7 @@ BlElementLayoutVerticalResizerProperty >> applyOnElement: anElement [ anElement constraintsDo: [ :c | c vertical resizer: self resizer ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLayoutVerticalResizerProperty >> printOn: aStream [ aStream nextPutAll: 'Horizontal resizer - '; diff --git a/src/Bloc/BlElementLocalBounds.class.st b/src/Bloc/BlElementLocalBounds.class.st index c4a6dad10..16a177ff6 100644 --- a/src/Bloc/BlElementLocalBounds.class.st +++ b/src/Bloc/BlElementLocalBounds.class.st @@ -1,30 +1,28 @@ Class { - #name : 'BlElementLocalBounds', - #superclass : 'BlElementBounds', + #name : #BlElementLocalBounds, + #superclass : #BlElementBounds, #instVars : [ 'extent', 'position' ], - #category : 'Bloc-Basic-Bounds', - #package : 'Bloc', - #tag : 'Basic-Bounds' + #category : 'Bloc-Basic-Bounds' } -{ #category : 'converting' } +{ #category : #converting } BlElementLocalBounds >> asRectangle [ ^ self position extent: self extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalBounds >> bounds [ ^ BlBounds origin: self position extent: self extent ] -{ #category : 'geometry - accessing' } +{ #category : #'geometry - accessing' } BlElementLocalBounds >> center [ "Return a point representing a geometrical center of this bounds" @@ -32,28 +30,28 @@ BlElementLocalBounds >> center [ ^ self position + (self extent / 2.0) ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalBounds >> extent [ ^ extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalBounds >> extent: aPoint [ "aPoint should satisfy isBlocFiniteFloatPoint and isBlocPositivePoint" extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalBounds >> height [ ^ self extent y ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementLocalBounds >> inChild: anElement [ @@ -64,7 +62,7 @@ BlElementLocalBounds >> inChild: anElement [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementLocalBounds >> inLocal [ @@ -74,7 +72,7 @@ BlElementLocalBounds >> inLocal [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementLocalBounds >> inParent [ @@ -85,7 +83,7 @@ BlElementLocalBounds >> inParent [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementLocalBounds >> inParent: anElement [ | subParent | @@ -102,7 +100,7 @@ BlElementLocalBounds >> inParent: anElement [ yourself ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementLocalBounds >> inSpace [ @@ -112,7 +110,7 @@ BlElementLocalBounds >> inSpace [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementLocalBounds >> initialize [ super initialize. @@ -120,7 +118,7 @@ BlElementLocalBounds >> initialize [ extent := 0.0@0.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalBounds >> position [ "Return bounds position (an origin) as a Point" @@ -128,21 +126,21 @@ BlElementLocalBounds >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalBounds >> position: aPoint [ "aPoint should satisfy #isBlocFiniteFloatPoint" position := aPoint ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlElementLocalBounds >> transformed [ ^ self inLocal transformed ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalBounds >> width [ diff --git a/src/Bloc/BlElementLocalTransformation.class.st b/src/Bloc/BlElementLocalTransformation.class.st index 1807e2d13..27b286fde 100644 --- a/src/Bloc/BlElementLocalTransformation.class.st +++ b/src/Bloc/BlElementLocalTransformation.class.st @@ -5,23 +5,21 @@ Transformation matrix is computed lazily up-on request for #matrix. " Class { - #name : 'BlElementLocalTransformation', - #superclass : 'BlElementDynamicTransformation', + #name : #BlElementLocalTransformation, + #superclass : #BlElementDynamicTransformation, #instVars : [ 'affineTransformation' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementLocalTransformation class >> new [ ^ self newWith: BlAffineCompositeTransformation new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementLocalTransformation class >> newWith: aBlAffineTransformation [ ^ self basicNew @@ -29,46 +27,46 @@ BlElementLocalTransformation class >> newWith: aBlAffineTransformation [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalTransformation >> affineTransformation [ ^ affineTransformation ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementLocalTransformation >> affineTransformationsDo: aBlockClosure [ affineTransformation do: aBlockClosure ] -{ #category : 'computation' } +{ #category : #computation } BlElementLocalTransformation >> computeMatrix: aBlMatrix in: aRectangle [ affineTransformation multiplyOn: aBlMatrix in: aRectangle ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementLocalTransformation >> initializeWith: aBlAffineTransformation [ self initialize. affineTransformation := aBlAffineTransformation ] -{ #category : 'testing' } +{ #category : #testing } BlElementLocalTransformation >> is2D [ "Return true if my current transformation is in 2D space, false otherwise" ^ affineTransformation is2D ] -{ #category : 'testing' } +{ #category : #testing } BlElementLocalTransformation >> is3D [ "Return true if my current transformation is in 3D space, false otherwise" ^ affineTransformation is3D ] -{ #category : 'testing' } +{ #category : #testing } BlElementLocalTransformation >> isIdentity [ "Return true if I represent an identity transformation, false otherwise" @@ -76,21 +74,21 @@ BlElementLocalTransformation >> isIdentity [ ^ affineTransformation isIdentity ] -{ #category : 'testing' } +{ #category : #testing } BlElementLocalTransformation >> isPureTranslation [ "Return true if I represent an pure translation, false otherwise" ^ affineTransformation isTranslation ] -{ #category : 'copying' } +{ #category : #copying } BlElementLocalTransformation >> postCopy [ super postCopy. affineTransformation := affineTransformation copy ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementLocalTransformation >> transformation [ self diff --git a/src/Bloc/BlElementMarginProperty.class.st b/src/Bloc/BlElementMarginProperty.class.st index 28fc6c097..15a7bff04 100644 --- a/src/Bloc/BlElementMarginProperty.class.st +++ b/src/Bloc/BlElementMarginProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementMarginProperty', - #superclass : 'BlElementProperty', + #name : #BlElementMarginProperty, + #superclass : #BlElementProperty, #instVars : [ 'margin' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementMarginProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,24 +18,24 @@ BlElementMarginProperty >> = anObject [ ^ margin = anObject margin ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementMarginProperty >> applyOnElement: anElement [ anElement margin: self margin ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementMarginProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ margin hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementMarginProperty >> margin [ ^ margin ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementMarginProperty >> margin: anObject [ margin := anObject ] diff --git a/src/Bloc/BlElementMaybeResolvedProperties.class.st b/src/Bloc/BlElementMaybeResolvedProperties.class.st index 39106cf20..aaf1bc68e 100644 --- a/src/Bloc/BlElementMaybeResolvedProperties.class.st +++ b/src/Bloc/BlElementMaybeResolvedProperties.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlElementMaybeResolvedProperties', - #superclass : 'BlElementProperties', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlElementMaybeResolvedProperties, + #superclass : #BlElementProperties, + #category : 'Bloc-Basic-Properties' } -{ #category : 'actions' } +{ #category : #actions } BlElementMaybeResolvedProperties >> applyOnElement: anElement [ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementMaybeResolvedProperties >> propertyAt: aPropertyType ifFound: aFoundBlock [ ^ self propertyAt: aPropertyType @@ -19,12 +17,12 @@ BlElementMaybeResolvedProperties >> propertyAt: aPropertyType ifFound: aFoundBlo ifNone: [ nil ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementMaybeResolvedProperties >> propertyAt: aPropertyType ifFound: aFoundBlock ifNone: aNoneBlock [ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementMaybeResolvedProperties >> propertyAt: aPropertyType ifNone: aNoneBlock [ ^ self propertyAt: aPropertyType diff --git a/src/Bloc/BlElementNamedId.class.st b/src/Bloc/BlElementNamedId.class.st index 6bc7a309f..118748f48 100644 --- a/src/Bloc/BlElementNamedId.class.st +++ b/src/Bloc/BlElementNamedId.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementNamedId', - #superclass : 'BlElementId', + #name : #BlElementNamedId, + #superclass : #BlElementId, #instVars : [ 'identifier' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementNamedId >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -24,19 +22,19 @@ BlElementNamedId >> = anObject [ ^ self asSymbol = anObject asSymbol ] -{ #category : 'converting' } +{ #category : #converting } BlElementNamedId >> asSymbol [ ^ self identifier ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementNamedId >> identifier [ ^ identifier ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementNamedId >> identifier: aSymbol [ identifier ifNotNil: [ (BlImmutableObjectChangeError object: self) signal ]. diff --git a/src/Bloc/BlElementNegationState.class.st b/src/Bloc/BlElementNegationState.class.st index dfe458131..88019ac25 100644 --- a/src/Bloc/BlElementNegationState.class.st +++ b/src/Bloc/BlElementNegationState.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementNegationState', - #superclass : 'BlElementState', + #name : #BlElementNegationState, + #superclass : #BlElementState, #instVars : [ 'state' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementNegationState >> = anotherState [ anotherState == self ifTrue: [ ^ true ]. @@ -20,27 +18,27 @@ BlElementNegationState >> = anotherState [ ^ self state = anotherState state ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementNegationState >> hash [ ^ self class hash bitXor: self state hash ] -{ #category : 'testing' } +{ #category : #testing } BlElementNegationState >> matches: aSetOfStates [ ^ (self state matches: aSetOfStates) not ] -{ #category : 'controlling' } +{ #category : #controlling } BlElementNegationState >> not [ ^ self state ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementNegationState >> optionalEventHandlerDo: aBlock [ state optionalEventHandlerDo: aBlock ] -{ #category : 'printing' } +{ #category : #printing } BlElementNegationState >> printOn: aStream [ aStream nextPut: $(; @@ -49,22 +47,22 @@ BlElementNegationState >> printOn: aStream [ nextPut: $) ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementNegationState >> priority [ ^ self state priority ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementNegationState >> state [ ^ state ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementNegationState >> state: anObject [ state := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementNegationState >> type [ "Return an object used to compare two states when adding to the collection of states in order to prevent elements from having duplicated states" diff --git a/src/Bloc/BlElementNoId.class.st b/src/Bloc/BlElementNoId.class.st index b528bc011..b77496544 100644 --- a/src/Bloc/BlElementNoId.class.st +++ b/src/Bloc/BlElementNoId.class.st @@ -1,42 +1,40 @@ Class { - #name : 'BlElementNoId', - #superclass : 'BlElementId', + #name : #BlElementNoId, + #superclass : #BlElementId, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementNoId class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementNoId class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementNoId >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'converting' } +{ #category : #converting } BlElementNoId >> asSymbol [ ^ nil ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementNoId >> hash [ ^ self class hash ] -{ #category : 'testing' } +{ #category : #testing } BlElementNoId >> isNoId [ ^ true ] diff --git a/src/Bloc/BlElementPaddingProperty.class.st b/src/Bloc/BlElementPaddingProperty.class.st index 3e4c1858a..99f5c291d 100644 --- a/src/Bloc/BlElementPaddingProperty.class.st +++ b/src/Bloc/BlElementPaddingProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementPaddingProperty', - #superclass : 'BlElementProperty', + #name : #BlElementPaddingProperty, + #superclass : #BlElementProperty, #instVars : [ 'padding' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementPaddingProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,24 +18,24 @@ BlElementPaddingProperty >> = anObject [ ^ padding = anObject padding ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementPaddingProperty >> applyOnElement: anElement [ anElement padding: self padding ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementPaddingProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ padding hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementPaddingProperty >> padding [ ^ padding ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementPaddingProperty >> padding: anObject [ padding := anObject ] diff --git a/src/Bloc/BlElementPositionChangedEvent.class.st b/src/Bloc/BlElementPositionChangedEvent.class.st index 821d508f6..f093bc5ef 100644 --- a/src/Bloc/BlElementPositionChangedEvent.class.st +++ b/src/Bloc/BlElementPositionChangedEvent.class.st @@ -5,29 +5,27 @@ Note: position may change even if an element has no parent " Class { - #name : 'BlElementPositionChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementPositionChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementPositionChangedEvent class >> disableIn: anObject [ anObject disablePositionChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementPositionChangedEvent class >> enableIn: anObject [ anObject enablePositionChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementPositionChangedEvent class >> wantedIn: anObject [ ^ anObject wantsPositionChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementPositionChangedEvent >> sendTo: anObject [ anObject elementPositionChangedEvent: self ] diff --git a/src/Bloc/BlElementPositionInSpaceChangedEvent.class.st b/src/Bloc/BlElementPositionInSpaceChangedEvent.class.st index f0e44edd2..2c17031ef 100644 --- a/src/Bloc/BlElementPositionInSpaceChangedEvent.class.st +++ b/src/Bloc/BlElementPositionInSpaceChangedEvent.class.st @@ -5,29 +5,27 @@ Position in space may change even if element's #position is still the same. It c " Class { - #name : 'BlElementPositionInSpaceChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementPositionInSpaceChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementPositionInSpaceChangedEvent class >> disableIn: anObject [ anObject disablePositionInSpaceChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementPositionInSpaceChangedEvent class >> enableIn: anObject [ anObject enablePositionInSpaceChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementPositionInSpaceChangedEvent class >> wantedIn: anObject [ ^ anObject wantsPositionInSpaceChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementPositionInSpaceChangedEvent >> sendTo: anObject [ anObject elementPositionInSpaceChangedEvent: self ] diff --git a/src/Bloc/BlElementPressedState.class.st b/src/Bloc/BlElementPressedState.class.st index 0ec05e271..4856a12b2 100644 --- a/src/Bloc/BlElementPressedState.class.st +++ b/src/Bloc/BlElementPressedState.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlElementPressedState', - #superclass : 'BlElementUniqueState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementPressedState, + #superclass : #BlElementUniqueState, + #category : 'Bloc-Basic-State' } -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementPressedState >> optionalEventHandlerDo: aBlock [ aBlock value: BlElementPressedStateEventHandler uniqueInstance ] -{ #category : 'printing' } +{ #category : #printing } BlElementPressedState >> printOn: aStream [ aStream nextPutAll: 'pressed' ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementPressedState >> priority [ ^ 20 ] diff --git a/src/Bloc/BlElementPressedStateEventHandler.class.st b/src/Bloc/BlElementPressedStateEventHandler.class.st index 4869ba134..7bccf8a76 100644 --- a/src/Bloc/BlElementPressedStateEventHandler.class.st +++ b/src/Bloc/BlElementPressedStateEventHandler.class.st @@ -1,30 +1,28 @@ Class { - #name : 'BlElementPressedStateEventHandler', - #superclass : 'BlElementStateEventHandler', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementPressedStateEventHandler, + #superclass : #BlElementStateEventHandler, + #category : 'Bloc-Basic-State' } -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementPressedStateEventHandler >> dragEndEvent: anEvent [ self element: anEvent currentTarget pressed: false ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementPressedStateEventHandler >> dragStartEvent: anEvent [ anEvent consumed: true. self element: anEvent currentTarget pressed: true ] -{ #category : 'private' } +{ #category : #private } BlElementPressedStateEventHandler >> element: anElement pressed: aBoolean [ aBoolean ifTrue: [ anElement states addState: BlElementState pressed ] ifFalse: [ anElement states removeState: BlElementState pressed ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlElementPressedStateEventHandler >> eventsToHandle [ ^ { BlDragEndEvent. @@ -34,13 +32,13 @@ BlElementPressedStateEventHandler >> eventsToHandle [ } ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementPressedStateEventHandler >> mouseDownEvent: anEvent [ anEvent consumed: true. self element: anEvent currentTarget pressed: true ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlElementPressedStateEventHandler >> mouseUpEvent: anEvent [ anEvent consumed: true. self element: anEvent currentTarget pressed: false diff --git a/src/Bloc/BlElementPropagatableProperties.class.st b/src/Bloc/BlElementPropagatableProperties.class.st index 932460ebf..8b23ccfac 100644 --- a/src/Bloc/BlElementPropagatableProperties.class.st +++ b/src/Bloc/BlElementPropagatableProperties.class.st @@ -1,23 +1,21 @@ Class { - #name : 'BlElementPropagatableProperties', - #superclass : 'BlElementResolvedProperties', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlElementPropagatableProperties, + #superclass : #BlElementResolvedProperties, + #category : 'Bloc-Basic-Properties' } -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementPropagatableProperties >> flushPropertiesToRemove [ ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementPropagatableProperties >> initialize [ super initialize. properties := Dictionary new ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementPropagatableProperties >> propertiesToPropagateToChildren [ ^ self ] diff --git a/src/Bloc/BlElementProperties.class.st b/src/Bloc/BlElementProperties.class.st index 77587ecee..75bb1c4cf 100644 --- a/src/Bloc/BlElementProperties.class.st +++ b/src/Bloc/BlElementProperties.class.st @@ -5,29 +5,27 @@ For example font size is by default inherited by the children " Class { - #name : 'BlElementProperties', - #superclass : 'Object', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlElementProperties, + #superclass : #Object, + #category : 'Bloc-Basic-Properties' } -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementProperties >> do: aBlock [ self properties do: aBlock ] -{ #category : 'testing' } +{ #category : #testing } BlElementProperties >> isEmpty [ ^ self properties isEmpty ] -{ #category : 'testing' } +{ #category : #testing } BlElementProperties >> isNotEmpty [ ^ self properties isNotEmpty ] -{ #category : 'printing' } +{ #category : #printing } BlElementProperties >> printOn: aStream [ "Append a sequence of characters to aStream that identify the receiver." @@ -37,12 +35,12 @@ BlElementProperties >> printOn: aStream [ print: self properties ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementProperties >> properties [ ^ #() ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementProperties >> size [ ^ self properties size ] diff --git a/src/Bloc/BlElementProperty.class.st b/src/Bloc/BlElementProperty.class.st index 112024392..724750823 100644 --- a/src/Bloc/BlElementProperty.class.st +++ b/src/Bloc/BlElementProperty.class.st @@ -36,49 +36,47 @@ Click on the buttons to the left from the rectangular element to see what happen " Class { - #name : 'BlElementProperty', - #superclass : 'Object', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlElementProperty, + #superclass : #Object, + #category : 'Bloc-Basic-Properties' } -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementProperty >> applyOnElement: anElement [ ] -{ #category : 'testing' } +{ #category : #testing } BlElementProperty >> canPropagateToChildren [ ^ false ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementProperty >> cleanUpOnElement: anElement [ ] -{ #category : 'private' } +{ #category : #private } BlElementProperty >> maybeApplyOnElement: anElement [ "Private method to be polymorphic with a property with status" self applyOnElement: anElement ] -{ #category : 'private' } +{ #category : #private } BlElementProperty >> maybeCleanUpOnElement: anElement [ "Private method to be polymorphic with a property with status" ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementProperty >> property [ ^ self ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementProperty >> resolveWithParentProperties: theParentProperties orGlobal: theGlobalProperties [ ^ self ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementProperty >> type [ ^ self class ] diff --git a/src/Bloc/BlElementPropertyWithStatus.class.st b/src/Bloc/BlElementPropertyWithStatus.class.st index 15ffee433..efb44c868 100644 --- a/src/Bloc/BlElementPropertyWithStatus.class.st +++ b/src/Bloc/BlElementPropertyWithStatus.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlElementPropertyWithStatus', - #superclass : 'Object', + #name : #BlElementPropertyWithStatus, + #superclass : #Object, #instVars : [ 'property', 'status' @@ -10,76 +10,74 @@ Class { 'JustAdded', 'ToBeRemoved' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlElementPropertyWithStatus class >> initialize [ JustAdded := 1 << 0. ToBeRemoved := 1 << 2. Applied := 1 << 3. ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> addApplied [ status := status | Applied ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> addJustAdded [ status := status | JustAdded ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> addToBeRemoved [ status := status | ToBeRemoved ] -{ #category : 'testing' } +{ #category : #testing } BlElementPropertyWithStatus >> canPropagateToChildren [ ^ self property canPropagateToChildren and: [ self isToBeRemoved not ] ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> clearApplied [ status := status & Applied bitInvert ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> clearJustAdded [ status := status & JustAdded bitInvert ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> clearToBeRemoved [ status := status & ToBeRemoved bitInvert ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementPropertyWithStatus >> initialize [ super initialize. status := 0 ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> isApplied [ ^ 0 ~= (status & Applied) ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> isJustAddded [ ^ 0 ~= (status & JustAdded) ] -{ #category : 'private - status' } +{ #category : #'private - status' } BlElementPropertyWithStatus >> isToBeRemoved [ ^ 0 ~= (status & ToBeRemoved) ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementPropertyWithStatus >> maybeApplyOnElement: anElement [ self isToBeRemoved ifFalse: [ @@ -89,7 +87,7 @@ BlElementPropertyWithStatus >> maybeApplyOnElement: anElement [ status := Applied ] ] ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementPropertyWithStatus >> maybeCleanUpOnElement: anElement [ self isToBeRemoved ifTrue: [ @@ -99,7 +97,7 @@ BlElementPropertyWithStatus >> maybeCleanUpOnElement: anElement [ self clearApplied ] ] ] -{ #category : 'printing' } +{ #category : #printing } BlElementPropertyWithStatus >> printOn: aStream [ "Append a sequence of characters to aStream that identify the receiver." @@ -112,17 +110,17 @@ BlElementPropertyWithStatus >> printOn: aStream [ print: status ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementPropertyWithStatus >> property [ ^ property ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementPropertyWithStatus >> property: anObject [ property := anObject ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementPropertyWithStatus >> resolveWithParentProperties: theParentProperties orGlobal: theGlobalProperties [ | aResolvedProperty | diff --git a/src/Bloc/BlElementRemovedFromParentEvent.class.st b/src/Bloc/BlElementRemovedFromParentEvent.class.st index 08569b4c9..d18dbcf91 100644 --- a/src/Bloc/BlElementRemovedFromParentEvent.class.st +++ b/src/Bloc/BlElementRemovedFromParentEvent.class.st @@ -18,29 +18,27 @@ parent removeChild: child " Class { - #name : 'BlElementRemovedFromParentEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementRemovedFromParentEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementRemovedFromParentEvent class >> disableIn: anObject [ anObject disableRemovedFromParent ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementRemovedFromParentEvent class >> enableIn: anObject [ anObject enableRemovedFromParent ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementRemovedFromParentEvent class >> wantedIn: anObject [ ^ anObject wantsRemovedFromParent ] -{ #category : 'sending' } +{ #category : #sending } BlElementRemovedFromParentEvent >> sendTo: anObject [ anObject elementRemovedFromParentEvent: self ] diff --git a/src/Bloc/BlElementRemovedFromSceneGraphEvent.class.st b/src/Bloc/BlElementRemovedFromSceneGraphEvent.class.st index c12a00d19..abe6acced 100644 --- a/src/Bloc/BlElementRemovedFromSceneGraphEvent.class.st +++ b/src/Bloc/BlElementRemovedFromSceneGraphEvent.class.st @@ -3,29 +3,27 @@ I inform that an element was removed from a scene. I can be added to any Bloc e " Class { - #name : 'BlElementRemovedFromSceneGraphEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementRemovedFromSceneGraphEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementRemovedFromSceneGraphEvent class >> disableIn: anObject [ anObject disableRemovedFromSceneGraph ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementRemovedFromSceneGraphEvent class >> enableIn: anObject [ anObject enableRemovedFromSceneGraph ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementRemovedFromSceneGraphEvent class >> wantedIn: anObject [ ^ anObject wantsRemovedFromSceneGraph ] -{ #category : 'sending' } +{ #category : #sending } BlElementRemovedFromSceneGraphEvent >> sendTo: anObject [ anObject elementRemovedFromSceneGraphEvent: self ] diff --git a/src/Bloc/BlElementResolvedProperties.class.st b/src/Bloc/BlElementResolvedProperties.class.st index 7589a2cd7..41ed7962e 100644 --- a/src/Bloc/BlElementResolvedProperties.class.st +++ b/src/Bloc/BlElementResolvedProperties.class.st @@ -1,33 +1,31 @@ Class { - #name : 'BlElementResolvedProperties', - #superclass : 'BlElementMaybeResolvedProperties', + #name : #BlElementResolvedProperties, + #superclass : #BlElementMaybeResolvedProperties, #instVars : [ 'properties' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'actions' } +{ #category : #actions } BlElementResolvedProperties >> applyOnElement: anElement [ properties do: [ :eachPropertyWithStatus | eachPropertyWithStatus maybeCleanUpOnElement: anElement ]. properties do: [ :eachPropertyWithStatus | eachPropertyWithStatus maybeApplyOnElement: anElement ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementResolvedProperties >> flushPropertiesToRemove [ properties := properties reject: [ :eachPropertyWithStatus | eachPropertyWithStatus isToBeRemoved ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementResolvedProperties >> initialize [ super initialize. properties := Dictionary new ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementResolvedProperties >> mergedWithProperties: aBlElementResolvedProperties [ | theProperties | @@ -38,7 +36,7 @@ BlElementResolvedProperties >> mergedWithProperties: aBlElementResolvedPropertie ^ BlElementResolvedProperties new properties: theProperties ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementResolvedProperties >> mergedWithPropertiesWithStatus: aBlElementResolvedProperties [ | theProperties | @@ -53,29 +51,29 @@ BlElementResolvedProperties >> mergedWithPropertiesWithStatus: aBlElementResolve ^ BlElementResolvedProperties new properties: theProperties ] -{ #category : 'copying' } +{ #category : #copying } BlElementResolvedProperties >> postCopy [ properties := properties copy ] -{ #category : 'private' } +{ #category : #private } BlElementResolvedProperties >> properties [ ^ properties ] -{ #category : 'private' } +{ #category : #private } BlElementResolvedProperties >> properties: aDictionaryOfProperties [ properties := aDictionaryOfProperties ] -{ #category : 'private' } +{ #category : #private } BlElementResolvedProperties >> propertiesAsArray [ ^ properties values ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementResolvedProperties >> propertiesToPropagateToChildren [ "only properties that are not to be removed should be propagated to children" @@ -84,7 +82,7 @@ BlElementResolvedProperties >> propertiesToPropagateToChildren [ thenCollect: [ :eachPropertyWithStatus | eachPropertyWithStatus property ]) ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementResolvedProperties >> propertyAt: aPropertyType ifFound: aFoundBlock ifNone: aNoneBlock [ ^ properties at: aPropertyType diff --git a/src/Bloc/BlElementScrolledEvent.class.st b/src/Bloc/BlElementScrolledEvent.class.st index b57d671fc..fcebf251a 100644 --- a/src/Bloc/BlElementScrolledEvent.class.st +++ b/src/Bloc/BlElementScrolledEvent.class.st @@ -1,49 +1,47 @@ Class { - #name : 'BlElementScrolledEvent', - #superclass : 'BlElementEvent', + #name : #BlElementScrolledEvent, + #superclass : #BlElementEvent, #instVars : [ 'delta' ], - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #category : 'Bloc-Events-Type-Element' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementScrolledEvent class >> delta: aPoint [ ^ self new delta: aPoint; yourself ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementScrolledEvent class >> disableIn: anObject [ anObject disableScrolledEvent ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementScrolledEvent class >> enableIn: anObject [ anObject enableScrolledEvent ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementScrolledEvent class >> wantedIn: anObject [ ^ anObject wantsScrolledEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementScrolledEvent >> delta [ ^ delta ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementScrolledEvent >> delta: aPoint [ delta := aPoint ] -{ #category : 'sending' } +{ #category : #sending } BlElementScrolledEvent >> sendTo: anObject [ anObject elementScrolledEvent: self ] diff --git a/src/Bloc/BlElementSelectedState.class.st b/src/Bloc/BlElementSelectedState.class.st index eba39d7f3..463040ce9 100644 --- a/src/Bloc/BlElementSelectedState.class.st +++ b/src/Bloc/BlElementSelectedState.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlElementSelectedState', - #superclass : 'BlElementUniqueState', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementSelectedState, + #superclass : #BlElementUniqueState, + #category : 'Bloc-Basic-State' } -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementSelectedState >> optionalEventHandlerDo: aBlock [ aBlock value: BlElementSelectedStateEventHandler uniqueInstance ] -{ #category : 'printing' } +{ #category : #printing } BlElementSelectedState >> printOn: aStream [ aStream nextPutAll: 'selected' ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementSelectedState >> priority [ ^ UserPriority ] diff --git a/src/Bloc/BlElementSelectedStateEventHandler.class.st b/src/Bloc/BlElementSelectedStateEventHandler.class.st index a67f1f25c..f096a27cc 100644 --- a/src/Bloc/BlElementSelectedStateEventHandler.class.st +++ b/src/Bloc/BlElementSelectedStateEventHandler.class.st @@ -1,24 +1,22 @@ Class { - #name : 'BlElementSelectedStateEventHandler', - #superclass : 'BlElementStateEventHandler', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementSelectedStateEventHandler, + #superclass : #BlElementStateEventHandler, + #category : 'Bloc-Basic-State' } -{ #category : 'private' } +{ #category : #private } BlElementSelectedStateEventHandler >> element: anElement selected: aBoolean [ aBoolean ifTrue: [ anElement states addState: BlElementState selected ] ifFalse: [ anElement states removeState: BlElementState selected ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlElementSelectedStateEventHandler >> eventsToHandle [ ^ { BlElementSelectedStateWish } ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlElementSelectedStateEventHandler >> handleEvent: aBlElementSelectedStateWish [ self element: aBlElementSelectedStateWish currentTarget diff --git a/src/Bloc/BlElementSelectedStateWish.class.st b/src/Bloc/BlElementSelectedStateWish.class.st index 404991206..4bd628c99 100644 --- a/src/Bloc/BlElementSelectedStateWish.class.st +++ b/src/Bloc/BlElementSelectedStateWish.class.st @@ -1,25 +1,23 @@ Class { - #name : 'BlElementSelectedStateWish', - #superclass : 'BlElementStateWish', + #name : #BlElementSelectedStateWish, + #superclass : #BlElementStateWish, #instVars : [ 'selected' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementSelectedStateWish class >> selected: aBoolean [ ^ self new selected: aBoolean ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementSelectedStateWish >> selected [ ^ selected ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementSelectedStateWish >> selected: anObject [ selected := anObject ] diff --git a/src/Bloc/BlElementSelectionAcquiredEvent.class.st b/src/Bloc/BlElementSelectionAcquiredEvent.class.st index 7e983ad3a..6a9038879 100644 --- a/src/Bloc/BlElementSelectionAcquiredEvent.class.st +++ b/src/Bloc/BlElementSelectionAcquiredEvent.class.st @@ -5,32 +5,30 @@ Text containing elements should react on this event and select a corresponding p " Class { - #name : 'BlElementSelectionAcquiredEvent', - #superclass : 'BlElementEvent', + #name : #BlElementSelectionAcquiredEvent, + #superclass : #BlElementEvent, #instVars : [ 'bounds' ], - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementSelectionAcquiredEvent class >> disableIn: anObject [ anObject disableSelectionAcquired ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementSelectionAcquiredEvent class >> enableIn: anObject [ anObject enableSelectionAcquired ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementSelectionAcquiredEvent class >> wantedIn: anObject [ ^ anObject wantsSelectionAcquired ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementSelectionAcquiredEvent >> bounds [ "Return intersection between current selection rectangle and target's bounds. Note: for performance reasons we reuse the same bounds object for all events of this type! @@ -40,12 +38,12 @@ BlElementSelectionAcquiredEvent >> bounds [ ^ bounds ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementSelectionAcquiredEvent >> bounds: aBlBounds [ bounds := aBlBounds ] -{ #category : 'sending' } +{ #category : #sending } BlElementSelectionAcquiredEvent >> sendTo: anObject [ anObject elementSelectionAcquiredEvent: self ] diff --git a/src/Bloc/BlElementSelectionLostEvent.class.st b/src/Bloc/BlElementSelectionLostEvent.class.st index 329557911..39850f666 100644 --- a/src/Bloc/BlElementSelectionLostEvent.class.st +++ b/src/Bloc/BlElementSelectionLostEvent.class.st @@ -3,29 +3,27 @@ Is sent when element is no longer within mouse selection rectangle " Class { - #name : 'BlElementSelectionLostEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementSelectionLostEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementSelectionLostEvent class >> disableIn: anObject [ anObject disableSelectionLost ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementSelectionLostEvent class >> enableIn: anObject [ anObject enableSelectionLost ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementSelectionLostEvent class >> wantedIn: anObject [ ^ anObject wantsSelectionLost ] -{ #category : 'sending' } +{ #category : #sending } BlElementSelectionLostEvent >> sendTo: anObject [ anObject elementSelectionLostEvent: self ] diff --git a/src/Bloc/BlElementState.class.st b/src/Bloc/BlElementState.class.st index 9afb0c3b7..a4664af95 100644 --- a/src/Bloc/BlElementState.class.st +++ b/src/Bloc/BlElementState.class.st @@ -1,135 +1,133 @@ Class { - #name : 'BlElementState', - #superclass : 'Object', + #name : #BlElementState, + #superclass : #Object, #classVars : [ 'UserPriority' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> default [ ^ BlElementDefaultState uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> deselected [ ^ self selected not ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> disabled [ ^ BlElementDisabledState uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> enabled [ ^ self disabled not ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> focused [ ^ BlElementFocusedState uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> hovered [ ^ BlElementHoveredState uniqueInstance ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlElementState class >> initialize [ UserPriority := 50 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> pressed [ ^ BlElementPressedState uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> selected [ ^ BlElementSelectedState uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementState class >> unfocused [ ^ self focused not ] -{ #category : 'controlling' } +{ #category : #controlling } BlElementState >> & anAnotherState [ ^ self and: anAnotherState ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementState >> = anotherState [ ^ anotherState class = self class ] -{ #category : 'controlling' } +{ #category : #controlling } BlElementState >> and: anAnotherState [ ^ BlElementConjunctionState new left: self; right: anAnotherState ] -{ #category : 'propagation' } +{ #category : #propagation } BlElementState >> finishedPropagateFrom: aParentElement [ "The computation of the propagation rules can be expensive, especially if there are many children. I am sent right after all #propagatedStateFrom:to: message sends to give states a chance to release propagation rule caches" ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementState >> hash [ ^ self class hash ] -{ #category : 'testing' } +{ #category : #testing } BlElementState >> matches: aSetOfStates [ ^ aSetOfStates hasState: self ] -{ #category : 'controlling' } +{ #category : #controlling } BlElementState >> not [ ^ BlElementNegationState new state: self ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementState >> optionalEventHandlerDo: aBlock [ ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementState >> optionalOnAddedTo: anElement [ ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementState >> optionalOnRemovedFrom: anElement [ ] -{ #category : 'controlling' } +{ #category : #controlling } BlElementState >> or: anAnotherState [ ^ BlElementDisjunctionState new left: self; right: anAnotherState ] -{ #category : 'propagation' } +{ #category : #propagation } BlElementState >> prepareToPropagateFrom: aParentElement [ "The computation of the propagation rules can be expensive, especially if there are many children. I am sent right before all #propagatedStateFrom:to: message sends to give states a chance to precompute propagation rules" ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementState >> priority [ ^ self subclassResponsibility ] -{ #category : 'propagation' } +{ #category : #propagation } BlElementState >> propagatedStateFrom: aParentElement to: aChildElement [ "Return a state that should be propagated from a given parent element to the child instead of me" @@ -137,7 +135,7 @@ BlElementState >> propagatedStateFrom: aParentElement to: aChildElement [ ^ self ] -{ #category : 'testing' } +{ #category : #testing } BlElementState >> shouldOverwriteChildState [ "Return true if I should overwrite an already existed child's state" @@ -145,12 +143,12 @@ BlElementState >> shouldOverwriteChildState [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlElementState >> shouldPropagateToChildren [ ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementState >> type [ "Return an object used to compare two states when adding to the collection of states in order to prevent elements from having duplicated states" @@ -159,7 +157,7 @@ BlElementState >> type [ ^ self subclassResponsibility ] -{ #category : 'controlling' } +{ #category : #controlling } BlElementState >> | anAnotherState [ ^ self or: anAnotherState ] diff --git a/src/Bloc/BlElementStateEvent.class.st b/src/Bloc/BlElementStateEvent.class.st index 4d85d20da..06f3e4083 100644 --- a/src/Bloc/BlElementStateEvent.class.st +++ b/src/Bloc/BlElementStateEvent.class.st @@ -1,20 +1,18 @@ Class { - #name : 'BlElementStateEvent', - #superclass : 'BlEvent', + #name : #BlElementStateEvent, + #superclass : #BlEvent, #instVars : [ 'element' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementStateEvent >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStateEvent >> element: anObject [ element := anObject ] diff --git a/src/Bloc/BlElementStateEventHandler.class.st b/src/Bloc/BlElementStateEventHandler.class.st index 6dfffdf62..7070468d2 100644 --- a/src/Bloc/BlElementStateEventHandler.class.st +++ b/src/Bloc/BlElementStateEventHandler.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementStateEventHandler', - #superclass : 'BlCustomEventHandler', + #name : #BlElementStateEventHandler, + #superclass : #BlCustomEventHandler, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementStateEventHandler class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] diff --git a/src/Bloc/BlElementStateWish.class.st b/src/Bloc/BlElementStateWish.class.st index e1617ca9b..65542b58f 100644 --- a/src/Bloc/BlElementStateWish.class.st +++ b/src/Bloc/BlElementStateWish.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlElementStateWish', - #superclass : 'BlEvent', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementStateWish, + #superclass : #BlEvent, + #category : 'Bloc-Basic-State' } diff --git a/src/Bloc/BlElementStates.class.st b/src/Bloc/BlElementStates.class.st index 334f3c4fc..831421254 100644 --- a/src/Bloc/BlElementStates.class.st +++ b/src/Bloc/BlElementStates.class.st @@ -3,20 +3,18 @@ " Class { - #name : 'BlElementStates', - #superclass : 'Object', + #name : #BlElementStates, + #superclass : #Object, #instVars : [ 'announcer', 'element', 'localStates', 'inheritedStates' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'adding' } +{ #category : #adding } BlElementStates >> addState: aBlElementState [ "Add a given local state overwriting any existing one of the same type" (localStates hasState: aBlElementState) @@ -34,7 +32,7 @@ BlElementStates >> addState: aBlElementState [ self onStatesChanged ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> allStates [ | theAllStates | @@ -48,29 +46,29 @@ BlElementStates >> allStates [ ^ theAllStates ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> announcer [ ^ announcer ifNil: [ announcer := Announcer new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> element: anObject [ element := anObject ] -{ #category : 'testing' } +{ #category : #testing } BlElementStates >> hasState: aBlElementState [ ^ localStates hasState: aBlElementState ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> inheritedStates: aSetOfStates [ self assert: [ aSetOfStates isKindOf: BlElementStatesSet ] @@ -80,12 +78,12 @@ BlElementStates >> inheritedStates: aSetOfStates [ self onStatesChanged ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> inheritedStatesCopy [ ^ inheritedStates copy ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementStates >> initialize [ super initialize. @@ -93,24 +91,24 @@ BlElementStates >> initialize [ inheritedStates := BlElementStatesSet new ] -{ #category : 'testing' } +{ #category : #testing } BlElementStates >> isDisabled [ ^ self hasState: BlElementState disabled ] -{ #category : 'testing' } +{ #category : #testing } BlElementStates >> isEnabled [ ^ self isDisabled not ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> localStatesCopy [ ^ localStates copy ] -{ #category : 'private' } +{ #category : #private } BlElementStates >> onStatesChanged [ "Just to keep it very simple" @@ -119,12 +117,12 @@ BlElementStates >> onStatesChanged [ announcer announce: #statesChanged ] -{ #category : 'private' } +{ #category : #private } BlElementStates >> privateLocalStates [ ^ localStates ] -{ #category : 'adding' } +{ #category : #adding } BlElementStates >> removeState: aBlElementState [ "remove all state of the same type" | aRemovedState | @@ -139,7 +137,7 @@ BlElementStates >> removeState: aBlElementState [ self onStatesChanged ] -{ #category : 'adding' } +{ #category : #adding } BlElementStates >> removeStatesSuchThat: aBlock [ | toBeRemoved | @@ -154,7 +152,7 @@ BlElementStates >> removeStatesSuchThat: aBlock [ self onStatesChanged ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> stateLike: aBlElementState ifFound: aFoundBlock ifNone: aNoneBlock [ ^ (localStates like: aBlElementState @@ -163,7 +161,7 @@ BlElementStates >> stateLike: aBlElementState ifFound: aFoundBlock ifNone: aNone ifNotNil: aFoundBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStates >> statesToInherit [ | theAllStates | @@ -180,7 +178,7 @@ BlElementStates >> statesToInherit [ ^ theAllStates ] -{ #category : 'api - states' } +{ #category : #'api - states' } BlElementStates >> withHover [ self element addEventHandlerIfNotPresent: BlElementHoveredStateEventHandler uniqueInstance ] diff --git a/src/Bloc/BlElementStatesSet.class.st b/src/Bloc/BlElementStatesSet.class.st index f02367a6c..307a3f5fa 100644 --- a/src/Bloc/BlElementStatesSet.class.st +++ b/src/Bloc/BlElementStatesSet.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlElementStatesSet', - #superclass : 'PluggableSet', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementStatesSet, + #superclass : #PluggableSet, + #category : 'Bloc-Basic-State' } -{ #category : 'testing' } +{ #category : #testing } BlElementStatesSet >> hasState: aState [ ^ (self like: aState ifAbsent: [ ^ false ]) = aState ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementStatesSet >> initialize: n [ super initialize: n. diff --git a/src/Bloc/BlElementStyle.class.st b/src/Bloc/BlElementStyle.class.st index 4e514cc94..46b7ff4b8 100644 --- a/src/Bloc/BlElementStyle.class.st +++ b/src/Bloc/BlElementStyle.class.st @@ -8,38 +8,36 @@ Since `BlElementStyle` uses `TBlElementProperties`, it counds with API to add an " Class { - #name : 'BlElementStyle', - #superclass : 'Object', + #name : #BlElementStyle, + #superclass : #Object, #traits : 'TBlElementProperties', #classTraits : 'TBlElementProperties classTrait', #instVars : [ 'state', 'properties' ], - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #category : 'Bloc-Basic-Style' } -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementStyle >> addProperties: aCollectionOfElementProperty [ self properties addProperties: aCollectionOfElementProperty ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementStyle >> addProperty: aBlElementProperty [ self properties addProperty: aBlElementProperty ] -{ #category : 'actions' } +{ #category : #actions } BlElementStyle >> applyOnElement: anElement [ anElement properties addProperties: self properties ] -{ #category : 'converting' } +{ #category : #converting } BlElementStyle >> asForwarded: aTargetObject [ ^ BlElementForwardedStyle new @@ -49,19 +47,19 @@ BlElementStyle >> asForwarded: aTargetObject [ yourself ] -{ #category : 'actions' } +{ #category : #actions } BlElementStyle >> cleanUpOnElement: anElement [ anElement properties removeProperties: self properties ] -{ #category : 'testing' } +{ #category : #testing } BlElementStyle >> hasProperties [ ^ self properties isNotEmpty ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementStyle >> initialize [ super initialize. @@ -69,20 +67,20 @@ BlElementStyle >> initialize [ properties := BlElementIntendedProperties new ] -{ #category : 'testing' } +{ #category : #testing } BlElementStyle >> isForwarded [ ^ false ] -{ #category : 'copying' } +{ #category : #copying } BlElementStyle >> postCopy [ state := state copy. properties := properties copy ] -{ #category : 'printing' } +{ #category : #printing } BlElementStyle >> printOn: aStream [ aStream @@ -92,43 +90,43 @@ BlElementStyle >> printOn: aStream [ print: self properties ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStyle >> priority [ ^ self state priority ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStyle >> properties [ ^ properties ] -{ #category : 'private' } +{ #category : #private } BlElementStyle >> properties: aBlElementProperties [ properties := aBlElementProperties ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementStyle >> removeProperties: aCollectionOfElementProperty [ self properties removeProperties: aCollectionOfElementProperty ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementStyle >> removeProperty: aBlElementProperty [ self properties removeProperty: aBlElementProperty ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStyle >> state [ ^ state ] -{ #category : 'private' } +{ #category : #private } BlElementStyle >> state: anInteractionState [ state := anInteractionState diff --git a/src/Bloc/BlElementStyles.class.st b/src/Bloc/BlElementStyles.class.st index 594565deb..e19bba3a8 100644 --- a/src/Bloc/BlElementStyles.class.st +++ b/src/Bloc/BlElementStyles.class.st @@ -17,19 +17,17 @@ See the class comment of `BlStyles` to learn the details of how styles are remov " Class { - #name : 'BlElementStyles', - #superclass : 'BlStyles', + #name : #BlElementStyles, + #superclass : #BlStyles, #instVars : [ 'previousAppliedStyles', 'isDirty', 'element' ], - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #category : 'Bloc-Basic-Style' } -{ #category : 'private' } +{ #category : #private } BlElementStyles >> applyStylesForStates: aCollectionOfStates [ | theNewAppliedStyles | @@ -45,7 +43,7 @@ BlElementStyles >> applyStylesForStates: aCollectionOfStates [ isDirty := false ] -{ #category : 'converting' } +{ #category : #converting } BlElementStyles >> asForwarded: aTargetObject [ ^ BlForwardedElementStyles new @@ -56,7 +54,7 @@ BlElementStyles >> asForwarded: aTargetObject [ element: element ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlElementStyles >> basicAddStyle: aStyle [ super basicAddStyle: aStyle. @@ -68,7 +66,7 @@ BlElementStyles >> basicAddStyle: aStyle [ element requestStyle ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlElementStyles >> basicRemovePropertiesOf: aStyleToRemove fromStyle: anExistingStyle [ | thePropertiesBefore | @@ -91,7 +89,7 @@ BlElementStyles >> basicRemovePropertiesOf: aStyleToRemove fromStyle: anExisting self element properties removeProperties: aStyleToRemove properties ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlElementStyles >> basicRemoveStyle: aStyle [ super basicRemoveStyle: aStyle. @@ -103,25 +101,25 @@ BlElementStyles >> basicRemoveStyle: aStyle [ element requestStyle ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementStyles >> createStylesCollection [ ^ SortedCollection sortUsing: #priority ascending ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStyles >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStyles >> element: aBlElement [ element := aBlElement ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } BlElementStyles >> for: aTargetObject [ ^ BlForwardedElementStyles new @@ -130,7 +128,7 @@ BlElementStyles >> for: aTargetObject [ targetObject: aTargetObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementStyles >> initialize [ super initialize. @@ -139,13 +137,13 @@ BlElementStyles >> initialize [ previousAppliedStyles := Set new ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementStyles >> markDirty [ isDirty := true ] -{ #category : 'private' } +{ #category : #private } BlElementStyles >> matchingProperties [ "An utility debug method to get all currently matching properties" @@ -153,14 +151,14 @@ BlElementStyles >> matchingProperties [ flatCollect: [ :eachStyle | eachStyle properties ] ] -{ #category : 'private' } +{ #category : #private } BlElementStyles >> matchingStyles [ "An utility debug method to get all currently matching styles" ^ self matchingStyles: element states allStates ] -{ #category : 'testing' } +{ #category : #testing } BlElementStyles >> needsStyle [ ^ isDirty diff --git a/src/Bloc/BlElementTransformation.class.st b/src/Bloc/BlElementTransformation.class.st index 7e9b1949f..8fcbdb8b2 100644 --- a/src/Bloc/BlElementTransformation.class.st +++ b/src/Bloc/BlElementTransformation.class.st @@ -5,14 +5,12 @@ For optimization purposes I use 2D matrix if 3D transformation was not requested " Class { - #name : 'BlElementTransformation', - #superclass : 'Object', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #BlElementTransformation, + #superclass : #Object, + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElementTransformation class >> scale: aBlVector [ | aScaleTransformation | @@ -25,26 +23,26 @@ BlElementTransformation class >> scale: aBlVector [ ^ BlElementLocalTransformation newWith: aScaleTransformation ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlElementTransformation >> affineTransformationsDo: aBlockClosure [ "Evaluate the block with associated instances of `BlAffineTransformation`." self subclassResponsibility ] -{ #category : 'converting' } +{ #category : #converting } BlElementTransformation >> asCachedTransformation [ ^ BlElementCachedExplicitTransformation forTransformation: self ] -{ #category : 'converting' } +{ #category : #converting } BlElementTransformation >> asElementTransformation [ ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlElementTransformation >> asMatrix: aRectangle [ | aMatrix | @@ -57,34 +55,34 @@ BlElementTransformation >> asMatrix: aRectangle [ ^ aMatrix ] -{ #category : 'computation' } +{ #category : #computation } BlElementTransformation >> computeMatrix: aBlMatrix in: aRectangle [ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlElementTransformation >> is2D [ "Return true if my current transformation is in 2D space, false otherwise" ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlElementTransformation >> is3D [ "Return true if my current transformation is in 3D space, false otherwise" ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlElementTransformation >> isIdentity [ "Return true if I represent the identity transformation, false otherwise" ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlElementTransformation >> isPureTranslation [ "Return true if the receiver specifies no rotation or scaling and represents only translation in xy 2D plane" diff --git a/src/Bloc/BlElementTransformationChangedEvent.class.st b/src/Bloc/BlElementTransformationChangedEvent.class.st index 7226f6875..e5c614c06 100644 --- a/src/Bloc/BlElementTransformationChangedEvent.class.st +++ b/src/Bloc/BlElementTransformationChangedEvent.class.st @@ -5,29 +5,27 @@ Note: transformation may change even if an element has no parent " Class { - #name : 'BlElementTransformationChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementTransformationChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementTransformationChangedEvent class >> disableIn: anEventDispatcher [ anEventDispatcher disableTransformationChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementTransformationChangedEvent class >> enableIn: anEventDispatcher [ anEventDispatcher enableTransformationChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementTransformationChangedEvent class >> wantedIn: anObject [ ^ anObject wantsTransformationChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementTransformationChangedEvent >> sendTo: anObject [ anObject elementTransformationChangedEvent: self ] diff --git a/src/Bloc/BlElementTransformationInSpaceChangedEvent.class.st b/src/Bloc/BlElementTransformationInSpaceChangedEvent.class.st index 5dd6a78bd..ec4a37d6a 100644 --- a/src/Bloc/BlElementTransformationInSpaceChangedEvent.class.st +++ b/src/Bloc/BlElementTransformationInSpaceChangedEvent.class.st @@ -5,30 +5,28 @@ Transformation in space may change even if element's transformation is still the " Class { - #name : 'BlElementTransformationInSpaceChangedEvent', - #superclass : 'BlElementEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlElementTransformationInSpaceChangedEvent, + #superclass : #BlElementEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementTransformationInSpaceChangedEvent class >> disableIn: anEventDispatcher [ anEventDispatcher disableTransformationInSpaceChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementTransformationInSpaceChangedEvent class >> enableIn: anEventDispatcher [ anEventDispatcher enableTransformationInSpaceChanged ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlElementTransformationInSpaceChangedEvent class >> wantedIn: anEventDispatcher [ ^ anEventDispatcher wantsTransformationInSpaceChanged ] -{ #category : 'sending' } +{ #category : #sending } BlElementTransformationInSpaceChangedEvent >> sendTo: anObject [ anObject elementTransformationInSpaceChangedEvent: self ] diff --git a/src/Bloc/BlElementTransformationScaleProperty.class.st b/src/Bloc/BlElementTransformationScaleProperty.class.st index b1dfffbdb..4a74a1e04 100644 --- a/src/Bloc/BlElementTransformationScaleProperty.class.st +++ b/src/Bloc/BlElementTransformationScaleProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementTransformationScaleProperty', - #superclass : 'BlElementProperty', + #name : #BlElementTransformationScaleProperty, + #superclass : #BlElementProperty, #instVars : [ 'scaleFactor' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementTransformationScaleProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,36 +18,36 @@ BlElementTransformationScaleProperty >> = anObject [ ^ scaleFactor = anObject scaleFactor ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementTransformationScaleProperty >> applyOnElement: anElement [ anElement transformDo: [ :t | t scaleBy: self scaleFactor ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementTransformationScaleProperty >> cleanUpOnElement: anElement [ anElement transformDo: [ :t | t scaleBy: 1 ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementTransformationScaleProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ scaleFactor hash ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementTransformationScaleProperty >> initialize [ super initialize. scaleFactor := 1 ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementTransformationScaleProperty >> scaleFactor [ ^ scaleFactor ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementTransformationScaleProperty >> scaleFactor: anObject [ scaleFactor := anObject ] diff --git a/src/Bloc/BlElementUnhoveredEvent.class.st b/src/Bloc/BlElementUnhoveredEvent.class.st index 7af69eb34..b34d4ebba 100644 --- a/src/Bloc/BlElementUnhoveredEvent.class.st +++ b/src/Bloc/BlElementUnhoveredEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlElementUnhoveredEvent', - #superclass : 'BlElementStateEvent', - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #name : #BlElementUnhoveredEvent, + #superclass : #BlElementStateEvent, + #category : 'Bloc-Basic-State' } diff --git a/src/Bloc/BlElementUniqueId.class.st b/src/Bloc/BlElementUniqueId.class.st index 113081e3c..932ef5228 100644 --- a/src/Bloc/BlElementUniqueId.class.st +++ b/src/Bloc/BlElementUniqueId.class.st @@ -5,32 +5,30 @@ Is intended to be subclassed for custom object-oriented ids " Class { - #name : 'BlElementUniqueId', - #superclass : 'BlElementId', + #name : #BlElementUniqueId, + #superclass : #BlElementId, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'converting' } +{ #category : #converting } BlElementUniqueId class >> asBlocElementId [ ^ self uniqueInstance ] -{ #category : 'converting' } +{ #category : #converting } BlElementUniqueId class >> asSymbol [ ^ self uniqueInstance asSymbol ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementUniqueId class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'converting' } +{ #category : #converting } BlElementUniqueId class >> indexed: anIndex [ "Convert me to an indexed id with a given index" @@ -38,24 +36,24 @@ BlElementUniqueId class >> indexed: anIndex [ ^ self asBlocElementId indexed: anIndex ] -{ #category : 'testing' } +{ #category : #testing } BlElementUniqueId class >> isAbstract [ ^ self = BlElementUniqueId ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementUniqueId class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementUniqueId >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementUniqueId >> description [ ^ self class comment ] diff --git a/src/Bloc/BlElementUniqueState.class.st b/src/Bloc/BlElementUniqueState.class.st index 72e6b013b..b3f5d8e62 100644 --- a/src/Bloc/BlElementUniqueState.class.st +++ b/src/Bloc/BlElementUniqueState.class.st @@ -1,20 +1,18 @@ Class { - #name : 'BlElementUniqueState', - #superclass : 'BlElementState', + #name : #BlElementUniqueState, + #superclass : #BlElementState, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-State', - #package : 'Bloc', - #tag : 'Basic-State' + #category : 'Bloc-Basic-State' } -{ #category : 'accessing' } +{ #category : #accessing } BlElementUniqueState class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementUniqueState >> type [ "Return an object used to compare two states when adding to the collection of states in order to prevent elements from having duplicated states" diff --git a/src/Bloc/BlElementUnresolvedProperties.class.st b/src/Bloc/BlElementUnresolvedProperties.class.st index 0c8b02771..7f3843428 100644 --- a/src/Bloc/BlElementUnresolvedProperties.class.st +++ b/src/Bloc/BlElementUnresolvedProperties.class.st @@ -1,20 +1,18 @@ Class { - #name : 'BlElementUnresolvedProperties', - #superclass : 'BlElementMaybeResolvedProperties', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlElementUnresolvedProperties, + #superclass : #BlElementMaybeResolvedProperties, + #category : 'Bloc-Basic-Properties' } -{ #category : 'actions' } +{ #category : #actions } BlElementUnresolvedProperties >> applyOnElement: anElement [ ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlElementUnresolvedProperties >> flushPropertiesToRemove [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementUnresolvedProperties >> propertyAt: aPropertyType ifFound: aFoundBlock ifNone: aNoneBlock [ ^ aNoneBlock value ] diff --git a/src/Bloc/BlElementVectorGeometry.class.st b/src/Bloc/BlElementVectorGeometry.class.st index 126a03532..5be5552e2 100644 --- a/src/Bloc/BlElementVectorGeometry.class.st +++ b/src/Bloc/BlElementVectorGeometry.class.st @@ -2,18 +2,16 @@ The geometry is used to define the geometry to be drawn and the interaction area. " Class { - #name : 'BlElementVectorGeometry', - #superclass : 'BlElementGeometry', + #name : #BlElementVectorGeometry, + #superclass : #BlElementGeometry, #instVars : [ 'extent', 'pathCache' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'converting' } +{ #category : #converting } BlElementVectorGeometry >> asElement [ ^ super asElement @@ -21,13 +19,13 @@ BlElementVectorGeometry >> asElement [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVectorGeometry >> extent [ ^ extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVectorGeometry >> extent: aPoint [ "The argument has to be a Point of numbers (integer or float). Do not try to provide a fraction as x or y of the point! @@ -36,7 +34,7 @@ BlElementVectorGeometry >> extent: aPoint [ extent := aPoint ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElementVectorGeometry >> geometryBounds [ "Return my pure geometry bounds (fill bounds). This property is different from #visualBounds in the sense that I don't take stroke into account. @@ -45,7 +43,7 @@ BlElementVectorGeometry >> geometryBounds [ ^ (self geometryBounds: BlBounds new) asRectangle ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElementVectorGeometry >> geometryBounds: aBlBounds [ "Load my bounds in mutable rectangle. @see #geometryBounds for more info" @@ -55,7 +53,7 @@ BlElementVectorGeometry >> geometryBounds: aBlBounds [ extent: self extent ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlElementVectorGeometry >> geometryBounds: aBounds of: aBlElement [ "Load my geometry bounds for a given element in a mutable rectangle. @see #geometryBounds for more info" @@ -64,7 +62,7 @@ BlElementVectorGeometry >> geometryBounds: aBounds of: aBlElement [ ^ self geometryBounds: aBounds ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVectorGeometry >> initialize [ super initialize. @@ -72,37 +70,37 @@ BlElementVectorGeometry >> initialize [ pathCache := BlPathCache on: self ] -{ #category : 'geometry' } +{ #category : #geometry } BlElementVectorGeometry >> matchElement: anElement [ "Adapt me to match the size of a given element" self matchExtent: anElement extent ] -{ #category : 'geometry' } +{ #category : #geometry } BlElementVectorGeometry >> matchExtent: aPoint [ "Resize geometry to exactly match provided extent as a Point" self subclassResponsibility ] -{ #category : 'copying' } +{ #category : #copying } BlElementVectorGeometry >> postCopy [ pathCache := BlPathCache on: self. self releaseCache ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlElementVectorGeometry >> releaseCache [ pathCache releaseCache ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlElementVectorGeometry >> releaseStrokedBoundsCache [ pathCache releaseStrokedBoundsCache ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlElementVectorGeometry >> strokedBounds: aBlBounds of: anElement [ "Return stroked bounds of a geometry if it would be stroked according to element's border configuration. Dispatch through outskirts first" @@ -111,7 +109,7 @@ BlElementVectorGeometry >> strokedBounds: aBlBounds of: anElement [ (pathCache strokedBounds: aBlBounds of: anElement) ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlElementVectorGeometry >> strokedBoundsCentered: aBlBounds of: aBlElement [ "Answer my bounds as if the border with centered outskirts. Particular geometries may answer a more precise answer." @@ -119,14 +117,14 @@ BlElementVectorGeometry >> strokedBoundsCentered: aBlBounds of: aBlElement [ ^ (self geometryBounds: aBlBounds) expandBy: aBlElement border width / 2.0 ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlElementVectorGeometry >> strokedBoundsInside: aBlBounds of: anElement [ "Stroked inside bounds property is equal to geometry bounds" ^ self geometryBounds: aBlBounds ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlElementVectorGeometry >> strokedBoundsOutside: aBlBounds of: aBlElement [ "Answer my bounds as if the border outside. Particular geometries may answer a more precise answer." diff --git a/src/Bloc/BlElementVisibilityProperty.class.st b/src/Bloc/BlElementVisibilityProperty.class.st index 035e09dac..9a0f5ae62 100644 --- a/src/Bloc/BlElementVisibilityProperty.class.st +++ b/src/Bloc/BlElementVisibilityProperty.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlElementVisibilityProperty', - #superclass : 'BlElementProperty', + #name : #BlElementVisibilityProperty, + #superclass : #BlElementProperty, #instVars : [ 'visibility' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'comparing' } +{ #category : #comparing } BlElementVisibilityProperty >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -20,24 +18,24 @@ BlElementVisibilityProperty >> = anObject [ ^ visibility = anObject visibility ] -{ #category : 'api - property' } +{ #category : #'api - property' } BlElementVisibilityProperty >> applyOnElement: anElement [ anElement visibility: self visibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlElementVisibilityProperty >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ visibility hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisibilityProperty >> visibility [ ^ visibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisibilityProperty >> visibility: anObject [ visibility := anObject ] diff --git a/src/Bloc/BlElementVisuals.class.st b/src/Bloc/BlElementVisuals.class.st index 62e8c8037..6bcdeb29e 100644 --- a/src/Bloc/BlElementVisuals.class.st +++ b/src/Bloc/BlElementVisuals.class.st @@ -3,8 +3,8 @@ " Class { - #name : 'BlElementVisuals', - #superclass : 'Object', + #name : #BlElementVisuals, + #superclass : #Object, #classVars : [ 'DefaultBackground', 'DefaultBorder', @@ -20,27 +20,25 @@ Class { 'DefaultOutskirts', 'DefaultVisibility' ], - #category : 'Bloc-Basic', - #package : 'Bloc', - #tag : 'Basic' + #category : 'Bloc-Basic' } -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals class >> defaultBackground [ ^ DefaultBackground ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals class >> defaultBorder [ ^ DefaultBorder ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals class >> defaultGeometry [ ^ DefaultGeometry ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlElementVisuals class >> initialize [ DefaultBackground := BlBackground transparent. DefaultGeometry := BlRectangleGeometry new. @@ -57,12 +55,12 @@ BlElementVisuals class >> initialize [ DefaultMouseCursor := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> background [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> background: aBlBackground [ "Change the background and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -70,12 +68,12 @@ BlElementVisuals >> background: aBlBackground [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> border [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> border: aBlBorder [ "Change the border and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -83,12 +81,12 @@ BlElementVisuals >> border: aBlBorder [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> clipChildren [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> clipChildren: aBoolean [ "Change if children should be clipped and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -96,12 +94,12 @@ BlElementVisuals >> clipChildren: aBoolean [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> compositingMode [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> compositingMode: aBlCompositingMode [ "Change the compositing mode and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -109,77 +107,77 @@ BlElementVisuals >> compositingMode: aBlCompositingMode [ ^ self subclassResponsibility ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultBackground [ ^ DefaultBackground ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultBorder [ ^ DefaultBorder ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultClipChildren [ ^ DefaultClipChildren ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultCompositingMode [ ^ DefaultCompositingMode ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultEffect [ ^ DefaultEffect ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultElevation [ ^ DefaultElevation ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultFocusability [ ^ DefaultFocusability ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultFocused [ ^ DefaultFocused ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultGeometry [ ^ DefaultGeometry ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultMouseCursor [ ^ DefaultMouseCursor ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultOpacity [ ^ DefaultOpacity ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultOutskirts [ ^ DefaultOutskirts ] -{ #category : 'initialization' } +{ #category : #initialization } BlElementVisuals >> defaultVisibility [ ^ DefaultVisibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> effect [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> effect: aBlElementEffect [ "Change the effect and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -187,12 +185,12 @@ BlElementVisuals >> effect: aBlElementEffect [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> elevation [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> elevation: aBlElevation [ "Change the elevation and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -200,12 +198,12 @@ BlElementVisuals >> elevation: aBlElevation [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> focusability [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> focusability: aBlFocusability [ "Change the focusability and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -213,12 +211,12 @@ BlElementVisuals >> focusability: aBlFocusability [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> focused [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> focused: aBoolean [ "Change focused state and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -226,12 +224,12 @@ BlElementVisuals >> focused: aBoolean [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> geometry [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> geometry: aBlElementGeometry [ "Change the geometry and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -239,12 +237,12 @@ BlElementVisuals >> geometry: aBlElementGeometry [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> mouseCursor [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> mouseCursor: aBlCursor [ "Change the mouse cursor and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -252,12 +250,12 @@ BlElementVisuals >> mouseCursor: aBlCursor [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> opacity [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> opacity: aNumber [ "Change the opacity and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -265,12 +263,12 @@ BlElementVisuals >> opacity: aNumber [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> outskirts [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> outskirts: aBlOutskirts [ "Change the outskirts and return new visuals to be used instead of the previous one (not necessarily a new instance)" @@ -278,12 +276,12 @@ BlElementVisuals >> outskirts: aBlOutskirts [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> visibility [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlElementVisuals >> visibility: aBlVisibility [ "Change the visibility and return new visuals to be used instead of the previous one (not necessarily a new instance)" diff --git a/src/Bloc/BlElevation.class.st b/src/Bloc/BlElevation.class.st index 186f0e9c9..b25e91117 100644 --- a/src/Bloc/BlElevation.class.st +++ b/src/Bloc/BlElevation.class.st @@ -8,20 +8,18 @@ Note: Elevation is not influenced by transformation matrix! " Class { - #name : 'BlElevation', - #superclass : 'Object', + #name : #BlElevation, + #superclass : #Object, #instVars : [ 'elevation' ], #classInstVars : [ 'zero' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlElevation class >> cleanUp [ super cleanUp. @@ -29,7 +27,7 @@ BlElevation class >> cleanUp [ zero := nil ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElevation class >> elevation: aNumber [ ^ self basicNew @@ -37,32 +35,32 @@ BlElevation class >> elevation: aNumber [ yourself ] -{ #category : 'testing' } +{ #category : #testing } BlElevation class >> isAbstract [ ^ self == BlElevation ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlElevation class >> zero [ ^ zero ifNil: [ zero := self elevation: 0 ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlElevation >> elevation [ ^ elevation ] -{ #category : 'accessing' } +{ #category : #accessing } BlElevation >> initializeWith: aNumber [ self initialize. elevation := aNumber ] -{ #category : 'printing' } +{ #category : #printing } BlElevation >> printOn: aStream [ super printOn: aStream. @@ -73,7 +71,7 @@ BlElevation >> printOn: aStream [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlElevation >> relatedTo: aNumber [ "Return a Number that represents the elevation related to the received value." diff --git a/src/Bloc/BlEllipse.class.st b/src/Bloc/BlEllipse.class.st index f8511061a..7f4d106c6 100644 --- a/src/Bloc/BlEllipse.class.st +++ b/src/Bloc/BlEllipse.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEllipse', - #superclass : 'BlEllipseGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlEllipse, + #superclass : #BlEllipseGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'accessing' } +{ #category : #accessing } BlEllipse class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlEllipseGeometry.class.st b/src/Bloc/BlEllipseGeometry.class.st index c5f4733c6..c3dce6954 100644 --- a/src/Bloc/BlEllipseGeometry.class.st +++ b/src/Bloc/BlEllipseGeometry.class.st @@ -11,14 +11,12 @@ In order to explicitely create an ellipse use extent: BlEllipseGeometry extent: 50@30 ""create an ellipse with width 50 and height 30"" " Class { - #name : 'BlEllipseGeometry', - #superclass : 'BlElementVectorGeometry', - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #name : #BlEllipseGeometry, + #superclass : #BlElementVectorGeometry, + #category : 'Bloc-Basic-Geometry' } -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlEllipseGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ | w h x y center xRadius yRadius normalized | @@ -38,19 +36,19 @@ BlEllipseGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement ^ ((normalized x squared / xRadius squared) + (normalized y squared / yRadius squared)) <= 1 ] -{ #category : 'testing' } +{ #category : #testing } BlEllipseGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEllipseGeometry >> hasJoins [ ^ false ] -{ #category : 'geometry' } +{ #category : #geometry } BlEllipseGeometry >> matchExtent: anExtent [ self extent: anExtent ] diff --git a/src/Bloc/BlEmUnit.class.st b/src/Bloc/BlEmUnit.class.st index 66e22a040..404d262a1 100644 --- a/src/Bloc/BlEmUnit.class.st +++ b/src/Bloc/BlEmUnit.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlEmUnit', - #superclass : 'BlUnit', - #category : 'Bloc-Basic-Units', - #package : 'Bloc', - #tag : 'Basic-Units' + #name : #BlEmUnit, + #superclass : #BlUnit, + #category : 'Bloc-Basic-Units' } -{ #category : 'printing' } +{ #category : #printing } BlEmUnit >> printOn: aStream [ aStream nextPutAll: 'em' ] -{ #category : 'accessing' } +{ #category : #accessing } BlEmUnit >> resolveLengthForValue: aCurrentValueOrBlock parent: aParentValueOrBlock global: aGlobalValueOrBlock [ diff --git a/src/Bloc/BlEmptyEventRecorder.class.st b/src/Bloc/BlEmptyEventRecorder.class.st index 229cb0c81..a13de034c 100644 --- a/src/Bloc/BlEmptyEventRecorder.class.st +++ b/src/Bloc/BlEmptyEventRecorder.class.st @@ -3,14 +3,12 @@ I simply ignore all events (play a role event recorder in a space) " Class { - #name : 'BlEmptyEventRecorder', - #superclass : 'BlSpaceEventRecorder', - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #name : #BlEmptyEventRecorder, + #superclass : #BlSpaceEventRecorder, + #category : 'Bloc-Space - Events' } -{ #category : 'api - recording' } +{ #category : #'api - recording' } BlEmptyEventRecorder >> record: anEvent [ "I ignore events" ] diff --git a/src/Bloc/BlEmptyGeometry.class.st b/src/Bloc/BlEmptyGeometry.class.st index b0c63b197..a98df4cb4 100644 --- a/src/Bloc/BlEmptyGeometry.class.st +++ b/src/Bloc/BlEmptyGeometry.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlEmptyGeometry', - #superclass : 'BlElementGeometry', - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #name : #BlEmptyGeometry, + #superclass : #BlElementGeometry, + #category : 'Bloc-Basic-Geometry' } -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlEmptyGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ ^ false ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlEmptyGeometry >> geometryBounds: aBlBounds of: aBlElement [ "Load my bounds in mutable rectangle. @see #geometryBounds for more info" @@ -25,32 +23,32 @@ BlEmptyGeometry >> geometryBounds: aBlBounds of: aBlElement [ bottom: aBlElement height ] -{ #category : 'testing' } +{ #category : #testing } BlEmptyGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEmptyGeometry >> hasJoins [ ^ false ] -{ #category : 'geometry' } +{ #category : #geometry } BlEmptyGeometry >> matchElement: anElement [ "Adapt me to match the size of a given element" ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlEmptyGeometry >> releaseCache [ ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlEmptyGeometry >> releaseStrokedBoundsCache [ ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlEmptyGeometry >> strokedBounds: aBlBounds of: anElement [ "Return stroked bounds of a geometry if it would be stroked according to element's border configuration. Dispatch through outskirts first" diff --git a/src/Bloc/BlEmptySelection.class.st b/src/Bloc/BlEmptySelection.class.st index 3075172dd..2e414a79d 100644 --- a/src/Bloc/BlEmptySelection.class.st +++ b/src/Bloc/BlEmptySelection.class.st @@ -3,21 +3,19 @@ I am an empty selection " Class { - #name : 'BlEmptySelection', - #superclass : 'BlSelection', - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #name : #BlEmptySelection, + #superclass : #BlSelection, + #category : 'Bloc-Utilities - Selection' } -{ #category : 'accessing' } +{ #category : #accessing } BlEmptySelection >> children [ ^ #() ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlEmptySelection >> contains: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -25,7 +23,7 @@ BlEmptySelection >> contains: anIndex [ ^ false ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlEmptySelection >> containsIndex: anIndex [ "Return true if selection indices include a given index, false otherwise. I am conceptually same as (self indices includes: anIndex)" @@ -34,27 +32,27 @@ BlEmptySelection >> containsIndex: anIndex [ ^ false ] -{ #category : 'copying' } +{ #category : #copying } BlEmptySelection >> copyFrom: aStartIndex to: anEndIndex [ ^ self copy ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlEmptySelection >> do: aBlock [ "Evaluate a given block with all recorded selection intervals" ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlEmptySelection >> isEmpty [ ^ true ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlEmptySelection >> isNotEmpty [ ^ self isEmpty not ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlEmptySelection >> reverseDo: aBlock [ "Evaluate a given block with all recorded selection intervals in reverse direction" ] diff --git a/src/Bloc/BlEndAlignment.class.st b/src/Bloc/BlEndAlignment.class.st index 09362ee02..9a9035ab0 100644 --- a/src/Bloc/BlEndAlignment.class.st +++ b/src/Bloc/BlEndAlignment.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlEndAlignment', - #superclass : 'BlRelativeAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlEndAlignment, + #superclass : #BlRelativeAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlEndAlignment class >> horizontal [ ^ BlHorizontalAlignment end ] -{ #category : 'factory' } +{ #category : #factory } BlEndAlignment class >> vertical [ ^ BlVerticalAlignment bottom ] diff --git a/src/Bloc/BlEqualizer.class.st b/src/Bloc/BlEqualizer.class.st index f1bc59b69..dbfc2519b 100644 --- a/src/Bloc/BlEqualizer.class.st +++ b/src/Bloc/BlEqualizer.class.st @@ -7,46 +7,44 @@ Use me with caution then and only then when there is no other solution, and you " Class { - #name : 'BlEqualizer', - #superclass : 'BlCustomEventHandler', + #name : #BlEqualizer, + #superclass : #BlCustomEventHandler, #instVars : [ 'sourceElements', 'targetElements' ], - #category : 'Bloc-Utilities - Equalizer', - #package : 'Bloc', - #tag : 'Utilities - Equalizer' + #category : 'Bloc-Utilities - Equalizer' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEqualizer class >> of: aCollectionOfTargetElements with: aCollectionOfSourceElements [ ^ self new sourceElements: aCollectionOfSourceElements; targetElements: aCollectionOfTargetElements ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEqualizer >> eventsToHandle [ ^ { BlElementExtentChangedEvent } ] -{ #category : 'accessing' } +{ #category : #accessing } BlEqualizer >> sourceElements [ ^ sourceElements ] -{ #category : 'accessing' } +{ #category : #accessing } BlEqualizer >> sourceElements: aCollection [ sourceElements := aCollection. sourceElements do: [ :anElement | anElement addEventHandler: self ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlEqualizer >> targetElements [ ^ targetElements ] -{ #category : 'accessing' } +{ #category : #accessing } BlEqualizer >> targetElements: anObject [ targetElements := anObject ] diff --git a/src/Bloc/BlErrorHandler.class.st b/src/Bloc/BlErrorHandler.class.st index 15c4ad2c8..78d0578a0 100644 --- a/src/Bloc/BlErrorHandler.class.st +++ b/src/Bloc/BlErrorHandler.class.st @@ -4,16 +4,14 @@ I am responsible for error handling that occur in the {{gtClass:BlElement}} " Class { - #name : 'BlErrorHandler', - #superclass : 'Object', + #name : #BlErrorHandler, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #category : 'Bloc-Basic-Errors' } -{ #category : 'private' } +{ #category : #private } BlErrorHandler >> convertToHandledError: anError in: anElement [ | aHandledError | @@ -26,21 +24,21 @@ BlErrorHandler >> convertToHandledError: anError in: anElement [ ^ aHandledError ] -{ #category : 'accessing' } +{ #category : #accessing } BlErrorHandler >> errors [ ^ #() ] -{ #category : 'accessing' } +{ #category : #accessing } BlErrorHandler >> errorsForPhase: aFramePhase [ ^ self errors select: [ :aHandledError | aHandledError framePhase = aFramePhase ] ] -{ #category : 'private' } +{ #category : #private } BlErrorHandler >> framePhaseOf: anElement [ @@ -49,7 +47,7 @@ BlErrorHandler >> framePhaseOf: anElement [ ifFalse: [ BlSpaceFrameUnknownPhase new ] ] -{ #category : 'private' } +{ #category : #private } BlErrorHandler >> handleCriticalError: aHandledError [ "Handle an error that no one know how to handle. I stop the space and crash the system" @@ -58,7 +56,7 @@ BlErrorHandler >> handleCriticalError: aHandledError [ [ aHandledError error debug ] fork ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlErrorHandler >> handleError: anError in: anElement [ "Handle a given error that comes from a provided visual element" | aHandledError | @@ -69,40 +67,40 @@ BlErrorHandler >> handleError: anError in: anElement [ self processError: aHandledError ] -{ #category : 'testing' } +{ #category : #testing } BlErrorHandler >> hasError [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlErrorHandler >> matches: aFramePhase [ ^ self subclassResponsibility ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlErrorHandler >> processError: aHandledError [ self subclassResponsibility ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlErrorHandler >> registerError: aHandledError [ "Register a given handled error for further debugging" self subclassResponsibility ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlErrorHandler >> with: anElement do: aBlock [ "Evaluate a given block while handling errors" self with: anElement do: aBlock failed: [ ] ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlErrorHandler >> with: anElement do: aBlock failed: aFailBlock [ "Evaluate a given block while handling errors" diff --git a/src/Bloc/BlEvent.class.st b/src/Bloc/BlEvent.class.st index d1c48b3d6..073005853 100644 --- a/src/Bloc/BlEvent.class.st +++ b/src/Bloc/BlEvent.class.st @@ -6,8 +6,8 @@ BlEvent allSubclasses " Class { - #name : 'BlEvent', - #superclass : 'Announcement', + #name : #BlEvent, + #superclass : #Announcement, #instVars : [ 'target', 'source', @@ -16,36 +16,34 @@ Class { 'canBePropagated', 'consumed' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlEvent class >> disableIn: anEventDispatcher [ anEventDispatcher disableGeneralEventType: self ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlEvent class >> enableIn: anEventDispatcher [ anEventDispatcher enableGeneralEventType: self ] -{ #category : 'event management' } +{ #category : #'event management' } BlEvent class >> fireEvent: anEvent [ ^ self fireEvent: anEvent target: anEvent target ] -{ #category : 'event management' } +{ #category : #'event management' } BlEvent class >> fireEvent: anEvent from: aTopEventTarget [ ^ self fireEvent: anEvent from: aTopEventTarget to: anEvent target ] -{ #category : 'event management' } +{ #category : #'event management' } BlEvent class >> fireEvent: anEvent from: aTopEventTarget to: aTargetEventTarget [ | theEvent aDispatcherChain | @@ -62,7 +60,7 @@ BlEvent class >> fireEvent: anEvent from: aTopEventTarget to: aTargetEventTarget ^ aDispatcherChain dispatchEvent: theEvent ] -{ #category : 'event management' } +{ #category : #'event management' } BlEvent class >> fireEvent: anEvent target: anEventTarget [ | theEvent aDispatcherChain | @@ -79,7 +77,7 @@ BlEvent class >> fireEvent: anEvent target: anEventTarget [ ^ aDispatcherChain dispatchEvent: theEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlEvent class >> from: anEventTarget [ ^ self new target: anEventTarget; @@ -87,14 +85,14 @@ BlEvent class >> from: anEventTarget [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlEvent class >> target: anObject [ ^ self new target: anObject; yourself ] -{ #category : 'private' } +{ #category : #private } BlEvent class >> targetToDictionaryForExport: anObject [ | aDictionary | @@ -109,18 +107,18 @@ BlEvent class >> targetToDictionaryForExport: anObject [ ^ aDictionary ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlEvent class >> wantedIn: anEventDispatcher [ ^ anEventDispatcher wantsGeneralEventType: self ] -{ #category : 'private - steps' } +{ #category : #'private - steps' } BlEvent >> arrivedTarget: aTBlEventTarget [ currentTarget := aTBlEventTarget ] -{ #category : 'converting' } +{ #category : #converting } BlEvent >> asDictionaryForExport [ ^ OrderedDictionary new at: #event put: self class name; @@ -133,36 +131,36 @@ BlEvent >> asDictionaryForExport [ yourself ] -{ #category : 'private - steps' } +{ #category : #'private - steps' } BlEvent >> bubblingTarget: aTBlEventTarget [ currentTarget := aTBlEventTarget ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> canBePropagated [ ^ canBePropagated ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEvent >> canBePropagated: anObject [ canBePropagated := anObject ] -{ #category : 'private - steps' } +{ #category : #'private - steps' } BlEvent >> capturingTarget: aTBlEventTarget [ currentTarget := aTBlEventTarget ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> consumed: aBoolean [ consumed := aBoolean ] -{ #category : 'copying' } +{ #category : #copying } BlEvent >> copyFrom: anEvent [ super copyFrom: anEvent. @@ -170,7 +168,7 @@ BlEvent >> copyFrom: anEvent [ consumed := false ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEvent >> currentTarget [ "Identifies the current target for the event, as the event traverses the scene graph. It always refers to the element to which the event handler has been attached, as opposed to #target which identifies the element on which the event occurred." @@ -179,30 +177,30 @@ BlEvent >> currentTarget [ ^ currentTarget ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEvent >> currentTarget: anEventTarget [ currentTarget := anEventTarget ] -{ #category : 'firing' } +{ #category : #firing } BlEvent >> fire [ BlEvent fireEvent: self ] -{ #category : 'private - steps' } +{ #category : #'private - steps' } BlEvent >> forwardingTarget: aTBlEventTarget [ currentTarget := aTBlEventTarget ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> hasSource [ ^ source isNotNil ] -{ #category : 'initialization' } +{ #category : #initialization } BlEvent >> initialize [ super initialize. @@ -210,134 +208,134 @@ BlEvent >> initialize [ canBePropagated := true ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isBaseDrag [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isBaseFocus [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isBlur [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isClick [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isConsumed [ ^ consumed ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isDoubleClick [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isDrag [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isElementEvent [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isFocus [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isFocusIn [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isFocusOut [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isFocusTransfer [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isGesture [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isKeyboard [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isMouse [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isMouseDown [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isMouseEnter [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isMouseLeave [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isMouseMove [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isMouseUp [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isSpaceEvent [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isTextInput [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isTouch [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isUIEvent [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlEvent >> isUniverseEvent [ ^ false ] -{ #category : 'firing' } +{ #category : #firing } BlEvent >> newCopyFor: aTarget [ ^ self class new copyFrom: self; @@ -345,17 +343,17 @@ BlEvent >> newCopyFor: aTarget [ yourself ] -{ #category : 'copying' } +{ #category : #copying } BlEvent >> postCopy [ super postCopy ] -{ #category : 'sending' } +{ #category : #sending } BlEvent >> sendTo: anObject [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlEvent >> source [ "Return an event target that plays a role of a source of this event" @@ -366,12 +364,12 @@ BlEvent >> source [ ^ source ] -{ #category : 'accessing' } +{ #category : #accessing } BlEvent >> source: aBlEventTarget [ source := aBlEventTarget ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEvent >> target [ "Return a reference to the object that dispatched the event. It is different from #currentTarget when the event handler is called during the bubbling or capturing phase of the event." @@ -380,12 +378,12 @@ BlEvent >> target [ ^ target ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEvent >> target: aTBlEventTarget [ target := aTBlEventTarget ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEvent >> timestamp [ "Returns the time at which the event was created." @@ -393,7 +391,7 @@ BlEvent >> timestamp [ ^ timestamp ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEvent >> timestamp: aDateAndTime [ timestamp := aDateAndTime diff --git a/src/Bloc/BlEventDelegator.class.st b/src/Bloc/BlEventDelegator.class.st index 3f2ce227b..736304834 100644 --- a/src/Bloc/BlEventDelegator.class.st +++ b/src/Bloc/BlEventDelegator.class.st @@ -5,18 +5,16 @@ I hold a strong reference to the event target " Class { - #name : 'BlEventDelegator', - #superclass : 'BlBasicEventHandler', + #name : #BlEventDelegator, + #superclass : #BlBasicEventHandler, #instVars : [ 'eventClass', 'eventTarget' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEventDelegator class >> delegate: anEventClass to: anEventTarget [ ^ self new eventClass: anEventClass; @@ -24,32 +22,32 @@ BlEventDelegator class >> delegate: anEventClass to: anEventTarget [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventDelegator >> eventClass [ ^ eventClass ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventDelegator >> eventClass: anObject [ eventClass := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventDelegator >> eventTarget [ ^ eventTarget ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventDelegator >> eventTarget: anObject [ eventTarget := anObject ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventDelegator >> handleEvent: anEvent [ self eventTarget dispatchEvent: anEvent ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventDelegator >> wantsEvent: anEvent [ ^ anEvent class == self eventClass or: [ anEvent class inheritsFrom: self eventClass ] ] diff --git a/src/Bloc/BlEventDispatcher.class.st b/src/Bloc/BlEventDispatcher.class.st index d68b79b0a..0a1968da9 100644 --- a/src/Bloc/BlEventDispatcher.class.st +++ b/src/Bloc/BlEventDispatcher.class.st @@ -1,21 +1,19 @@ Class { - #name : 'BlEventDispatcher', - #superclass : 'Object', + #name : #BlEventDispatcher, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventDispatcher >> dispatchEvent: anEvent [ ^ self dispatchEvent: anEvent next: BlEventDispatcherChain empty ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventDispatcher >> dispatchEvent: anEvent next: aBlEventDispatcherChain [ @@ -25,27 +23,27 @@ BlEventDispatcher >> dispatchEvent: anEvent next: aBlEventDispatcherChain [ ^ anEvent ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventDispatcher >> filters [ ^ Array streamContents: [ :aStream | self filtersDo: [ :eachFilter | aStream nextPut: eachFilter ] ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventDispatcher >> filtersDo: aBlock [ "Evaulate a given block with every event filter as an argument" ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventDispatcher >> handlers [ ^ Array streamContents: [ :aStream | self handlersDo: [ :eachHandler | aStream nextPut: eachHandler ] ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventDispatcher >> handlersDo: aBlock [ "Evaulate a given block with every event handler as an argument" ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlEventDispatcher >> hasEventHandlerSuchThat: aBlock [ @@ -56,7 +54,7 @@ BlEventDispatcher >> hasEventHandlerSuchThat: aBlock [ ^ false ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventDispatcher >> type [ "Return the type name of the dispatcher. Might be used by IDE extensions" @@ -64,7 +62,7 @@ BlEventDispatcher >> type [ ^ 'Silent' ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventDispatcher >> wantsEvent: anEvent [ "Return true if my current conditions allow me to dispatch a given event, false otherwise. Default implementation always returns true. Override me to customize the behaviour" diff --git a/src/Bloc/BlEventDispatcherChain.class.st b/src/Bloc/BlEventDispatcherChain.class.st index d85b4c5b9..e68c3a881 100644 --- a/src/Bloc/BlEventDispatcherChain.class.st +++ b/src/Bloc/BlEventDispatcherChain.class.st @@ -3,32 +3,30 @@ I am a chain of BlEventDispatchers " Class { - #name : 'BlEventDispatcherChain', - #superclass : 'Object', + #name : #BlEventDispatcherChain, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'previous', 'dispatcher' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEventDispatcherChain class >> empty [ ^ BlEventDispatcherEmptyChain uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEventDispatcherChain class >> with: aBlEventDispatcher [ ^ self new initializeWith: aBlEventDispatcher ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventDispatcherChain >> dispatchEvent: anEvent [ "Dispatch a given event through the whole dispatcher chain" | aPreviousChain | @@ -40,34 +38,34 @@ BlEventDispatcherChain >> dispatchEvent: anEvent [ ^ self dispatcher dispatchEvent: anEvent next: aPreviousChain ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventDispatcherChain >> dispatcher [ ^ dispatcher ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventDispatcherChain >> first [ ^ self hasPrevious ifTrue: [ self previous first ] ifFalse: [ self ] ] -{ #category : 'private - testing' } +{ #category : #'private - testing' } BlEventDispatcherChain >> hasDispatcher [ ^ dispatcher isNotNil ] -{ #category : 'private - testing' } +{ #category : #'private - testing' } BlEventDispatcherChain >> hasPrevious [ ^ previous isNotNil ] -{ #category : 'initialization' } +{ #category : #initialization } BlEventDispatcherChain >> initializeWith: aBlEventDispatcher [ self @@ -80,7 +78,7 @@ BlEventDispatcherChain >> initializeWith: aBlEventDispatcher [ previous := nil ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventDispatcherChain >> previous [ @@ -91,7 +89,7 @@ BlEventDispatcherChain >> previous [ ^ previous ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventDispatcherChain >> previous: aBlEventDispatcherChain [ self assert: [ self hasPrevious not ] @@ -100,7 +98,7 @@ BlEventDispatcherChain >> previous: aBlEventDispatcherChain [ previous := aBlEventDispatcherChain ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventDispatcherChain >> withAllPrevious [ @@ -113,7 +111,7 @@ BlEventDispatcherChain >> withAllPrevious [ aChain := aChain previous ] ] ] -{ #category : 'api - adding' } +{ #category : #'api - adding' } BlEventDispatcherChain >> withNext: aBlEventDispatcher [ | aNextChain | diff --git a/src/Bloc/BlEventDispatcherEmptyChain.class.st b/src/Bloc/BlEventDispatcherEmptyChain.class.st index e43667d66..59f0307c2 100644 --- a/src/Bloc/BlEventDispatcherEmptyChain.class.st +++ b/src/Bloc/BlEventDispatcherEmptyChain.class.st @@ -4,34 +4,32 @@ Basically, I implement a null object pattern and used as next or previous elemen " Class { - #name : 'BlEventDispatcherEmptyChain', - #superclass : 'BlEventDispatcherChain', + #name : #BlEventDispatcherEmptyChain, + #superclass : #BlEventDispatcherChain, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlEventDispatcherEmptyChain class >> cleanUp [ super cleanUp. uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventDispatcherEmptyChain class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventDispatcherEmptyChain >> dispatchEvent: anEvent [ ^ anEvent ] -{ #category : 'api - adding' } +{ #category : #'api - adding' } BlEventDispatcherEmptyChain >> withNext: aBlEventDispatcher [ ^ BlEventDispatcherChain with: aBlEventDispatcher ] diff --git a/src/Bloc/BlEventErrorHandler.class.st b/src/Bloc/BlEventErrorHandler.class.st index 86e364465..a6b0f7d56 100644 --- a/src/Bloc/BlEventErrorHandler.class.st +++ b/src/Bloc/BlEventErrorHandler.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlEventErrorHandler', - #superclass : 'BlSingleErrorHandler', - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #name : #BlEventErrorHandler, + #superclass : #BlSingleErrorHandler, + #category : 'Bloc-Basic-Errors' } -{ #category : 'testing' } +{ #category : #testing } BlEventErrorHandler >> matches: aFramePhase [ ^ aFramePhase isEventPhase ] diff --git a/src/Bloc/BlEventFilter.class.st b/src/Bloc/BlEventFilter.class.st index ab95658f0..f2d781073 100644 --- a/src/Bloc/BlEventFilter.class.st +++ b/src/Bloc/BlEventFilter.class.st @@ -1,29 +1,27 @@ Class { - #name : 'BlEventFilter', - #superclass : 'BlBasicEventHandler', + #name : #BlEventFilter, + #superclass : #BlBasicEventHandler, #instVars : [ 'eventClass' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEventFilter class >> on: anEventClass [ ^ self new eventClass: anEventClass ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventFilter >> eventClass [ ^ eventClass ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventFilter >> eventClass: aBlEventClass [ self assert: [ eventClass isNil ] @@ -32,24 +30,24 @@ BlEventFilter >> eventClass: aBlEventClass [ eventClass := aBlEventClass ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventFilter >> eventsToHandle [ ^ { self eventClass } ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventFilter >> handleEvent: anEvent [ anEvent consumed: true ] -{ #category : 'printing' } +{ #category : #printing } BlEventFilter >> printOn: aStream [ aStream nextPutAll: 'Event filter of '; nextPutAll: self eventClass name ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventFilter >> wantsEvent: anEvent [ ^ anEvent class == self eventClass or: [ anEvent class inheritsFrom: self eventClass ] ] diff --git a/src/Bloc/BlEventForwarder.class.st b/src/Bloc/BlEventForwarder.class.st index ea3acabc8..345f6a6e0 100644 --- a/src/Bloc/BlEventForwarder.class.st +++ b/src/Bloc/BlEventForwarder.class.st @@ -11,54 +11,52 @@ BlEventForwarder " Class { - #name : 'BlEventForwarder', - #superclass : 'BlBasicEventHandler', + #name : #BlEventForwarder, + #superclass : #BlBasicEventHandler, #instVars : [ 'eventTarget', 'eventHandler' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEventForwarder class >> forwardTo: anEventHandler from: anEventTarget [ ^ self new eventTarget: anEventTarget; eventHandler: anEventHandler ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventForwarder >> eventHandler [ ^ eventHandler ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventForwarder >> eventHandler: aBlBasicEventHandler [ eventHandler := aBlBasicEventHandler ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventForwarder >> eventTarget [ ^ eventTarget ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventForwarder >> eventTarget: aTBlEventTarget [ eventTarget := aTBlEventTarget ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventForwarder >> eventsToHandle [ ^ self eventHandler eventsToHandle ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventForwarder >> handleEvent: anEvent [ | aCurrentTarget | @@ -69,7 +67,7 @@ BlEventForwarder >> handleEvent: anEvent [ anEvent currentTarget: aCurrentTarget ] ] -{ #category : 'printing' } +{ #category : #printing } BlEventForwarder >> printOn: aStream [ aStream nextPutAll: 'Forward '; @@ -78,7 +76,7 @@ BlEventForwarder >> printOn: aStream [ print: self eventTarget ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventForwarder >> wantsEvent: anEvent [ diff --git a/src/Bloc/BlEventHandler.class.st b/src/Bloc/BlEventHandler.class.st index 482d3eb11..cc37593b9 100644 --- a/src/Bloc/BlEventHandler.class.st +++ b/src/Bloc/BlEventHandler.class.st @@ -11,18 +11,16 @@ BlEventHandler " Class { - #name : 'BlEventHandler', - #superclass : 'BlBasicEventHandler', + #name : #BlEventHandler, + #superclass : #BlBasicEventHandler, #instVars : [ 'action', 'eventClass' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEventHandler class >> on: anEventClass do: aBlock [ ^ self new eventClass: anEventClass; @@ -30,14 +28,14 @@ BlEventHandler class >> on: anEventClass do: aBlock [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlEventHandler class >> on: anEventClass sendTo: anObject [ ^ self on: anEventClass do: [ :event | event sendTo: anObject ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlEventHandler >> = anotherObject [ self species == anotherObject species ifFalse: [ ^ false ]. @@ -46,49 +44,49 @@ BlEventHandler >> = anotherObject [ and: [ anotherObject action = self action ] ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventHandler >> action [ ^ action ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventHandler >> action: anObject [ action := anObject ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventHandler >> eventClass [ ^ eventClass ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlEventHandler >> eventClass: anObject [ eventClass := anObject ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventHandler >> eventsToHandle [ ^ { self eventClass } ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventHandler >> handleEvent: anEvent [ self action cull: anEvent ] -{ #category : 'comparing' } +{ #category : #comparing } BlEventHandler >> hash [ ^ self action hash bitXor: self eventClass hash ] -{ #category : 'printing' } +{ #category : #printing } BlEventHandler >> printOn: aStream [ aStream nextPutAll: 'Event handler of '; nextPutAll: self eventClass name ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventHandler >> wantsEvent: anEvent [ ^ anEvent class == self eventClass or: [ anEvent class inheritsFrom: self eventClass ] ] diff --git a/src/Bloc/BlEventListener.class.st b/src/Bloc/BlEventListener.class.st index ed1bf7d4a..cc36b0038 100644 --- a/src/Bloc/BlEventListener.class.st +++ b/src/Bloc/BlEventListener.class.st @@ -1,184 +1,182 @@ Class { - #name : 'BlEventListener', - #superclass : 'BlBasicEventHandler', - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #name : #BlEventListener, + #superclass : #BlBasicEventHandler, + #category : 'Bloc-Events-Handler' } -{ #category : 'focus handlers' } +{ #category : #'focus handlers' } BlEventListener >> blurEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> clickAvortedEvent: anEvent [ "a mouse down followed by a mouse up but in different a target" ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> clickEvent: anEvent [ "The click event is fired when a pointing device button (usually a mouse's primary button) is pressed and released on a single element." ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> doubleClickEvent: anEvent [ ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlEventListener >> dragEndEvent: anEvent [ ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlEventListener >> dragEnterEvent: anEvent [ ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlEventListener >> dragEvent: anEvent [ ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlEventListener >> dragLeaveEvent: anEvent [ ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlEventListener >> dragOverEvent: anEvent [ ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlEventListener >> dragStartEvent: anEvent [ ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlEventListener >> dropEvent: anEvent [ ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlEventListener >> eventsToHandle [ ^ BlUIEvent allSubclasses ] -{ #category : 'focus handlers' } +{ #category : #'focus handlers' } BlEventListener >> focusEvent: anEvent [ ] -{ #category : 'focus handlers' } +{ #category : #'focus handlers' } BlEventListener >> focusInEvent: anEvent [ ] -{ #category : 'focus handlers' } +{ #category : #'focus handlers' } BlEventListener >> focusOutEvent: anEvent [ ] -{ #category : 'focus handlers' } +{ #category : #'focus handlers' } BlEventListener >> focusTransferEvent: anEvent [ ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlEventListener >> handleEvent: anEvent [ anEvent sendTo: self ] -{ #category : 'keyboard handlers' } +{ #category : #'keyboard handlers' } BlEventListener >> keyDownEvent: anEvent [ ] -{ #category : 'keyboard handlers' } +{ #category : #'keyboard handlers' } BlEventListener >> keyUpEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseDownEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseEnterEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseLeaveEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseMoveEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseOutEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseOverEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseUpEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlEventListener >> mouseWheelEvent: anEvent [ ] -{ #category : 'keyboard handlers' } +{ #category : #'keyboard handlers' } BlEventListener >> shortcutEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceCloseRequest: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceClosedEvent: anEvent [ "Is sent after space is closed" ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceFocusInEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceFocusOutEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceIconChangedEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceMouseEnterEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceMouseLeaveEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceMovedEvent: anEvent [ ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceRedrawRequestedEvent: anEvent [ "Is sent by the host indicating that the space should be re-rendered" ] -{ #category : 'space handlers' } +{ #category : #'space handlers' } BlEventListener >> spaceResizedEvent: anEvent [ "Is sent after window size was changed" ] -{ #category : 'keyboard handlers' } +{ #category : #'keyboard handlers' } BlEventListener >> textInputEvent: anEvent [ ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlEventListener >> wantsEvent: anEvent [ anEvent isElementEvent diff --git a/src/Bloc/BlEventTraversalBubblingStep.class.st b/src/Bloc/BlEventTraversalBubblingStep.class.st index 8489e8988..d7254f972 100644 --- a/src/Bloc/BlEventTraversalBubblingStep.class.st +++ b/src/Bloc/BlEventTraversalBubblingStep.class.st @@ -5,14 +5,12 @@ This is known as bubbling, and occurs only if BlEvent>>#canBePropagated is true. " Class { - #name : 'BlEventTraversalBubblingStep', - #superclass : 'BlEventTraversalStep', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlEventTraversalBubblingStep, + #superclass : #BlEventTraversalStep, + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalBubblingStep >> type [ diff --git a/src/Bloc/BlEventTraversalCapturingStep.class.st b/src/Bloc/BlEventTraversalCapturingStep.class.st index f10ece0ac..128bd2ec8 100644 --- a/src/Bloc/BlEventTraversalCapturingStep.class.st +++ b/src/Bloc/BlEventTraversalCapturingStep.class.st @@ -5,14 +5,12 @@ This process starts with the Space, then Root, then the Element, and so on throu " Class { - #name : 'BlEventTraversalCapturingStep', - #superclass : 'BlEventTraversalStep', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlEventTraversalCapturingStep, + #superclass : #BlEventTraversalStep, + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalCapturingStep >> type [ diff --git a/src/Bloc/BlEventTraversalForwardingStep.class.st b/src/Bloc/BlEventTraversalForwardingStep.class.st index d6331eb01..2dbdd563e 100644 --- a/src/Bloc/BlEventTraversalForwardingStep.class.st +++ b/src/Bloc/BlEventTraversalForwardingStep.class.st @@ -3,14 +3,12 @@ The event is being manually forwarded to other dispatchers " Class { - #name : 'BlEventTraversalForwardingStep', - #superclass : 'BlEventTraversalStep', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlEventTraversalForwardingStep, + #superclass : #BlEventTraversalStep, + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalForwardingStep >> type [ diff --git a/src/Bloc/BlEventTraversalStep.class.st b/src/Bloc/BlEventTraversalStep.class.st index 5cf5dce7f..869e68887 100644 --- a/src/Bloc/BlEventTraversalStep.class.st +++ b/src/Bloc/BlEventTraversalStep.class.st @@ -3,30 +3,28 @@ I describe which phase the event flow is currently being evaluated. " Class { - #name : 'BlEventTraversalStep', - #superclass : 'Object', + #name : #BlEventTraversalStep, + #superclass : #Object, #instVars : [ 'target' ], #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalStep class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalStep >> dispatcher [ ^ self target eventDispatcher ] -{ #category : 'printing' } +{ #category : #printing } BlEventTraversalStep >> printOn: stream [ super printOn: stream. self target ifNotNil: [ @@ -35,17 +33,17 @@ BlEventTraversalStep >> printOn: stream [ stream nextPut: $). ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalStep >> target [ ^ target ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalStep >> target: anObject [ target := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalStep >> type [ diff --git a/src/Bloc/BlEventTraversalTargetStep.class.st b/src/Bloc/BlEventTraversalTargetStep.class.st index 4514efd44..32975b2d5 100644 --- a/src/Bloc/BlEventTraversalTargetStep.class.st +++ b/src/Bloc/BlEventTraversalTargetStep.class.st @@ -3,14 +3,12 @@ The event has arrived at the event's target. Event listeners registered for this " Class { - #name : 'BlEventTraversalTargetStep', - #superclass : 'BlEventTraversalStep', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlEventTraversalTargetStep, + #superclass : #BlEventTraversalStep, + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlEventTraversalTargetStep >> type [ diff --git a/src/Bloc/BlExtentMeasurementSpec.class.st b/src/Bloc/BlExtentMeasurementSpec.class.st index 57199b3ce..52ff470be 100644 --- a/src/Bloc/BlExtentMeasurementSpec.class.st +++ b/src/Bloc/BlExtentMeasurementSpec.class.st @@ -5,39 +5,37 @@ I am used by Layouts " Class { - #name : 'BlExtentMeasurementSpec', - #superclass : 'Object', + #name : #BlExtentMeasurementSpec, + #superclass : #Object, #instVars : [ 'widthSpec', 'heightSpec' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlExtentMeasurementSpec class >> atMost: anExtent [ ^ self new widthSpec: (BlMeasurementSpec atMost: anExtent x asFloat); heightSpec: (BlMeasurementSpec atMost: anExtent y asFloat) ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlExtentMeasurementSpec class >> exact: anExtent [ ^ self new widthSpec: (BlMeasurementSpec exact: anExtent x asFloat); heightSpec: (BlMeasurementSpec exact: anExtent y asFloat) ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlExtentMeasurementSpec class >> unspecified [ ^ self new widthSpec: BlMeasurementSpec unspecified; heightSpec: BlMeasurementSpec unspecified ] -{ #category : 'comparing' } +{ #category : #comparing } BlExtentMeasurementSpec >> = anotherObject [ self == anotherObject ifTrue: [ ^ true ]. @@ -48,32 +46,32 @@ BlExtentMeasurementSpec >> = anotherObject [ and: [ anotherObject heightSpec = heightSpec ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlExtentMeasurementSpec >> hash [ ^ heightSpec hash bitXor: widthSpec hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlExtentMeasurementSpec >> heightSpec [ ^ heightSpec ] -{ #category : 'accessing' } +{ #category : #accessing } BlExtentMeasurementSpec >> heightSpec: anObject [ heightSpec := anObject ] -{ #category : 'testing' } +{ #category : #testing } BlExtentMeasurementSpec >> isExact [ ^ self widthSpec isExact and: [ self heightSpec isExact ] ] -{ #category : 'geometry' } +{ #category : #geometry } BlExtentMeasurementSpec >> min: aMinSize max: aMaxSize [ ^ (self widthSpec min: aMinSize x max: aMaxSize x) @ (self heightSpec min: aMinSize y max: aMaxSize y) ] -{ #category : 'printing' } +{ #category : #printing } BlExtentMeasurementSpec >> printOn: aStream [ aStream nextPutAll: 'width: ('. aStream nextPutAll: (self widthSpec asString). @@ -82,7 +80,7 @@ BlExtentMeasurementSpec >> printOn: aStream [ aStream nextPutAll: ')'. ] -{ #category : 'geometry' } +{ #category : #geometry } BlExtentMeasurementSpec >> sizeFor: anExtent [ | width height | width := self widthSpec sizeFor: anExtent x. @@ -90,13 +88,13 @@ BlExtentMeasurementSpec >> sizeFor: anExtent [ ^ width @ height ] -{ #category : 'accessing' } +{ #category : #accessing } BlExtentMeasurementSpec >> widthSpec [ ^ widthSpec ] -{ #category : 'accessing' } +{ #category : #accessing } BlExtentMeasurementSpec >> widthSpec: anObject [ widthSpec := anObject ] diff --git a/src/Bloc/BlFastForwardedTime.class.st b/src/Bloc/BlFastForwardedTime.class.st index 9fe5f939b..14a6ef78d 100644 --- a/src/Bloc/BlFastForwardedTime.class.st +++ b/src/Bloc/BlFastForwardedTime.class.st @@ -11,19 +11,17 @@ I am a time with an ability to manipulate its speed, make it run faster or go sl " Class { - #name : 'BlFastForwardedTime', - #superclass : 'BlTime', + #name : #BlFastForwardedTime, + #superclass : #BlTime, #instVars : [ 'speed', 'previousRealTime', 'previousSpeededUpTime' ], - #category : 'Bloc-Universe', - #package : 'Bloc', - #tag : 'Universe' + #category : 'Bloc-Universe' } -{ #category : 'private - time' } +{ #category : #'private - time' } BlFastForwardedTime >> currentTime [ "Return a 'current' date and time" @@ -41,7 +39,7 @@ BlFastForwardedTime >> currentTime [ ^ aSpeededTime ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlFastForwardedTime >> every: aDuration while: aWhileBlock do: aDoBlock [ "Evaluate a aDoBlock while aWhileBlock evaluates to true waiting a given amount of time between executions. The first evaluation of a aDoBlock is instant. @@ -62,7 +60,7 @@ BlFastForwardedTime >> every: aDuration while: aWhileBlock do: aDoBlock [ (anExpectedTime - aCurrentTime) wait ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlFastForwardedTime >> initialize [ super initialize. @@ -71,19 +69,19 @@ BlFastForwardedTime >> initialize [ previousSpeededUpTime := previousRealTime. ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlFastForwardedTime >> speed [ ^ speed ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlFastForwardedTime >> speed: aNumber [ speed := aNumber ] -{ #category : 'api - time' } +{ #category : #'api - time' } BlFastForwardedTime >> wait: aDuration [ "Advance clock by waiting for a given amount of time" diff --git a/src/Bloc/BlFocusChain.class.st b/src/Bloc/BlFocusChain.class.st index fd886db86..dc73b8735 100644 --- a/src/Bloc/BlFocusChain.class.st +++ b/src/Bloc/BlFocusChain.class.st @@ -7,14 +7,12 @@ I am used by {{gtClass:BlFocusProcessor}} to properly send events " Class { - #name : 'BlFocusChain', - #superclass : 'DoubleLinkedList', - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #name : #BlFocusChain, + #superclass : #DoubleLinkedList, + #category : 'Bloc-Space - Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlFocusChain class >> of: anElement [ | aChain | @@ -25,7 +23,7 @@ BlFocusChain class >> of: anElement [ ^ aChain ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlFocusChain >> deepestAttachedElementDo: aBlock ifAbsent: ifAbsentBlock [ "Evaluate a given block with the first attached older parent of the focused element" @@ -36,7 +34,7 @@ BlFocusChain >> deepestAttachedElementDo: aBlock ifAbsent: ifAbsentBlock [ ^ ifAbsentBlock value ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlFocusChain >> leafsDo: aBlock [ "Evaluate a given block with all leaf elements in the chain starting from the focused element in reverse order" | previousElementHadParent | diff --git a/src/Bloc/BlFocusDueToRemovedFromParentReason.class.st b/src/Bloc/BlFocusDueToRemovedFromParentReason.class.st index 05bd13ead..3f8ac671a 100644 --- a/src/Bloc/BlFocusDueToRemovedFromParentReason.class.st +++ b/src/Bloc/BlFocusDueToRemovedFromParentReason.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlFocusDueToRemovedFromParentReason', - #superclass : 'BlFocusReason', - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #name : #BlFocusDueToRemovedFromParentReason, + #superclass : #BlFocusReason, + #category : 'Bloc-Space - Support' } diff --git a/src/Bloc/BlFocusDueToRemovedFromSpaceReason.class.st b/src/Bloc/BlFocusDueToRemovedFromSpaceReason.class.st index ccee1652f..bdd570533 100644 --- a/src/Bloc/BlFocusDueToRemovedFromSpaceReason.class.st +++ b/src/Bloc/BlFocusDueToRemovedFromSpaceReason.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlFocusDueToRemovedFromSpaceReason', - #superclass : 'BlFocusReason', - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #name : #BlFocusDueToRemovedFromSpaceReason, + #superclass : #BlFocusReason, + #category : 'Bloc-Space - Support' } diff --git a/src/Bloc/BlFocusEvent.class.st b/src/Bloc/BlFocusEvent.class.st index 24def1e16..8eee2da38 100644 --- a/src/Bloc/BlFocusEvent.class.st +++ b/src/Bloc/BlFocusEvent.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlFocusEvent', - #superclass : 'BlBaseFocusEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlFocusEvent, + #superclass : #BlBaseFocusEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlFocusEvent >> isFocus [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlFocusEvent >> sendTo: anObject [ anObject focusEvent: self ] diff --git a/src/Bloc/BlFocusInEvent.class.st b/src/Bloc/BlFocusInEvent.class.st index 032290edb..535762bdc 100644 --- a/src/Bloc/BlFocusInEvent.class.st +++ b/src/Bloc/BlFocusInEvent.class.st @@ -3,19 +3,17 @@ The `=BlFocusInEvent`= event is sent to an element when it, or any element insid " Class { - #name : 'BlFocusInEvent', - #superclass : 'BlBaseFocusEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlFocusInEvent, + #superclass : #BlBaseFocusEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlFocusInEvent >> isFocusIn [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlFocusInEvent >> sendTo: anObject [ anObject focusInEvent: self ] diff --git a/src/Bloc/BlFocusOutEvent.class.st b/src/Bloc/BlFocusOutEvent.class.st index 73aaf9666..2a0f9cb31 100644 --- a/src/Bloc/BlFocusOutEvent.class.st +++ b/src/Bloc/BlFocusOutEvent.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlFocusOutEvent', - #superclass : 'BlBaseFocusEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlFocusOutEvent, + #superclass : #BlBaseFocusEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlFocusOutEvent >> isFocusOut [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlFocusOutEvent >> sendTo: anObject [ anObject focusOutEvent: self ] diff --git a/src/Bloc/BlFocusProcessor.class.st b/src/Bloc/BlFocusProcessor.class.st index 0cf3d5af1..a4f196615 100644 --- a/src/Bloc/BlFocusProcessor.class.st +++ b/src/Bloc/BlFocusProcessor.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlFocusProcessor', - #superclass : 'BlBaseEventProcessor', + #name : #BlFocusProcessor, + #superclass : #BlBaseEventProcessor, #instVars : [ 'focusChain' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireBlurEvent: anElement [ "Create and send blur event that doesn't bubble, perform simple direct dispatch to the given target element" self @@ -17,7 +15,7 @@ BlFocusProcessor >> fireBlurEvent: anElement [ target: anElement ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireBlurEvent: anElement dueTo: aFocusReason [ "Create and send blur event that doesn't bubble, perform simple direct dispatch to the given target element" self @@ -25,7 +23,7 @@ BlFocusProcessor >> fireBlurEvent: anElement dueTo: aFocusReason [ target: anElement ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireFocusEvent: anElement [ "Send focus event that doesn't bubble, perform simple direct dispatch to the target" @@ -34,14 +32,14 @@ BlFocusProcessor >> fireFocusEvent: anElement [ target: anElement ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireFocusInEvent: anElement [ "Send focusIn event that should bubble" self fireEvent: (self newFocusInEvent target: anElement) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireFocusInEvent: anElement from: aTopEventTarget [ "Send focusIn event that should bubble" @@ -51,28 +49,28 @@ BlFocusProcessor >> fireFocusInEvent: anElement from: aTopEventTarget [ self fireEvent: (self newFocusInEvent target: anElement) from: aTopEventTarget ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireFocusOutEvent: anElement [ "Send focusOut event that should bubble" self fireEvent: (self newFocusOutEvent target: anElement) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireFocusOutEvent: anElement dueTo: aFocusReason [ "Send focusOut event that should bubble" self fireEvent: (self newFocusOutEvent target: anElement; reason: aFocusReason) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireFocusOutEvent: anElement from: aTopEventTarget dueTo: aFocusReason [ "Send focusOut event that should bubble" self fireEvent: (self newFocusOutEvent target: anElement; reason: aFocusReason) from: aTopEventTarget ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlFocusProcessor >> fireFocusTransferEvent: anElement from: aPreviousFocusedElement [ "Send focus event that doesn't bubble, perform simple direct dispatch to the target" self @@ -82,22 +80,22 @@ BlFocusProcessor >> fireFocusTransferEvent: anElement from: aPreviousFocusedElem target: anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusProcessor >> focusOwner [ ^ self space focusOwner ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusProcessor >> focusOwner: anElement [ self space focusOwner: anElement ] -{ #category : 'focus - processing' } +{ #category : #'focus - processing' } BlFocusProcessor >> handleMouseDown: anEvent [ "Clicking outside does not mean focus should be lost" ] -{ #category : 'testing' } +{ #category : #testing } BlFocusProcessor >> hasFocusOwner [ "Return true if there is an element holding focus, false otherwise. When there are no elements interested in focus it is given to the root element. @@ -107,7 +105,7 @@ BlFocusProcessor >> hasFocusOwner [ ^ self focusOwner notNil ] -{ #category : 'focus - requesting' } +{ #category : #'focus - requesting' } BlFocusProcessor >> looseFor: anElement [ self deprecated: 'Please use loseFor: instead.' @@ -118,7 +116,7 @@ BlFocusProcessor >> looseFor: anElement [ self loseFor: anElement ] -{ #category : 'focus - requesting' } +{ #category : #'focus - requesting' } BlFocusProcessor >> loseFor: anElement [ self focusOwner ~= anElement ifTrue: [ ^ self ]. @@ -128,7 +126,7 @@ BlFocusProcessor >> loseFor: anElement [ self focusOwner: nil ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlFocusProcessor >> newBlurEvent [ "Create, initialize and return a blur event that should be sent to the element that just lost its focus" @@ -138,7 +136,7 @@ BlFocusProcessor >> newBlurEvent [ canBePropagated: false ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlFocusProcessor >> newFocusEvent [ "Create, initialize and return a focus event that should be sent to the element after it gets focus" @@ -148,7 +146,7 @@ BlFocusProcessor >> newFocusEvent [ canBePropagated: false ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlFocusProcessor >> newFocusInEvent [ "Create, initialize and return a focus-in event that should be sent as a part of focus processing" @@ -157,7 +155,7 @@ BlFocusProcessor >> newFocusInEvent [ ^ BlFocusInEvent new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlFocusProcessor >> newFocusOutEvent [ "Create, initialize and return a focus-out event that should be sent as a part of blur processing" @@ -166,7 +164,7 @@ BlFocusProcessor >> newFocusOutEvent [ ^ BlFocusOutEvent new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlFocusProcessor >> newFocusTransferEvent [ "Create, initialize and return a focus transfer event that should be sent to the element before performing a focus transfer" @@ -175,13 +173,13 @@ BlFocusProcessor >> newFocusTransferEvent [ ^ BlFocusTransferEvent new ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlFocusProcessor >> onSpaceClosed [ self focusOwner: nil. focusChain := nil ] -{ #category : 'focus - processing' } +{ #category : #'focus - processing' } BlFocusProcessor >> processBlur: anElement [ self assert: [ self hasFocusOwner ] @@ -194,7 +192,7 @@ BlFocusProcessor >> processBlur: anElement [ self fireBlurEvent: anElement ] -{ #category : 'focus - processing' } +{ #category : #'focus - processing' } BlFocusProcessor >> processBlur: anElement dueToFocus: aNewFocusedElement dueTo: aFocusReason [ self assert: [ self hasFocusOwner ] @@ -216,7 +214,7 @@ BlFocusProcessor >> processBlur: anElement dueToFocus: aNewFocusedElement dueTo: self fireBlurEvent: anElement dueTo: aFocusReason ] -{ #category : 'focus - processing' } +{ #category : #'focus - processing' } BlFocusProcessor >> processFocus: anElement [ self assert: [ anElement isNotNil ] @@ -235,7 +233,7 @@ BlFocusProcessor >> processFocus: anElement [ self fireFocusEvent: anElement ] -{ #category : 'focus - processing' } +{ #category : #'focus - processing' } BlFocusProcessor >> processFocus: anElement dueToTransferFrom: aPreviousFocus [ self assert: [ anElement isNotNil ] @@ -266,19 +264,19 @@ BlFocusProcessor >> processFocus: anElement dueToTransferFrom: aPreviousFocus [ self fireFocusEvent: anElement ] -{ #category : 'focus - processing' } +{ #category : #'focus - processing' } BlFocusProcessor >> processWindowFocusIn: anEvent [ self space grabFocus ] -{ #category : 'focus - processing' } +{ #category : #'focus - processing' } BlFocusProcessor >> processWindowFocusOut: anEvent [ self space ungrabFocus ] -{ #category : 'focus - requesting' } +{ #category : #'focus - requesting' } BlFocusProcessor >> requestFor: anElement dueTo: aFocusReason [ | aPreviousFocusOwner | diff --git a/src/Bloc/BlFocusReason.class.st b/src/Bloc/BlFocusReason.class.st index dc5550a02..29e9ae296 100644 --- a/src/Bloc/BlFocusReason.class.st +++ b/src/Bloc/BlFocusReason.class.st @@ -1,20 +1,18 @@ Class { - #name : 'BlFocusReason', - #superclass : 'Object', + #name : #BlFocusReason, + #superclass : #Object, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #category : 'Bloc-Space - Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlFocusReason class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusReason class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] diff --git a/src/Bloc/BlFocusTransferEvent.class.st b/src/Bloc/BlFocusTransferEvent.class.st index f4c0f3dce..4f67705d4 100644 --- a/src/Bloc/BlFocusTransferEvent.class.st +++ b/src/Bloc/BlFocusTransferEvent.class.st @@ -1,30 +1,28 @@ Class { - #name : 'BlFocusTransferEvent', - #superclass : 'BlBaseFocusEvent', + #name : #BlFocusTransferEvent, + #superclass : #BlBaseFocusEvent, #instVars : [ 'transfer' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlFocusTransferEvent >> hasTransfer [ ^ transfer isNotNil ] -{ #category : 'testing' } +{ #category : #testing } BlFocusTransferEvent >> isFocusTransfer [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlFocusTransferEvent >> sendTo: anObject [ anObject focusTransferEvent: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusTransferEvent >> transfer [ self assert: [ self hasTransfer ] @@ -33,7 +31,7 @@ BlFocusTransferEvent >> transfer [ ^ transfer ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusTransferEvent >> transfer: anObject [ transfer := anObject ] diff --git a/src/Bloc/BlFocusUnknownReason.class.st b/src/Bloc/BlFocusUnknownReason.class.st index df5873018..c9a0df659 100644 --- a/src/Bloc/BlFocusUnknownReason.class.st +++ b/src/Bloc/BlFocusUnknownReason.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlFocusUnknownReason', - #superclass : 'BlFocusReason', - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #name : #BlFocusUnknownReason, + #superclass : #BlFocusReason, + #category : 'Bloc-Space - Support' } diff --git a/src/Bloc/BlFocusability.class.st b/src/Bloc/BlFocusability.class.st index 84846a6cb..beebf3e31 100644 --- a/src/Bloc/BlFocusability.class.st +++ b/src/Bloc/BlFocusability.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlFocusability', - #superclass : 'Object', + #name : #BlFocusability, + #superclass : #Object, #classInstVars : [ 'after', 'before', @@ -8,27 +8,25 @@ Class { 'none', 'ignore' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'accessing' } +{ #category : #accessing } BlFocusability class >> after [ ^ after ifNil: [ after := BlFocusabilityAfter new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusability class >> before [ ^ before ifNil: [ before := BlFocusabilityBefore new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusability class >> block [ ^ block ifNil: [ block := BlFocusabilityBlock new ] ] -{ #category : 'cleanup' } +{ #category : #cleanup } BlFocusability class >> cleanUp [ super cleanUp. @@ -39,31 +37,31 @@ BlFocusability class >> cleanUp [ ignore := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusability class >> ignore [ ^ ignore ifNil: [ ignore := BlFocusabilityIgnore new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlFocusability class >> none [ ^ none ifNil: [ none := BlFocusabilityNone new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlFocusability >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'focus' } +{ #category : #focus } BlFocusability >> focusables: anOrderedCollection along: aBlFocusSearchDirection of: anElement [ "Add focusable elements that are descendants of a given element (possibly including anElement) to anOrderedCollection" self subclassResponsibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlFocusability >> hash [ ^ self class hash ] diff --git a/src/Bloc/BlFocusabilityAfter.class.st b/src/Bloc/BlFocusabilityAfter.class.st index baac44890..2b8144734 100644 --- a/src/Bloc/BlFocusabilityAfter.class.st +++ b/src/Bloc/BlFocusabilityAfter.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlFocusabilityAfter', - #superclass : 'BlFocusability', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlFocusabilityAfter, + #superclass : #BlFocusability, + #category : 'Bloc-Basic-Properties' } -{ #category : 'focus' } +{ #category : #focus } BlFocusabilityAfter >> focusables: aBlFocusFinderCandidates along: aBlFocusSearchDirection of: anElement [ "We always add visible children and skip anElement itself if there are focusable descendants" | focusablesCount | diff --git a/src/Bloc/BlFocusabilityBefore.class.st b/src/Bloc/BlFocusabilityBefore.class.st index fa6f2c5ef..f1634dc06 100644 --- a/src/Bloc/BlFocusabilityBefore.class.st +++ b/src/Bloc/BlFocusabilityBefore.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlFocusabilityBefore', - #superclass : 'BlFocusability', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlFocusabilityBefore, + #superclass : #BlFocusability, + #category : 'Bloc-Basic-Properties' } -{ #category : 'focus' } +{ #category : #focus } BlFocusabilityBefore >> focusables: aBlFocusFinderCandidates along: aBlFocusSearchDirection of: anElement [ "anElement should get focus before descendants" diff --git a/src/Bloc/BlFocusabilityBlock.class.st b/src/Bloc/BlFocusabilityBlock.class.st index e2cff42c3..68ce2a7ae 100644 --- a/src/Bloc/BlFocusabilityBlock.class.st +++ b/src/Bloc/BlFocusabilityBlock.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlFocusabilityBlock', - #superclass : 'BlFocusability', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlFocusabilityBlock, + #superclass : #BlFocusability, + #category : 'Bloc-Basic-Properties' } -{ #category : 'focus' } +{ #category : #focus } BlFocusabilityBlock >> focusables: anOrderedCollection along: aBlFocusSearchDirection of: anElement [ "Block descendants and only add anElement" diff --git a/src/Bloc/BlFocusabilityIgnore.class.st b/src/Bloc/BlFocusabilityIgnore.class.st index 3c3675ff7..eeb34b15b 100644 --- a/src/Bloc/BlFocusabilityIgnore.class.st +++ b/src/Bloc/BlFocusabilityIgnore.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlFocusabilityIgnore', - #superclass : 'BlFocusability', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlFocusabilityIgnore, + #superclass : #BlFocusability, + #category : 'Bloc-Basic-Properties' } -{ #category : 'focus' } +{ #category : #focus } BlFocusabilityIgnore >> focusables: aBlFocusFinderCandidates along: aBlFocusSearchDirection of: anElement [ "I ignore myself and only add children" diff --git a/src/Bloc/BlFocusabilityNone.class.st b/src/Bloc/BlFocusabilityNone.class.st index c30600e3c..7ed999d8a 100644 --- a/src/Bloc/BlFocusabilityNone.class.st +++ b/src/Bloc/BlFocusabilityNone.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlFocusabilityNone', - #superclass : 'BlFocusability', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlFocusabilityNone, + #superclass : #BlFocusability, + #category : 'Bloc-Basic-Properties' } -{ #category : 'focus' } +{ #category : #focus } BlFocusabilityNone >> focusables: anOrderedCollection along: aBlFocusSearchDirection of: anElement [ "Add focusable elements that are descendants of a given element (possibly including anElement) to anOrderedCollection" ] diff --git a/src/Bloc/BlForwardedElementStyles.class.st b/src/Bloc/BlForwardedElementStyles.class.st index eaea79e95..567ad541e 100644 --- a/src/Bloc/BlForwardedElementStyles.class.st +++ b/src/Bloc/BlForwardedElementStyles.class.st @@ -4,17 +4,15 @@ Extends `BlElementStyles` by adding an ability to customise `BlForwardedElementS " Class { - #name : 'BlForwardedElementStyles', - #superclass : 'BlElementStyles', + #name : #BlForwardedElementStyles, + #superclass : #BlElementStyles, #instVars : [ 'targetObject' ], - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #category : 'Bloc-Basic-Style' } -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlForwardedElementStyles >> newStyleForState: aBlElementState [ ^ BlElementForwardedStyle new @@ -22,7 +20,7 @@ BlForwardedElementStyles >> newStyleForState: aBlElementState [ targetObject: targetObject ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlForwardedElementStyles >> styleForState: aState ifFound: aFoundBlock ifNone: aNoneBlock [ ^ styles @@ -34,13 +32,13 @@ BlForwardedElementStyles >> styleForState: aState ifFound: aFoundBlock ifNone: a ifNone: aNoneBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlForwardedElementStyles >> targetObject [ ^ targetObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlForwardedElementStyles >> targetObject: anObject [ targetObject := anObject diff --git a/src/Bloc/BlForwardedStyles.class.st b/src/Bloc/BlForwardedStyles.class.st index b9a7c549a..dba97aa51 100644 --- a/src/Bloc/BlForwardedStyles.class.st +++ b/src/Bloc/BlForwardedStyles.class.st @@ -5,17 +5,15 @@ Extends `BlStyles` by adding an ability to customise `BlForwardedStyles>>#target " Class { - #name : 'BlForwardedStyles', - #superclass : 'BlStyles', + #name : #BlForwardedStyles, + #superclass : #BlStyles, #instVars : [ 'targetObject' ], - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #category : 'Bloc-Basic-Style' } -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlForwardedStyles >> newStyleForState: aBlElementState [ ^ BlElementForwardedStyle new @@ -23,7 +21,7 @@ BlForwardedStyles >> newStyleForState: aBlElementState [ targetObject: targetObject ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlForwardedStyles >> styleForState: aState ifFound: aFoundBlock ifNone: aNoneBlock [ ^ styles @@ -35,13 +33,13 @@ BlForwardedStyles >> styleForState: aState ifFound: aFoundBlock ifNone: aNoneBlo ifNone: aNoneBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlForwardedStyles >> targetObject [ ^ targetObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlForwardedStyles >> targetObject: anObject [ targetObject := anObject diff --git a/src/Bloc/BlGaussianShadowEffect.class.st b/src/Bloc/BlGaussianShadowEffect.class.st index 87637097a..b8ce75af2 100644 --- a/src/Bloc/BlGaussianShadowEffect.class.st +++ b/src/Bloc/BlGaussianShadowEffect.class.st @@ -4,23 +4,21 @@ The use of gaussian shadow is quite expensive in terms of rendering. Therefore I " Class { - #name : 'BlGaussianShadowEffect', - #superclass : 'BlShadowEffect', + #name : #BlGaussianShadowEffect, + #superclass : #BlShadowEffect, #instVars : [ 'width' ], - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlGaussianShadowEffect class >> color: aColor offset: anOffset width: aNumber [ ^ self color: aColor width: aNumber offset: anOffset ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlGaussianShadowEffect class >> color: aColor width: aNumber offset: anOffset [ ^ self basicNew @@ -28,7 +26,7 @@ BlGaussianShadowEffect class >> color: aColor width: aNumber offset: anOffset [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlGaussianShadowEffect class >> default [ self @@ -41,7 +39,7 @@ BlGaussianShadowEffect class >> default [ offset: 10@20 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlGaussianShadowEffect class >> new [ ^ self @@ -50,7 +48,7 @@ BlGaussianShadowEffect class >> new [ offset: 0@0 ] -{ #category : 'copying' } +{ #category : #copying } BlGaussianShadowEffect >> copyWithColor: aColor [ ^ self class @@ -59,7 +57,7 @@ BlGaussianShadowEffect >> copyWithColor: aColor [ offset: self offset ] -{ #category : 'copying' } +{ #category : #copying } BlGaussianShadowEffect >> copyWithOffset: aPoint [ ^ self class @@ -68,7 +66,7 @@ BlGaussianShadowEffect >> copyWithOffset: aPoint [ offset: aPoint ] -{ #category : 'copying' } +{ #category : #copying } BlGaussianShadowEffect >> copyWithWidth: aNumber [ ^ self class @@ -77,7 +75,7 @@ BlGaussianShadowEffect >> copyWithWidth: aNumber [ offset: self offset ] -{ #category : 'geometry' } +{ #category : #geometry } BlGaussianShadowEffect >> extraShadowSpace [ "Compute extra space that should be freed for shadow around element. I depend on the width, and it is recommended to be 3 times of sigma (width) used for gaussian blur" @@ -85,7 +83,7 @@ BlGaussianShadowEffect >> extraShadowSpace [ ^ self width * 1.5 ] -{ #category : 'initialization' } +{ #category : #initialization } BlGaussianShadowEffect >> initializeColor: aColor width: aWidth offset: aPoint [ self initialize. @@ -95,13 +93,13 @@ BlGaussianShadowEffect >> initializeColor: aColor width: aWidth offset: aPoint [ offset := aPoint asPoint ] -{ #category : 'testing' } +{ #category : #testing } BlGaussianShadowEffect >> wantsCompositionLayer [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlGaussianShadowEffect >> width [ ^ width diff --git a/src/Bloc/BlGlobalElevation.class.st b/src/Bloc/BlGlobalElevation.class.st index fc49bdd1f..5f2cb5399 100644 --- a/src/Bloc/BlGlobalElevation.class.st +++ b/src/Bloc/BlGlobalElevation.class.st @@ -3,14 +3,12 @@ I represent a global element elevation given in Space coordinate system. " Class { - #name : 'BlGlobalElevation', - #superclass : 'BlElevation', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlGlobalElevation, + #superclass : #BlElevation, + #category : 'Bloc-Basic-Properties' } -{ #category : 'accessing' } +{ #category : #accessing } BlGlobalElevation >> relatedTo: aNumber [ "Global elevation is constant" diff --git a/src/Bloc/BlGrabCursor.class.st b/src/Bloc/BlGrabCursor.class.st index 40a1e4ecf..0378c29b5 100644 --- a/src/Bloc/BlGrabCursor.class.st +++ b/src/Bloc/BlGrabCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlGrabCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlGrabCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlGrabbingCursor.class.st b/src/Bloc/BlGrabbingCursor.class.st index 1672605fa..a199d7423 100644 --- a/src/Bloc/BlGrabbingCursor.class.st +++ b/src/Bloc/BlGrabbingCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlGrabbingCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlGrabbingCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlGradientPaint.class.st b/src/Bloc/BlGradientPaint.class.st index 1f035f8bf..22ba3b7e4 100644 --- a/src/Bloc/BlGradientPaint.class.st +++ b/src/Bloc/BlGradientPaint.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlGradientPaint', - #superclass : 'BlPaint', + #name : #BlGradientPaint, + #superclass : #BlPaint, #instVars : [ 'stops' ], - #category : 'Bloc-Paint', - #package : 'Bloc', - #tag : 'Paint' + #category : 'Bloc-Paint' } -{ #category : 'initialization' } +{ #category : #initialization } BlGradientPaint >> from: aStartColor to: anEndColor [ "A convenience method to create a gradient consisting out of 2 colors" @@ -19,12 +17,12 @@ BlGradientPaint >> from: aStartColor to: anEndColor [ } ] -{ #category : 'accessing' } +{ #category : #accessing } BlGradientPaint >> stops [ ^ stops ] -{ #category : 'accessing' } +{ #category : #accessing } BlGradientPaint >> stops: anArray [ stops := anArray ] diff --git a/src/Bloc/BlHandCursor.class.st b/src/Bloc/BlHandCursor.class.st index b7fee3259..f9f2c1210 100644 --- a/src/Bloc/BlHandCursor.class.st +++ b/src/Bloc/BlHandCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlHandCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlHandCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlHandCursor >> asForm [ ^ Cursor webLink ] diff --git a/src/Bloc/BlHandledError.class.st b/src/Bloc/BlHandledError.class.st index 0aace24be..d905d566d 100644 --- a/src/Bloc/BlHandledError.class.st +++ b/src/Bloc/BlHandledError.class.st @@ -3,64 +3,62 @@ I represent an error that bloc gracefully handled during some specific frame pha " Class { - #name : 'BlHandledError', - #superclass : 'Object', + #name : #BlHandledError, + #superclass : #Object, #instVars : [ 'error', 'errorHandler', 'framePhase', 'element' ], - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #category : 'Bloc-Basic-Errors' } -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> debug [ self error debug ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> element: anElement [ element := anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> error [ ^ error ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> error: anError [ error := anError ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> errorHandler [ ^ errorHandler ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> errorHandler: anObject [ errorHandler := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> framePhase [ ^ framePhase ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandledError >> framePhase: aSpaceFramePhase [ framePhase := aSpaceFramePhase ] diff --git a/src/Bloc/BlHandlerAnnouncementSubscription.class.st b/src/Bloc/BlHandlerAnnouncementSubscription.class.st index dff5fa946..c24b45a90 100644 --- a/src/Bloc/BlHandlerAnnouncementSubscription.class.st +++ b/src/Bloc/BlHandlerAnnouncementSubscription.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlHandlerAnnouncementSubscription', - #superclass : 'Object', + #name : #BlHandlerAnnouncementSubscription, + #superclass : #Object, #instVars : [ 'subscriber' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'comparing' } +{ #category : #comparing } BlHandlerAnnouncementSubscription >> = anotherObject [ self == anotherObject ifTrue: [ ^ true ]. @@ -18,44 +16,44 @@ BlHandlerAnnouncementSubscription >> = anotherObject [ ^ anotherObject subscriber = self subscriber ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandlerAnnouncementSubscription >> announcementClass [ "Polymorphic to ${method:AnnouncementSubscription>>#announcementClass}$" ^ self class ] -{ #category : 'announcing' } +{ #category : #announcing } BlHandlerAnnouncementSubscription >> deliver: anAnnouncement [ (self handlesAnnouncement: anAnnouncement) ifTrue: [ self subscriber handleEvent: anAnnouncement ] ] -{ #category : 'testing' } +{ #category : #testing } BlHandlerAnnouncementSubscription >> handlesAnnouncement: anAnnouncement [ ^ self subscriber wantsEvent: anAnnouncement ] -{ #category : 'comparing' } +{ #category : #comparing } BlHandlerAnnouncementSubscription >> hash [ ^ self class hash bitXor: self subscriber hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandlerAnnouncementSubscription >> subscriber [ ^ subscriber ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandlerAnnouncementSubscription >> subscriber: aTBlEventHandler [ subscriber := aTBlEventHandler ] -{ #category : 'announcing' } +{ #category : #announcing } BlHandlerAnnouncementSubscription >> unregister [ "Nothing, for compatibility with AnnouncementSubscription" diff --git a/src/Bloc/BlHandlerAnnouncerRegistry.class.st b/src/Bloc/BlHandlerAnnouncerRegistry.class.st index 2f0236bac..be021b648 100644 --- a/src/Bloc/BlHandlerAnnouncerRegistry.class.st +++ b/src/Bloc/BlHandlerAnnouncerRegistry.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlHandlerAnnouncerRegistry', - #superclass : 'BlHandlerRegistry', + #name : #BlHandlerAnnouncerRegistry, + #superclass : #BlHandlerRegistry, #instVars : [ 'announcer' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'testing' } +{ #category : #testing } BlHandlerAnnouncerRegistry class >> isSupported [ ^ true ] -{ #category : 'printing' } +{ #category : #printing } BlHandlerAnnouncerRegistry class >> label [ ^ 'Announcer' ] -{ #category : 'testing' } +{ #category : #testing } BlHandlerAnnouncerRegistry class >> priority [ ^ 1 ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerAnnouncerRegistry >> add: aHandler [ "Adds a given event handler to the registry. @@ -35,21 +33,21 @@ BlHandlerAnnouncerRegistry >> add: aHandler [ self announcer subscriptions add: (BlHandlerAnnouncementSubscription new subscriber: aHandler) ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandlerAnnouncerRegistry >> announcer [ ^ announcer ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlHandlerAnnouncerRegistry >> dispatchEvent: anEvent [ "Dispatch a given event to all registered handlers that are interested in it" self announcer announce: anEvent ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlHandlerAnnouncerRegistry >> do: aBlock [ "Evaluate aBlock with each registered handler as the argument" @@ -57,7 +55,7 @@ BlHandlerAnnouncerRegistry >> do: aBlock [ self announcer subscriptions subscriptions do: [ :aSubscription | aBlock value: aSubscription subscriber ] ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlHandlerAnnouncerRegistry >> handlers [ "Return an immutable collection of all registered event handlers" @@ -65,14 +63,14 @@ BlHandlerAnnouncerRegistry >> handlers [ ^ self subscriptions collect: #subscriber ] -{ #category : 'initialization' } +{ #category : #initialization } BlHandlerAnnouncerRegistry >> initialize [ super initialize. announcer := Announcer new ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlHandlerAnnouncerRegistry >> numberOfHandlers [ "Return amount of registered event handlers" @@ -80,7 +78,7 @@ BlHandlerAnnouncerRegistry >> numberOfHandlers [ ^ self announcer numberOfSubscriptions ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerAnnouncerRegistry >> remove: aHandler [ "Remove given event handler from my registry. Provided handler must not be nil and must be registered" @@ -88,7 +86,7 @@ BlHandlerAnnouncerRegistry >> remove: aHandler [ self announcer subscriptions removeSubscriber: aHandler ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerAnnouncerRegistry >> removeAllSuchThat: aBlock [ "Remove all event handlers for which aBlock returns true. Return a collection of removed handlers" @@ -105,7 +103,7 @@ BlHandlerAnnouncerRegistry >> removeAllSuchThat: aBlock [ ^ toBeRemoved asArray ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandlerAnnouncerRegistry >> subscriptions [ diff --git a/src/Bloc/BlHandlerArrayRegistry.class.st b/src/Bloc/BlHandlerArrayRegistry.class.st index 289e1cc94..e5c492a73 100644 --- a/src/Bloc/BlHandlerArrayRegistry.class.st +++ b/src/Bloc/BlHandlerArrayRegistry.class.st @@ -1,33 +1,31 @@ Class { - #name : 'BlHandlerArrayRegistry', - #superclass : 'BlHandlerRegistry', + #name : #BlHandlerArrayRegistry, + #superclass : #BlHandlerRegistry, #instVars : [ 'handlers' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'testing' } +{ #category : #testing } BlHandlerArrayRegistry class >> isSupported [ ^ true ] -{ #category : 'printing' } +{ #category : #printing } BlHandlerArrayRegistry class >> label [ ^ 'Custom (Array)' ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandlerArrayRegistry class >> priority [ ^ 2 ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerArrayRegistry >> add: aHandler [ "Adds a given event handler to the registry. aHandler must not be nil and must not be already registered" @@ -43,7 +41,7 @@ BlHandlerArrayRegistry >> add: aHandler [ handlers := handlers copyWith: aHandler ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlHandlerArrayRegistry >> dispatchEvent: anEvent [ "Dispatch a given event to all registered handlers that are interested in it" | theHandlers | @@ -57,14 +55,14 @@ BlHandlerArrayRegistry >> dispatchEvent: anEvent [ each handleEvent: anEvent ] ] ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlHandlerArrayRegistry >> do: aBlock [ "Evaluate aBlock with each registered handler as the argument" handlers do: aBlock ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlHandlerArrayRegistry >> handlers [ "Return an immutable collection of all registered event handlers" @@ -72,14 +70,14 @@ BlHandlerArrayRegistry >> handlers [ ^ handlers ] -{ #category : 'initialization' } +{ #category : #initialization } BlHandlerArrayRegistry >> initialize [ super initialize. handlers := Array new ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlHandlerArrayRegistry >> numberOfHandlers [ "Return amount of registered event handlers" @@ -87,7 +85,7 @@ BlHandlerArrayRegistry >> numberOfHandlers [ ^ self handlers size ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerArrayRegistry >> remove: aHandler [ "Remove given event handler from my registry. Provided handler must not be nil and must be registered" @@ -103,7 +101,7 @@ BlHandlerArrayRegistry >> remove: aHandler [ handlers := handlers copyWithout: aHandler ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerArrayRegistry >> removeAllSuchThat: aBlock [ "Remove all event handlers for which aBlock returns true. Return a collection of removed handlers" diff --git a/src/Bloc/BlHandlerRegistry.class.st b/src/Bloc/BlHandlerRegistry.class.st index 39fc6b524..c49c98dfd 100644 --- a/src/Bloc/BlHandlerRegistry.class.st +++ b/src/Bloc/BlHandlerRegistry.class.st @@ -18,45 +18,43 @@ registry dispatchEvent: BlMouseUpEvent new. " Class { - #name : 'BlHandlerRegistry', - #superclass : 'Object', + #name : #BlHandlerRegistry, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #classVars : [ 'PreferableHandlerRegistryClass' ], - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'testing' } +{ #category : #testing } BlHandlerRegistry class >> isSupported [ ^ false ] -{ #category : 'printing' } +{ #category : #printing } BlHandlerRegistry class >> label [ "Return a human-readable name to identify myself." ^ self subclassResponsibility ] -{ #category : 'settings' } +{ #category : #settings } BlHandlerRegistry class >> preferableHandlerRegistryClass [ ^ PreferableHandlerRegistryClass ifNil: [ PreferableHandlerRegistryClass := self supportedRegistryClasses first ] ] -{ #category : 'settings' } +{ #category : #settings } BlHandlerRegistry class >> preferableHandlerRegistryClass: aBlHandlerRegistryClass [ PreferableHandlerRegistryClass := aBlHandlerRegistryClass ] -{ #category : 'accessing' } +{ #category : #accessing } BlHandlerRegistry class >> priority [ "Return priority as positive number: The lower the value, the more likely to be selected." @@ -64,7 +62,7 @@ BlHandlerRegistry class >> priority [ ^ self subclassResponsibility ] -{ #category : 'settings' } +{ #category : #settings } BlHandlerRegistry class >> settingsOn: aBuilder [ @@ -78,7 +76,7 @@ BlHandlerRegistry class >> settingsOn: aBuilder [ description: 'Choose the class to be used for event handler registry' ] -{ #category : 'settings' } +{ #category : #settings } BlHandlerRegistry class >> supportedRegistryClasses [ "Answer all supported `BlHandlerRegistry` classes, sorted by their priority (lowest first)." @@ -87,7 +85,7 @@ BlHandlerRegistry class >> supportedRegistryClasses [ sort: [ :a :b | a priority < b priority ] ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerRegistry >> add: aHandler [ "Adds a given event handler to the registry. aHandler must not be nil and must not be already registered" @@ -95,7 +93,7 @@ BlHandlerRegistry >> add: aHandler [ self subclassResponsibility ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlHandlerRegistry >> anySatisfy: aBlock [ "Evaluate aBlock with every registered event handler. If aBlock returns true for any element return true. @@ -106,21 +104,21 @@ BlHandlerRegistry >> anySatisfy: aBlock [ ^ false ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlHandlerRegistry >> dispatchEvent: anEvent [ "Dispatch a given event to all registered handlers that are interested in it" self subclassResponsibility ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlHandlerRegistry >> do: aBlock [ "Evaluate aBlock with each registered handler as the argument" self subclassResponsibility ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlHandlerRegistry >> handlers [ "Return an immutable collection of all registered event handlers" @@ -128,7 +126,7 @@ BlHandlerRegistry >> handlers [ ^ self subclassResponsibility ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlHandlerRegistry >> hasHandler: anEventHandler [ "Return true if a given event handler is registered, false otherwise" @@ -136,7 +134,7 @@ BlHandlerRegistry >> hasHandler: anEventHandler [ ^ self anySatisfy: [ :each | each = anEventHandler ] ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlHandlerRegistry >> isEmpty [ "Return true if registry is empty (there are no handlers), false otherwise" @@ -144,7 +142,7 @@ BlHandlerRegistry >> isEmpty [ ^ self numberOfHandlers isZero ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlHandlerRegistry >> numberOfHandlers [ "Return amount of registered event handlers" @@ -152,7 +150,7 @@ BlHandlerRegistry >> numberOfHandlers [ ^ self subclassResponsibility ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerRegistry >> remove: aHandler [ "Remove given event handler from my registry. Provided handler must not be nil and must be registered" @@ -160,7 +158,7 @@ BlHandlerRegistry >> remove: aHandler [ self subclassResponsibility ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlHandlerRegistry >> removeAllSuchThat: aBlock [ "Remove all event handlers for which aBlock returns true. Return a collection of removed handlers" diff --git a/src/Bloc/BlHeadlessBufferSurfaceRenderer.class.st b/src/Bloc/BlHeadlessBufferSurfaceRenderer.class.st index 9cb0d9cac..be55bcd9b 100644 --- a/src/Bloc/BlHeadlessBufferSurfaceRenderer.class.st +++ b/src/Bloc/BlHeadlessBufferSurfaceRenderer.class.st @@ -9,7 +9,7 @@ Class { #tag : 'Universe - Host Headless' } -{ #category : 'initialization' } +{ #category : #initialization } BlHeadlessBufferSurfaceRenderer >> initializeForSurface: aSurface [ | aForm anExtent | @@ -25,6 +25,6 @@ BlHeadlessBufferSurfaceRenderer >> initializeForSurface: aSurface [ extent: anExtent ] -{ #category : 'initialization' } +{ #category : #initialization } BlHeadlessBufferSurfaceRenderer >> renderSurface: aSurface damaged: aCollectionOfRectangles [ ] diff --git a/src/Bloc/BlHeadlessHost.class.st b/src/Bloc/BlHeadlessHost.class.st index 1f19caa4b..8aa5acab2 100644 --- a/src/Bloc/BlHeadlessHost.class.st +++ b/src/Bloc/BlHeadlessHost.class.st @@ -3,64 +3,62 @@ I am a fallback host that is chosen if there are no other available and supporte " Class { - #name : 'BlHeadlessHost', - #superclass : 'BlHost', + #name : #BlHeadlessHost, + #superclass : #BlHost, #instVars : [ 'isRunning' ], #classVars : [ 'PulseLoop' ], - #category : 'Bloc-Universe - Host Headless', - #package : 'Bloc', - #tag : 'Universe - Host Headless' + #category : 'Bloc-Universe - Host Headless' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlHeadlessHost class >> initialize [ PulseLoop := BlHostPulseLoop forHost: self ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHeadlessHost class >> isRunning [ ^ PulseLoop isRunning ] -{ #category : 'printing' } +{ #category : #printing } BlHeadlessHost class >> label [ ^ 'Headless' ] -{ #category : 'driver selection' } +{ #category : #'driver selection' } BlHeadlessHost class >> priority [ "Infinite priority means that I am selected only if there are no other available hosts" ^ Float infinity ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHeadlessHost class >> start [ PulseLoop start ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHeadlessHost class >> stop [ PulseLoop stop ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHeadlessHost class >> uiProcessDo: aBlock [ "Evaluate aBlock with the running UI Process of this host if any" PulseLoop loopProcess ifNotNil: aBlock ] -{ #category : 'host - api' } +{ #category : #'host - api' } BlHeadlessHost >> createHostSpaceFor: aSpace [ | aHostSpace | @@ -74,7 +72,7 @@ BlHeadlessHost >> createHostSpaceFor: aSpace [ aSpace hostSpace: aHostSpace ] -{ #category : 'host - api' } +{ #category : #'host - api' } BlHeadlessHost >> destroyHostSpaceFor: aSpace [ aSpace hostSpace @@ -86,7 +84,7 @@ BlHeadlessHost >> destroyHostSpaceFor: aSpace [ aSpace detachHostSpace ] -{ #category : 'host - testing' } +{ #category : #'host - testing' } BlHeadlessHost >> supportsBufferSurface [ ^ true diff --git a/src/Bloc/BlHeadlessHostSpace.class.st b/src/Bloc/BlHeadlessHostSpace.class.st index bf8c4f3fd..8f7597082 100644 --- a/src/Bloc/BlHeadlessHostSpace.class.st +++ b/src/Bloc/BlHeadlessHostSpace.class.st @@ -3,8 +3,8 @@ I am a fallback host space that is chosen if there are no other available and su " Class { - #name : 'BlHeadlessHostSpace', - #superclass : 'Object', + #name : #BlHeadlessHostSpace, + #superclass : #Object, #traits : 'TBlHostSpace + TBlDebug + TBlSpaceProperties', #classTraits : 'TBlHostSpace classTrait + TBlDebug classTrait + TBlSpaceProperties classTrait', #instVars : [ @@ -12,12 +12,10 @@ Class { 'position', 'title' ], - #category : 'Bloc-Universe - Host Headless', - #package : 'Bloc', - #tag : 'Universe - Host Headless' + #category : 'Bloc-Universe - Host Headless' } -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> borderless [ "Return true if underlying window is now borderless, false otherwise" @@ -25,29 +23,29 @@ BlHeadlessHostSpace >> borderless [ ^ false ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> borderless: aBoolean [ "Make host window borderless if true is given" ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> close [ "do nothing" ] -{ #category : 'initialization' } +{ #category : #initialization } BlHeadlessHostSpace >> createBufferSurfaceRenderer [ ^ BlHeadlessBufferSurfaceRenderer new ] -{ #category : 'host space - cursor' } +{ #category : #'host space - cursor' } BlHeadlessHostSpace >> cursor: aCursor [ "Change current cursor image/view to the given one" ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } BlHeadlessHostSpace >> densityDpi [ "Return the screen density expressed as dots-per-inch" @@ -55,7 +53,7 @@ BlHeadlessHostSpace >> densityDpi [ ^ 96.0 ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> fullscreen [ "Return true if an underlying window is in fullscreen mode, false otherwise" @@ -64,13 +62,13 @@ BlHeadlessHostSpace >> fullscreen [ ^ false ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> fullscreen: aBoolean [ "Switch underlying window to fullscreen if true is given and exit fullscreen mode if false is given" ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> fullsize [ "Return true if an underlying window is in fullsize mode, false otherwise" @@ -79,31 +77,31 @@ BlHeadlessHostSpace >> fullsize [ ^ false ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> fullsize: aBoolean [ "Switch underlying window to fullsize if true is given and exit fullsize mode if false is given. See ${method:TBlSpaceProperties>>#fullsize}" ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> hide [ "do nothing" ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> icon: aForm [ "Change window's icon to the given one" ] -{ #category : 'initialization' } +{ #category : #initialization } BlHeadlessHostSpace >> initialize [ super initialize. eventFetcher := BlHostEventFetcher hostSpace: self. ] -{ #category : 'host space - testing' } +{ #category : #'host space - testing' } BlHeadlessHostSpace >> isVisible [ "Return true if underlying window is shown, false otherwise. Note: If window was shown and then minimized it is still considered to be visible. @@ -113,7 +111,7 @@ BlHeadlessHostSpace >> isVisible [ ^ false ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } BlHeadlessHostSpace >> logicalSize [ "Returns the logical size of the host's client area. The client area is the content of the window, excluding the title bar and borders. @@ -122,29 +120,29 @@ BlHeadlessHostSpace >> logicalSize [ ^ BlLogicalDisplaySize width: 0 height: 0 ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> maximize [ "do nothing" ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> maximized [ ^ false ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> minimize [ "do nothing" ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> minimized [ ^ false ] -{ #category : 'host space - testing' } +{ #category : #'host space - testing' } BlHeadlessHostSpace >> needsRebuild [ "Return true if window should be recreated after user saved and quit pharo" @@ -152,12 +150,12 @@ BlHeadlessHostSpace >> needsRebuild [ ^ false ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> open [ "do nothing" ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } BlHeadlessHostSpace >> physicalSize [ "Return a physical host size which is what the framebuffer size should be. This size may differ from the logical size on high dpi (retina) screens. @@ -166,7 +164,7 @@ BlHeadlessHostSpace >> physicalSize [ ^ BlPhysicalDisplaySize width: 0 height: 0 ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> position [ "Return window's position in screen coordinates" @@ -174,7 +172,7 @@ BlHeadlessHostSpace >> position [ ^ position ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> position: aPoint [ "Change window's position to a given point in screen coordinates" @@ -182,12 +180,12 @@ BlHeadlessHostSpace >> position: aPoint [ ] -{ #category : 'host space - drawing' } +{ #category : #'host space - drawing' } BlHeadlessHostSpace >> render: aSpace [ "Render a given abstract space on an underlying window or visual area" ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> resizable [ "Return true if underlying window is resizable, false otherwise" @@ -195,16 +193,16 @@ BlHeadlessHostSpace >> resizable [ ^ true ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> resizable: aBoolean [ "Make underlying window resizable if true is given" ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> show [ ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> title [ "Return window's title as a string" @@ -212,31 +210,31 @@ BlHeadlessHostSpace >> title [ ^ title ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlHeadlessHostSpace >> title: aString [ "Change window's title" title := aString ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> toBack [ "do nothing" ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } BlHeadlessHostSpace >> toFront [ "do nothing" ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlHeadlessHostSpace >> universe [ ^ universe ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } BlHeadlessHostSpace >> windowExtent: anExtent [ ] diff --git a/src/Bloc/BlHeightEqualizer.class.st b/src/Bloc/BlHeightEqualizer.class.st index d0b40f0be..b92613327 100644 --- a/src/Bloc/BlHeightEqualizer.class.st +++ b/src/Bloc/BlHeightEqualizer.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlHeightEqualizer', - #superclass : 'BlEqualizer', + #name : #BlHeightEqualizer, + #superclass : #BlEqualizer, #instVars : [ 'heightBlock' ], - #category : 'Bloc-Utilities - Equalizer', - #package : 'Bloc', - #tag : 'Utilities - Equalizer' + #category : 'Bloc-Utilities - Equalizer' } -{ #category : 'element handlers' } +{ #category : #'element handlers' } BlHeightEqualizer >> elementExtentChangedEvent: anEvent [ | maxHeight | @@ -17,12 +15,12 @@ BlHeightEqualizer >> elementExtentChangedEvent: anEvent [ self targetElements do: [ :anElement | heightBlock value: anElement value: maxHeight ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlHeightEqualizer >> height: aBlock [ heightBlock := aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlHeightEqualizer >> initialize [ super initialize. diff --git a/src/Bloc/BlHelpCursor.class.st b/src/Bloc/BlHelpCursor.class.st index f93dc0cb5..695b3e898 100644 --- a/src/Bloc/BlHelpCursor.class.st +++ b/src/Bloc/BlHelpCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlHelpCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlHelpCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlHistogram.class.st b/src/Bloc/BlHistogram.class.st index 05fb2245d..54041eb7e 100644 --- a/src/Bloc/BlHistogram.class.st +++ b/src/Bloc/BlHistogram.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlHistogram', - #superclass : 'BlHistogramGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlHistogram, + #superclass : #BlHistogramGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlHistogram class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlHistogramGeometry.class.st b/src/Bloc/BlHistogramGeometry.class.st index f5e37178f..82a30c873 100644 --- a/src/Bloc/BlHistogramGeometry.class.st +++ b/src/Bloc/BlHistogramGeometry.class.st @@ -8,8 +8,8 @@ See {{gtClass:BlHistogramExamples}} for more examples " Class { - #name : 'BlHistogramGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlHistogramGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'values', 'orientation' @@ -20,12 +20,10 @@ Class { 'RightToLeft', 'TopToBottom' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlHistogramGeometry class >> initialize [ LeftToRight := #leftToRight. RightToLeft := #rightToLeft. @@ -33,31 +31,31 @@ BlHistogramGeometry class >> initialize [ TopToBottom := #topToBottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlHistogramGeometry >> beBottomToTop [ orientation := BottomToTop. self releaseCache ] -{ #category : 'accessing' } +{ #category : #accessing } BlHistogramGeometry >> beLeftToRight [ orientation := LeftToRight. self releaseCache ] -{ #category : 'accessing' } +{ #category : #accessing } BlHistogramGeometry >> beRightToLeft [ orientation := RightToLeft. self releaseCache ] -{ #category : 'accessing' } +{ #category : #accessing } BlHistogramGeometry >> beTopToBottom [ orientation := TopToBottom. self releaseCache ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlHistogramGeometry >> computeDelta [ (self isLeftToRight or: [ self isRightToLeft ]) ifTrue: [ ^ 0 @ (self extent y / self values size) asFloat ]. @@ -67,7 +65,7 @@ BlHistogramGeometry >> computeDelta [ ^ 0@0 ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlHistogramGeometry >> computeLengthVector [ self isLeftToRight ifTrue: [ ^ 1@0 ]. @@ -81,7 +79,7 @@ BlHistogramGeometry >> computeLengthVector [ ^ 0@0 ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlHistogramGeometry >> computeOrigin [ self isLeftToRight ifTrue: [ ^ 0@0 ]. @@ -95,7 +93,7 @@ BlHistogramGeometry >> computeOrigin [ ^ 0@0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlHistogramGeometry >> initialize [ super initialize. @@ -103,39 +101,39 @@ BlHistogramGeometry >> initialize [ orientation := BottomToTop ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlHistogramGeometry >> isBottomToTop [ ^ orientation = BottomToTop ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlHistogramGeometry >> isLeftToRight [ ^ orientation = LeftToRight ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlHistogramGeometry >> isRightToLeft [ ^ orientation = RightToLeft ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlHistogramGeometry >> isTopToBottom [ ^ orientation = TopToBottom ] -{ #category : 'geometry' } +{ #category : #geometry } BlHistogramGeometry >> matchExtent: aPoint [ "Resize geometry to exactly match provided extent as a Point" extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlHistogramGeometry >> values [ ^ values ] -{ #category : 'accessing' } +{ #category : #accessing } BlHistogramGeometry >> values: aCollectionOfFloats [ values := aCollectionOfFloats. self releaseCache diff --git a/src/Bloc/BlHorizontalAlignment.class.st b/src/Bloc/BlHorizontalAlignment.class.st index e33802ba1..62c719b62 100644 --- a/src/Bloc/BlHorizontalAlignment.class.st +++ b/src/Bloc/BlHorizontalAlignment.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlHorizontalAlignment', - #superclass : 'BlElementAlignment', + #name : #BlHorizontalAlignment, + #superclass : #BlElementAlignment, #classInstVars : [ 'center', 'left', 'right' ], - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment class >> center [ ^ center ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment class >> directed: aBlLayoutDirection [ ^ aBlLayoutDirection of: self ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlHorizontalAlignment class >> initialize [ super initialize. @@ -32,67 +30,67 @@ BlHorizontalAlignment class >> initialize [ end := BlHorizontalEndAlignment new. ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment class >> left [ ^ left ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment class >> leftToRight [ ^ self subclassResponsibility ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment class >> null [ ^ BlElementAlignment null horizontal ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment class >> right [ ^ right ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment class >> rightToLeft [ ^ self subclassResponsibility ] -{ #category : 'composition' } +{ #category : #composition } BlHorizontalAlignment >> + aVerticalAlignment [ ^ BlCompositeAlignment horizontal: self vertical: aVerticalAlignment ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment >> center [ ^ self class center ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment >> directed: aBlLayoutDirection [ ^ self class directed: aBlLayoutDirection ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment >> end [ ^ self class end ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment >> leftToRight [ ^ self class leftToRight ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment >> null [ ^ self class null ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment >> rightToLeft [ ^ self class rightToLeft ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalAlignment >> start [ ^ self class start ] diff --git a/src/Bloc/BlHorizontalCenterAlignment.class.st b/src/Bloc/BlHorizontalCenterAlignment.class.st index 1fc6bf5eb..e62eedf8c 100644 --- a/src/Bloc/BlHorizontalCenterAlignment.class.st +++ b/src/Bloc/BlHorizontalCenterAlignment.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlHorizontalCenterAlignment', - #superclass : 'BlHorizontalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlHorizontalCenterAlignment, + #superclass : #BlHorizontalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlHorizontalCenterAlignment class >> initialize [ super initialize. ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCenterAlignment class >> leftToRight [ ^ self center ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCenterAlignment class >> rightToLeft [ ^ self center ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCenterAlignment >> inverted [ ^ BlElementAlignment vertical center ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCenterAlignment >> swap [ ^ self ] -{ #category : 'translation' } +{ #category : #translation } BlHorizontalCenterAlignment >> translationOf: aBounds in: aContainerBounds [ diff --git a/src/Bloc/BlHorizontalCoordinateAlignment.class.st b/src/Bloc/BlHorizontalCoordinateAlignment.class.st index 3c20b22db..90ac5a492 100644 --- a/src/Bloc/BlHorizontalCoordinateAlignment.class.st +++ b/src/Bloc/BlHorizontalCoordinateAlignment.class.st @@ -1,31 +1,29 @@ Class { - #name : 'BlHorizontalCoordinateAlignment', - #superclass : 'BlHorizontalAlignment', + #name : #BlHorizontalCoordinateAlignment, + #superclass : #BlHorizontalAlignment, #instVars : [ 'coordinate', 'relativeAlignment' ], - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'accessing' } +{ #category : #accessing } BlHorizontalCoordinateAlignment >> coordinate [ ^ coordinate ] -{ #category : 'accessing' } +{ #category : #accessing } BlHorizontalCoordinateAlignment >> coordinate: anObject [ coordinate := anObject ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCoordinateAlignment >> directed: aBlLayoutDirection [ ^ aBlLayoutDirection of: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlHorizontalCoordinateAlignment >> initialize [ super initialize. @@ -33,12 +31,12 @@ BlHorizontalCoordinateAlignment >> initialize [ relativeAlignment := BlElementAlignment horizontal center ] -{ #category : 'accessing' } +{ #category : #accessing } BlHorizontalCoordinateAlignment >> relativeAlignment [ ^ relativeAlignment ] -{ #category : 'accessing' } +{ #category : #accessing } BlHorizontalCoordinateAlignment >> relativeAlignment: anObject [ relativeAlignment := anObject ] diff --git a/src/Bloc/BlHorizontalCoordinateEndAlignment.class.st b/src/Bloc/BlHorizontalCoordinateEndAlignment.class.st index 936a14ff5..41b18f929 100644 --- a/src/Bloc/BlHorizontalCoordinateEndAlignment.class.st +++ b/src/Bloc/BlHorizontalCoordinateEndAlignment.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlHorizontalCoordinateEndAlignment', - #superclass : 'BlHorizontalCoordinateAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlHorizontalCoordinateEndAlignment, + #superclass : #BlHorizontalCoordinateAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCoordinateEndAlignment >> leftToRight [ ^ BlHorizontalCoordinateRightAlignment new coordinate: coordinate; diff --git a/src/Bloc/BlHorizontalCoordinateLeftAlignment.class.st b/src/Bloc/BlHorizontalCoordinateLeftAlignment.class.st index 57336d3a4..014253d02 100644 --- a/src/Bloc/BlHorizontalCoordinateLeftAlignment.class.st +++ b/src/Bloc/BlHorizontalCoordinateLeftAlignment.class.st @@ -3,14 +3,12 @@ The coordinate is measured from the left side of the outer bounds " Class { - #name : 'BlHorizontalCoordinateLeftAlignment', - #superclass : 'BlHorizontalCoordinateAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlHorizontalCoordinateLeftAlignment, + #superclass : #BlHorizontalCoordinateAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'translation' } +{ #category : #translation } BlHorizontalCoordinateLeftAlignment >> translationOf: aBounds in: aContainerBounds [ | aRelativeDelta anExpectedLeft | diff --git a/src/Bloc/BlHorizontalCoordinateRightAlignment.class.st b/src/Bloc/BlHorizontalCoordinateRightAlignment.class.st index ce252b77b..bb9fbdc81 100644 --- a/src/Bloc/BlHorizontalCoordinateRightAlignment.class.st +++ b/src/Bloc/BlHorizontalCoordinateRightAlignment.class.st @@ -3,14 +3,12 @@ The coordinate is measured from the right side of the outer bounds " Class { - #name : 'BlHorizontalCoordinateRightAlignment', - #superclass : 'BlHorizontalCoordinateAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlHorizontalCoordinateRightAlignment, + #superclass : #BlHorizontalCoordinateAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'translation' } +{ #category : #translation } BlHorizontalCoordinateRightAlignment >> translationOf: aBounds in: aContainerBounds [ | aRelativeDelta anExpectedRight | diff --git a/src/Bloc/BlHorizontalCoordinateStartAlignment.class.st b/src/Bloc/BlHorizontalCoordinateStartAlignment.class.st index ba0e0cd3b..de3277a9a 100644 --- a/src/Bloc/BlHorizontalCoordinateStartAlignment.class.st +++ b/src/Bloc/BlHorizontalCoordinateStartAlignment.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlHorizontalCoordinateStartAlignment', - #superclass : 'BlHorizontalCoordinateAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlHorizontalCoordinateStartAlignment, + #superclass : #BlHorizontalCoordinateAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCoordinateStartAlignment >> leftToRight [ ^ BlHorizontalCoordinateLeftAlignment new coordinate: coordinate; relativeAlignment: relativeAlignment leftToRight ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalCoordinateStartAlignment >> rightToLeft [ ^ BlHorizontalCoordinateRightAlignment new coordinate: coordinate; diff --git a/src/Bloc/BlHorizontalEndAlignment.class.st b/src/Bloc/BlHorizontalEndAlignment.class.st index 26a2c3313..4dd4290e3 100644 --- a/src/Bloc/BlHorizontalEndAlignment.class.st +++ b/src/Bloc/BlHorizontalEndAlignment.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlHorizontalEndAlignment', - #superclass : 'BlHorizontalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlHorizontalEndAlignment, + #superclass : #BlHorizontalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlHorizontalEndAlignment class >> initialize [ super initialize. ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalEndAlignment class >> leftToRight [ ^ self right ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalEndAlignment class >> rightToLeft [ ^ self left ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalEndAlignment >> inverted [ ^ BlElementAlignment vertical end ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalEndAlignment >> swap [ ^ BlElementAlignment horizontal start ] diff --git a/src/Bloc/BlHorizontalStartAlignment.class.st b/src/Bloc/BlHorizontalStartAlignment.class.st index 1a6363918..58898fcd2 100644 --- a/src/Bloc/BlHorizontalStartAlignment.class.st +++ b/src/Bloc/BlHorizontalStartAlignment.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlHorizontalStartAlignment', - #superclass : 'BlHorizontalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlHorizontalStartAlignment, + #superclass : #BlHorizontalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlHorizontalStartAlignment class >> initialize [ super initialize. ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalStartAlignment class >> leftToRight [ ^ self left ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalStartAlignment class >> rightToLeft [ ^ self right ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalStartAlignment >> inverted [ ^ BlElementAlignment vertical start ] -{ #category : 'factory' } +{ #category : #factory } BlHorizontalStartAlignment >> swap [ ^ BlElementAlignment horizontal end ] diff --git a/src/Bloc/BlHost.class.st b/src/Bloc/BlHost.class.st index 6a7a36c18..92396dfb2 100644 --- a/src/Bloc/BlHost.class.st +++ b/src/Bloc/BlHost.class.st @@ -5,58 +5,56 @@ A Host can be compared to a driver that communicates with the native multimedia " Class { - #name : 'BlHost', - #superclass : 'Object', + #name : #BlHost, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #classVars : [ 'PreferableHostClass' ], - #category : 'Bloc-Universe - Host', - #package : 'Bloc', - #tag : 'Universe - Host' + #category : 'Bloc-Universe - Host' } -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHost class >> isRunning [ ^ self subclassResponsibility ] -{ #category : 'driver selection' } +{ #category : #'driver selection' } BlHost class >> isSupported [ ^ false ] -{ #category : 'driver selection' } +{ #category : #'driver selection' } BlHost class >> label [ "Return a human readable title to identify myself." ^ self subclassResponsibility ] -{ #category : 'driver selection' } +{ #category : #'driver selection' } BlHost class >> pickHost [ "Answer a new instance of the preferable host." ^ self preferableHostClass new ] -{ #category : 'settings' } +{ #category : #settings } BlHost class >> preferableHostClass [ ^ PreferableHostClass ifNil: [ PreferableHostClass := self prioritaryHostClass ] ] -{ #category : 'settings' } +{ #category : #settings } BlHost class >> preferableHostClass: aHostClass [ PreferableHostClass := aHostClass ] -{ #category : 'driver selection' } +{ #category : #'driver selection' } BlHost class >> prioritaryHostClass [ "Answer either the supported host with the lowest priority, or `BlHeadlessHost` if there isn't any supported host." @@ -66,7 +64,7 @@ BlHost class >> prioritaryHostClass [ ifNotEmpty: [ :theHostClasses | theHostClasses first ] ] -{ #category : 'driver selection' } +{ #category : #'driver selection' } BlHost class >> priority [ "Return host priority as positive number which influences host order and selection of a default host. @@ -75,7 +73,7 @@ BlHost class >> priority [ ^ self subclassResponsibility ] -{ #category : 'settings' } +{ #category : #settings } BlHost class >> settingsOn: aBuilder [ @@ -90,19 +88,19 @@ BlHost class >> settingsOn: aBuilder [ ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHost class >> start [ self subclassResponsibility ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHost class >> stop [ self subclassResponsibility ] -{ #category : 'driver selection' } +{ #category : #'driver selection' } BlHost class >> supportedHostClasses [ "Return all supported Bloc host classes, sorted by priority (lowest first)." @@ -111,24 +109,24 @@ BlHost class >> supportedHostClasses [ sort: [ :a :b | a priority < b priority ] ] -{ #category : 'api - ui process' } +{ #category : #'api - ui process' } BlHost class >> uiProcessDo: aBlock [ "Evaluate aBlock with the running UI Process of this host if any" ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlHost class >> universe [ ^ BlParallelUniverse forHost: self ] -{ #category : 'host - api' } +{ #category : #'host - api' } BlHost >> createHostSpaceFor: aSpace [ self subclassResponsibility ] -{ #category : 'host - api' } +{ #category : #'host - api' } BlHost >> destroyHostSpaceFor: aSpace [ "Destroys host space window of a given space. Note: in most cases under 'destroy host space' we mean 'close host window' and unregister it" @@ -136,14 +134,14 @@ BlHost >> destroyHostSpaceFor: aSpace [ self subclassResponsibility ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHost >> isRunning [ "Return true if host is initialized and running" ^ self class isRunning ] -{ #category : 'host - testing' } +{ #category : #'host - testing' } BlHost >> isStillAvailable [ "Let's assume that a space is opened with me as a host. I return true if I am still available host for the current system. @@ -154,46 +152,46 @@ BlHost >> isStillAvailable [ ^ true ] -{ #category : 'paragraph - measuring' } +{ #category : #'paragraph - measuring' } BlHost >> offscreenMeasureTextParagraph: aBlTextParagraph [ "Update the received paragraph with its measurement." BlHostRenderer preferableClass offscreenMeasureTextParagraph: aBlTextParagraph ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHost >> start [ self class start ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlHost >> stop [ self class stop ] -{ #category : 'host - testing' } +{ #category : #'host - testing' } BlHost >> supportsBufferSurface [ "Return true if this host can work with buffer surface, false otherwise" ^ false ] -{ #category : 'host - testing' } +{ #category : #'host - testing' } BlHost >> supportsFormSurface [ "Return true if this host can work with form surface, false otherwise" ^ false ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlHost >> uiProcessDo: aBlock [ self class uiProcessDo: aBlock ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlHost >> universe [ ^ self class universe diff --git a/src/Bloc/BlHostEventFetcher.class.st b/src/Bloc/BlHostEventFetcher.class.st index 831001917..2d3add87f 100644 --- a/src/Bloc/BlHostEventFetcher.class.st +++ b/src/Bloc/BlHostEventFetcher.class.st @@ -3,30 +3,28 @@ I am the abstract class for event queue management " Class { - #name : 'BlHostEventFetcher', - #superclass : 'Object', + #name : #BlHostEventFetcher, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'eventQueue', 'hostSpace' ], - #category : 'Bloc-Universe - Host', - #package : 'Bloc', - #tag : 'Universe - Host' + #category : 'Bloc-Universe - Host' } -{ #category : 'accessing' } +{ #category : #accessing } BlHostEventFetcher class >> hostSpace: aBlHostSpace [ ^ self basicNew initialize hostSpace: aBlHostSpace ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostEventFetcher class >> new [ self error: 'Do not create an instance of ', self name, ' using new. Please use #hostSpace: instead' ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlHostEventFetcher >> enqueueEvent: aBlEvent [ "Enqueue a given Bloc Event in the event queue. Do not use me directly, instead rely on #enqueueEvent: from HostSpace" @@ -35,7 +33,7 @@ BlHostEventFetcher >> enqueueEvent: aBlEvent [ self hostSpace space ifNotNil: [ :aSpace | aSpace requestNextPulse ] ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlHostEventFetcher >> fetchedEventsDo: aBlock [ "Flush event queue and evaluate a given block with every queued event as argument" | theEvents | @@ -45,17 +43,17 @@ BlHostEventFetcher >> fetchedEventsDo: aBlock [ theEvents do: aBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostEventFetcher >> hostSpace [ ^ hostSpace ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostEventFetcher >> hostSpace: anObject [ hostSpace := anObject ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlHostEventFetcher >> initialize [ super initialize. diff --git a/src/Bloc/BlHostPulseLoop.class.st b/src/Bloc/BlHostPulseLoop.class.st index f48a2b814..514df1fb8 100644 --- a/src/Bloc/BlHostPulseLoop.class.st +++ b/src/Bloc/BlHostPulseLoop.class.st @@ -9,8 +9,8 @@ The opened spaces listen the pulse to be synchronized and to update their state " Class { - #name : 'BlHostPulseLoop', - #superclass : 'Object', + #name : #BlHostPulseLoop, + #superclass : #Object, #instVars : [ 'hostClass', 'loopProcess', @@ -19,12 +19,10 @@ Class { 'pulseStartMS', 'pulseDurationMS' ], - #category : 'Bloc-Universe - Host', - #package : 'Bloc', - #tag : 'Universe - Host' + #category : 'Bloc-Universe - Host' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlHostPulseLoop class >> forHost: aHostClass [ ^ self basicNew @@ -33,25 +31,25 @@ BlHostPulseLoop class >> forHost: aHostClass [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlHostPulseLoop class >> new [ self error: 'Use #forHost: instead' ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostPulseLoop class >> processId [ ^ 'Bloc Main Loop' ] -{ #category : 'period' } +{ #category : #period } BlHostPulseLoop >> defaultPulsePeriod [ ^ 15 milliSeconds ] -{ #category : 'debug' } +{ #category : #debug } BlHostPulseLoop >> forceStartNewUIProcess [ "I should only be used by the logic for opening the debugger. @@ -65,7 +63,7 @@ BlHostPulseLoop >> forceStartNewUIProcess [ loopProcess resume. ] -{ #category : 'debug' } +{ #category : #debug } BlHostPulseLoop >> forceStartOfUIProcess: aProces [ "I should only be used by the logic for closing the debugger." @@ -73,19 +71,19 @@ BlHostPulseLoop >> forceStartOfUIProcess: aProces [ loopProcess resume. ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostPulseLoop >> hostClass [ ^ hostClass ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostPulseLoop >> hostClass: aHostClass [ hostClass := aHostClass ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostPulseLoop >> initialize [ super initialize. @@ -93,25 +91,25 @@ BlHostPulseLoop >> initialize [ self pulsePeriod: self defaultPulsePeriod ] -{ #category : 'testing' } +{ #category : #testing } BlHostPulseLoop >> isRunning [ ^ loopProcess isNotNil and: [ loopProcess isTerminated not ] ] -{ #category : 'testing' } +{ #category : #testing } BlHostPulseLoop >> isRunningInTheSameProcess [ ^ Processor activeProcess effectiveProcess == loopProcess ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostPulseLoop >> loopProcess [ ^ loopProcess ] -{ #category : 'loop process' } +{ #category : #'loop process' } BlHostPulseLoop >> newLoopBlock [ ^ [ [ @@ -126,7 +124,7 @@ BlHostPulseLoop >> newLoopBlock [ ] doWhileTrue: [ loopProcess == Processor activeProcess ] ] ] -{ #category : 'loop process' } +{ #category : #'loop process' } BlHostPulseLoop >> newLoopProcess [ ^ self newLoopBlock newProcess @@ -135,32 +133,32 @@ BlHostPulseLoop >> newLoopProcess [ yourself ] -{ #category : 'loop process' } +{ #category : #'loop process' } BlHostPulseLoop >> processId [ ^ self class processId ] -{ #category : 'loop process' } +{ #category : #'loop process' } BlHostPulseLoop >> processPriority [ ^ 40 ] -{ #category : 'period' } +{ #category : #period } BlHostPulseLoop >> pulsePeriod [ ^ pulsePeriodMS milliSeconds ] -{ #category : 'period' } +{ #category : #period } BlHostPulseLoop >> pulsePeriod: aDuration [ pulsePeriodMS := aDuration asMilliSeconds. msToWaitForBackgroundProcess := (pulsePeriodMS // 2) min: 1. ] -{ #category : 'lifecycle' } +{ #category : #lifecycle } BlHostPulseLoop >> start [ self isRunning ifTrue: [ ^ self ]. @@ -169,7 +167,7 @@ BlHostPulseLoop >> start [ loopProcess resume ] -{ #category : 'lifecycle' } +{ #category : #lifecycle } BlHostPulseLoop >> stop [ | currentProcess | @@ -181,7 +179,7 @@ BlHostPulseLoop >> stop [ currentProcess terminate ] -{ #category : 'period' } +{ #category : #period } BlHostPulseLoop >> waitUntilNextPulse [ "Wait the appropriate amount of time for the next pulse" diff --git a/src/Bloc/BlHostRenderer.class.st b/src/Bloc/BlHostRenderer.class.st index 84d8e42d6..1c173808b 100644 --- a/src/Bloc/BlHostRenderer.class.st +++ b/src/Bloc/BlHostRenderer.class.st @@ -3,8 +3,8 @@ Host renderer is resposible for the overall rendering logic " Class { - #name : 'BlHostRenderer', - #superclass : 'Object', + #name : #BlHostRenderer, + #superclass : #Object, #instVars : [ 'session', 'surface', @@ -15,39 +15,37 @@ Class { #classInstVars : [ 'preferableClass' ], - #category : 'Bloc-Universe - Renderer', - #package : 'Bloc', - #tag : 'Universe - Renderer' + #category : 'Bloc-Universe - Renderer' } -{ #category : 'settings' } +{ #category : #settings } BlHostRenderer class >> availableClasses [ ^ self allSubclasses ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRenderer class >> label [ "Answer a human readable title to identify the class." ^ self subclassResponsibility ] -{ #category : 'host - api' } +{ #category : #'host - api' } BlHostRenderer class >> newFormFrom: aBlElement [ "Answer a `Form` with the received element rendered on it." ^ self subclassResponsibility ] -{ #category : 'host - api' } +{ #category : #'host - api' } BlHostRenderer class >> offscreenMeasureTextParagraph: aBlTextParagraph [ "Update the received paragraph with its measurement." ^ self subclassResponsibility ] -{ #category : 'settings' } +{ #category : #settings } BlHostRenderer class >> preferableClass [ ^ preferableClass ifNil: [ @@ -55,13 +53,13 @@ BlHostRenderer class >> preferableClass [ preferableClass := ac anyOne ] ] ] -{ #category : 'settings' } +{ #category : #settings } BlHostRenderer class >> preferableClass: aBlHostRenderer [ preferableClass := aBlHostRenderer ] -{ #category : 'settings' } +{ #category : #settings } BlHostRenderer class >> settingsOn: aBuilder [ @@ -77,14 +75,14 @@ BlHostRenderer class >> settingsOn: aBuilder [ ] -{ #category : 'host - api' } +{ #category : #'host - api' } BlHostRenderer class >> write: aBlElement asPngTo: aFileReference [ "Draw the element into a PNG at the specified location." self subclassResponsibility ] -{ #category : 'rendering' } +{ #category : #rendering } BlHostRenderer >> finishedRender: aSpace [ "Perform neccessary actions after rendering is complete. By default I clear dirty areas of a given space" @@ -92,7 +90,7 @@ BlHostRenderer >> finishedRender: aSpace [ aSpace clearDirtyElements ] -{ #category : 'testing' } +{ #category : #testing } BlHostRenderer >> hasResized: aHostSpace [ "Return true if host space resized since previous frame, otherwise false" @@ -104,7 +102,7 @@ BlHostRenderer >> hasResized: aHostSpace [ or: [ aHostSpace scaleFactor ~= surface scaleFactor ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRenderer >> initializeForHostSpace: aBlHostSpace [ "Initialize this renderer for a given host space. Please note, that it I be called multiple times" @@ -112,7 +110,7 @@ BlHostRenderer >> initializeForHostSpace: aBlHostSpace [ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlHostRenderer >> isValid [ session == Smalltalk session @@ -127,13 +125,13 @@ BlHostRenderer >> isValid [ ^ true ] -{ #category : 'rendering' } +{ #category : #rendering } BlHostRenderer >> measureTextParagraph: aBlTextParagraph [ textMeasurer measureTextParagraph: aBlTextParagraph ] -{ #category : 'rendering' } +{ #category : #rendering } BlHostRenderer >> render: aHostSpace [ "Render a given space according to its dirty areas. Note: if there are no dirty areas nothing will happen, including window diff --git a/src/Bloc/BlHostRendererBufferSurface.class.st b/src/Bloc/BlHostRendererBufferSurface.class.st index fba9a5fc4..81f32f926 100644 --- a/src/Bloc/BlHostRendererBufferSurface.class.st +++ b/src/Bloc/BlHostRendererBufferSurface.class.st @@ -4,81 +4,79 @@ I represent a pixel buffer surface to be used by host renderer and host space. When used, rendering happens in a pixel buffer and than can be displayed in a native window " Class { - #name : 'BlHostRendererBufferSurface', - #superclass : 'BlHostRendererSurface', + #name : #BlHostRendererBufferSurface, + #superclass : #BlHostRendererSurface, #instVars : [ 'stride', 'buffer', 'extent', 'strongReference' ], - #category : 'Bloc-Universe - Renderer', - #package : 'Bloc', - #tag : 'Universe - Renderer' + #category : 'Bloc-Universe - Renderer' } -{ #category : 'testing' } +{ #category : #testing } BlHostRendererBufferSurface class >> isSupportedBy: anObject [ "Return whether a given object supports buffer surface." ^ anObject supportsBufferSurface ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererBufferSurface class >> priority [ ^ 20 ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererBufferSurface >> buffer [ ^ buffer ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererBufferSurface >> buffer: aPixelBuffer [ buffer := aPixelBuffer ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererBufferSurface >> createSpaceRendererOn: anObject [ ^ anObject createBufferSpaceRenderer ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererBufferSurface >> createSurfaceRendererOn: anObject [ ^ anObject createBufferSurfaceRenderer ] -{ #category : 'geometry' } +{ #category : #geometry } BlHostRendererBufferSurface >> extent [ ^ extent ] -{ #category : 'geometry' } +{ #category : #geometry } BlHostRendererBufferSurface >> extent: aPoint [ extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererBufferSurface >> stride [ ^ stride ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererBufferSurface >> stride: aNumber [ stride := aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererBufferSurface >> strongReference: anObject [ strongReference := anObject diff --git a/src/Bloc/BlHostRendererFormSurface.class.st b/src/Bloc/BlHostRendererFormSurface.class.st index 830bab1a1..61a8157aa 100644 --- a/src/Bloc/BlHostRendererFormSurface.class.st +++ b/src/Bloc/BlHostRendererFormSurface.class.st @@ -5,66 +5,64 @@ When used, rendering happens in a Form and than can be displayed in a morphic wi " Class { - #name : 'BlHostRendererFormSurface', - #superclass : 'BlHostRendererSurface', + #name : #BlHostRendererFormSurface, + #superclass : #BlHostRendererSurface, #instVars : [ 'externalForm' ], - #category : 'Bloc-Universe - Renderer', - #package : 'Bloc', - #tag : 'Universe - Renderer' + #category : 'Bloc-Universe - Renderer' } -{ #category : 'testing' } +{ #category : #testing } BlHostRendererFormSurface class >> isSupportedBy: anObject [ "Return whether a given object supports Form surface." ^ anObject supportsFormSurface ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererFormSurface class >> priority [ ^ 30 ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererFormSurface >> createSpaceRendererOn: anObject [ ^ anObject createFormSpaceRenderer ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererFormSurface >> createSurfaceRendererOn: anObject [ ^ anObject createFormSurfaceRenderer ] -{ #category : 'geometry' } +{ #category : #geometry } BlHostRendererFormSurface >> extent [ ^ externalForm extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererFormSurface >> form [ ^ externalForm ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererFormSurface >> form: aForm [ externalForm := aForm ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererFormSurface >> pointer [ ^ externalForm pointer ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererFormSurface >> stride [ ^ externalForm stride diff --git a/src/Bloc/BlHostRendererSurface.class.st b/src/Bloc/BlHostRendererSurface.class.st index e7cdc5dd2..3623f3c44 100644 --- a/src/Bloc/BlHostRendererSurface.class.st +++ b/src/Bloc/BlHostRendererSurface.class.st @@ -3,27 +3,25 @@ I am a mediator between host space and host renderer " Class { - #name : 'BlHostRendererSurface', - #superclass : 'Object', + #name : #BlHostRendererSurface, + #superclass : #Object, #instVars : [ 'physicalSize', 'scaleFactor', 'shouldUpdateEveryFrame', 'updateActions' ], - #category : 'Bloc-Universe - Renderer', - #package : 'Bloc', - #tag : 'Universe - Renderer' + #category : 'Bloc-Universe - Renderer' } -{ #category : 'testing' } +{ #category : #testing } BlHostRendererSurface class >> isSupportedBy: anObject [ "Return whether a given object supports this surface." ^ self subclassResponsibility ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlHostRendererSurface class >> newForHostSpace: aBlHostSpace [ ^ self new @@ -31,33 +29,33 @@ BlHostRendererSurface class >> newForHostSpace: aBlHostSpace [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlHostRendererSurface class >> priority [ ^ self subclassResponsibility ] -{ #category : 'api - updates' } +{ #category : #'api - updates' } BlHostRendererSurface >> addUpdateAction: aValuable [ updateActions add: aValuable ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererSurface >> createSpaceRendererOn: anObject [ "Return a new `BlHostSpaceRenderer` in dialog with the received argument." ^ self subclassResponsibility ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererSurface >> createSurfaceRendererOn: aBlHostSpace [ "Return a new `BlHostSurfaceRenderer` in dialog with the received argument." ^ self subclassResponsibility ] -{ #category : 'geometry' } +{ #category : #geometry } BlHostRendererSurface >> extent [ "Return a `Point` that represents the logical extent of the underlying surface. Note: This extent can difer from canvas or window extents." @@ -65,7 +63,7 @@ BlHostRendererSurface >> extent [ ^ self subclassResponsibility ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererSurface >> initialize [ super initialize. @@ -74,14 +72,14 @@ BlHostRendererSurface >> initialize [ updateActions := OrderedCollection new ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererSurface >> initializeForHostSpace: aBlHostSpace [ physicalSize := aBlHostSpace physicalSize. scaleFactor := aBlHostSpace scaleFactor ] -{ #category : 'geometry' } +{ #category : #geometry } BlHostRendererSurface >> logicalSize [ "Returns the logical size of the host's client area. The client area is the content of the window, excluding the title bar and borders. @@ -90,7 +88,7 @@ BlHostRendererSurface >> logicalSize [ ^ self physicalSize asLogical: self scaleFactor ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererSurface >> newSpaceRendererOn: aBlHostSpace [ ^ (self createSpaceRendererOn: aBlHostSpace) @@ -98,7 +96,7 @@ BlHostRendererSurface >> newSpaceRendererOn: aBlHostSpace [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlHostRendererSurface >> newSurfaceRendererOn: aBlHostSpace [ ^ (self createSurfaceRendererOn: aBlHostSpace) @@ -106,13 +104,13 @@ BlHostRendererSurface >> newSurfaceRendererOn: aBlHostSpace [ yourself ] -{ #category : 'api - updates' } +{ #category : #'api - updates' } BlHostRendererSurface >> performUpdates [ updateActions do: [ :eachUpdateAction | eachUpdateAction value ] ] -{ #category : 'geometry' } +{ #category : #geometry } BlHostRendererSurface >> physicalSize [ "Return a physical host size which is what the framebuffer size should be. This size may differ from the logical size on high DPI screens. @@ -121,7 +119,7 @@ BlHostRendererSurface >> physicalSize [ ^ physicalSize ] -{ #category : 'geometry' } +{ #category : #geometry } BlHostRendererSurface >> scaleFactor [ "Return a scaling dpi factor from logical to physical coordinates. On high DPI displays (e.g. Retina), scaling factor is > 1" @@ -129,13 +127,13 @@ BlHostRendererSurface >> scaleFactor [ ^ scaleFactor ] -{ #category : 'api - updates' } +{ #category : #'api - updates' } BlHostRendererSurface >> shouldUpdateEveryFrame [ ^ shouldUpdateEveryFrame ] -{ #category : 'api - updates' } +{ #category : #'api - updates' } BlHostRendererSurface >> updateEveryFrame [ shouldUpdateEveryFrame := true ] diff --git a/src/Bloc/BlHostSpaceRenderer.class.st b/src/Bloc/BlHostSpaceRenderer.class.st index c85db56cb..c5c38e3cd 100644 --- a/src/Bloc/BlHostSpaceRenderer.class.st +++ b/src/Bloc/BlHostSpaceRenderer.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlHostSpaceRenderer', - #superclass : 'Object', - #category : 'Bloc-Universe - Renderer', - #package : 'Bloc', - #tag : 'Universe - Renderer' + #name : #BlHostSpaceRenderer, + #superclass : #Object, + #category : 'Bloc-Universe - Renderer' } -{ #category : 'initialization' } +{ #category : #initialization } BlHostSpaceRenderer >> initializeForSurface: aSurface [ "Initalize space renderer to be used with a given surface" self subclassResponsibility ] -{ #category : 'rendering' } +{ #category : #rendering } BlHostSpaceRenderer >> renderSpace: aSpace [ "Render a space and return a collection of damaged rectangles." diff --git a/src/Bloc/BlHostSurfaceRenderer.class.st b/src/Bloc/BlHostSurfaceRenderer.class.st index 89090aecb..6752e2e47 100644 --- a/src/Bloc/BlHostSurfaceRenderer.class.st +++ b/src/Bloc/BlHostSurfaceRenderer.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlHostSurfaceRenderer', - #superclass : 'Object', - #category : 'Bloc-Universe - Renderer', - #package : 'Bloc', - #tag : 'Universe - Renderer' + #name : #BlHostSurfaceRenderer, + #superclass : #Object, + #category : 'Bloc-Universe - Renderer' } -{ #category : 'initialization' } +{ #category : #initialization } BlHostSurfaceRenderer >> initializeForSurface: aSurface [ self subclassResponsibility ] -{ #category : 'rendering' } +{ #category : #rendering } BlHostSurfaceRenderer >> renderSurface: aSurface damaged: aCollectionOfRectangles [ "Render a given surface on a host space" diff --git a/src/Bloc/BlHostTextMeasurer.class.st b/src/Bloc/BlHostTextMeasurer.class.st index 074a41658..3077e153f 100644 --- a/src/Bloc/BlHostTextMeasurer.class.st +++ b/src/Bloc/BlHostTextMeasurer.class.st @@ -8,32 +8,30 @@ Used mainly " Class { - #name : 'BlHostTextMeasurer', - #superclass : 'Object', - #category : 'Bloc-Universe - Renderer', - #package : 'Bloc', - #tag : 'Universe - Renderer' + #name : #BlHostTextMeasurer, + #superclass : #Object, + #category : 'Bloc-Universe - Renderer' } -{ #category : 'measurement' } +{ #category : #measurement } BlHostTextMeasurer >> measureTextParagraph: aBlTextParagraph [ self subclassResponsibility ] -{ #category : 'measurement' } +{ #category : #measurement } BlHostTextMeasurer >> measureTextSpan: aBlTextSpan [ self subclassResponsibility ] -{ #category : 'paragraph span instance creation' } +{ #category : #'paragraph span instance creation' } BlHostTextMeasurer >> newParagraphSpan [ ^ self subclassResponsibility ] -{ #category : 'measurement' } +{ #category : #measurement } BlHostTextMeasurer >> newParagraphSpanFor: aBlSpan [ ^ self newParagraphSpan diff --git a/src/Bloc/BlIdleErrorHandler.class.st b/src/Bloc/BlIdleErrorHandler.class.st index fe359c312..1d6501e06 100644 --- a/src/Bloc/BlIdleErrorHandler.class.st +++ b/src/Bloc/BlIdleErrorHandler.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlIdleErrorHandler', - #superclass : 'BlSingleErrorHandler', - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #name : #BlIdleErrorHandler, + #superclass : #BlSingleErrorHandler, + #category : 'Bloc-Basic-Errors' } -{ #category : 'testing' } +{ #category : #testing } BlIdleErrorHandler >> matches: aFramePhase [ ^ aFramePhase isIdlePhase ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlIdleErrorHandler >> processError: aHandledError [ ] diff --git a/src/Bloc/BlIgnoredLayout.class.st b/src/Bloc/BlIgnoredLayout.class.st index b30ead65e..91e1ed48b 100644 --- a/src/Bloc/BlIgnoredLayout.class.st +++ b/src/Bloc/BlIgnoredLayout.class.st @@ -3,14 +3,12 @@ Ignore me :) " Class { - #name : 'BlIgnoredLayout', - #superclass : 'BlLayout', - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #name : #BlIgnoredLayout, + #superclass : #BlLayout, + #category : 'Bloc-Layouts-Basic' } -{ #category : 'constraints' } +{ #category : #constraints } BlIgnoredLayout class >> constraints [ ^ BlIgnoredLayoutConstraints new ] diff --git a/src/Bloc/BlIgnoredLayoutConstraints.class.st b/src/Bloc/BlIgnoredLayoutConstraints.class.st index 5b5166209..537d25f88 100644 --- a/src/Bloc/BlIgnoredLayoutConstraints.class.st +++ b/src/Bloc/BlIgnoredLayoutConstraints.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlIgnoredLayoutConstraints', - #superclass : 'BlLayoutConstraints', - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #name : #BlIgnoredLayoutConstraints, + #superclass : #BlLayoutConstraints, + #category : 'Bloc-Layouts-Basic' } -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraints >> alignment [ ^ self horizontal alignment + self vertical alignment ] -{ #category : 'initialization' } +{ #category : #initialization } BlIgnoredLayoutConstraints >> defaultHorizontal [ ^ BlIgnoredLayoutConstraintsHorizontal new ] -{ #category : 'initialization' } +{ #category : #initialization } BlIgnoredLayoutConstraints >> defaultVertical [ ^ BlIgnoredLayoutConstraintsVertical new ] diff --git a/src/Bloc/BlIgnoredLayoutConstraintsHorizontal.class.st b/src/Bloc/BlIgnoredLayoutConstraintsHorizontal.class.st index 984714fa9..9dcf8924a 100644 --- a/src/Bloc/BlIgnoredLayoutConstraintsHorizontal.class.st +++ b/src/Bloc/BlIgnoredLayoutConstraintsHorizontal.class.st @@ -1,21 +1,19 @@ Class { - #name : 'BlIgnoredLayoutConstraintsHorizontal', - #superclass : 'BlLayoutConstraintsAxis', + #name : #BlIgnoredLayoutConstraintsHorizontal, + #superclass : #BlLayoutConstraintsAxis, #instVars : [ 'alignment', 'weight' ], - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsHorizontal >> alignCenter [ alignment := BlElementAlignment horizontal center ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsHorizontal >> alignCenterAt: aUnitCoordinateNumber [ "Align the center of the element vertically with a unit-coordinate inside of the parent" @@ -24,22 +22,22 @@ BlIgnoredLayoutConstraintsHorizontal >> alignCenterAt: aUnitCoordinateNumber [ relativeAlignment: BlElementAlignment horizontal center ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsHorizontal >> alignLeft [ alignment := BlElementAlignment horizontal start ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsHorizontal >> alignNone [ alignment := BlElementAlignment horizontal null ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsHorizontal >> alignRight [ alignment := BlElementAlignment horizontal end ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsHorizontal >> alignRightAt: aUnitCoordinateNumber [ "Align the right of the element horizontally with a unit-coordinate inside of the parent" @@ -48,12 +46,12 @@ BlIgnoredLayoutConstraintsHorizontal >> alignRightAt: aUnitCoordinateNumber [ relativeAlignment: BlElementAlignment horizontal end ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsHorizontal >> alignment [ ^ alignment ] -{ #category : 'initialization' } +{ #category : #initialization } BlIgnoredLayoutConstraintsHorizontal >> initialize [ super initialize. @@ -61,14 +59,14 @@ BlIgnoredLayoutConstraintsHorizontal >> initialize [ weight := 1.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsHorizontal >> weight [ ^ weight ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsHorizontal >> weight: aNumber [ self assert: [ aNumber isNotNil ] diff --git a/src/Bloc/BlIgnoredLayoutConstraintsVertical.class.st b/src/Bloc/BlIgnoredLayoutConstraintsVertical.class.st index 98a8b7d39..c87ccf8ad 100644 --- a/src/Bloc/BlIgnoredLayoutConstraintsVertical.class.st +++ b/src/Bloc/BlIgnoredLayoutConstraintsVertical.class.st @@ -1,21 +1,19 @@ Class { - #name : 'BlIgnoredLayoutConstraintsVertical', - #superclass : 'BlLayoutConstraintsAxis', + #name : #BlIgnoredLayoutConstraintsVertical, + #superclass : #BlLayoutConstraintsAxis, #instVars : [ 'alignment', 'weight' ], - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsVertical >> alignBottom [ alignment := BlElementAlignment vertical end ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsVertical >> alignBottomAt: aUnitCoordinateNumber [ "Align the bottom of the element vertically with a unit-coordinate inside of the parent" @@ -24,12 +22,12 @@ BlIgnoredLayoutConstraintsVertical >> alignBottomAt: aUnitCoordinateNumber [ relativeAlignment: BlElementAlignment vertical end ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsVertical >> alignCenter [ alignment := BlElementAlignment vertical center ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsVertical >> alignCenterAt: aUnitCoordinateNumber [ "Align the center of the element vertically with a unit-coordinate inside of the parent" @@ -38,17 +36,17 @@ BlIgnoredLayoutConstraintsVertical >> alignCenterAt: aUnitCoordinateNumber [ relativeAlignment: BlElementAlignment vertical center ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsVertical >> alignNone [ alignment := BlElementAlignment vertical null ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsVertical >> alignTop [ alignment := BlElementAlignment vertical start ] -{ #category : 'alignment' } +{ #category : #alignment } BlIgnoredLayoutConstraintsVertical >> alignTopAt: aUnitCoordinateNumber [ "Align the top of the element vertically with a unit-coordinate inside of the parent" @@ -57,12 +55,12 @@ BlIgnoredLayoutConstraintsVertical >> alignTopAt: aUnitCoordinateNumber [ relativeAlignment: BlElementAlignment vertical start ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsVertical >> alignment [ ^ alignment ] -{ #category : 'initialization' } +{ #category : #initialization } BlIgnoredLayoutConstraintsVertical >> initialize [ super initialize. @@ -70,14 +68,14 @@ BlIgnoredLayoutConstraintsVertical >> initialize [ weight := 1.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsVertical >> weight [ ^ weight ] -{ #category : 'accessing' } +{ #category : #accessing } BlIgnoredLayoutConstraintsVertical >> weight: aNumber [ self assert: [ aNumber isNotNil ] diff --git a/src/Bloc/BlImageBackground.class.st b/src/Bloc/BlImageBackground.class.st index eb0b41bee..116f1150d 100644 --- a/src/Bloc/BlImageBackground.class.st +++ b/src/Bloc/BlImageBackground.class.st @@ -8,29 +8,27 @@ Examples are provided by the class {{gtClass:BlImageBackgroundExamples}}. " Class { - #name : 'BlImageBackground', - #superclass : 'BlBackground', + #name : #BlImageBackground, + #superclass : #BlBackground, #instVars : [ 'image' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlImageBackground class >> image: aForm [ ^ self new image: aForm ] -{ #category : 'accessing' } +{ #category : #accessing } BlImageBackground >> image [ ^ image ] -{ #category : 'accessing' } +{ #category : #accessing } BlImageBackground >> image: aForm [ image isNotNil @@ -39,7 +37,7 @@ BlImageBackground >> image: aForm [ image := aForm ] -{ #category : 'testing' } +{ #category : #testing } BlImageBackground >> isTransparent [ "Unfortunately there is no fast way to detect if a Form is completely transparent, the only check we can afford to do is to see whether the extent of the form is positive" @@ -47,7 +45,7 @@ BlImageBackground >> isTransparent [ ^ (self opacity closeTo: 0) or: [ self image extent min = 0 ] ] -{ #category : 'geometry' } +{ #category : #geometry } BlImageBackground >> matchExtent: anExtent [ "Not sure what we should do with image background. Will implement later" diff --git a/src/Bloc/BlImageBackgroundBuilder.class.st b/src/Bloc/BlImageBackgroundBuilder.class.st index 089f46590..74ef52d64 100644 --- a/src/Bloc/BlImageBackgroundBuilder.class.st +++ b/src/Bloc/BlImageBackgroundBuilder.class.st @@ -1,34 +1,32 @@ Class { - #name : 'BlImageBackgroundBuilder', - #superclass : 'BlBackgroundBuilder', + #name : #BlImageBackgroundBuilder, + #superclass : #BlBackgroundBuilder, #instVars : [ 'form' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'building' } +{ #category : #building } BlImageBackgroundBuilder >> build [ ^ (BlImageBackground image: self form) opacity: self opacity ] -{ #category : 'accessing' } +{ #category : #accessing } BlImageBackgroundBuilder >> form [ ^ form ] -{ #category : 'accessing' } +{ #category : #accessing } BlImageBackgroundBuilder >> form: aForm [ form := aForm ] -{ #category : 'accessing' } +{ #category : #accessing } BlImageBackgroundBuilder >> iconNamed: aSymbol [ self form: (Smalltalk ui icons iconNamed: aSymbol) ] diff --git a/src/Bloc/BlImagePatternPaint.class.st b/src/Bloc/BlImagePatternPaint.class.st index 61b61ff3d..941c6a0d3 100644 --- a/src/Bloc/BlImagePatternPaint.class.st +++ b/src/Bloc/BlImagePatternPaint.class.st @@ -1,30 +1,28 @@ Class { - #name : 'BlImagePatternPaint', - #superclass : 'BlPaint', + #name : #BlImagePatternPaint, + #superclass : #BlPaint, #instVars : [ 'form' ], - #category : 'Bloc-Paint', - #package : 'Bloc', - #tag : 'Paint' + #category : 'Bloc-Paint' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlImagePatternPaint class >> form: aForm [ ^ self new form: aForm ] -{ #category : 'accessing' } +{ #category : #accessing } BlImagePatternPaint >> form [ ^ form ] -{ #category : 'accessing' } +{ #category : #accessing } BlImagePatternPaint >> form: aForm [ form := aForm ] -{ #category : 'geometry' } +{ #category : #geometry } BlImagePatternPaint >> matchExtent: anExtent [ "don't know what to do for the image pattern paint" ] diff --git a/src/Bloc/BlImmutableObjectChangeError.class.st b/src/Bloc/BlImmutableObjectChangeError.class.st index 687f2a3be..5a8f74a28 100644 --- a/src/Bloc/BlImmutableObjectChangeError.class.st +++ b/src/Bloc/BlImmutableObjectChangeError.class.st @@ -1,30 +1,28 @@ Class { - #name : 'BlImmutableObjectChangeError', - #superclass : 'Error', + #name : #BlImmutableObjectChangeError, + #superclass : #Error, #instVars : [ 'object' ], - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #category : 'Bloc-Basic-Errors' } -{ #category : 'accessing' } +{ #category : #accessing } BlImmutableObjectChangeError class >> object: anObject [ ^ self new object: anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlImmutableObjectChangeError >> description [ ^ self object printString, ' is immutable and can not be changed' ] -{ #category : 'accessing' } +{ #category : #accessing } BlImmutableObjectChangeError >> object [ ^ object ] -{ #category : 'accessing' } +{ #category : #accessing } BlImmutableObjectChangeError >> object: anObject [ object := anObject ] diff --git a/src/Bloc/BlInsets.class.st b/src/Bloc/BlInsets.class.st index 76d5515a4..9e301d1d4 100644 --- a/src/Bloc/BlInsets.class.st +++ b/src/Bloc/BlInsets.class.st @@ -7,8 +7,8 @@ I provide several creation methods but usually four points are necessary to full " Class { - #name : 'BlInsets', - #superclass : 'Object', + #name : #BlInsets, + #superclass : #Object, #instVars : [ 'top', 'left', @@ -18,12 +18,10 @@ Class { #classVars : [ 'Empty' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> all: aNumber [ ^ self @@ -33,7 +31,7 @@ BlInsets class >> all: aNumber [ left: aNumber ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> bottom: b [ ^ self @@ -43,7 +41,7 @@ BlInsets class >> bottom: b [ left: 0 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> empty [ ^ Empty ifNil: [ @@ -54,7 +52,7 @@ BlInsets class >> empty [ left: 0 ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> horizontal: aNumber [ ^ self left: aNumber right: aNumber @@ -76,7 +74,7 @@ BlInsets class >> left: l [ left: l ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> left: l right: r [ ^ self @@ -86,7 +84,7 @@ BlInsets class >> left: l right: r [ left: l ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> right: r [ ^ self @@ -96,7 +94,7 @@ BlInsets class >> right: r [ left: 0 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> top: t [ ^ self @@ -106,7 +104,7 @@ BlInsets class >> top: t [ left: 0 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> top: t bottom: b [ ^ self @@ -116,7 +114,7 @@ BlInsets class >> top: t bottom: b [ left: 0 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> top: t left: l [ ^ self @@ -126,7 +124,7 @@ BlInsets class >> top: t left: l [ left: l ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> top: t left: l bottom: b right: r [ ^ self basicNew @@ -137,7 +135,7 @@ BlInsets class >> top: t left: l bottom: b right: r [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> top: t right: r [ ^ self @@ -147,7 +145,7 @@ BlInsets class >> top: t right: r [ left: 0 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> top: t right: r bottom: b left: l [ ^ self basicNew @@ -158,13 +156,13 @@ BlInsets class >> top: t right: r bottom: b left: l [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlInsets class >> vertical: aNumber [ ^ self top: aNumber bottom: aNumber ] -{ #category : 'converting' } +{ #category : #converting } BlInsets >> + anInsets [ ^ BlInsets @@ -174,7 +172,7 @@ BlInsets >> + anInsets [ left: left + anInsets left ] -{ #category : 'converting' } +{ #category : #converting } BlInsets >> - anInsets [ ^ BlInsets @@ -184,7 +182,7 @@ BlInsets >> - anInsets [ left: (left - anInsets left max: 0) ] -{ #category : 'testing' } +{ #category : #testing } BlInsets >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -196,31 +194,31 @@ BlInsets >> = anObject [ and: [ bottom = anObject bottom ] ] ] ] -{ #category : 'converting' } +{ #category : #converting } BlInsets >> asMargin [ ^ Margin top: top left: left bottom: bottom right: right ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> bottom [ ^ bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> bottomLeft [ ^ left @ bottom ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> bottomRight [ ^ right @ bottom ] -{ #category : 'converting' } +{ #category : #converting } BlInsets >> expand: aRectangle [ "Answer a rectangle whose size has been expanded by the receiver which represents each rectangle corner." "Optimisation: fast return if I don't modify bounds. gives 10x speed boost" @@ -231,19 +229,19 @@ BlInsets >> expand: aRectangle [ corner: (aRectangle right + self right) @ (aRectangle bottom + self bottom) ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> extent [ ^ self width @ self height ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> height [ ^ top + bottom ] -{ #category : 'initialization' } +{ #category : #initialization } BlInsets >> initializeTop: aTop right: aRight bottom: aBottom left: aLeft [ "Initialize all values. None of the values should be changed afterwards." @@ -254,7 +252,7 @@ BlInsets >> initializeTop: aTop right: aRight bottom: aBottom left: aLeft [ left := aLeft asFloat ] -{ #category : 'converting' } +{ #category : #converting } BlInsets >> inset: aRectangle [ "Answer a rectangle whose size has been reduced by the receiver." "Optimisation: fast return if I don't modify bounds. gives 10x speed boost" @@ -266,7 +264,7 @@ BlInsets >> inset: aRectangle [ corner: (aRectangle right - self right) @ (aRectangle bottom - self bottom) ] -{ #category : 'testing' } +{ #category : #testing } BlInsets >> isEmpty [ "Return true if insets is empty and does not influence bounds, false otherwise. Note: comparing the sum of width and height may lead to unexpected results when insets are negative" @@ -277,7 +275,7 @@ BlInsets >> isEmpty [ and: [ self left isZero ] ] ] ] -{ #category : 'testing' } +{ #category : #testing } BlInsets >> isUniform [ "Return true if all insets (right, left, top, bottom) are same" @@ -287,19 +285,19 @@ BlInsets >> isUniform [ and: [ self left closeTo: self top ] ] ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> left [ ^ left ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> max [ ^ self top max: (self right max: (self bottom max: self left)) ] -{ #category : 'converting' } +{ #category : #converting } BlInsets >> negated [ ^ self class @@ -309,7 +307,7 @@ BlInsets >> negated [ left: self left negated ] -{ #category : 'printing' } +{ #category : #printing } BlInsets >> printOn: aStream [ aStream @@ -338,37 +336,37 @@ BlInsets >> printOn: aStream [ print: left ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> right [ ^ right ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> top [ ^ top ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> topLeft [ ^ left @ top ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> topRight [ ^ right @ top ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> width [ ^ left + right ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> withBottom: aBottom [ ^ self class @@ -378,7 +376,7 @@ BlInsets >> withBottom: aBottom [ left: self left ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> withExtraBottom: aBottom [ ^ self class @@ -388,7 +386,7 @@ BlInsets >> withExtraBottom: aBottom [ left: self left ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> withLeft: aLeft [ ^ self class @@ -398,7 +396,7 @@ BlInsets >> withLeft: aLeft [ left: aLeft ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> withRight: aRight [ ^ self class @@ -408,7 +406,7 @@ BlInsets >> withRight: aRight [ left: self left ] -{ #category : 'accessing' } +{ #category : #accessing } BlInsets >> withTop: aTop [ ^ self class diff --git a/src/Bloc/BlInterpolator.class.st b/src/Bloc/BlInterpolator.class.st index 3c0c4a041..2bacee00b 100644 --- a/src/Bloc/BlInterpolator.class.st +++ b/src/Bloc/BlInterpolator.class.st @@ -11,32 +11,30 @@ Example " Class { - #name : 'BlInterpolator', - #superclass : 'Object', + #name : #BlInterpolator, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #classInstVars : [ 'default' ], - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlInterpolator class >> cleanUp [ super cleanUp. default := nil ] -{ #category : 'unique instance' } +{ #category : #'unique instance' } BlInterpolator class >> default [ "I return a unique instance of an interpolator with default configuration" ^ default ifNil: [ default := self new ] ] -{ #category : 'interpolation' } +{ #category : #interpolation } BlInterpolator >> interpolate: aNumber [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlKeyCombination.class.st b/src/Bloc/BlKeyCombination.class.st index bd4968eb7..97f7491e7 100644 Binary files a/src/Bloc/BlKeyCombination.class.st and b/src/Bloc/BlKeyCombination.class.st differ diff --git a/src/Bloc/BlKeyCombinationBuilder.class.st b/src/Bloc/BlKeyCombinationBuilder.class.st index 4e6b29df3..cdd7417e1 100644 --- a/src/Bloc/BlKeyCombinationBuilder.class.st +++ b/src/Bloc/BlKeyCombinationBuilder.class.st @@ -21,25 +21,23 @@ Example: " Class { - #name : 'BlKeyCombinationBuilder', - #superclass : 'Object', + #name : #BlKeyCombinationBuilder, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'combination', 'converter' ], - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> a [ combination with: (BlSingleKeyCombination new key: KeyboardKey A) ] -{ #category : 'keys - modifiers' } +{ #category : #'keys - modifiers' } BlKeyCombinationBuilder >> alt [ | alt | @@ -52,53 +50,53 @@ BlKeyCombinationBuilder >> alt [ with: alt ] -{ #category : 'keys - navigation' } +{ #category : #'keys - navigation' } BlKeyCombinationBuilder >> arrowDown [ combination with: (BlSingleKeyCombination new key: KeyboardKey down) ] -{ #category : 'keys - navigation' } +{ #category : #'keys - navigation' } BlKeyCombinationBuilder >> arrowLeft [ combination with: (BlSingleKeyCombination new key: KeyboardKey left) ] -{ #category : 'keys - navigation' } +{ #category : #'keys - navigation' } BlKeyCombinationBuilder >> arrowRight [ combination with: (BlSingleKeyCombination new key: KeyboardKey right) ] -{ #category : 'keys - navigation' } +{ #category : #'keys - navigation' } BlKeyCombinationBuilder >> arrowUp [ combination with: (BlSingleKeyCombination new key: KeyboardKey up) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> b [ combination with: (BlSingleKeyCombination new key: KeyboardKey B) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> backspace [ combination with: (BlSingleKeyCombination new key: KeyboardKey backspace) ] -{ #category : 'builder' } +{ #category : #builder } BlKeyCombinationBuilder >> build [ ^ self toNormalForm: combination ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> c [ combination with: (BlSingleKeyCombination new key: KeyboardKey C) ] -{ #category : 'builder' } +{ #category : #builder } BlKeyCombinationBuilder >> cnf [ converter := BlKeyCombinationConverterCNF new ] -{ #category : 'keys - modifiers' } +{ #category : #'keys - modifiers' } BlKeyCombinationBuilder >> control [ | control | @@ -111,67 +109,67 @@ BlKeyCombinationBuilder >> control [ with: control ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> d [ combination with: (BlSingleKeyCombination new key: KeyboardKey D) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> delete [ combination with: (BlSingleKeyCombination new key: KeyboardKey delete) ] -{ #category : 'builder' } +{ #category : #builder } BlKeyCombinationBuilder >> dnf [ converter := BlKeyCombinationConverterDNF new ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> e [ combination with: (BlSingleKeyCombination new key: KeyboardKey E) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> end [ combination with: (BlSingleKeyCombination new key: KeyboardKey end) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> equal [ combination with: (BlSingleKeyCombination new key: KeyboardKey equal) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> escape [ combination with: (BlSingleKeyCombination new key: KeyboardKey escape) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> f [ combination with: (BlSingleKeyCombination new key: KeyboardKey F) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> g [ combination with: (BlSingleKeyCombination new key: KeyboardKey G) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> home [ combination with: (BlSingleKeyCombination new key: KeyboardKey home) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> i [ combination with: (BlSingleKeyCombination new key: KeyboardKey I) ] -{ #category : 'initialization' } +{ #category : #initialization } BlKeyCombinationBuilder >> initialize [ super initialize. @@ -179,24 +177,24 @@ BlKeyCombinationBuilder >> initialize [ converter := BlKeyCombinationConverterCNF new ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyCombinationBuilder >> key: aKey [ combination with: (BlSingleKeyCombination new key: aKey) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> l [ combination with: (BlSingleKeyCombination new key: KeyboardKey L) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> m [ combination with: (BlSingleKeyCombination new key: KeyboardKey M) ] -{ #category : 'keys - modifiers' } +{ #category : #'keys - modifiers' } BlKeyCombinationBuilder >> meta [ | meta | @@ -211,23 +209,23 @@ BlKeyCombinationBuilder >> meta [ with: meta ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> minus [ combination with: (BlSingleKeyCombination new key: KeyboardKey minus) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> n [ combination with: (BlSingleKeyCombination new key: KeyboardKey N) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> p [ combination with: (BlSingleKeyCombination new key: KeyboardKey P) ] -{ #category : 'keys - modifiers' } +{ #category : #'keys - modifiers' } BlKeyCombinationBuilder >> primary [ "I add a primary modifier to the key combination On Mac: Command (Meta). @@ -237,23 +235,23 @@ BlKeyCombinationBuilder >> primary [ combination with: OSPlatform current primaryModifier ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> r [ combination with: (BlSingleKeyCombination new key: KeyboardKey R) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> return [ combination with: (BlSingleKeyCombination new key: KeyboardKey enter) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> s [ combination with: (BlSingleKeyCombination new key: KeyboardKey S) ] -{ #category : 'keys - modifiers' } +{ #category : #'keys - modifiers' } BlKeyCombinationBuilder >> secondary [ "I add a secondary modifier to the key combination On Mac: Control (Meta). @@ -263,7 +261,7 @@ BlKeyCombinationBuilder >> secondary [ combination with: OSPlatform current secondaryModifier ] -{ #category : 'keys - modifiers' } +{ #category : #'keys - modifiers' } BlKeyCombinationBuilder >> shift [ | shift | @@ -276,24 +274,24 @@ BlKeyCombinationBuilder >> shift [ with: shift ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> space [ combination with: (BlSingleKeyCombination new key: KeyboardKey space) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> t [ combination with: (BlSingleKeyCombination new key: KeyboardKey T) ] -{ #category : 'keys - special' } +{ #category : #'keys - special' } BlKeyCombinationBuilder >> tab [ combination with: (BlSingleKeyCombination new key: KeyboardKey tab) ] -{ #category : 'private' } +{ #category : #private } BlKeyCombinationBuilder >> toNormalForm: aKeyCombination [ "Converts a given key combination to a normal form (CNF or DNF) (https://en.wikipedia.org/wiki/Conjunctive_normal_form) @@ -303,22 +301,22 @@ BlKeyCombinationBuilder >> toNormalForm: aKeyCombination [ ^ aKeyCombination accept: converter ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> v [ combination with: (BlSingleKeyCombination new key: KeyboardKey V) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> w [ combination with: (BlSingleKeyCombination new key: KeyboardKey W) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> x [ combination with: (BlSingleKeyCombination new key: KeyboardKey X) ] -{ #category : 'keys - letters' } +{ #category : #'keys - letters' } BlKeyCombinationBuilder >> z [ combination with: (BlSingleKeyCombination new key: KeyboardKey Z) ] diff --git a/src/Bloc/BlKeyCombinationConverterCNF.class.st b/src/Bloc/BlKeyCombinationConverterCNF.class.st index 34f2fd016..3fe4a8bed 100644 --- a/src/Bloc/BlKeyCombinationConverterCNF.class.st +++ b/src/Bloc/BlKeyCombinationConverterCNF.class.st @@ -3,14 +3,12 @@ I transform composite key combination formula into a CNF (https://en.wikipedia.o " Class { - #name : 'BlKeyCombinationConverterCNF', - #superclass : 'BlKeyCombinationVisitor', - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #name : #BlKeyCombinationConverterCNF, + #superclass : #BlKeyCombinationVisitor, + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationConverterCNF >> visitAlternative: aBlAlternativeCombination [ | combinations pairedCompulsories alternative | @@ -42,7 +40,7 @@ BlKeyCombinationConverterCNF >> visitAlternative: aBlAlternativeCombination [ ^ alternative accept: self. ] -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationConverterCNF >> visitCompulsory: aBlCompulsoryCombination [ | compulsory | @@ -54,7 +52,7 @@ BlKeyCombinationConverterCNF >> visitCompulsory: aBlCompulsoryCombination [ ^ compulsory ] -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationConverterCNF >> visitKey: aBlKeyCodeCombination [ ^ BlCompulsoryCombination new with: aBlKeyCodeCombination ] diff --git a/src/Bloc/BlKeyCombinationConverterDNF.class.st b/src/Bloc/BlKeyCombinationConverterDNF.class.st index 09be418cb..b7299ff26 100644 --- a/src/Bloc/BlKeyCombinationConverterDNF.class.st +++ b/src/Bloc/BlKeyCombinationConverterDNF.class.st @@ -3,14 +3,12 @@ I transform composite key combination formula into a DNF (https://en.wikipedia.o " Class { - #name : 'BlKeyCombinationConverterDNF', - #superclass : 'BlKeyCombinationVisitor', - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #name : #BlKeyCombinationConverterDNF, + #superclass : #BlKeyCombinationVisitor, + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationConverterDNF >> visitAlternative: aBlAlternativeCombination [ | alternative | @@ -22,7 +20,7 @@ BlKeyCombinationConverterDNF >> visitAlternative: aBlAlternativeCombination [ ^ alternative ] -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationConverterDNF >> visitCompulsory: aBlCompulsoryCombination [ | combinations pairedAlternatives compulsory | @@ -54,7 +52,7 @@ BlKeyCombinationConverterDNF >> visitCompulsory: aBlCompulsoryCombination [ ^ compulsory accept: self ] -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationConverterDNF >> visitKey: aBlKeyCodeCombination [ ^ BlAlternativeCombination new with: aBlKeyCodeCombination ] diff --git a/src/Bloc/BlKeyCombinationVisitor.class.st b/src/Bloc/BlKeyCombinationVisitor.class.st index eb1c0d7a2..0405df473 100644 --- a/src/Bloc/BlKeyCombinationVisitor.class.st +++ b/src/Bloc/BlKeyCombinationVisitor.class.st @@ -8,23 +8,21 @@ Example: " Class { - #name : 'BlKeyCombinationVisitor', - #superclass : 'Object', + #name : #BlKeyCombinationVisitor, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationVisitor >> visitAlternative: aBlAlternativeCombination [ ] -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationVisitor >> visitCompulsory: aBlCompulsoryCombination [ ] -{ #category : 'visiting' } +{ #category : #visiting } BlKeyCombinationVisitor >> visitKey: aBlKeyCodeCombination [ ] diff --git a/src/Bloc/BlKeyDownEvent.class.st b/src/Bloc/BlKeyDownEvent.class.st index 86cd667e5..81f651aa8 100644 --- a/src/Bloc/BlKeyDownEvent.class.st +++ b/src/Bloc/BlKeyDownEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlKeyDownEvent', - #superclass : 'BlKeyboardEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlKeyDownEvent, + #superclass : #BlKeyboardEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlKeyDownEvent >> sendTo: anObject [ anObject keyDownEvent: self ] diff --git a/src/Bloc/BlKeyModifiers.class.st b/src/Bloc/BlKeyModifiers.class.st index cc3a9b217..602e3cb77 100644 --- a/src/Bloc/BlKeyModifiers.class.st +++ b/src/Bloc/BlKeyModifiers.class.st @@ -1,40 +1,38 @@ Class { - #name : 'BlKeyModifiers', - #superclass : 'Object', + #name : #BlKeyModifiers, + #superclass : #Object, #instVars : [ 'hashKey' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> altMask [ ^ 2r000100 ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> capsLockMask [ ^ 2r010000 ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> cmdMask [ ^ 2r001000 ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> ctrlMask [ ^ 2r000010 ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> numLockMask [ ^ 2r100000 ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBool [ ^ self new shift: shiftBool @@ -43,7 +41,7 @@ BlKeyModifiers class >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBo cmd: cmdBool ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBool capsLock: capsLockBool numLock: numLockBool [ ^ self new shift: shiftBool @@ -54,79 +52,79 @@ BlKeyModifiers class >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBo numLock: numLockBool ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlKeyModifiers class >> shiftMask [ ^ 2r000001 ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> = aKeyModifiers [ ^ self hash = aKeyModifiers hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> alt: altBool [ hashKey := hashKey bitAt: 3 put: altBool asBit ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> capsLock: capsLockBool [ hashKey := hashKey bitAt: 5 put: capsLockBool asBit ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> cmd: cmdBool [ hashKey := hashKey bitAt: 4 put: cmdBool asBit ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> ctrl: ctrlBool [ hashKey := hashKey bitAt: 2 put: ctrlBool asBit ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> hash [ ^ hashKey ] -{ #category : 'initialization' } +{ #category : #initialization } BlKeyModifiers >> initialize [ super initialize. hashKey := 2r000000 ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isAlt [ ^ hashKey anyMask: self class altMask ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isCapsLock [ ^ hashKey anyMask: self class capsLockMask ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isCmd [ ^ hashKey anyMask: self class cmdMask ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isCtrl [ ^ hashKey anyMask: self class ctrlMask ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isEmpty [ ^ hashKey = 0 ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isNumLock [ ^ hashKey anyMask: self class numLockMask ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isPrimaryModifier [ "Return true if primary modifier is pressed, false otherwise" | aPrimaryModifier | @@ -142,12 +140,12 @@ BlKeyModifiers >> isPrimaryModifier [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isShift [ ^ hashKey anyMask: self class shiftMask ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isSoftEmpty [ "Return true if none of the following modifiers is pressed: CMD, CTRL, SHIFT, SUPER, ALT" ^ self isAlt not and: [ @@ -157,17 +155,17 @@ BlKeyModifiers >> isSoftEmpty [ self isSuper not ] ] ] ] ] -{ #category : 'testing' } +{ #category : #testing } BlKeyModifiers >> isSuper [ ^ self isCmd ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> numLock: numLockBool [ hashKey := hashKey bitAt: 6 put: numLockBool asBit ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> printOn: aStream [ |mods| mods := OrderedCollection new. @@ -182,12 +180,12 @@ BlKeyModifiers >> printOn: aStream [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyModifiers >> shift: shiftBool [ hashKey := hashKey bitAt: 1 put: shiftBool asBit ] -{ #category : 'initialization' } +{ #category : #initialization } BlKeyModifiers >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBool [ hashKey := hashKey bitAt: 1 put: shiftBool asBit. hashKey := hashKey bitAt: 2 put: ctrlBool asBit. @@ -195,7 +193,7 @@ BlKeyModifiers >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBool [ hashKey := hashKey bitAt: 4 put: cmdBool asBit ] -{ #category : 'initialization' } +{ #category : #initialization } BlKeyModifiers >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBool capsLock: capsLockBool numLock: numLockBool [ hashKey := hashKey bitAt: 1 put: shiftBool asBit. hashKey := hashKey bitAt: 2 put: ctrlBool asBit. @@ -205,7 +203,7 @@ BlKeyModifiers >> shift: shiftBool ctrl: ctrlBool alt: altBool cmd: cmdBool caps hashKey := hashKey bitAt: 6 put: numLockBool asBit ] -{ #category : 'printing' } +{ #category : #printing } BlKeyModifiers >> storeOn: aStream [ aStream nextPutAll: '('. aStream nextPutAll: self class name. diff --git a/src/Bloc/BlKeyUpEvent.class.st b/src/Bloc/BlKeyUpEvent.class.st index 950ed7a4c..b1ee64ea8 100644 --- a/src/Bloc/BlKeyUpEvent.class.st +++ b/src/Bloc/BlKeyUpEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlKeyUpEvent', - #superclass : 'BlKeyboardEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlKeyUpEvent, + #superclass : #BlKeyboardEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlKeyUpEvent >> sendTo: anObject [ anObject keyUpEvent: self ] diff --git a/src/Bloc/BlKeyboardBuffer.class.st b/src/Bloc/BlKeyboardBuffer.class.st index ed8300e82..bff4dbdba 100644 --- a/src/Bloc/BlKeyboardBuffer.class.st +++ b/src/Bloc/BlKeyboardBuffer.class.st @@ -5,38 +5,36 @@ I allow `=BlKeyboardProcessor`= to sent key still pressed event every frame if t " Class { - #name : 'BlKeyboardBuffer', - #superclass : 'Object', + #name : #BlKeyboardBuffer, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'events' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlKeyboardBuffer >> add: anEvent [ events at: anEvent key put: anEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyboardBuffer >> eventAt: aKey [ ^ events at: aKey ] -{ #category : 'accessing' } +{ #category : #accessing } BlKeyboardBuffer >> events [ ^ events values ] -{ #category : 'testing' } +{ #category : #testing } BlKeyboardBuffer >> hasEvent: aKey [ "Return true if there is a buffered event for a given key" @@ -44,7 +42,7 @@ BlKeyboardBuffer >> hasEvent: aKey [ ^ events includesKey: aKey ] -{ #category : 'testing' } +{ #category : #testing } BlKeyboardBuffer >> hasExactlyAll: aCollectionOfKeys [ "Return true if the buffer has exactly a collection of given keys" @@ -53,24 +51,24 @@ BlKeyboardBuffer >> hasExactlyAll: aCollectionOfKeys [ ^ (events keys asSet reject: #isUnkownKey) = aCollectionOfKeys asSet ] -{ #category : 'initialization' } +{ #category : #initialization } BlKeyboardBuffer >> initialize [ super initialize. events := Dictionary new ] -{ #category : 'testing' } +{ #category : #testing } BlKeyboardBuffer >> isEmpty [ ^ events isEmpty ] -{ #category : 'testing' } +{ #category : #testing } BlKeyboardBuffer >> isNotEmpty [ ^ events isNotEmpty ] -{ #category : 'testing' } +{ #category : #testing } BlKeyboardBuffer >> isPressed: aKey [ "Return true if a given key is pressed, false otherwise" @@ -78,7 +76,7 @@ BlKeyboardBuffer >> isPressed: aKey [ ^ self hasEvent: aKey ] -{ #category : 'printing' } +{ #category : #printing } BlKeyboardBuffer >> printOn: aStream [ aStream nextPut: $(. @@ -88,7 +86,7 @@ BlKeyboardBuffer >> printOn: aStream [ aStream nextPut: $) ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlKeyboardBuffer >> remove: anEvent [ events removeKey: anEvent key ] diff --git a/src/Bloc/BlKeyboardEvent.class.st b/src/Bloc/BlKeyboardEvent.class.st index 21e718107..1dbf4ef6e 100644 --- a/src/Bloc/BlKeyboardEvent.class.st +++ b/src/Bloc/BlKeyboardEvent.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlKeyboardEvent', - #superclass : 'BlUIEvent', + #name : #BlKeyboardEvent, + #superclass : #BlUIEvent, #instVars : [ 'scanCode', 'key' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'converting' } +{ #category : #converting } BlKeyboardEvent >> asDictionaryForExport [ ^ super asDictionaryForExport at: #scanCode put: scanCode printString; @@ -18,24 +16,24 @@ BlKeyboardEvent >> asDictionaryForExport [ yourself ] -{ #category : 'testing' } +{ #category : #testing } BlKeyboardEvent >> isKeyboard [ ^ true ] -{ #category : 'key - accessing' } +{ #category : #'key - accessing' } BlKeyboardEvent >> key [ ^ key ] -{ #category : 'key - accessing' } +{ #category : #'key - accessing' } BlKeyboardEvent >> key: aBlKeyboardKey [ key := aBlKeyboardKey ] -{ #category : 'printing' } +{ #category : #printing } BlKeyboardEvent >> printOn: aStream [ aStream nextPutAll: self class name; @@ -49,7 +47,7 @@ BlKeyboardEvent >> printOn: aStream [ nextPut: $) ] -{ #category : 'key - accessing' } +{ #category : #'key - accessing' } BlKeyboardEvent >> scanCode [ "A scancode (or scan code) is the data that most computer keyboards send to a computer to report which keys have been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard. @@ -59,7 +57,7 @@ BlKeyboardEvent >> scanCode [ ^ scanCode ] -{ #category : 'key - accessing' } +{ #category : #'key - accessing' } BlKeyboardEvent >> scanCode: aNumber [ scanCode := aNumber ] diff --git a/src/Bloc/BlKeyboardKeyTable.class.st b/src/Bloc/BlKeyboardKeyTable.class.st index 9d26c2393..08172694f 100644 --- a/src/Bloc/BlKeyboardKeyTable.class.st +++ b/src/Bloc/BlKeyboardKeyTable.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlKeyboardKeyTable', - #superclass : 'Object', - #category : 'Bloc-Universe', - #package : 'Bloc', - #tag : 'Universe' + #name : #BlKeyboardKeyTable, + #superclass : #Object, + #category : 'Bloc-Universe' } -{ #category : 'initialization' } +{ #category : #initialization } BlKeyboardKeyTable >> initialize: aMapDictionary withKeys: aMapArray [ aMapArray pairsDo: [ :eachCode :eachKey | aMapDictionary at: eachCode put: eachKey copy ] ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlKeyboardKeyTable >> keyFromVirtualCode: aScanCode [ ^ self subclassResponsibility diff --git a/src/Bloc/BlKeyboardProcessor.class.st b/src/Bloc/BlKeyboardProcessor.class.st index 9863f2d3c..71cdacbd1 100644 --- a/src/Bloc/BlKeyboardProcessor.class.st +++ b/src/Bloc/BlKeyboardProcessor.class.st @@ -4,8 +4,8 @@ Is responsible for processing {{gtClass:BlKeyboardEvent}} which are sent by the " Class { - #name : 'BlKeyboardProcessor', - #superclass : 'BlBaseEventProcessor', + #name : #BlKeyboardProcessor, + #superclass : #BlBaseEventProcessor, #instVars : [ 'buffer', 'textInputBuffer', @@ -15,19 +15,17 @@ Class { 'previousShortcutTime', 'previousShortcutRepeatTime' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlKeyboardProcessor >> buffer [ ^ buffer ] -{ #category : 'target detection' } +{ #category : #'target detection' } BlKeyboardProcessor >> findTarget [ "Find and return an appropriate element target for a keyboard event. By default a keyboard event target is currently focused element if exists @@ -40,7 +38,7 @@ BlKeyboardProcessor >> findTarget [ ifFalse: [ self space root ] ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlKeyboardProcessor >> handleSpaceEventProcessedEvent: anEvent [ | aShortcutEvent aTimeNow | @@ -66,7 +64,7 @@ BlKeyboardProcessor >> handleSpaceEventProcessedEvent: anEvent [ previousShortcutRepeatTime := self space time now ] -{ #category : 'initialization' } +{ #category : #initialization } BlKeyboardProcessor >> initialize [ super initialize. @@ -81,7 +79,7 @@ BlKeyboardProcessor >> initialize [ previousShortcutRepeatTime := DateAndTime now. "when the last repeated shortcut was sent" ] -{ #category : 'testing' } +{ #category : #testing } BlKeyboardProcessor >> keystrokesAllowed [ "Return true if keystrokes are allowed, false otherwise" @@ -89,7 +87,7 @@ BlKeyboardProcessor >> keystrokesAllowed [ ^ preventKeystrokes not ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlKeyboardProcessor >> processBufferedTextInput [ | aTarget | @@ -107,7 +105,7 @@ BlKeyboardProcessor >> processBufferedTextInput [ textInputBuffer reset ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlKeyboardProcessor >> processKeyDown: anEvent [ | aTarget aShortcutEvent | @@ -140,7 +138,7 @@ BlKeyboardProcessor >> processKeyDown: anEvent [ preventKeystrokes := aShortcutEvent isConsumed ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlKeyboardProcessor >> processKeyUp: anEvent [ | aTarget | @@ -163,7 +161,7 @@ BlKeyboardProcessor >> processKeyUp: anEvent [ ifTrue: [ preventKeystrokes := false ] ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlKeyboardProcessor >> processTextInput: anEvent [ self keystrokesAllowed ifFalse: [ ^ self ]. @@ -173,7 +171,7 @@ BlKeyboardProcessor >> processTextInput: anEvent [ modifiers: anEvent modifiers ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlKeyboardProcessor >> processWindowFocusOut: anEvent [ "Take all registered key down events from the buffer and send them as key up events to release keys" diff --git a/src/Bloc/BlLayout.class.st b/src/Bloc/BlLayout.class.st index 765f2d153..e092befb6 100644 --- a/src/Bloc/BlLayout.class.st +++ b/src/Bloc/BlLayout.class.st @@ -79,21 +79,19 @@ BlLayout allSubclasses " Class { - #name : 'BlLayout', - #superclass : 'Object', + #name : #BlLayout, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } -{ #category : 'constraints' } +{ #category : #constraints } BlLayout class >> constraints [ ^ self subclassResponsibility ] -{ #category : 'private - alignment' } +{ #category : #'private - alignment' } BlLayout >> align: anElement bounds: elementBounds in: theParentBounds with: aBlElementAlignment [ "I don't additionally take element margin or parent padding" | aTranslation alignment | @@ -105,7 +103,7 @@ BlLayout >> align: anElement bounds: elementBounds in: theParentBounds with: aBl ^ elementBounds translateBy: aTranslation ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } BlLayout >> align: aChildElement horizontal: aBlAlignment [ "I should be used to dispatch children alignment configuration through layout to provide higher level uniform alignment api. Layouts that support children alignment should override me as follows: @@ -115,7 +113,7 @@ BlLayout >> align: aChildElement horizontal: aBlAlignment [ " ] -{ #category : 'private - alignment' } +{ #category : #'private - alignment' } BlLayout >> align: elementBounds in: theParentBounds with: aBlElementAlignment [ "I don't additionally take element margin or parent padding" | aTranslation alignment | @@ -127,7 +125,7 @@ BlLayout >> align: elementBounds in: theParentBounds with: aBlElementAlignment [ ^ elementBounds translateBy: aTranslation ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } BlLayout >> align: aChildElement vertical: aBlAlignment [ "I should be used to dispatch children alignment configuration through layout to provide higher level uniform alignment api. Layouts that support children alignment should override me as follows: @@ -137,19 +135,19 @@ BlLayout >> align: aChildElement vertical: aBlAlignment [ " ] -{ #category : 'api - direction' } +{ #category : #'api - direction' } BlLayout >> defaultDirection [ ^ BlLayoutDirection leftToRight ] -{ #category : 'api - direction' } +{ #category : #'api - direction' } BlLayout >> direction [ ^ self defaultDirection ] -{ #category : 'geometry' } +{ #category : #geometry } BlLayout >> findClosestChildOf: anElement to: aPoint [ "Find and return the closest direct child of a given element to a provided point in the coordinate system of anElement" @@ -157,21 +155,21 @@ BlLayout >> findClosestChildOf: anElement to: aPoint [ ^ anElement children first ] -{ #category : 'protected' } +{ #category : #protected } BlLayout >> isInfluencedByTransformation [ "Return true if the layout may be influenced by the element's transformation" ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlLayout >> isOrientable [ " can be vertical/horizontal ? " ^ false ] -{ #category : 'enumeration' } +{ #category : #enumeration } BlLayout >> layeredChildren: anElement do: aBlock [ "Evaluate a given block with all children of anElement that should be layered out within anElement. @@ -182,11 +180,11 @@ BlLayout >> layeredChildren: anElement do: aBlock [ thenDo: aBlock ] -{ #category : 'layout' } +{ #category : #layout } BlLayout >> layout: anElement in: aRectangle context: aBlElementBoundsUpdateContext [ ] -{ #category : 'layout' } +{ #category : #layout } BlLayout >> layoutIgnored: anElement context: aBlElementBoundsUpdateContext [ "Layout children ignored by layout so that their measured bounds become actual bounds in parent" @@ -215,14 +213,14 @@ BlLayout >> layoutIgnored: anElement context: aBlElementBoundsUpdateContext [ aChild applyLayoutIn: childBounds context: aBlElementBoundsUpdateContext ] ] -{ #category : 'protected' } +{ #category : #protected } BlLayout >> mayInfluencePosition [ "Return true if the layout may influence the position of the element with this layout" ^ false ] -{ #category : 'measure' } +{ #category : #measure } BlLayout >> measure: anElement with: anExtentSpec [ "Default simple and naive implementation that does not support #fitContent resizing strategy of the anElement that uses a layout with this version of measurement" @@ -234,7 +232,7 @@ BlLayout >> measure: anElement with: anExtentSpec [ parentSpec: anExtentSpec ] ] -{ #category : 'private - measurement' } +{ #category : #'private - measurement' } BlLayout >> measureChild: aChildElement parentSpec: anExtentSpec [ "Measure a given child element allowing it to take as much space within parent as it want *does not* taking child's margin and parent's padding into account. @@ -247,7 +245,7 @@ BlLayout >> measureChild: aChildElement parentSpec: anExtentSpec [ heightUsed: 0.0 ] -{ #category : 'protected' } +{ #category : #protected } BlLayout >> measureChild: anElement parentSpec: parentSpec widthUsed: widthUsed heightUsed: heightUsed [ "Measure anElement based on provided parent's extent measurement specification and used width and height. used width and height can contain margin and/or padding. @@ -264,7 +262,7 @@ BlLayout >> measureChild: anElement parentSpec: parentSpec widthUsed: widthUsed resizer: anElement constraints vertical resizer)) ] -{ #category : 'protected' } +{ #category : #protected } BlLayout >> measureChildWithMargins: anElement parentSpec: parentSpec [ "Measure anElement based on provided parent's extent measurement specification taking element's margin and parent's padding into account" @@ -276,7 +274,7 @@ BlLayout >> measureChildWithMargins: anElement parentSpec: parentSpec [ heightUsed: 0 ] -{ #category : 'protected' } +{ #category : #protected } BlLayout >> measureChildWithMargins: anElement parentSpec: parentSpec widthUsed: widthUsed heightUsed: heightUsed [ "Measure anElement based on provided parent's extent measurement specification and used width and height taking element's margin and parent's padding into account" @@ -288,7 +286,7 @@ BlLayout >> measureChildWithMargins: anElement parentSpec: parentSpec widthUsed: heightUsed: anElement parent insets height + anElement outsets height + heightUsed ] -{ #category : 'private - measurement' } +{ #category : #'private - measurement' } BlLayout >> measureChildren: aCollectionOfChildren [ aCollectionOfChildren do: [ :aChild | self @@ -296,7 +294,7 @@ BlLayout >> measureChildren: aCollectionOfChildren [ parentSpec: BlExtentMeasurementSpec unspecified ] ] -{ #category : 'private - measurement' } +{ #category : #'private - measurement' } BlLayout >> measureIgnored: anElement with: anExtentSpec [ "Measure ignore children of a given parent allowing them to take as much space as they want" @@ -319,7 +317,7 @@ BlLayout >> measureIgnored: anElement with: anExtentSpec [ parentSpec: aWidthSpec @ aHeightSpec ] ] -{ #category : 'enumeration' } +{ #category : #enumeration } BlLayout >> measuredChildren: anElement do: aBlock [ "Evaluate a given block with all children of anElement that should be taken into account during measurement process. @@ -330,7 +328,7 @@ BlLayout >> measuredChildren: anElement do: aBlock [ thenDo: aBlock ] -{ #category : 'protected' } +{ #category : #protected } BlLayout >> measurementSpecFor: parentSpec usedSize: usedSize resizer: childResizer [ "I determine what measurement specification my child should have based on parent's measurement spec and child's resizer property. @@ -358,13 +356,13 @@ BlLayout >> measurementSpecFor: parentSpec usedSize: usedSize resizer: childResi ^ parentSpec mode measurement: childResizer with: size ] -{ #category : 'hooks - layout' } +{ #category : #'hooks - layout' } BlLayout >> onCleanUp: anElement [ "Is sent when the layout caches should be cleaned up. This happens for example when an element is removed from the scene" ] -{ #category : 'hooks - layout' } +{ #category : #'hooks - layout' } BlLayout >> onLayoutDone: anElement [ "Is sent after layout is completely computed. All layout changes done within this hook will be performed during the next frame. diff --git a/src/Bloc/BlLayoutChildNode.class.st b/src/Bloc/BlLayoutChildNode.class.st index 9da7cb995..19f874896 100644 --- a/src/Bloc/BlLayoutChildNode.class.st +++ b/src/Bloc/BlLayoutChildNode.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlLayoutChildNode', - #superclass : 'BlLayoutNode', + #name : #BlLayoutChildNode, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutChildNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutChildNode classTrait', #instVars : [ @@ -11,27 +11,25 @@ Class { 'userData', 'actions' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> children [ ^ #() ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> constraints [ ^ constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> constraints: aBlLayoutConstraints [ constraints := aBlLayoutConstraints ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNode >> extent [ "Return the size of the node in the parent coordinate system" @@ -39,7 +37,7 @@ BlLayoutChildNode >> extent [ ^ measurement extent ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutChildNode >> initialize [ super initialize. @@ -49,7 +47,7 @@ BlLayoutChildNode >> initialize [ actions := Stack new ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNode >> layoutBounds [ @@ -58,27 +56,27 @@ BlLayoutChildNode >> layoutBounds [ extent: measurement extent ] -{ #category : 'api - measure' } +{ #category : #'api - measure' } BlLayoutChildNode >> measure: anExtentSpecOrBlock [ measurement := measurement measure: self with: anExtentSpecOrBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> measurement: aBlLayoutNodeMeasurement [ measurement := aBlLayoutNodeMeasurement ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> parent [ ^ parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> parent: anObject [ parent := anObject ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNode >> popAction [ @@ -87,7 +85,7 @@ BlLayoutChildNode >> popAction [ ifNotEmpty: [ :theActions | theActions pop ] ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNode >> position [ "Return a position of the top left corner in the parent coordinate system" @@ -95,7 +93,7 @@ BlLayoutChildNode >> position [ ^ measurement position ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNode >> position: aPoint [ "Set position of the top left corner in the parent coordinate system" @@ -103,7 +101,7 @@ BlLayoutChildNode >> position: aPoint [ measurement position: aPoint ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutChildNode >> printOn: aStream [ aStream nextPutAll: 'Node position: '; @@ -112,58 +110,58 @@ BlLayoutChildNode >> printOn: aStream [ print: measurement extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> privateMeasurement [ ^ measurement ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNode >> pushAction: aBlLayoutNodeElementAction [ actions push: aBlLayoutNodeElementAction ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> transformationDo: aBlock [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNode >> userData [ ^ userData ifNil: [ userData := Dictionary new ] ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNode >> withEdges: aCollectionOfLayoutEdges [ ^ BlLayoutChildNodeWithEdges new childNode: self; connectedEdges: aCollectionOfLayoutEdges ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNode >> withElement: aBlElement [ ^ BlLayoutChildNodeWithElement new childNode: self; element: aBlElement ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNode >> withMatrix: aBlMatrix [ ^ BlLayoutChildNodeWithTransformation new childNode: self; matrix: aBlMatrix ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNode >> withTransformation: aBlElementTransformation [ ^ BlLayoutChildNodeWithTransformation new childNode: self; transformation: aBlElementTransformation ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNode >> withoutElement [ "Return a layout node that does not know the element" @@ -171,7 +169,7 @@ BlLayoutChildNode >> withoutElement [ ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNode >> withoutTransformation [ ^ self ] diff --git a/src/Bloc/BlLayoutChildNodeWithEdges.class.st b/src/Bloc/BlLayoutChildNodeWithEdges.class.st index f9835be48..3ab3eac1e 100644 --- a/src/Bloc/BlLayoutChildNodeWithEdges.class.st +++ b/src/Bloc/BlLayoutChildNodeWithEdges.class.st @@ -1,61 +1,59 @@ Class { - #name : 'BlLayoutChildNodeWithEdges', - #superclass : 'BlLayoutNode', + #name : #BlLayoutChildNodeWithEdges, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutChildNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutChildNode classTrait', #instVars : [ 'childNode', 'connectedEdges' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> addConnectedEdge: anEdge [ (self connectedEdges includes: anEdge) ifFalse: [ self connectedEdges add: anEdge ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> childNode: aBlLayoutChildNode [ childNode := aBlLayoutChildNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> children [ ^ { childNode } ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> connectedEdges [ ^ connectedEdges ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> connectedEdges: aCollectionOfLayoutEdges [ connectedEdges := aCollectionOfLayoutEdges asOrderedCollection ] -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> connectedNodes [ ^ (BlLayoutGraphConnectedEdges on: self) nodes ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> constraints [ ^ childNode constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> constraints: aBlLayoutConstraints [ childNode constraints: aBlLayoutConstraints ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithEdges >> extent [ "Return the size of the node in the parent coordinate system" @@ -63,88 +61,88 @@ BlLayoutChildNodeWithEdges >> extent [ ^ childNode extent ] -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> hasNodesAlongIncomingEdges [ ^ self nodesAlongIncomingEdges isNotEmpty ] -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> hasNodesAlongOutgoingEdges [ ^ self nodesAlongOutgoingEdges isNotEmpty ] -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> incomingEdges [ ^ (BlLayoutGraphConnectedEdges on: self) incoming ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutChildNodeWithEdges >> initialize [ super initialize. connectedEdges := OrderedCollection new ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithEdges >> layoutBounds [ ^ childNode layoutBounds ] -{ #category : 'api - measure' } +{ #category : #'api - measure' } BlLayoutChildNodeWithEdges >> measure: anExtentSpecOrBlock [ childNode measure: anExtentSpecOrBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> measurement: aBlLayoutNodeMeasurement [ childNode measurement: aBlLayoutNodeMeasurement ] -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> nodesAlongIncomingEdges [ ^ self incomingEdges nodes ] -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> nodesAlongOutgoingEdges [ ^ self outgoingEdges nodes ] -{ #category : 'api - edges' } +{ #category : #'api - edges' } BlLayoutChildNodeWithEdges >> outgoingEdges [ ^ (BlLayoutGraphConnectedEdges on: self) outgoing ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> parent [ ^ childNode parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> parent: aBlLayoutParentNode [ childNode parent: aBlLayoutParentNode ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNodeWithEdges >> popAction [ ^ childNode popAction ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithEdges >> position [ "Return a position of the top left corner in the parent coordinate system" @@ -152,7 +150,7 @@ BlLayoutChildNodeWithEdges >> position [ ^ childNode position ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithEdges >> position: aPoint [ "Set position of the top left corner in the parent coordinate system" @@ -160,7 +158,7 @@ BlLayoutChildNodeWithEdges >> position: aPoint [ childNode position: aPoint ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutChildNodeWithEdges >> printOn: aStream [ aStream nextPutAll: 'Edges: '; @@ -171,50 +169,50 @@ BlLayoutChildNodeWithEdges >> printOn: aStream [ print: self outgoingEdges size ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> privateMeasurement [ ^ childNode privateMeasurement ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNodeWithEdges >> pushAction: aBlLayoutNodeElementAction [ childNode pushAction: aBlLayoutNodeElementAction ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> transformationDo: aBlock [ childNode transformationDo: aBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithEdges >> userData [ ^ childNode userData ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithEdges >> withEdges: aCollectionOfLayoutEdges [ ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithEdges >> withElement: aBlElement [ ^ BlLayoutChildNodeWithElement new childNode: self; element: aBlElement ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithEdges >> withTransformation: aBlElementTransformation [ ^ self class new childNode: (childNode withTransformation: aBlElementTransformation); connectedEdges: connectedEdges ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithEdges >> withoutTransformation [ ^ self class new childNode: childNode withoutTransformation; diff --git a/src/Bloc/BlLayoutChildNodeWithElement.class.st b/src/Bloc/BlLayoutChildNodeWithElement.class.st index 060052c42..5e165faad 100644 --- a/src/Bloc/BlLayoutChildNodeWithElement.class.st +++ b/src/Bloc/BlLayoutChildNodeWithElement.class.st @@ -4,50 +4,48 @@ Is used to keep track of the child node and its associated element " Class { - #name : 'BlLayoutChildNodeWithElement', - #superclass : 'BlLayoutNode', + #name : #BlLayoutChildNodeWithElement, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutChildNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutChildNode classTrait', #instVars : [ 'childNode', 'element' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> childNode: aBlLayoutChildNode [ childNode := aBlLayoutChildNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> children [ ^ { childNode } ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> constraints [ ^ childNode constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> constraints: aBlLayoutConstraints [ childNode constraints: aBlLayoutConstraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> element: anObject [ element := anObject ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithElement >> extent [ "Return the size of the node in the parent coordinate system" @@ -55,43 +53,43 @@ BlLayoutChildNodeWithElement >> extent [ ^ childNode extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithElement >> layoutBounds [ ^ childNode layoutBounds ] -{ #category : 'api - measure' } +{ #category : #'api - measure' } BlLayoutChildNodeWithElement >> measure: anExtentSpecOrBlock [ childNode measure: anExtentSpecOrBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> measurement: aBlLayoutNodeMeasurement [ childNode measurement: aBlLayoutNodeMeasurement ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> parent [ ^ childNode parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> parent: aBlLayoutParentNode [ childNode parent: aBlLayoutParentNode ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNodeWithElement >> popAction [ ^ childNode popAction ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithElement >> position [ "Return a position of the top left corner in the parent coordinate system" @@ -99,7 +97,7 @@ BlLayoutChildNodeWithElement >> position [ ^ childNode position ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithElement >> position: aPoint [ "Set position of the top left corner in the parent coordinate system" @@ -107,7 +105,7 @@ BlLayoutChildNodeWithElement >> position: aPoint [ childNode position: aPoint ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutChildNodeWithElement >> printOn: aStream [ aStream nextPutAll: 'Element position: '; @@ -116,55 +114,55 @@ BlLayoutChildNodeWithElement >> printOn: aStream [ print: self element measuredBounds extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> privateMeasurement [ ^ childNode privateMeasurement ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNodeWithElement >> pushAction: aBlLayoutNodeElementAction [ childNode pushAction: aBlLayoutNodeElementAction ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> transformationDo: aBlock [ childNode transformationDo: aBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithElement >> userData [ ^ childNode userData ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithElement >> withEdges: aCollectionOfLayoutEdges [ ^ BlLayoutChildNodeWithEdges new childNode: self; connectedEdges: aCollectionOfLayoutEdges ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithElement >> withElement: aBlElement [ ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithElement >> withTransformation: aBlElementTransformation [ ^ self class new childNode: (childNode withTransformation: aBlElementTransformation); element: element ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithElement >> withoutElement [ ^ childNode ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithElement >> withoutTransformation [ ^ self class new childNode: childNode withoutTransformation; diff --git a/src/Bloc/BlLayoutChildNodeWithTransformation.class.st b/src/Bloc/BlLayoutChildNodeWithTransformation.class.st index a43e337a0..548157f34 100644 --- a/src/Bloc/BlLayoutChildNodeWithTransformation.class.st +++ b/src/Bloc/BlLayoutChildNodeWithTransformation.class.st @@ -1,45 +1,43 @@ Class { - #name : 'BlLayoutChildNodeWithTransformation', - #superclass : 'BlLayoutNode', + #name : #BlLayoutChildNodeWithTransformation, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutChildNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutChildNode classTrait', #instVars : [ 'childNode', 'transformation' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlLayoutChildNodeWithTransformation >> boundsToParent: theBounds [ ^ transformation transformBounds: theBounds ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> childNode: aBlLayoutChildNode [ childNode := aBlLayoutChildNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> children [ ^ { childNode } ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> constraints [ ^ childNode constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> constraints: aBlLayoutConstraints [ childNode constraints: aBlLayoutConstraints ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithTransformation >> extent [ "Return the size of the node in the parent coordinate system" @@ -47,14 +45,14 @@ BlLayoutChildNodeWithTransformation >> extent [ ^ self extentToParent: childNode extent ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlLayoutChildNodeWithTransformation >> extentToParent: aPoint [ ^ (transformation transformBounds: (BlBounds origin: 0@0 extent: aPoint)) extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithTransformation >> layoutBounds [ | aDelta | @@ -68,12 +66,12 @@ BlLayoutChildNodeWithTransformation >> layoutBounds [ extent: self privateMeasurement extent ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlLayoutChildNodeWithTransformation >> matrix: aBlMatrix [ self transformation: (BlElementAbsoluteTransformation matrix: aBlMatrix) ] -{ #category : 'api - measure' } +{ #category : #'api - measure' } BlLayoutChildNodeWithTransformation >> measure: anExtentSpecOrBlock [ childNode measure: anExtentSpecOrBlock. @@ -82,7 +80,7 @@ BlLayoutChildNodeWithTransformation >> measure: anExtentSpecOrBlock [ (Rectangle origin: 0.0 @ 0.0 extent: self privateMeasurement extent) ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> measurement: aBlLayoutNodeMeasurement [ childNode measurement: aBlLayoutNodeMeasurement. @@ -93,68 +91,68 @@ BlLayoutChildNodeWithTransformation >> measurement: aBlLayoutNodeMeasurement [ self transformation bounds: (BlBounds origin: 0.0@0.0 extent: self privateMeasurement extent) ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> parent [ ^ childNode parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> parent: aBlLayoutParentNode [ childNode parent: aBlLayoutParentNode ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlLayoutChildNodeWithTransformation >> pointToLocal: aPoint [ ^ self transformation inverseTransformPoint: aPoint ] -{ #category : 'api - transformation' } +{ #category : #'api - transformation' } BlLayoutChildNodeWithTransformation >> pointToParent: aPoint [ ^ transformation transformPoint: aPoint ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNodeWithTransformation >> popAction [ ^ childNode popAction ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithTransformation >> position [ ^ childNode position + (self pointToParent: 0@0) ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutChildNodeWithTransformation >> position: aPoint [ childNode position: aPoint - (self pointToParent: 0@0) ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> privateMeasurement [ ^ childNode privateMeasurement ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } BlLayoutChildNodeWithTransformation >> pushAction: aBlLayoutNodeElementAction [ childNode pushAction: aBlLayoutNodeElementAction ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> transformation [ ^ transformation ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> transformation: aBlElementTransformation [ transformation := aBlElementTransformation asCachedTransformation @@ -165,40 +163,40 @@ BlLayoutChildNodeWithTransformation >> transformation: aBlElementTransformation yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> transformationDo: aBlock [ aBlock value: transformation asElementTransformation ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutChildNodeWithTransformation >> userData [ ^ childNode userData ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithTransformation >> withEdges: aCollectionOfLayoutEdges [ ^ BlLayoutChildNodeWithEdges new childNode: self; connectedEdges: aCollectionOfLayoutEdges ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithTransformation >> withElement: aBlElement [ ^ BlLayoutChildNodeWithElement new childNode: self; element: aBlElement ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithTransformation >> withTransformation: aBlElementTransformation [ self transformation: aBlElementTransformation ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutChildNodeWithTransformation >> withoutTransformation [ ^ childNode ] diff --git a/src/Bloc/BlLayoutCommonConstraints.class.st b/src/Bloc/BlLayoutCommonConstraints.class.st index 9cf331c6d..358dc6c13 100644 --- a/src/Bloc/BlLayoutCommonConstraints.class.st +++ b/src/Bloc/BlLayoutCommonConstraints.class.st @@ -33,8 +33,8 @@ Internal Representation and Key Implementation Points. " Class { - #name : 'BlLayoutCommonConstraints', - #superclass : 'BlLayoutConstraints', + #name : #BlLayoutCommonConstraints, + #superclass : #BlLayoutConstraints, #instVars : [ 'constraints', 'position', @@ -49,26 +49,24 @@ Class { 'previouslyAccessedConstraintsType', 'accountTransformation' ], - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> accountByLayout [ "Makes an element with this constraits be accounted by layout (not ignored)" ignoredByLayout := false ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> accountTransformation [ "Let the layout know that the element's transformation should be taken into account during layout" accountTransformation := true ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutCommonConstraints >> at: aLayoutClass [ "Return a layout constrait object specific for a given layout defined by its class. Returned constraint can not be nil" @@ -95,24 +93,24 @@ BlLayoutCommonConstraints >> at: aLayoutClass [ ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutCommonConstraints >> defaultHorizontal [ ^ BlLayoutCommonConstraintsAxis new ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutCommonConstraints >> defaultVertical [ ^ BlLayoutCommonConstraintsAxis new ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> doNotAccountTransformation [ "Let the layout know that the element's transformation should *not* be taken into account during layout" accountTransformation := false ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> ignoreByLayout [ "Makes an element with this constraits be ignored by layout. An element will still be measured but will not be taken into account @@ -121,12 +119,12 @@ BlLayoutCommonConstraints >> ignoreByLayout [ ignoredByLayout := true ] -{ #category : 'api - layouts' } +{ #category : #'api - layouts' } BlLayoutCommonConstraints >> ignored [ ^ self at: BlIgnoredLayout ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutCommonConstraints >> ignoredByLayout [ "Return true if an element must be ignored by layout, otherwise false" @@ -134,12 +132,12 @@ BlLayoutCommonConstraints >> ignoredByLayout [ ^ ignoredByLayout ] -{ #category : 'api - layouts' } +{ #category : #'api - layouts' } BlLayoutCommonConstraints >> infinite [ ^ self at: BlInfiniteLayout ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutCommonConstraints >> initialize [ super initialize. @@ -160,7 +158,7 @@ BlLayoutCommonConstraints >> initialize [ constraints := nil ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> margin [ "Return an immutable margin property, margin can not be nil" @@ -168,14 +166,14 @@ BlLayoutCommonConstraints >> margin [ ^ margin ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> margin: aBlMargin [ "Change element's margin to aBlMargin" margin := aBlMargin ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> maxHeight [ "Return a maximal height an element can have, maxHeight can not be nil, @@ -184,7 +182,7 @@ BlLayoutCommonConstraints >> maxHeight [ ^ maxHeight ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> maxHeight: aNumber [ "Set maximal height to be aNumber, aNumber must not be nil @@ -193,7 +191,7 @@ BlLayoutCommonConstraints >> maxHeight: aNumber [ maxHeight := aNumber asFloat ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> maxWidth [ "Return a maximal width an element can have, maxWidth can not be nil, @@ -202,7 +200,7 @@ BlLayoutCommonConstraints >> maxWidth [ ^ maxWidth ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> maxWidth: aNumber [ "Set maximal width to be aNumber, aNumber must not be nil @@ -211,7 +209,7 @@ BlLayoutCommonConstraints >> maxWidth: aNumber [ maxWidth := aNumber asFloat ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> minHeight [ "Return a minimal height an element can have, minHeight can not be nil or infinity" @@ -219,7 +217,7 @@ BlLayoutCommonConstraints >> minHeight [ ^ minHeight ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> minHeight: aNumber [ "Set minimal height to be aNumber, aNumber must not be nil @@ -229,7 +227,7 @@ BlLayoutCommonConstraints >> minHeight: aNumber [ minHeight := aNumber asFloat ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> minWidth [ "Return a minimal width an element can have, minWidth can not be nil or infinity" @@ -237,7 +235,7 @@ BlLayoutCommonConstraints >> minWidth [ ^ minWidth ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> minWidth: aNumber [ "Set minimal width to be aNumber, aNumber must not be nil @@ -247,12 +245,12 @@ BlLayoutCommonConstraints >> minWidth: aNumber [ minWidth := aNumber asFloat ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutCommonConstraints >> other [ ^ constraints ifNil: [ ^ Dictionary new ] ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> padding [ "Return an immutable padding property. The padding can not be nil" @@ -261,50 +259,50 @@ BlLayoutCommonConstraints >> padding [ ^ padding ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> padding: aBlPadding [ "Change element's padding." padding := aBlPadding ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> position [ ^ position ] -{ #category : 'api - constraints' } +{ #category : #'api - constraints' } BlLayoutCommonConstraints >> position: aPoint [ position := aPoint ] -{ #category : 'api - layouts' } +{ #category : #'api - layouts' } BlLayoutCommonConstraints >> proportional [ ^ self at: BlProportionalLayout ] -{ #category : 'api - layouts' } +{ #category : #'api - layouts' } BlLayoutCommonConstraints >> requestedHeightIn: anElement [ ^ self vertical requestedHeightIn: anElement ] -{ #category : 'api - layouts' } +{ #category : #'api - layouts' } BlLayoutCommonConstraints >> requestedSizeIn: anElement [ ^ (self requestedWidthIn: anElement) @ (self requestedHeightIn: anElement) ] -{ #category : 'api - layouts' } +{ #category : #'api - layouts' } BlLayoutCommonConstraints >> requestedWidthIn: anElement [ ^ self horizontal requestedWidthIn: anElement ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutCommonConstraints >> shouldAccountTransformation [ diff --git a/src/Bloc/BlLayoutCommonConstraintsAxis.class.st b/src/Bloc/BlLayoutCommonConstraintsAxis.class.st index 44420dc3d..2269f20ed 100644 --- a/src/Bloc/BlLayoutCommonConstraintsAxis.class.st +++ b/src/Bloc/BlLayoutCommonConstraintsAxis.class.st @@ -1,66 +1,64 @@ Class { - #name : 'BlLayoutCommonConstraintsAxis', - #superclass : 'BlLayoutConstraintsAxis', + #name : #BlLayoutCommonConstraintsAxis, + #superclass : #BlLayoutConstraintsAxis, #instVars : [ 'resizer' ], - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } -{ #category : 'resizing' } +{ #category : #resizing } BlLayoutCommonConstraintsAxis >> exact: aNumber [ self resizer: (BlLayoutResizer exact: aNumber asFloat) ] -{ #category : 'resizing' } +{ #category : #resizing } BlLayoutCommonConstraintsAxis >> fitContent [ self resizer: BlLayoutResizer fitContent ] -{ #category : 'resizing' } +{ #category : #resizing } BlLayoutCommonConstraintsAxis >> fitContentLimited [ self resizer: BlLayoutResizer fitContentLimited ] -{ #category : 'resizing' } +{ #category : #resizing } BlLayoutCommonConstraintsAxis >> fitContentLimitedOffset: aNumber [ self resizer: (BlLayoutResizer fitContentLimitedOffset: aNumber) ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutCommonConstraintsAxis >> initialize [ super initialize. resizer := BlLayoutResizer exact: 50.0 ] -{ #category : 'resizing' } +{ #category : #resizing } BlLayoutCommonConstraintsAxis >> matchParent [ self resizer: BlLayoutResizer matchParent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutCommonConstraintsAxis >> requestedHeightIn: anElement [ ^ self resizer requestedHeightIn: anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutCommonConstraintsAxis >> requestedWidthIn: anElement [ ^ self resizer requestedWidthIn: anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutCommonConstraintsAxis >> resizer [ ^ resizer ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutCommonConstraintsAxis >> resizer: aBlLayoutResizer [ self assert: [ aBlLayoutResizer isKindOf: BlLayoutResizer ] diff --git a/src/Bloc/BlLayoutConstraints.class.st b/src/Bloc/BlLayoutConstraints.class.st index 096a32bf1..4ada4e786 100644 --- a/src/Bloc/BlLayoutConstraints.class.st +++ b/src/Bloc/BlLayoutConstraints.class.st @@ -9,30 +9,28 @@ See `=BlLayoutConstraintsAxis`= to learn more about axis-dependent constraints " Class { - #name : 'BlLayoutConstraints', - #superclass : 'Object', + #name : #BlLayoutConstraints, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'vertical', 'horizontal' ], - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutConstraints >> defaultHorizontal [ ^ BlLayoutConstraintsAxis new ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutConstraints >> defaultVertical [ ^ BlLayoutConstraintsAxis new ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutConstraints >> horizontal [ "Return horizontal-axis specific constraints. horizontal constraints can not be nil" @@ -41,7 +39,7 @@ BlLayoutConstraints >> horizontal [ ^ horizontal ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutConstraints >> initialize [ super initialize. @@ -49,7 +47,7 @@ BlLayoutConstraints >> initialize [ vertical := self defaultVertical ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutConstraints >> vertical [ "Return vertical-axis specific constraints. vertical constraints can not be nil" diff --git a/src/Bloc/BlLayoutConstraintsAxis.class.st b/src/Bloc/BlLayoutConstraintsAxis.class.st index 32ef83570..fa56b4ceb 100644 --- a/src/Bloc/BlLayoutConstraintsAxis.class.st +++ b/src/Bloc/BlLayoutConstraintsAxis.class.st @@ -1,9 +1,7 @@ Class { - #name : 'BlLayoutConstraintsAxis', - #superclass : 'Object', + #name : #BlLayoutConstraintsAxis, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #category : 'Bloc-Layouts-Basic' } diff --git a/src/Bloc/BlLayoutDirection.class.st b/src/Bloc/BlLayoutDirection.class.st index 776c0edfb..df66631e7 100644 --- a/src/Bloc/BlLayoutDirection.class.st +++ b/src/Bloc/BlLayoutDirection.class.st @@ -6,18 +6,16 @@ I do not have any logic and can only used as direction flag. Layouts that have d " Class { - #name : 'BlLayoutDirection', - #superclass : 'Object', + #name : #BlLayoutDirection, + #superclass : #Object, #classVars : [ 'leftToRight', 'rightToLeft' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlLayoutDirection class >> initialize [ super initialize. @@ -25,43 +23,43 @@ BlLayoutDirection class >> initialize [ rightToLeft := BlLayoutRightToLeft new ] -{ #category : 'factory' } +{ #category : #factory } BlLayoutDirection class >> leftToRight [ ^ leftToRight ] -{ #category : 'factory' } +{ #category : #factory } BlLayoutDirection class >> rightToLeft [ ^ rightToLeft ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutDirection >> inverted [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutDirection >> isLeftToRight [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutDirection >> isRightToLeft [ ^ self subclassResponsibility ] -{ #category : 'dispatch' } +{ #category : #dispatch } BlLayoutDirection >> of: anObject [ ^ self subclassResponsibility ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlLayoutDirection >> with: aCollection do: aBlock [ ^ self subclassResponsibility ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlLayoutDirection >> with: aCollection inject: thisValue into: binaryBlock [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlLayoutEdge.class.st b/src/Bloc/BlLayoutEdge.class.st index 3f492839e..e5792499e 100644 --- a/src/Bloc/BlLayoutEdge.class.st +++ b/src/Bloc/BlLayoutEdge.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlLayoutEdge', - #superclass : 'Object', + #name : #BlLayoutEdge, + #superclass : #Object, #instVars : [ 'fromNode', 'toNode' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutEdge >> fromElement [ self deprecated: 'Use #fromNode instead' @@ -19,17 +17,17 @@ BlLayoutEdge >> fromElement [ ^ self fromNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutEdge >> fromNode [ ^ fromNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutEdge >> fromNode: anObject [ fromNode := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutEdge >> toElement [ self deprecated: 'Use #toNode instead' @@ -38,12 +36,12 @@ BlLayoutEdge >> toElement [ ^ self toNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutEdge >> toNode [ ^ toNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutEdge >> toNode: anObject [ toNode := anObject ] diff --git a/src/Bloc/BlLayoutErrorHandler.class.st b/src/Bloc/BlLayoutErrorHandler.class.st index 383029d13..2eda990dd 100644 --- a/src/Bloc/BlLayoutErrorHandler.class.st +++ b/src/Bloc/BlLayoutErrorHandler.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlLayoutErrorHandler', - #superclass : 'BlSingleErrorHandler', - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #name : #BlLayoutErrorHandler, + #superclass : #BlSingleErrorHandler, + #category : 'Bloc-Basic-Errors' } -{ #category : 'testing' } +{ #category : #testing } BlLayoutErrorHandler >> matches: aFramePhase [ ^ aFramePhase isLayoutPhase ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlLayoutErrorHandler >> processError: aBlHandledError [ NonInteractiveTranscript stderr show: aBlHandledError; diff --git a/src/Bloc/BlLayoutExactResizer.class.st b/src/Bloc/BlLayoutExactResizer.class.st index c49bffd26..94a715fa7 100644 --- a/src/Bloc/BlLayoutExactResizer.class.st +++ b/src/Bloc/BlLayoutExactResizer.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlLayoutExactResizer', - #superclass : 'BlLayoutResizer', + #name : #BlLayoutExactResizer, + #superclass : #BlLayoutResizer, #instVars : [ 'size' ], @@ -9,12 +9,10 @@ Class { 'fifty', 'hundred' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlLayoutExactResizer class >> cleanUp [ super cleanUp. @@ -23,17 +21,17 @@ BlLayoutExactResizer class >> cleanUp [ hundred := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer class >> fifty [ ^ fifty ifNil: [ fifty := self new size: 50.0 ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer class >> hundred [ ^ hundred ifNil: [ hundred := self new size: 100.0 ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer class >> size: aNumber [ aNumber isZero ifTrue: [ ^ self zero ]. @@ -49,12 +47,12 @@ BlLayoutExactResizer class >> size: aNumber [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer class >> zero [ ^ zero ifNil: [ zero := self new size: 0.0 ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlLayoutExactResizer >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -63,22 +61,22 @@ BlLayoutExactResizer >> = anObject [ ^ self size = anObject size ] -{ #category : 'comparing' } +{ #category : #comparing } BlLayoutExactResizer >> hash [ ^ super hash bitXor: self size hash ] -{ #category : 'controlling' } +{ #category : #controlling } BlLayoutExactResizer >> ifExact: aBlock [ ^ aBlock cull: self ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutExactResizer >> isExact [ ^ true ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutExactResizer >> measurementAtMostWith: aNumber [ "Parent has imposed a maximum size on us. Child wants a specific size... so be it" @@ -86,7 +84,7 @@ BlLayoutExactResizer >> measurementAtMostWith: aNumber [ ^ BlMeasurementSpec exact: self size ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutExactResizer >> measurementExactlyWith: aNumber [ "Parent has imposed an exact size on us" @@ -94,7 +92,7 @@ BlLayoutExactResizer >> measurementExactlyWith: aNumber [ ^ BlMeasurementSpec exact: self size ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutExactResizer >> measurementUnspecifiedWith: aNumber [ "Child wants a specific size... let it have it" @@ -102,31 +100,31 @@ BlLayoutExactResizer >> measurementUnspecifiedWith: aNumber [ ^ BlMeasurementSpec exact: self size ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutExactResizer >> printOn: aStream [ aStream nextPutAll: 'Exact '; nextPutAll: self size asString ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer >> requestedHeightIn: anElement [ ^ self size ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer >> requestedWidthIn: anElement [ ^ self size ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer >> size [ ^ size ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutExactResizer >> size: aNumber [ "aNumber should satisfy #isBlocFiniteFloat and #isBlocPositiveFloat" diff --git a/src/Bloc/BlLayoutFitContentLimitedOffsetResizer.class.st b/src/Bloc/BlLayoutFitContentLimitedOffsetResizer.class.st index 3297a34e4..19d1837fa 100644 --- a/src/Bloc/BlLayoutFitContentLimitedOffsetResizer.class.st +++ b/src/Bloc/BlLayoutFitContentLimitedOffsetResizer.class.st @@ -1,42 +1,40 @@ Class { - #name : 'BlLayoutFitContentLimitedOffsetResizer', - #superclass : 'BlLayoutFitContentLimitedResizer', + #name : #BlLayoutFitContentLimitedOffsetResizer, + #superclass : #BlLayoutFitContentLimitedResizer, #instVars : [ 'offset' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutFitContentLimitedOffsetResizer class >> offset: aNumber [ ^ self new offset: aNumber; yourself ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentLimitedOffsetResizer >> measurementAtMostWith: aNumber [ ^ super measurementAtMostWith: aNumber - offset ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentLimitedOffsetResizer >> measurementExactlyWith: aNumber [ ^ super measurementExactlyWith: aNumber - offset ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutFitContentLimitedOffsetResizer >> offset [ ^ offset ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutFitContentLimitedOffsetResizer >> offset: anObject [ offset := anObject ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutFitContentLimitedOffsetResizer >> printOn: aStream [ aStream nextPutAll: 'Fit content limited offset: '. offset printOn: aStream diff --git a/src/Bloc/BlLayoutFitContentLimitedResizer.class.st b/src/Bloc/BlLayoutFitContentLimitedResizer.class.st index 3aae589f7..30958aa32 100644 --- a/src/Bloc/BlLayoutFitContentLimitedResizer.class.st +++ b/src/Bloc/BlLayoutFitContentLimitedResizer.class.st @@ -1,42 +1,40 @@ Class { - #name : 'BlLayoutFitContentLimitedResizer', - #superclass : 'BlLayoutResizer', + #name : #BlLayoutFitContentLimitedResizer, + #superclass : #BlLayoutResizer, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlLayoutFitContentLimitedResizer class >> cleanUp [ super cleanUp. uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutFitContentLimitedResizer class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'controlling' } +{ #category : #controlling } BlLayoutFitContentLimitedResizer >> ifFitContent: aBlock [ ^ aBlock cull: self ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutFitContentLimitedResizer >> isFitContent [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutFitContentLimitedResizer >> isFitContentLimited [ ^ true ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentLimitedResizer >> measurementAtMostWith: aNumber [ "Child wants to determine its own size. It can't be bigger than us." @@ -44,7 +42,7 @@ BlLayoutFitContentLimitedResizer >> measurementAtMostWith: aNumber [ ^ BlMeasurementSpec new beAtMost: aNumber ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentLimitedResizer >> measurementExactlyWith: aNumber [ "Child wants to determine its own size. It can't be bigger than us." @@ -52,7 +50,7 @@ BlLayoutFitContentLimitedResizer >> measurementExactlyWith: aNumber [ ^ BlMeasurementSpec new beAtMost: aNumber ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentLimitedResizer >> measurementUnspecifiedWith: aNumber [ "Child wants to determine its own size.... find out how big it should be" @@ -60,7 +58,7 @@ BlLayoutFitContentLimitedResizer >> measurementUnspecifiedWith: aNumber [ ^ BlMeasurementSpec unspecified: aNumber ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutFitContentLimitedResizer >> printOn: aStream [ aStream nextPutAll: 'Fit content limited' ] diff --git a/src/Bloc/BlLayoutFitContentResizer.class.st b/src/Bloc/BlLayoutFitContentResizer.class.st index 3a6aea631..34bc6a0a7 100644 --- a/src/Bloc/BlLayoutFitContentResizer.class.st +++ b/src/Bloc/BlLayoutFitContentResizer.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlLayoutFitContentResizer', - #superclass : 'BlLayoutResizer', + #name : #BlLayoutFitContentResizer, + #superclass : #BlLayoutResizer, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlLayoutFitContentResizer class >> cleanUp [ super cleanUp. uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutFitContentResizer class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'controlling' } +{ #category : #controlling } BlLayoutFitContentResizer >> ifFitContent: aBlock [ ^ aBlock cull: self ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutFitContentResizer >> isFitContent [ ^ true ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentResizer >> measurementAtMostWith: aNumber [ "Child wants to determine its own size. It may be bigger than us." @@ -39,7 +37,7 @@ BlLayoutFitContentResizer >> measurementAtMostWith: aNumber [ ^ BlMeasurementSpec unspecified ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentResizer >> measurementExactlyWith: aNumber [ "Child wants to determine its own size. It may be bigger than us." @@ -47,7 +45,7 @@ BlLayoutFitContentResizer >> measurementExactlyWith: aNumber [ ^ BlMeasurementSpec unspecified ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutFitContentResizer >> measurementUnspecifiedWith: aNumber [ "Child wants to determine its own size.... find out how big it should be" @@ -55,12 +53,12 @@ BlLayoutFitContentResizer >> measurementUnspecifiedWith: aNumber [ ^ BlMeasurementSpec unspecified: aNumber ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutFitContentResizer >> printOn: aStream [ aStream nextPutAll: 'Fit content' ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutFitContentResizer >> requestedHeightIn: anElement [ | h | @@ -70,7 +68,7 @@ BlLayoutFitContentResizer >> requestedHeightIn: anElement [ ^ h ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutFitContentResizer >> requestedWidthIn: anElement [ | w | diff --git a/src/Bloc/BlLayoutGraphConnectedEdges.class.st b/src/Bloc/BlLayoutGraphConnectedEdges.class.st index e826bea1e..8ff643cb3 100644 --- a/src/Bloc/BlLayoutGraphConnectedEdges.class.st +++ b/src/Bloc/BlLayoutGraphConnectedEdges.class.st @@ -1,24 +1,22 @@ Class { - #name : 'BlLayoutGraphConnectedEdges', - #superclass : 'BlLayoutGraphEdgesIterator', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutGraphConnectedEdges, + #superclass : #BlLayoutGraphEdgesIterator, + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlLayoutGraphConnectedEdges >> do: aBlock [ "Evaluate a given block with all connected edges of the graph element" self layoutNode connectedEdges do: aBlock ] -{ #category : 'api - iterator' } +{ #category : #'api - iterator' } BlLayoutGraphConnectedEdges >> incoming [ ^ BlLayoutGraphIncomingEdges on: self layoutNode ] -{ #category : 'api - iterator' } +{ #category : #'api - iterator' } BlLayoutGraphConnectedEdges >> outgoing [ ^ BlLayoutGraphOutgoingEdges on: self layoutNode ] diff --git a/src/Bloc/BlLayoutGraphConnectedNodes.class.st b/src/Bloc/BlLayoutGraphConnectedNodes.class.st index 89fa807a5..9498511d0 100644 --- a/src/Bloc/BlLayoutGraphConnectedNodes.class.st +++ b/src/Bloc/BlLayoutGraphConnectedNodes.class.st @@ -1,20 +1,18 @@ Class { - #name : 'BlLayoutGraphConnectedNodes', - #superclass : 'BlLayoutGraphIterator', + #name : #BlLayoutGraphConnectedNodes, + #superclass : #BlLayoutGraphIterator, #instVars : [ 'edges' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutGraphConnectedNodes class >> on: aLayoutNode from: theLayoutEdges [ ^ (self on: aLayoutNode) initializeWith: theLayoutEdges ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlLayoutGraphConnectedNodes >> do: aBlock [ edges do: [ :eachLayoutEdge | "we don't want to include a node from which we asked for edges" @@ -24,7 +22,7 @@ BlLayoutGraphConnectedNodes >> do: aBlock [ ifTrue: [ aBlock value: eachLayoutEdge toNode ] ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutGraphConnectedNodes >> initializeWith: theLayoutEdges [ edges := theLayoutEdges ] diff --git a/src/Bloc/BlLayoutGraphEdgesIterator.class.st b/src/Bloc/BlLayoutGraphEdgesIterator.class.st index 67f3ce722..adf0994fa 100644 --- a/src/Bloc/BlLayoutGraphEdgesIterator.class.st +++ b/src/Bloc/BlLayoutGraphEdgesIterator.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlLayoutGraphEdgesIterator', - #superclass : 'BlLayoutGraphIterator', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutGraphEdgesIterator, + #superclass : #BlLayoutGraphIterator, + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlLayoutGraphEdgesIterator >> do: aBlock [ "Evaluate a given block with all iterator items" ^ self subclassResponsibility ] -{ #category : 'api - iterator' } +{ #category : #'api - iterator' } BlLayoutGraphEdgesIterator >> nodes [ ^ BlLayoutGraphConnectedNodes on: self layoutNode from: self ] diff --git a/src/Bloc/BlLayoutGraphIncomingEdges.class.st b/src/Bloc/BlLayoutGraphIncomingEdges.class.st index f7b990634..408cfcd1a 100644 --- a/src/Bloc/BlLayoutGraphIncomingEdges.class.st +++ b/src/Bloc/BlLayoutGraphIncomingEdges.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlLayoutGraphIncomingEdges', - #superclass : 'BlLayoutGraphEdgesIterator', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutGraphIncomingEdges, + #superclass : #BlLayoutGraphEdgesIterator, + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlLayoutGraphIncomingEdges >> do: aBlock [ "Evaluate a given block with all incoming edges to the layout node" diff --git a/src/Bloc/BlLayoutGraphIterator.class.st b/src/Bloc/BlLayoutGraphIterator.class.st index 5b837e58a..6908db92f 100644 --- a/src/Bloc/BlLayoutGraphIterator.class.st +++ b/src/Bloc/BlLayoutGraphIterator.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlLayoutGraphIterator', - #superclass : 'Object', + #name : #BlLayoutGraphIterator, + #superclass : #Object, #instVars : [ 'layoutNode' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutGraphIterator class >> new [ self error: '(Use on: instead) I must be always created in a context of a layout node' ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutGraphIterator class >> on: aBlLayoutChildNode [ ^ self basicNew initialize; layoutNode: aBlLayoutChildNode ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlLayoutGraphIterator >> asArray [ "Return a collection of all items enumerable by this iterator" @@ -29,14 +27,14 @@ BlLayoutGraphIterator >> asArray [ ^ Array streamContents: [ :aStream | self do: [ :anObject | aStream nextPut: anObject ] ] ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlLayoutGraphIterator >> do: aBlock [ "Evaluate a given block with all iterator items" ^ self subclassResponsibility ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlLayoutGraphIterator >> hasAny [ "Return true if I have any items" @@ -45,7 +43,7 @@ BlLayoutGraphIterator >> hasAny [ ^ false ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlLayoutGraphIterator >> hasNone [ "Return true if I don't have any items, false otherwise" @@ -54,33 +52,33 @@ BlLayoutGraphIterator >> hasNone [ ^ true ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlLayoutGraphIterator >> isEmpty [ ^ self hasNone ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlLayoutGraphIterator >> isNotEmpty [ ^ self hasAny ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutGraphIterator >> layoutNode [ ^ layoutNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutGraphIterator >> layoutNode: aBlLayoutChildNode [ layoutNode := aBlLayoutChildNode ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlLayoutGraphIterator >> select: selectBlock thenDo: doBlock [ "Utility method to improve readability. Do not create the intermediate collection." @@ -90,7 +88,7 @@ BlLayoutGraphIterator >> select: selectBlock thenDo: doBlock [ ifTrue: [ doBlock value: anElement ] ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlLayoutGraphIterator >> size [ "Return amount of items that can be returned by this iterator. Please note, I have to iterate over all items, so complexity is linear" diff --git a/src/Bloc/BlLayoutGraphOutgoingEdges.class.st b/src/Bloc/BlLayoutGraphOutgoingEdges.class.st index 3388e3449..2c92e3b4d 100644 --- a/src/Bloc/BlLayoutGraphOutgoingEdges.class.st +++ b/src/Bloc/BlLayoutGraphOutgoingEdges.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlLayoutGraphOutgoingEdges', - #superclass : 'BlLayoutGraphEdgesIterator', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutGraphOutgoingEdges, + #superclass : #BlLayoutGraphEdgesIterator, + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlLayoutGraphOutgoingEdges >> do: aBlock [ "Evaluate a given block with all outgoing edges to the layout node" diff --git a/src/Bloc/BlLayoutHorizontal.class.st b/src/Bloc/BlLayoutHorizontal.class.st index 4aa3d790c..8be0168f2 100644 --- a/src/Bloc/BlLayoutHorizontal.class.st +++ b/src/Bloc/BlLayoutHorizontal.class.st @@ -3,24 +3,22 @@ I am a concrete horizontal orientation " Class { - #name : 'BlLayoutHorizontal', - #superclass : 'BlLayoutOrientation', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #name : #BlLayoutHorizontal, + #superclass : #BlLayoutOrientation, + #category : 'Bloc-Layouts-Support' } -{ #category : 'testing' } +{ #category : #testing } BlLayoutHorizontal >> isHorizontal [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutHorizontal >> isVertical [ ^ false ] -{ #category : 'dispatch' } +{ #category : #dispatch } BlLayoutHorizontal >> of: anObject [ ^ anObject horizontal ] diff --git a/src/Bloc/BlLayoutLeftToRight.class.st b/src/Bloc/BlLayoutLeftToRight.class.st index d103e24f5..3b5a2fccf 100644 --- a/src/Bloc/BlLayoutLeftToRight.class.st +++ b/src/Bloc/BlLayoutLeftToRight.class.st @@ -3,40 +3,38 @@ I am a concrete left-to-right direction " Class { - #name : 'BlLayoutLeftToRight', - #superclass : 'BlLayoutDirection', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #name : #BlLayoutLeftToRight, + #superclass : #BlLayoutDirection, + #category : 'Bloc-Layouts-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutLeftToRight >> inverted [ ^ self class rightToLeft ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutLeftToRight >> isLeftToRight [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutLeftToRight >> isRightToLeft [ ^ false ] -{ #category : 'dispatch' } +{ #category : #dispatch } BlLayoutLeftToRight >> of: anObject [ ^ anObject leftToRight ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlLayoutLeftToRight >> with: aCollection do: aBlock [ aCollection do: aBlock ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlLayoutLeftToRight >> with: aCollection inject: thisValue into: binaryBlock [ ^ aCollection inject: thisValue into: binaryBlock ] diff --git a/src/Bloc/BlLayoutMatchParentResizer.class.st b/src/Bloc/BlLayoutMatchParentResizer.class.st index 45a0ada33..fe4d55dfa 100644 --- a/src/Bloc/BlLayoutMatchParentResizer.class.st +++ b/src/Bloc/BlLayoutMatchParentResizer.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlLayoutMatchParentResizer', - #superclass : 'BlLayoutResizer', + #name : #BlLayoutMatchParentResizer, + #superclass : #BlLayoutResizer, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlLayoutMatchParentResizer class >> cleanUp [ super cleanUp. uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutMatchParentResizer class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'controlling' } +{ #category : #controlling } BlLayoutMatchParentResizer >> ifMatchParent: aBlock [ ^ aBlock cull: self ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutMatchParentResizer >> isMatchParent [ ^ true ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutMatchParentResizer >> measurementAtMostWith: aNumber [ "Child wants to be our size, but our size is not fixed. Constrain child to not be bigger than us." @@ -39,7 +37,7 @@ BlLayoutMatchParentResizer >> measurementAtMostWith: aNumber [ ^ BlMeasurementSpec new beAtMost: aNumber ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutMatchParentResizer >> measurementExactlyWith: aNumber [ "Parent has imposed an exact size on us, child wants to be our size. So be it." @@ -47,7 +45,7 @@ BlLayoutMatchParentResizer >> measurementExactlyWith: aNumber [ ^ BlMeasurementSpec new beExact: aNumber ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutMatchParentResizer >> measurementUnspecifiedWith: aNumber [ "Child wants to be our size... find out how big it should be" @@ -55,19 +53,19 @@ BlLayoutMatchParentResizer >> measurementUnspecifiedWith: aNumber [ ^ BlMeasurementSpec unspecified: aNumber ] -{ #category : 'printing' } +{ #category : #printing } BlLayoutMatchParentResizer >> printOn: aStream [ aStream nextPutAll: 'Match parent' ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutMatchParentResizer >> requestedHeightIn: anElement [ anElement parent ifNil: [^ anElement height]. ^ anElement parent requestedHeightIn: anElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutMatchParentResizer >> requestedWidthIn: anElement [ anElement parent ifNil: [^ anElement width]. diff --git a/src/Bloc/BlLayoutNode.class.st b/src/Bloc/BlLayoutNode.class.st index 893589d3e..88ad53072 100644 --- a/src/Bloc/BlLayoutNode.class.st +++ b/src/Bloc/BlLayoutNode.class.st @@ -4,9 +4,7 @@ Is a node that is laied out by {{gtClass:BlLayout}} " Class { - #name : 'BlLayoutNode', - #superclass : 'Object', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutNode, + #superclass : #Object, + #category : 'Bloc-Layouts-Model' } diff --git a/src/Bloc/BlLayoutNodeChildren.class.st b/src/Bloc/BlLayoutNodeChildren.class.st index 0ca3db2c8..ec2ed62ea 100644 --- a/src/Bloc/BlLayoutNodeChildren.class.st +++ b/src/Bloc/BlLayoutNodeChildren.class.st @@ -1,13 +1,11 @@ Class { - #name : 'BlLayoutNodeChildren', - #superclass : 'Array', - #type : 'variable', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutNodeChildren, + #superclass : #Array, + #type : #variable, + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutNodeChildren >> boundingBox [ | aBoundingBox | @@ -25,17 +23,17 @@ BlLayoutNodeChildren >> boundingBox [ ^ aBoundingBox expanded asRectangle ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutNodeChildren >> extent [ ^ self collect: [ :eachChild | eachChild extent ] as: Array ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutNodeChildren >> layoutBounds [ ^ self collect: [ :eachChild | eachChild layoutBounds asRectangle ] as: Array ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutNodeChildren >> normalizePositions [ | theTopLeft | @@ -48,17 +46,17 @@ BlLayoutNodeChildren >> normalizePositions [ self do: [ :eachNode | eachNode position: eachNode position - theTopLeft ] ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutNodeChildren >> roundPositions [ self do: [ :eachNode | eachNode position: eachNode position rounded ] ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutNodeChildren >> withoutElement [ ^ self collect: [ :eachNode | eachNode withoutElement ] ] -{ #category : 'converting' } +{ #category : #converting } BlLayoutNodeChildren >> withoutTransformation [ ^ self collect: [ :eachNode | eachNode withoutTransformation ] ] diff --git a/src/Bloc/BlLayoutNodeComputedMeasurement.class.st b/src/Bloc/BlLayoutNodeComputedMeasurement.class.st index 753598b9f..f299b0af0 100644 --- a/src/Bloc/BlLayoutNodeComputedMeasurement.class.st +++ b/src/Bloc/BlLayoutNodeComputedMeasurement.class.st @@ -1,45 +1,43 @@ Class { - #name : 'BlLayoutNodeComputedMeasurement', - #superclass : 'BlLayoutNodeMeasurement', + #name : #BlLayoutNodeComputedMeasurement, + #superclass : #BlLayoutNodeMeasurement, #instVars : [ 'position', 'extent' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeComputedMeasurement >> extent [ ^ extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeComputedMeasurement >> extent: anObject [ extent := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutNodeComputedMeasurement >> initialize [ super initialize. position := 0.0@0.0 ] -{ #category : 'measure' } +{ #category : #measure } BlLayoutNodeComputedMeasurement >> measure: aLayoutChildNode with: anExtentSpecOrBlock [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeComputedMeasurement >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeComputedMeasurement >> position: aPoint [ position := aPoint ] diff --git a/src/Bloc/BlLayoutNodeElementAction.class.st b/src/Bloc/BlLayoutNodeElementAction.class.st index 8eedd15fa..986ff07d9 100644 --- a/src/Bloc/BlLayoutNodeElementAction.class.st +++ b/src/Bloc/BlLayoutNodeElementAction.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlLayoutNodeElementAction', - #superclass : 'Object', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutNodeElementAction, + #superclass : #Object, + #category : 'Bloc-Layouts-Model' } -{ #category : 'evaluating' } +{ #category : #evaluating } BlLayoutNodeElementAction >> laidOut: aChildNode element: anElement [ ] -{ #category : 'evaluating' } +{ #category : #evaluating } BlLayoutNodeElementAction >> measured: aChildNode element: anElement [ ] diff --git a/src/Bloc/BlLayoutNodeElementMeasurement.class.st b/src/Bloc/BlLayoutNodeElementMeasurement.class.st index d006ee92a..6ae1d7e94 100644 --- a/src/Bloc/BlLayoutNodeElementMeasurement.class.st +++ b/src/Bloc/BlLayoutNodeElementMeasurement.class.st @@ -3,27 +3,25 @@ Let's the layout know that the node should be measurement during the first pass " Class { - #name : 'BlLayoutNodeElementMeasurement', - #superclass : 'BlLayoutNodeMeasurement', + #name : #BlLayoutNodeElementMeasurement, + #superclass : #BlLayoutNodeMeasurement, #instVars : [ 'element' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeElementMeasurement >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeElementMeasurement >> element: anObject [ element := anObject ] -{ #category : 'measure' } +{ #category : #measure } BlLayoutNodeElementMeasurement >> measure: aLayoutChildNode with: anExtentSpecOrBlock [ diff --git a/src/Bloc/BlLayoutNodeMeasurement.class.st b/src/Bloc/BlLayoutNodeMeasurement.class.st index c5c911e27..3f2381a5e 100644 --- a/src/Bloc/BlLayoutNodeMeasurement.class.st +++ b/src/Bloc/BlLayoutNodeMeasurement.class.st @@ -1,29 +1,27 @@ Class { - #name : 'BlLayoutNodeMeasurement', - #superclass : 'Object', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutNodeMeasurement, + #superclass : #Object, + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeMeasurement >> bounds [ ^ BlBounds origin: self position extent: self extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeMeasurement >> extent [ ^ 0@0 ] -{ #category : 'measure' } +{ #category : #measure } BlLayoutNodeMeasurement >> measure: aLayoutChildNode with: anExtentSpecOrBlock [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutNodeMeasurement >> position [ ^ 0@0 ] diff --git a/src/Bloc/BlLayoutNodeNullMeasurement.class.st b/src/Bloc/BlLayoutNodeNullMeasurement.class.st index 5cb530284..0b6d31657 100644 --- a/src/Bloc/BlLayoutNodeNullMeasurement.class.st +++ b/src/Bloc/BlLayoutNodeNullMeasurement.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlLayoutNodeNullMeasurement', - #superclass : 'BlLayoutNodeMeasurement', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutNodeNullMeasurement, + #superclass : #BlLayoutNodeMeasurement, + #category : 'Bloc-Layouts-Model' } -{ #category : 'measure' } +{ #category : #measure } BlLayoutNodeNullMeasurement >> measure: aLayoutChildNode with: anExtentSpecOrBlock [ diff --git a/src/Bloc/BlLayoutNodeResizerMeasurement.class.st b/src/Bloc/BlLayoutNodeResizerMeasurement.class.st index 4c1fe9a30..bb9099dce 100644 --- a/src/Bloc/BlLayoutNodeResizerMeasurement.class.st +++ b/src/Bloc/BlLayoutNodeResizerMeasurement.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlLayoutNodeResizerMeasurement', - #superclass : 'BlLayoutNodeMeasurement', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #BlLayoutNodeResizerMeasurement, + #superclass : #BlLayoutNodeMeasurement, + #category : 'Bloc-Layouts-Model' } -{ #category : 'measure' } +{ #category : #measure } BlLayoutNodeResizerMeasurement >> measure: aLayoutChildNode with: anExtentSpecOrBlock [ | anExtentSpec width measuredWidth height measuredHeight | diff --git a/src/Bloc/BlLayoutOrientation.class.st b/src/Bloc/BlLayoutOrientation.class.st index b43c13922..f6fe392bf 100644 --- a/src/Bloc/BlLayoutOrientation.class.st +++ b/src/Bloc/BlLayoutOrientation.class.st @@ -6,23 +6,21 @@ I do not have any logic and can only used as orientation flag. Layouts that have " Class { - #name : 'BlLayoutOrientation', - #superclass : 'Object', + #name : #BlLayoutOrientation, + #superclass : #Object, #classVars : [ 'horizontal', 'vertical' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'factory' } +{ #category : #factory } BlLayoutOrientation class >> horizontal [ ^ horizontal ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlLayoutOrientation class >> initialize [ super initialize. @@ -30,22 +28,22 @@ BlLayoutOrientation class >> initialize [ vertical := BlLayoutVertical new ] -{ #category : 'factory' } +{ #category : #factory } BlLayoutOrientation class >> vertical [ ^ vertical ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutOrientation >> isHorizontal [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutOrientation >> isVertical [ ^ self subclassResponsibility ] -{ #category : 'dispatch' } +{ #category : #dispatch } BlLayoutOrientation >> of: anObject [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlLayoutParentNode.class.st b/src/Bloc/BlLayoutParentNode.class.st index 2a6128cb6..03f432e55 100644 --- a/src/Bloc/BlLayoutParentNode.class.st +++ b/src/Bloc/BlLayoutParentNode.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlLayoutParentNode', - #superclass : 'BlLayoutNode', + #name : #BlLayoutParentNode, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutParentNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutParentNode classTrait', #instVars : [ @@ -10,12 +10,10 @@ Class { 'extent', 'position' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutParentNode class >> alreadyMeasured: aBlElement [ ^ self new constraints: aBlElement constraints; @@ -37,7 +35,7 @@ BlLayoutParentNode class >> alreadyMeasured: aBlElement [ eachNode withElement: eachChild ]) ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutParentNode class >> alreadyMeasuredWithoutTransformation: aBlElement [ ^ self new constraints: aBlElement constraints; @@ -50,7 +48,7 @@ BlLayoutParentNode class >> alreadyMeasuredWithoutTransformation: aBlElement [ extent: eachChild measuredExtent)) withElement: eachChild ]) ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutParentNode class >> getParentTransformation: anElement [ | aTransformation | @@ -65,7 +63,7 @@ BlLayoutParentNode class >> getParentTransformation: anElement [ ^ aTransformation ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutParentNode class >> getTransformation: anElement [ | aTransformation | @@ -79,7 +77,7 @@ BlLayoutParentNode class >> getTransformation: anElement [ ^ aTransformation ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutParentNode class >> toMeasure: aBlElement [ | anElementTransformation aParentNode | @@ -107,50 +105,50 @@ BlLayoutParentNode class >> toMeasure: aBlElement [ ^ aParentNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> children [ ^ children ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> children: aCollectionOfChildNodes [ children := aCollectionOfChildNodes as: BlLayoutNodeChildren. children do: [ :eachChild | eachChild parent: self parent ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> constraints [ ^ constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> constraints: aBlLayoutConstraints [ constraints := aBlLayoutConstraints ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNode >> extent [ ^ extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNode >> extent: aPoint [ extent := aPoint ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } BlLayoutParentNode >> extentSpec [ ^ extentSpec ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> extentSpec: anObject [ extentSpec := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlLayoutParentNode >> initialize [ super initialize. @@ -159,26 +157,26 @@ BlLayoutParentNode >> initialize [ extent := 0.0@0.0. ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> parent [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> position: aPoint [ position := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNode >> transformationDo: aBlock [ ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlLayoutParentNode >> withFilter: aSelectBlock [ ^ BlLayoutParentNodeWithFilter new parentNode: self; @@ -186,7 +184,7 @@ BlLayoutParentNode >> withFilter: aSelectBlock [ children: (self children select: aSelectBlock) ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlLayoutParentNode >> withTransformation: aBlElementTransformation [ ^ BlLayoutParentNodeWithTransformation new parentNode: self; diff --git a/src/Bloc/BlLayoutParentNodeWithEdges.class.st b/src/Bloc/BlLayoutParentNodeWithEdges.class.st index c644b21c9..3d1f10c84 100644 --- a/src/Bloc/BlLayoutParentNodeWithEdges.class.st +++ b/src/Bloc/BlLayoutParentNodeWithEdges.class.st @@ -1,93 +1,91 @@ Class { - #name : 'BlLayoutParentNodeWithEdges', - #superclass : 'BlLayoutNode', + #name : #BlLayoutParentNodeWithEdges, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutParentNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutParentNode classTrait', #instVars : [ 'parentNode', 'children' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> children [ ^ children ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> children: aBlLayoutNodeChildren [ children := aBlLayoutNodeChildren as: BlLayoutNodeChildren. children do: [ :eachChild | eachChild parent: self parent ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> constraints [ ^ parentNode constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> constraints: aBlLayoutConstraints [ parentNode constraints: aBlLayoutConstraints ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNodeWithEdges >> extent [ ^ parentNode extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNodeWithEdges >> extent: aPoint [ parentNode extent: aPoint ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } BlLayoutParentNodeWithEdges >> extentSpec [ ^ parentNode extentSpec ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } BlLayoutParentNodeWithEdges >> extentSpec: aBlExtentMeasurementSpec [ parentNode extentSpec: aBlExtentMeasurementSpec ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> parent [ ^ parentNode parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> parentNode [ ^ parentNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> parentNode: anObject [ parentNode := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> position [ ^ parentNode position ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> position: aPoint [ parentNode position: aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithEdges >> transformationDo: aBlock [ parentNode transformationDo: aBlock ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlLayoutParentNodeWithEdges >> withFilter: aSelectBlock [ ^ BlLayoutParentNodeWithFilter new parentNode: self; diff --git a/src/Bloc/BlLayoutParentNodeWithFilter.class.st b/src/Bloc/BlLayoutParentNodeWithFilter.class.st index a97672fd4..d1bc2adf2 100644 --- a/src/Bloc/BlLayoutParentNodeWithFilter.class.st +++ b/src/Bloc/BlLayoutParentNodeWithFilter.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlLayoutParentNodeWithFilter', - #superclass : 'BlLayoutNode', + #name : #BlLayoutParentNodeWithFilter, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutParentNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutParentNode classTrait', #instVars : [ @@ -8,92 +8,90 @@ Class { 'filter', 'children' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> children [ ^ children ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> children: aBlLayoutNodeChildren [ children := aBlLayoutNodeChildren as: BlLayoutNodeChildren. children do: [ :eachChild | eachChild parent: self parent ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> constraints [ ^ parentNode constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> constraints: aBlLayoutConstraints [ parentNode constraints: aBlLayoutConstraints ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNodeWithFilter >> extent [ ^ parentNode extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNodeWithFilter >> extent: aPoint [ parentNode extent: aPoint ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } BlLayoutParentNodeWithFilter >> extentSpec [ ^ parentNode extentSpec ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } BlLayoutParentNodeWithFilter >> extentSpec: aBlExtentMeasurementSpec [ parentNode extentSpec: aBlExtentMeasurementSpec ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> filterBlock: aBlockClosure [ filter := aBlockClosure ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> parent [ ^ parentNode parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> parentNode [ ^ parentNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> parentNode: anObject [ parentNode := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> position [ ^ parentNode position ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> position: aPoint [ parentNode position: aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithFilter >> transformationDo: aBlock [ parentNode transformationDo: aBlock ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlLayoutParentNodeWithFilter >> withFilter: aSelectBlockOrFilterObject [ "implement filter as an object to support comparison and not filter twice" filter = aSelectBlockOrFilterObject diff --git a/src/Bloc/BlLayoutParentNodeWithTransformation.class.st b/src/Bloc/BlLayoutParentNodeWithTransformation.class.st index f22248ac4..4653195f0 100644 --- a/src/Bloc/BlLayoutParentNodeWithTransformation.class.st +++ b/src/Bloc/BlLayoutParentNodeWithTransformation.class.st @@ -1,45 +1,43 @@ Class { - #name : 'BlLayoutParentNodeWithTransformation', - #superclass : 'BlLayoutNode', + #name : #BlLayoutParentNodeWithTransformation, + #superclass : #BlLayoutNode, #traits : 'TBlLayoutNode + TBlLayoutParentNode', #classTraits : 'TBlLayoutNode classTrait + TBlLayoutParentNode classTrait', #instVars : [ 'parentNode', 'transformation' ], - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> children [ ^ parentNode children ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> children: aBlLayoutNodeChildren [ parentNode children: aBlLayoutNodeChildren ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> constraints [ ^ parentNode constraints ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> constraints: aBlLayoutConstraints [ parentNode constraints: aBlLayoutConstraints ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNodeWithTransformation >> extent [ ^ parentNode extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlLayoutParentNodeWithTransformation >> extent: aPoint [ parentNode extent: aPoint. @@ -47,39 +45,39 @@ BlLayoutParentNodeWithTransformation >> extent: aPoint [ (BlBounds origin: self position extent: aPoint) ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } BlLayoutParentNodeWithTransformation >> extentSpec [ ^ parentNode extentSpec ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } BlLayoutParentNodeWithTransformation >> extentSpec: aBlExtentMeasurementSpec [ parentNode extentSpec: aBlExtentMeasurementSpec ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> parent [ ^ parentNode parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> parentNode [ ^ parentNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> parentNode: anObject [ parentNode := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> position [ ^ parentNode position ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> position: aPoint [ parentNode position: aPoint. @@ -87,7 +85,7 @@ BlLayoutParentNodeWithTransformation >> position: aPoint [ (BlBounds origin: aPoint extent: self extent) ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> transformation [ self @@ -97,7 +95,7 @@ BlLayoutParentNodeWithTransformation >> transformation [ ^ transformation ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> transformation: aBlElementTransformation [ transformation := aBlElementTransformation asCachedTransformation @@ -107,12 +105,12 @@ BlLayoutParentNodeWithTransformation >> transformation: aBlElementTransformation extent: self extent) ] -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutParentNodeWithTransformation >> transformationDo: aBlock [ aBlock value: transformation ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlLayoutParentNodeWithTransformation >> withFilter: aSelectBlock [ ^ BlLayoutParentNodeWithFilter new parentNode: self; @@ -120,7 +118,7 @@ BlLayoutParentNodeWithTransformation >> withFilter: aSelectBlock [ children: (self children select: aSelectBlock) ] -{ #category : 'api - converting' } +{ #category : #'api - converting' } BlLayoutParentNodeWithTransformation >> withTransformation: aBlElementTransformation [ ^ BlLayoutParentNodeWithTransformation new parentNode: parentNode; diff --git a/src/Bloc/BlLayoutResizer.class.st b/src/Bloc/BlLayoutResizer.class.st index bd8fce0a5..fb565c4db 100644 --- a/src/Bloc/BlLayoutResizer.class.st +++ b/src/Bloc/BlLayoutResizer.class.st @@ -1,95 +1,93 @@ Class { - #name : 'BlLayoutResizer', - #superclass : 'Object', + #name : #BlLayoutResizer, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutResizer class >> exact: aNumber [ ^ BlLayoutExactResizer size: aNumber ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutResizer class >> fitContent [ ^ BlLayoutFitContentResizer uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutResizer class >> fitContentLimited [ ^ BlLayoutFitContentLimitedResizer uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutResizer class >> fitContentLimitedOffset: aNumber [ ^ BlLayoutFitContentLimitedOffsetResizer offset: aNumber ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLayoutResizer class >> matchParent [ ^ BlLayoutMatchParentResizer uniqueInstance ] -{ #category : 'comparing' } +{ #category : #comparing } BlLayoutResizer >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'comparing' } +{ #category : #comparing } BlLayoutResizer >> hash [ ^ self class hash ] -{ #category : 'controlling' } +{ #category : #controlling } BlLayoutResizer >> ifExact: aBlock [ ^ self ] -{ #category : 'controlling' } +{ #category : #controlling } BlLayoutResizer >> ifFitContent: aBlock [ ^ self ] -{ #category : 'controlling' } +{ #category : #controlling } BlLayoutResizer >> ifMatchParent: aBlock [ ^ self ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutResizer >> isExact [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutResizer >> isFitContent [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutResizer >> isFitContentLimited [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutResizer >> isMatchParent [ ^ false ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutResizer >> measurementAtMostWith: aNumber [ ^ self subclassResponsibility ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutResizer >> measurementExactlyWith: aNumber [ ^ self subclassResponsibility ] -{ #category : 'double dispatching' } +{ #category : #'double dispatching' } BlLayoutResizer >> measurementUnspecifiedWith: aNumber [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlLayoutRightToLeft.class.st b/src/Bloc/BlLayoutRightToLeft.class.st index bbdddf0d1..a5bb12ed5 100644 --- a/src/Bloc/BlLayoutRightToLeft.class.st +++ b/src/Bloc/BlLayoutRightToLeft.class.st @@ -3,40 +3,38 @@ I am a concrete right-to-left direction " Class { - #name : 'BlLayoutRightToLeft', - #superclass : 'BlLayoutDirection', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #name : #BlLayoutRightToLeft, + #superclass : #BlLayoutDirection, + #category : 'Bloc-Layouts-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlLayoutRightToLeft >> inverted [ ^ self class leftToRight ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutRightToLeft >> isLeftToRight [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutRightToLeft >> isRightToLeft [ ^ true ] -{ #category : 'dispatch' } +{ #category : #dispatch } BlLayoutRightToLeft >> of: anObject [ ^ anObject rightToLeft ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlLayoutRightToLeft >> with: aCollection do: aBlock [ aCollection reverseDo: aBlock ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlLayoutRightToLeft >> with: aCollection inject: thisValue into: binaryBlock [ "Reversed implementation of Collection>>#inject:into:" | nextValue | diff --git a/src/Bloc/BlLayoutVertical.class.st b/src/Bloc/BlLayoutVertical.class.st index c29e4e26f..a02793077 100644 --- a/src/Bloc/BlLayoutVertical.class.st +++ b/src/Bloc/BlLayoutVertical.class.st @@ -3,24 +3,22 @@ I am a concrete vertical orientation " Class { - #name : 'BlLayoutVertical', - #superclass : 'BlLayoutOrientation', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #name : #BlLayoutVertical, + #superclass : #BlLayoutOrientation, + #category : 'Bloc-Layouts-Support' } -{ #category : 'testing' } +{ #category : #testing } BlLayoutVertical >> isHorizontal [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlLayoutVertical >> isVertical [ ^ true ] -{ #category : 'dispatch' } +{ #category : #dispatch } BlLayoutVertical >> of: anObject [ ^ anObject vertical ] diff --git a/src/Bloc/BlLeftAlignment.class.st b/src/Bloc/BlLeftAlignment.class.st index bbdc2d81d..21f3ee1e7 100644 --- a/src/Bloc/BlLeftAlignment.class.st +++ b/src/Bloc/BlLeftAlignment.class.st @@ -4,39 +4,37 @@ See BlLayoutAlignment for more info. " Class { - #name : 'BlLeftAlignment', - #superclass : 'BlHorizontalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlLeftAlignment, + #superclass : #BlHorizontalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlLeftAlignment class >> initialize [ super initialize. ] -{ #category : 'factory' } +{ #category : #factory } BlLeftAlignment class >> leftToRight [ ^ self left ] -{ #category : 'factory' } +{ #category : #factory } BlLeftAlignment class >> rightToLeft [ ^ self right ] -{ #category : 'factory' } +{ #category : #factory } BlLeftAlignment >> inverted [ ^ BlElementAlignment vertical start ] -{ #category : 'factory' } +{ #category : #factory } BlLeftAlignment >> swap [ ^ BlElementAlignment right ] -{ #category : 'translation' } +{ #category : #translation } BlLeftAlignment >> translationOf: aBounds in: aContainerBounds [ diff --git a/src/Bloc/BlLine.class.st b/src/Bloc/BlLine.class.st index a2a8e4050..138a07942 100644 --- a/src/Bloc/BlLine.class.st +++ b/src/Bloc/BlLine.class.st @@ -3,19 +3,17 @@ I define a geometry of a straight line " Class { - #name : 'BlLine', - #superclass : 'BlLineGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlLine, + #superclass : #BlLineGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlLine class >> isDeprecated [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlLine >> intersectionWith: anotherSegment [ "Copied from LineSegment>>intersectionWith:" | det deltaPt alpha beta pt1Dir pt2Dir | diff --git a/src/Bloc/BlLineGeometry.class.st b/src/Bloc/BlLineGeometry.class.st index 39464aca4..cd148545b 100644 --- a/src/Bloc/BlLineGeometry.class.st +++ b/src/Bloc/BlLineGeometry.class.st @@ -2,25 +2,23 @@ I define a geometry of a straight line " Class { - #name : 'BlLineGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlLineGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'from', 'to' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLineGeometry class >> from: aFromPoint to: aToPoint [ ^ self new from: aFromPoint to: aToPoint ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlLineGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ "Answer whether aPoint is contained by this geometry" @@ -30,7 +28,7 @@ BlLineGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ within: aBlElement border width / 2 ] -{ #category : 'accessing' } +{ #category : #accessing } BlLineGeometry >> from [ "Return start location of the line in owner element's local coordinate system" @@ -38,12 +36,12 @@ BlLineGeometry >> from [ ^ from ] -{ #category : 'accessing' } +{ #category : #accessing } BlLineGeometry >> from: aPoint [ self from: aPoint to: to ] -{ #category : 'initialization' } +{ #category : #initialization } BlLineGeometry >> from: aFromPoint to: aToPoint [ (from = aFromPoint and: [ to = aToPoint ]) @@ -53,7 +51,7 @@ BlLineGeometry >> from: aFromPoint to: aToPoint [ to := aToPoint ] -{ #category : 'geometry' } +{ #category : #geometry } BlLineGeometry >> geometryBounds: aBlBounds [ ^ aBlBounds rectangle: @@ -62,19 +60,19 @@ BlLineGeometry >> geometryBounds: aBlBounds [ self to }) ] -{ #category : 'testing' } +{ #category : #testing } BlLineGeometry >> hasCaps [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlLineGeometry >> hasJoins [ ^ false ] -{ #category : 'initialization' } +{ #category : #initialization } BlLineGeometry >> initialize [ super initialize. @@ -82,12 +80,12 @@ BlLineGeometry >> initialize [ to := 0@0 ] -{ #category : 'geometry' } +{ #category : #geometry } BlLineGeometry >> matchExtent: aPoint [ extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlLineGeometry >> to [ "Return end location of the line in owner element's local coordinate system" @@ -95,7 +93,7 @@ BlLineGeometry >> to [ ^ to ] -{ #category : 'accessing' } +{ #category : #accessing } BlLineGeometry >> to: aPoint [ self from: from to: aPoint ] diff --git a/src/Bloc/BlLinearGradientPaint.class.st b/src/Bloc/BlLinearGradientPaint.class.st index 9c9158f8b..8d6a1db8a 100644 --- a/src/Bloc/BlLinearGradientPaint.class.st +++ b/src/Bloc/BlLinearGradientPaint.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlLinearGradientPaint', - #superclass : 'BlGradientPaint', + #name : #BlLinearGradientPaint, + #superclass : #BlGradientPaint, #instVars : [ 'start', 'end' ], - #category : 'Bloc-Paint', - #package : 'Bloc', - #tag : 'Paint' + #category : 'Bloc-Paint' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLinearGradientPaint class >> direction: aPoint [ "Create a linear gradient in a given direction" @@ -32,7 +30,7 @@ BlLinearGradientPaint class >> direction: aPoint [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLinearGradientPaint class >> horizontal [ "Create a horizontal linear gradient" @@ -42,7 +40,7 @@ BlLinearGradientPaint class >> horizontal [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlLinearGradientPaint class >> vertical [ "Create a vertical linear gradient" @@ -52,17 +50,17 @@ BlLinearGradientPaint class >> vertical [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlLinearGradientPaint >> end [ ^ end ] -{ #category : 'accessing' } +{ #category : #accessing } BlLinearGradientPaint >> end: aPoint [ end := aPoint ] -{ #category : 'geometry' } +{ #category : #geometry } BlLinearGradientPaint >> matchExtent: anExtent [ | aDirection aStart anEnd aDelta aScaleX aScaleY | @@ -90,12 +88,12 @@ BlLinearGradientPaint >> matchExtent: anExtent [ self end: anEnd - aDelta ] -{ #category : 'accessing' } +{ #category : #accessing } BlLinearGradientPaint >> start [ ^ start ] -{ #category : 'accessing' } +{ #category : #accessing } BlLinearGradientPaint >> start: aPoint [ start := aPoint ] diff --git a/src/Bloc/BlLinearInterpolator.class.st b/src/Bloc/BlLinearInterpolator.class.st index 6864c0298..fd8112f2c 100644 --- a/src/Bloc/BlLinearInterpolator.class.st +++ b/src/Bloc/BlLinearInterpolator.class.st @@ -3,14 +3,12 @@ I am an interpolator where the rate of change is constant " Class { - #name : 'BlLinearInterpolator', - #superclass : 'BlInterpolator', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlLinearInterpolator, + #superclass : #BlInterpolator, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlLinearInterpolator >> interpolate: aNumber [ "f(x) = x" diff --git a/src/Bloc/BlMatrix.class.st b/src/Bloc/BlMatrix.class.st index 38969749c..bf079acbe 100644 --- a/src/Bloc/BlMatrix.class.st +++ b/src/Bloc/BlMatrix.class.st @@ -3,28 +3,26 @@ I represent a transformation Matrix and define common API of 2D and 3D matrices " Class { - #name : 'BlMatrix', - #superclass : 'Object', + #name : #BlMatrix, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'comparing' } +{ #category : #comparing } BlMatrix >> = anObject [ self subclassResponsibility ] -{ #category : 'converting' } +{ #category : #converting } BlMatrix >> asMatrixCollection [ ^ self subclassResponsibility ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrix >> decomposition [ "Return a decomposition of the matrix" @@ -32,7 +30,7 @@ BlMatrix >> decomposition [ ^ self subclassResponsibility ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrix >> determinant [ "Compute and return my determinant" @@ -40,12 +38,12 @@ BlMatrix >> determinant [ ^ self subclassResponsibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlMatrix >> hash [ ^ self subclassResponsibility ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrix >> interpolate: aFactor to: anotherMatrix [ "Perform a matrix interpolation with a given factor" @@ -55,41 +53,41 @@ BlMatrix >> interpolate: aFactor to: anotherMatrix [ to: anotherMatrix decomposition) composition ] -{ #category : 'testing' } +{ #category : #testing } BlMatrix >> is2D [ "Return true if matrix is 2D, false otherwise" ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlMatrix >> isIdentity [ ^ self subclassResponsibility ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> multiplyBy: aMatrix [ "Perform a right multiplication by a given matrix" self subclassResponsibility ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> perspective: aDepth [ "Apply perspective by aDepth which should be positive" self subclassResponsibility ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> reflectBy: aDiagonalVector [ "Apply a reflection transformation given by a diagonal vector" self subclassResponsibility ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> rotateBy: aNumber [ "Apply a rotation transformation by a given amount of degrees around z-axis" @@ -98,28 +96,28 @@ BlMatrix >> rotateBy: aNumber [ around: BlVector zAxis ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> rotateByDegrees: aNumber around: aBlVector [ "Apply a rotation transformation by a given amount of degrees around a provided axis vector" self rotateByRadians: aNumber degreesToRadians around: aBlVector ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> rotateByRadians: aNumber around: aBlVector [ "Apply a rotation transformation by a given amount of radians around a provided axis vector" self subclassResponsibility ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> scaleBy: aBlVector [ "Apply a scaling defined by a given vector" self subclassResponsibility ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix >> transformBounds: aBlBounds [ "In-place transform given BlBounds according to my transformation. (local to global transformation)" @@ -128,7 +126,7 @@ BlMatrix >> transformBounds: aBlBounds [ ^ self subclassResponsibility ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix >> transformPoint2D: aPoint2D [ "Transform a given 2D point (either a ==Point== or ==BlPoint2D==). In any case return BlPoint2D" @@ -137,7 +135,7 @@ BlMatrix >> transformPoint2D: aPoint2D [ ^ self subclassResponsibility ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix >> transformPoint3D: aPoint3D [ "Transform a given 3D point according to this transformation matrix" @@ -145,7 +143,7 @@ BlMatrix >> transformPoint3D: aPoint3D [ ^ self subclassResponsibility ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix >> transformPoint4D: aPoint4D [ "Transform a given 4D point according to this transformation matrix" @@ -153,7 +151,7 @@ BlMatrix >> transformPoint4D: aPoint4D [ ^ self subclassResponsibility ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix >> transformPoint: aPoint [ "Transform a given point according to transformation matrix. I perform a double dispatch to handle 2D/3D/4D points and 2D/3D matrices" @@ -162,7 +160,7 @@ BlMatrix >> transformPoint: aPoint [ ^ aPoint transformedOn: self ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix >> translateBy: aBlVector [ "Apply a translation by a given vector" diff --git a/src/Bloc/BlMatrix2D.class.st b/src/Bloc/BlMatrix2D.class.st index 2338eb96f..0f956e737 100644 --- a/src/Bloc/BlMatrix2D.class.st +++ b/src/Bloc/BlMatrix2D.class.st @@ -10,8 +10,8 @@ My components are named according to mathematical convention: " Class { - #name : 'BlMatrix2D', - #superclass : 'BlMatrix', + #name : #BlMatrix2D, + #superclass : #BlMatrix, #instVars : [ 'x', 'y', @@ -20,12 +20,10 @@ Class { 'sx', 'sy' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix2D class >> reflection: aDiagonalVector [ "Return a matrix which corresponds to a reflection transformation with a given diagonal" @@ -34,7 +32,7 @@ BlMatrix2D class >> reflection: aDiagonalVector [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix2D class >> rotation: anAngle [ "Return a matrix which corresponds to a rotation transformation by given angle" @@ -43,7 +41,7 @@ BlMatrix2D class >> rotation: anAngle [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix2D class >> scale: aBlVector [ "Return a matrix which corresponds to a scale transformation by given factor" @@ -52,7 +50,7 @@ BlMatrix2D class >> scale: aBlVector [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix2D class >> shear: aCoefficientPoint [ "Return a matrix which corresponds to a shear transformation by given coefficient" @@ -61,7 +59,7 @@ BlMatrix2D class >> shear: aCoefficientPoint [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix2D class >> translation: aBlVector [ "Return a matrix which corresponds to a translation transformation by given factor" @@ -70,7 +68,7 @@ BlMatrix2D class >> translation: aBlVector [ yourself ] -{ #category : 'comparing' } +{ #category : #comparing } BlMatrix2D >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -86,7 +84,7 @@ BlMatrix2D >> = anObject [ and: [ self y = anObject y ] ] ] ] ] ] -{ #category : 'converting' } +{ #category : #converting } BlMatrix2D >> asMatrixCollection [ ^ Array2D rows: 3 columns: 3 contents: { sx . shx . x. @@ -95,7 +93,7 @@ BlMatrix2D >> asMatrixCollection [ } ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrix2D >> decomposition [ "Decompose this 2D Matrix into components and return a resulting decomposition. Based on https://drafts.csswg.org/css-transforms/#decomposing-a-2d-matrix" @@ -161,7 +159,7 @@ BlMatrix2D >> decomposition [ matrix: matrix ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrix2D >> determinant [ "Compute and return my determinant" @@ -169,7 +167,7 @@ BlMatrix2D >> determinant [ ^ (sx * sy) - (shy * shx) ] -{ #category : 'comparing' } +{ #category : #comparing } BlMatrix2D >> hash [ ^ ((((self sx hash bitXor: self shy hash) bitXor: self shx hash) @@ -178,7 +176,7 @@ BlMatrix2D >> hash [ bitXor: self y hash ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix2D >> initialize [ super initialize. @@ -190,7 +188,7 @@ BlMatrix2D >> initialize [ y := 0.0 ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrix2D >> inverse [ "In-place inverse me. Throw BlSingularMatrixError if matrix is singular (non-invertible or degenerate)" @@ -217,7 +215,7 @@ BlMatrix2D >> inverse [ y := inverseDeterminant * f ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrix2D >> inverted [ "Return a new instance that is my inverse. Signal a `BlSingularMatrixError` if matrix is singular (non-invertible or degenerate)" @@ -225,14 +223,14 @@ BlMatrix2D >> inverted [ ^ self copy inverse ] -{ #category : 'testing' } +{ #category : #testing } BlMatrix2D >> is2D [ "Return true if matrix is 2D, false otherwise" ^ true ] -{ #category : 'matrix - testing' } +{ #category : #'matrix - testing' } BlMatrix2D >> isIdentity [ "Return true if I represent an identity transformation, false otherwise" @@ -244,7 +242,7 @@ BlMatrix2D >> isIdentity [ y = 0.0 ] ] ] ] ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix2D >> matrix: aMatrix [ "Copy matrix values" @@ -256,7 +254,7 @@ BlMatrix2D >> matrix: aMatrix [ y := aMatrix y ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix2D >> multiplyBy: aMatrix2D [ "Perform a right multiplication by a given 2D matrix" | r11 r12 r21 r22 r31 r32 | @@ -276,17 +274,17 @@ BlMatrix2D >> multiplyBy: aMatrix2D [ y := r32 ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix2D >> perspective: aDepth [ "2D matrix does not have a perspective components" ] -{ #category : 'printing' } +{ #category : #printing } BlMatrix2D >> printOn: aStream [ aStream print: self asMatrixCollection ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix2D >> reflectBy: aDiagonalVector [ "Apply a reflection transformation given by a diagonal vector" @@ -294,7 +292,7 @@ BlMatrix2D >> reflectBy: aDiagonalVector [ self multiplyBy: (self class reflection: aDiagonalVector) ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix2D >> reflection: aDiagonalVector [ "Set me to be a 2D matrix representing a reflection defined by a given diagonal" @@ -306,7 +304,7 @@ BlMatrix2D >> reflection: aDiagonalVector [ shy := 0 ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix2D >> rotateByRadians: anAngle around: aBlVector [ "Apply a rotation transformation by a given amount of radians around a provided axis vector" self @@ -321,7 +319,7 @@ BlMatrix2D >> rotateByRadians: anAngle around: aBlVector [ self multiplyBy: (self class rotation: anAngle) ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix2D >> rotation: anAngle [ "Set me to be a 2D matrix representing a rotation by a given angle in radians" @@ -337,7 +335,7 @@ BlMatrix2D >> rotation: anAngle [ shy := aSin ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix2D >> scaleBy: aBlVector [ | aScale3D | "Apply a scaling defined by a given vector" @@ -361,7 +359,7 @@ BlMatrix2D >> scaleBy: aBlVector [ y := y * aScale3D y ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix2D >> shear: aCoefficientPoint [ "Set me to be a 2D matrix representing a shear by a given coefficient (shx, shy)" @@ -373,7 +371,7 @@ BlMatrix2D >> shear: aCoefficientPoint [ shy := aCoefficientPoint y ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> shx [ "Returns the X coordinate shearing element of the affine transformation matrix" @@ -381,12 +379,12 @@ BlMatrix2D >> shx [ ^ shx ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> shx: anObject [ shx := anObject ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> shy [ "Returns the Y coordinate shearing element of the affine transformation matrix" @@ -394,12 +392,12 @@ BlMatrix2D >> shy [ ^ shy ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> shy: anObject [ shy := anObject ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> sx [ "Returns the X coordinate scaling element of the affine transformation matrix" @@ -407,12 +405,12 @@ BlMatrix2D >> sx [ ^ sx ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> sx: anObject [ sx := anObject ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> sy [ "Returns the Y coordinate scaling element of the affine transformation matrix" @@ -420,12 +418,12 @@ BlMatrix2D >> sy [ ^ sy ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> sy: anObject [ sy := anObject ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix2D >> transformBounds: aBlBounds [ "In-place transform given BlBounds according to my transformation. (local to global transformation)" @@ -468,13 +466,13 @@ BlMatrix2D >> transformBounds: aBlBounds [ ^ aBlBounds ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix2D >> transformPoint2D: aPoint2D [ ^ self transformX: aPoint2D x Y: aPoint2D y ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix2D >> transformX: aX Y: aY [ | newX newY | @@ -484,19 +482,19 @@ BlMatrix2D >> transformX: aX Y: aY [ ^ newX @ newY ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix2D >> transformX: aX withY: aY [ ^ (aX * sx) + (aY * shx) + x ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix2D >> transformY: aY withX: aX [ ^ (aX * shy) + (aY * sy) + y ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix2D >> translateBy: aBlVector [ "Apply a translation by a given vector" | aTranslate3D | @@ -515,7 +513,7 @@ BlMatrix2D >> translateBy: aBlVector [ y := y + aTranslate3D y. ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> x [ "Returns the X coordinate of the translation element of the affine transformation matrix" @@ -523,12 +521,12 @@ BlMatrix2D >> x [ ^ x ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> x: anObject [ x := anObject ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> y [ "Returns the Y coordinate of the translation element of the affine transformation matrix" @@ -536,7 +534,7 @@ BlMatrix2D >> y [ ^ y ] -{ #category : 'matrix - accessing' } +{ #category : #'matrix - accessing' } BlMatrix2D >> y: anObject [ y := anObject ] diff --git a/src/Bloc/BlMatrix3D.class.st b/src/Bloc/BlMatrix3D.class.st index fe5c9150d..06bb9bb69 100644 --- a/src/Bloc/BlMatrix3D.class.st +++ b/src/Bloc/BlMatrix3D.class.st @@ -11,8 +11,8 @@ My components are named according to mathematical convention: " Class { - #name : 'BlMatrix3D', - #superclass : 'BlMatrix', + #name : #BlMatrix3D, + #superclass : #BlMatrix, #instVars : [ 'sx', 'shy0', @@ -31,12 +31,10 @@ Class { 'z', 'w' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix3D class >> flushToZero: aFloat [ ^ (aFloat closeTo: 0.0) @@ -44,7 +42,7 @@ BlMatrix3D class >> flushToZero: aFloat [ ifFalse: [ aFloat ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix3D class >> fromQuaternion: aQuaternion [ "Return a new 3D rotation matrix from a given rotation quaternion" @@ -53,7 +51,7 @@ BlMatrix3D class >> fromQuaternion: aQuaternion [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrix3D class >> rotation: aTheta axis: aVector [ "Create a 3D matrix representing a rotation about a given axis vector by aTheta radians" @@ -63,7 +61,7 @@ BlMatrix3D class >> rotation: aTheta axis: aVector [ yourself ] -{ #category : 'comparing' } +{ #category : #comparing } BlMatrix3D >> = anObject [ self == anObject ifTrue: [ ^ true ]. self class = anObject class ifFalse: [ ^ false ]. @@ -87,7 +85,7 @@ BlMatrix3D >> = anObject [ ^true ] -{ #category : 'converting' } +{ #category : #converting } BlMatrix3D >> asMatrixCollection [ ^ Array2D rows: 4 @@ -100,7 +98,7 @@ BlMatrix3D >> asMatrixCollection [ } ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix3D >> initialize [ super initialize. @@ -122,14 +120,14 @@ BlMatrix3D >> initialize [ w := 1.0 ] -{ #category : 'testing' } +{ #category : #testing } BlMatrix3D >> is2D [ "Return true if matrix is 2D, false otherwise" ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlMatrix3D >> isIdentity [ "scale" @@ -158,7 +156,7 @@ BlMatrix3D >> isIdentity [ ^ true ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix3D >> multiplyBy: aMatrix3D [ "Multiply me in-place by a given 3D Matrix" | _sx _shx0 _shx1 _x _shy0 _sy _shy1 _y _shz0 _shz1 _sz _z _wx _wy _wz _w | @@ -204,7 +202,7 @@ BlMatrix3D >> multiplyBy: aMatrix3D [ w := _w ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix3D >> perspective: aDepth [ "Apply perspective by aDepth which should be positive" @@ -218,7 +216,7 @@ BlMatrix3D >> perspective: aDepth [ wz := wz - (1.0 / aDepth * w) ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlMatrix3D >> postScaleX: aX Y: aY Z: aZ [ "Apply the scale AFTER my existing transformation. Any vector that is multiplied by the resulting matrix @@ -241,7 +239,7 @@ BlMatrix3D >> postScaleX: aX Y: aY Z: aZ [ z := z * aZ ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlMatrix3D >> postTranslateX: aX Y: aY Z: aZ [ "Apply the translation AFTER my existing transformation. Any vector that is multiplied by the resulting matrix @@ -264,7 +262,7 @@ BlMatrix3D >> postTranslateX: aX Y: aY Z: aZ [ z := z + (w * aZ) ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlMatrix3D >> preScaleX: aX Y: aY Z: aZ [ "Apply the scaling BEFORE my existing transformation. Any vector that is multiplied by the resulting matrix will first be scaled, @@ -286,7 +284,7 @@ BlMatrix3D >> preScaleX: aX Y: aY Z: aZ [ wz := wz * aZ ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlMatrix3D >> preTranslateX: aX Y: aY Z: aZ [ "Apply the translation BEFORE my existing transformation. Any vector that is multiplied by the resulting matrix will first be translated, @@ -298,7 +296,7 @@ BlMatrix3D >> preTranslateX: aX Y: aY Z: aZ [ w := w + (aX * wx) + (aY * wy) + (aZ * wz) ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix3D >> quaternion: aQuaternion [ "Set me to be a rotation matrix defined by a given quaternion" | normalized x2 y2 z2 xx xy xz yy yz zz _wx _wy _wz | @@ -340,7 +338,7 @@ BlMatrix3D >> quaternion: aQuaternion [ w := 1.0. ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix3D >> rotateByRadians: aTheta around: aBlVector [ "Apply a rotation transformation by a given amount of radians around a provided axis vector" | aRotationMatrix | @@ -349,7 +347,7 @@ BlMatrix3D >> rotateByRadians: aTheta around: aBlVector [ self multiplyBy: aRotationMatrix ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlMatrix3D >> rotateX: aTheta [ "Rotate me around X-axis by aTheta degrees in radians" | cosTheta sinTheta temp | @@ -379,7 +377,7 @@ BlMatrix3D >> rotateX: aTheta [ wz := (sinTheta negated * temp) + (cosTheta * wz) ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrix3D >> rotation: aTheta axis: aVector [ "Set me to be a 3D matrix representing a rotation about a given axis vector by aTheta radians" | aNormalizedVector aX aY aZ cosTheta sinTheta sc sq | @@ -423,52 +421,52 @@ BlMatrix3D >> rotation: aTheta axis: aVector [ w := 1.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> shx0 [ ^ shx0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> shx1 [ ^ shx1 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> shy0 [ ^ shy0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> shy1 [ ^ shy1 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> shz0 [ ^ shz0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> shz1 [ ^ shz1 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> sx [ ^ sx ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> sy [ ^ sy ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> sz [ ^ sz ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix3D >> transformBounds: aBlBounds [ "In-place transform given BlBounds according to my transformation. (local to global transformation)" @@ -499,7 +497,7 @@ BlMatrix3D >> transformBounds: aBlBounds [ bottom: maxY ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix3D >> transformPoint2D: aPoint2D [ | aX aY aW | @@ -513,7 +511,7 @@ BlMatrix3D >> transformPoint2D: aPoint2D [ y: aY asFloat / aW ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix3D >> transformPoint3D: aPoint3D [ | aX aY aZ aW | @@ -529,7 +527,7 @@ BlMatrix3D >> transformPoint3D: aPoint3D [ z: aZ asFloat / aW ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlMatrix3D >> transformPoint4D: aPoint4D [ | aX aY aZ aW | @@ -546,7 +544,7 @@ BlMatrix3D >> transformPoint4D: aPoint4D [ w: aW ] -{ #category : 'matrix - transformations' } +{ #category : #'matrix - transformations' } BlMatrix3D >> translateBy: aBlVector [ | aTranslate3D | @@ -558,37 +556,37 @@ BlMatrix3D >> translateBy: aBlVector [ Z: aTranslate3D z ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> w [ ^ w ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> wx [ ^ wx ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> wy [ ^ wy ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> wz [ ^ wz ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> x [ ^ x ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> y [ ^ y ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrix3D >> z [ ^ z ] diff --git a/src/Bloc/BlMatrixDecomposition.class.st b/src/Bloc/BlMatrixDecomposition.class.st index 26e2320ac..152fd0ccc 100644 --- a/src/Bloc/BlMatrixDecomposition.class.st +++ b/src/Bloc/BlMatrixDecomposition.class.st @@ -16,21 +16,19 @@ For example in case of 2D matrix they are: " Class { - #name : 'BlMatrixDecomposition', - #superclass : 'Object', - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #name : #BlMatrixDecomposition, + #superclass : #Object, + #category : 'Bloc-Basic-Math' } -{ #category : 'converting' } +{ #category : #converting } BlMatrixDecomposition >> asDictionary [ ^ self subclassResponsibility ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrixDecomposition >> composition [ "Compose and return a matrix for this decomposition" @@ -38,7 +36,7 @@ BlMatrixDecomposition >> composition [ ^ self subclassResponsibility ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrixDecomposition >> interpolate: aFactor to: anotherDecomposition [ diff --git a/src/Bloc/BlMatrixDecomposition2D.class.st b/src/Bloc/BlMatrixDecomposition2D.class.st index c55f447d8..fd8bdc158 100644 --- a/src/Bloc/BlMatrixDecomposition2D.class.st +++ b/src/Bloc/BlMatrixDecomposition2D.class.st @@ -5,20 +5,18 @@ https://drafts.csswg.org/css-transforms/#interpolation-of-2d-matrices " Class { - #name : 'BlMatrixDecomposition2D', - #superclass : 'BlMatrixDecomposition', + #name : #BlMatrixDecomposition2D, + #superclass : #BlMatrixDecomposition, #instVars : [ 'translation', 'scale', 'angle', 'matrix' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> angle [ "Return a decomposed rotation angle in degrees" @@ -26,12 +24,12 @@ BlMatrixDecomposition2D >> angle [ ^ angle ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> angle: aNumber [ angle := aNumber ] -{ #category : 'converting' } +{ #category : #converting } BlMatrixDecomposition2D >> asDictionary [ ^ { @@ -42,7 +40,7 @@ BlMatrixDecomposition2D >> asDictionary [ } asOrderedDictionary ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrixDecomposition2D >> composition [ | composedMatrix | @@ -69,7 +67,7 @@ BlMatrixDecomposition2D >> composition [ ^ composedMatrix ] -{ #category : 'matrix - mathematical functions' } +{ #category : #'matrix - mathematical functions' } BlMatrixDecomposition2D >> interpolate: aFactor to: anotherDecomposition [ "Algorithm is based on https://drafts.csswg.org/css-transforms/#interpolation-of-decomposed-2d-matrix-values" @@ -116,38 +114,38 @@ BlMatrixDecomposition2D >> interpolate: aFactor to: anotherDecomposition [ matrix: aMatrix ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> matrix [ ^ matrix ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> matrix: aMatrix [ matrix := aMatrix ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> scale [ ^ scale ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> scale: aVector [ scale := aVector ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> translation [ ^ translation ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixDecomposition2D >> translation: aVector [ translation := aVector ] diff --git a/src/Bloc/BlMatrixDecomposition3D.class.st b/src/Bloc/BlMatrixDecomposition3D.class.st index aa147d4c9..7f8b3d011 100644 --- a/src/Bloc/BlMatrixDecomposition3D.class.st +++ b/src/Bloc/BlMatrixDecomposition3D.class.st @@ -3,9 +3,7 @@ I am a decomposition of 3D matrix " Class { - #name : 'BlMatrixDecomposition3D', - #superclass : 'BlMatrixDecomposition', - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #name : #BlMatrixDecomposition3D, + #superclass : #BlMatrixDecomposition, + #category : 'Bloc-Basic-Math' } diff --git a/src/Bloc/BlMatrixTransformation.class.st b/src/Bloc/BlMatrixTransformation.class.st index b1da0b968..0ee75229d 100644 --- a/src/Bloc/BlMatrixTransformation.class.st +++ b/src/Bloc/BlMatrixTransformation.class.st @@ -3,17 +3,15 @@ I am an affine transformation that is directly defined by transformation matrix " Class { - #name : 'BlMatrixTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlMatrixTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'matrix' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMatrixTransformation class >> matrix: aBlMatrix [ ^ self new @@ -21,7 +19,7 @@ BlMatrixTransformation class >> matrix: aBlMatrix [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlMatrixTransformation >> initialize [ super initialize. @@ -29,25 +27,25 @@ BlMatrixTransformation >> initialize [ matrix := BlMatrix2D new ] -{ #category : 'testing' } +{ #category : #testing } BlMatrixTransformation >> is2D [ ^ matrix is2D ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixTransformation >> matrix [ ^ matrix ] -{ #category : 'accessing' } +{ #category : #accessing } BlMatrixTransformation >> matrix: aBlMatrix [ matrix := aBlMatrix ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlMatrixTransformation >> multiplyOn: aBlMatrix [ aBlMatrix multiplyBy: matrix diff --git a/src/Bloc/BlMeasurementAtMostMode.class.st b/src/Bloc/BlMeasurementAtMostMode.class.st index adce03aa4..e3a94c49a 100644 --- a/src/Bloc/BlMeasurementAtMostMode.class.st +++ b/src/Bloc/BlMeasurementAtMostMode.class.st @@ -4,31 +4,29 @@ For more information see class comment of BlMeasurementMode " Class { - #name : 'BlMeasurementAtMostMode', - #superclass : 'BlMeasurementMode', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #name : #BlMeasurementAtMostMode, + #superclass : #BlMeasurementMode, + #category : 'Bloc-Layouts-Support' } -{ #category : 'testing' } +{ #category : #testing } BlMeasurementAtMostMode >> isAtMost [ ^ true ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementAtMostMode >> measurement: aResizing with: aFloat [ ^ aResizing measurementAtMostWith: aFloat ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementAtMostMode >> printOn: aStream [ aStream nextPutAll: 'At most' ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementAtMostMode >> printOn: aStream size: aNumber [ self printOn: aStream. @@ -36,7 +34,7 @@ BlMeasurementAtMostMode >> printOn: aStream size: aNumber [ aStream nextPutAll: aNumber asString ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementAtMostMode >> size: aNumber min: aMinSizeFloat max: aMaxSizeFloat [ "aNumber should satisfy #isBlocFiniteFloat, aMinSizeFloat and aMaxSizeFloat #isBlocFiniteFloat" @@ -45,7 +43,7 @@ BlMeasurementAtMostMode >> size: aNumber min: aMinSizeFloat max: aMaxSizeFloat [ ^ BlMeasurementSpec atMost: (aNumber min: aMaxSizeFloat) ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementAtMostMode >> size: aNumber with: aSpecSize [ "aNumber should satisfy #isBlocFiniteFloat" diff --git a/src/Bloc/BlMeasurementExactMode.class.st b/src/Bloc/BlMeasurementExactMode.class.st index 525d0d247..305bdcac6 100644 --- a/src/Bloc/BlMeasurementExactMode.class.st +++ b/src/Bloc/BlMeasurementExactMode.class.st @@ -4,31 +4,29 @@ For more information see class comment of BlMeasurementMode " Class { - #name : 'BlMeasurementExactMode', - #superclass : 'BlMeasurementMode', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #name : #BlMeasurementExactMode, + #superclass : #BlMeasurementMode, + #category : 'Bloc-Layouts-Support' } -{ #category : 'testing' } +{ #category : #testing } BlMeasurementExactMode >> isExact [ ^ true ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementExactMode >> measurement: aResizing with: aFloat [ ^ aResizing measurementExactlyWith: aFloat ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementExactMode >> printOn: aStream [ aStream nextPutAll: 'Exact' ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementExactMode >> printOn: aStream size: aNumber [ self printOn: aStream. @@ -36,7 +34,7 @@ BlMeasurementExactMode >> printOn: aStream size: aNumber [ aStream nextPutAll: aNumber asString ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementExactMode >> size: aNumber min: aMinSizeFloat max: aMaxSizeFloat [ "aNumber should satisfy #isBlocFiniteFloat, aMinSizeFloat and aMaxSizeFloat #isBlocFiniteFloat" @@ -45,7 +43,7 @@ BlMeasurementExactMode >> size: aNumber min: aMinSizeFloat max: aMaxSizeFloat [ ^ BlMeasurementSpec exact: (aNumber min: aMaxSizeFloat max: aMinSizeFloat) ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementExactMode >> size: aNumber with: aSpecSize [ "aNumber should satisfy: #isBlocFiniteFloat" diff --git a/src/Bloc/BlMeasurementMode.class.st b/src/Bloc/BlMeasurementMode.class.st index a9ba7387e..74885f0a8 100644 --- a/src/Bloc/BlMeasurementMode.class.st +++ b/src/Bloc/BlMeasurementMode.class.st @@ -12,26 +12,24 @@ My main methods are " Class { - #name : 'BlMeasurementMode', - #superclass : 'Object', + #name : #BlMeasurementMode, + #superclass : #Object, #classInstVars : [ 'atMost', 'exact', 'unspecified' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlMeasurementMode class >> atMost [ ^ atMost ifNil: [ atMost := BlMeasurementAtMostMode new ] ] -{ #category : 'cleanup' } +{ #category : #cleanup } BlMeasurementMode class >> cleanUp [ super cleanUp. @@ -40,68 +38,68 @@ BlMeasurementMode class >> cleanUp [ unspecified := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlMeasurementMode class >> exact [ ^ exact ifNil: [ exact := BlMeasurementExactMode new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlMeasurementMode class >> unspecified [ ^ unspecified ifNil: [ unspecified := BlMeasurementUnspecifiedMode new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlMeasurementMode >> = anotherObject [ self == anotherObject ifTrue: [ ^ true ]. ^ anotherObject class == self class ] -{ #category : 'comparing' } +{ #category : #comparing } BlMeasurementMode >> hash [ ^ self class hash ] -{ #category : 'testing' } +{ #category : #testing } BlMeasurementMode >> isAtMost [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlMeasurementMode >> isExact [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlMeasurementMode >> isUnspecified [ ^ false ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementMode >> measurement: aResizing with: aNumber [ ^ self subclassResponsibility ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementMode >> printOn: aStream size: aNumber [ "Prints measurement mode with taking a given size into account" self subclassResponsibility ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementMode >> size: aNumber min: aMinSize max: aMaxSize [ ^ self subclassResponsibility ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementMode >> size: aNumber with: aSpecSize [ diff --git a/src/Bloc/BlMeasurementSpec.class.st b/src/Bloc/BlMeasurementSpec.class.st index 4f3429bb5..103bc1262 100644 --- a/src/Bloc/BlMeasurementSpec.class.st +++ b/src/Bloc/BlMeasurementSpec.class.st @@ -1,26 +1,24 @@ Class { - #name : 'BlMeasurementSpec', - #superclass : 'Object', + #name : #BlMeasurementSpec, + #superclass : #Object, #instVars : [ 'size', 'mode' ], - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #category : 'Bloc-Layouts-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMeasurementSpec class >> atMost: aNumber [ ^ self new beAtMost: aNumber ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMeasurementSpec class >> exact: aNumber [ ^ self new beExact: aNumber ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMeasurementSpec class >> size: aSize mode: aMode [ ^ self new size: aSize; @@ -28,17 +26,17 @@ BlMeasurementSpec class >> size: aSize mode: aMode [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMeasurementSpec class >> unspecified [ ^ self unspecified: 0.0 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMeasurementSpec class >> unspecified: aNumber [ ^ self new beUnspecified: aNumber ] -{ #category : 'comparing' } +{ #category : #comparing } BlMeasurementSpec >> = anotherObject [ self == anotherObject @@ -50,92 +48,92 @@ BlMeasurementSpec >> = anotherObject [ and: [ anotherObject mode = mode ] ] -{ #category : 'composition' } +{ #category : #composition } BlMeasurementSpec >> @ heightMeasurementSpec [ ^ BlExtentMeasurementSpec new widthSpec: self; heightSpec: heightMeasurementSpec ] -{ #category : 'converting' } +{ #category : #converting } BlMeasurementSpec >> beAtMost: aNumber [ self size: aNumber; mode: BlMeasurementMode atMost ] -{ #category : 'converting' } +{ #category : #converting } BlMeasurementSpec >> beExact: aNumber [ self size: aNumber; mode: BlMeasurementMode exact ] -{ #category : 'converting' } +{ #category : #converting } BlMeasurementSpec >> beUnspecified [ self beUnspecified: 0 ] -{ #category : 'converting' } +{ #category : #converting } BlMeasurementSpec >> beUnspecified: aNumber [ self size: aNumber; mode: BlMeasurementMode unspecified ] -{ #category : 'comparing' } +{ #category : #comparing } BlMeasurementSpec >> hash [ ^ size hash bitXor: mode hash ] -{ #category : 'testing' } +{ #category : #testing } BlMeasurementSpec >> isAtMost [ ^ self mode isAtMost ] -{ #category : 'testing' } +{ #category : #testing } BlMeasurementSpec >> isExact [ ^ self mode isExact ] -{ #category : 'testing' } +{ #category : #testing } BlMeasurementSpec >> isUnspecified [ ^ self mode isUnspecified ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementSpec >> min: aMinSize max: aMaxSize [ ^ self mode size: self size min: aMinSize max: aMaxSize ] -{ #category : 'accessing' } +{ #category : #accessing } BlMeasurementSpec >> mode [ ^ mode ] -{ #category : 'accessing' } +{ #category : #accessing } BlMeasurementSpec >> mode: aMeasurementSpec [ mode := aMeasurementSpec ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementSpec >> printOn: aStream [ self mode printOn: aStream size: self size ] -{ #category : 'accessing' } +{ #category : #accessing } BlMeasurementSpec >> size [ ^ size ] -{ #category : 'accessing' } +{ #category : #accessing } BlMeasurementSpec >> size: aNumber [ "aNumber should satisfy: #isBlocPositiveFloat" size := aNumber ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementSpec >> sizeFor: aNumber [ "aNumber should satisfy: #isBlocFiniteFloat" diff --git a/src/Bloc/BlMeasurementUnspecifiedMode.class.st b/src/Bloc/BlMeasurementUnspecifiedMode.class.st index a770f960c..380c69d01 100644 --- a/src/Bloc/BlMeasurementUnspecifiedMode.class.st +++ b/src/Bloc/BlMeasurementUnspecifiedMode.class.st @@ -4,37 +4,35 @@ For more information see class comment of BlMeasurementMode " Class { - #name : 'BlMeasurementUnspecifiedMode', - #superclass : 'BlMeasurementMode', - #category : 'Bloc-Layouts-Support', - #package : 'Bloc', - #tag : 'Layouts-Support' + #name : #BlMeasurementUnspecifiedMode, + #superclass : #BlMeasurementMode, + #category : 'Bloc-Layouts-Support' } -{ #category : 'testing' } +{ #category : #testing } BlMeasurementUnspecifiedMode >> isUnspecified [ ^ true ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementUnspecifiedMode >> measurement: aResizing with: aFloat [ ^ aResizing measurementUnspecifiedWith: aFloat ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementUnspecifiedMode >> printOn: aStream [ aStream nextPutAll: 'Unspecified' ] -{ #category : 'printing' } +{ #category : #printing } BlMeasurementUnspecifiedMode >> printOn: aStream size: aNumber [ self printOn: aStream ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementUnspecifiedMode >> size: aNumber min: aMinSizeFloat max: aMaxSizeFloat [ "aNumber should satisfy #isBlocFiniteFloat, aMinSizeFloat and aMaxSizeFloat #isBlocFiniteFloat" @@ -43,7 +41,7 @@ BlMeasurementUnspecifiedMode >> size: aNumber min: aMinSizeFloat max: aMaxSizeFl ^ BlMeasurementSpec atMost: (aMinSizeFloat max: aMaxSizeFloat) ] -{ #category : 'geometry' } +{ #category : #geometry } BlMeasurementUnspecifiedMode >> size: aNumber with: aSpecSize [ "aNumber should satisfy #isBlocFiniteFloat" diff --git a/src/Bloc/BlMemoryEventRecorder.class.st b/src/Bloc/BlMemoryEventRecorder.class.st index d098f0eea..5324766dc 100644 --- a/src/Bloc/BlMemoryEventRecorder.class.st +++ b/src/Bloc/BlMemoryEventRecorder.class.st @@ -3,24 +3,22 @@ I record events in a collection " Class { - #name : 'BlMemoryEventRecorder', - #superclass : 'BlSpaceEventRecorder', + #name : #BlMemoryEventRecorder, + #superclass : #BlSpaceEventRecorder, #instVars : [ 'events', 'time', 'pulseTimestamp' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlMemoryEventRecorder >> events [ ^ events ] -{ #category : 'initialization' } +{ #category : #initialization } BlMemoryEventRecorder >> initialize [ super initialize. @@ -28,14 +26,14 @@ BlMemoryEventRecorder >> initialize [ time := BlTime real ] -{ #category : 'api - recording' } +{ #category : #'api - recording' } BlMemoryEventRecorder >> onPulse [ super onPulse. pulseTimestamp := self time now ] -{ #category : 'api - recording' } +{ #category : #'api - recording' } BlMemoryEventRecorder >> record: anEvent [ | aCopiedEvent | @@ -46,7 +44,7 @@ BlMemoryEventRecorder >> record: anEvent [ self events add: aCopiedEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMemoryEventRecorder >> time [ ^ time ] diff --git a/src/Bloc/BlMemoryTelemetry.class.st b/src/Bloc/BlMemoryTelemetry.class.st index a9bd6bc71..d7fb6b500 100644 --- a/src/Bloc/BlMemoryTelemetry.class.st +++ b/src/Bloc/BlMemoryTelemetry.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlMemoryTelemetry', - #superclass : 'BlTelemetry', + #name : #BlMemoryTelemetry, + #superclass : #BlTelemetry, #instVars : [ 'tasks', 'tasksStack' ], - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #category : 'Bloc-Space - Telemetry' } -{ #category : 'tasks' } +{ #category : #tasks } BlMemoryTelemetry >> finishSync [ | anEndTime | @@ -25,7 +23,7 @@ BlMemoryTelemetry >> finishSync [ gcEndTime: Smalltalk vm totalGCTime ] -{ #category : 'initialization' } +{ #category : #initialization } BlMemoryTelemetry >> initialize [ super initialize. @@ -33,7 +31,7 @@ BlMemoryTelemetry >> initialize [ tasksStack := Stack new ] -{ #category : 'tasks' } +{ #category : #tasks } BlMemoryTelemetry >> reset [ [ tasksStack isNotEmpty ] whileTrue: [ self finishSync ]. @@ -42,7 +40,7 @@ BlMemoryTelemetry >> reset [ tasksStack removeAll ] -{ #category : 'tasks' } +{ #category : #tasks } BlMemoryTelemetry >> startSync: aNameBlock [ | aNewTask aRealStart aGcTime | @@ -63,7 +61,7 @@ BlMemoryTelemetry >> startSync: aNameBlock [ aNewTask gcStartTime: aGcTime ] -{ #category : 'tasks' } +{ #category : #tasks } BlMemoryTelemetry >> tasks [ ^ tasks ] diff --git a/src/Bloc/BlMiddleAlignment.class.st b/src/Bloc/BlMiddleAlignment.class.st index 9de111089..83ad541b3 100644 --- a/src/Bloc/BlMiddleAlignment.class.st +++ b/src/Bloc/BlMiddleAlignment.class.st @@ -4,19 +4,17 @@ See BlLayoutAlignment for more info. " Class { - #name : 'BlMiddleAlignment', - #superclass : 'BlRelativeAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlMiddleAlignment, + #superclass : #BlRelativeAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlMiddleAlignment class >> horizontal [ ^ BlHorizontalAlignment center ] -{ #category : 'factory' } +{ #category : #factory } BlMiddleAlignment class >> vertical [ ^ BlVerticalAlignment center ] diff --git a/src/Bloc/BlMiddleClickEvent.class.st b/src/Bloc/BlMiddleClickEvent.class.st index bed034687..1f985cdb3 100644 --- a/src/Bloc/BlMiddleClickEvent.class.st +++ b/src/Bloc/BlMiddleClickEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlMiddleClickEvent', - #superclass : 'BlClickEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMiddleClickEvent, + #superclass : #BlClickEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlMiddleMouseDownEvent.class.st b/src/Bloc/BlMiddleMouseDownEvent.class.st index c49b501b9..b5186a4cf 100644 --- a/src/Bloc/BlMiddleMouseDownEvent.class.st +++ b/src/Bloc/BlMiddleMouseDownEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlMiddleMouseDownEvent', - #superclass : 'BlMouseDownEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMiddleMouseDownEvent, + #superclass : #BlMouseDownEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlMiddleMouseUpEvent.class.st b/src/Bloc/BlMiddleMouseUpEvent.class.st index a14700f87..18ed3a644 100644 --- a/src/Bloc/BlMiddleMouseUpEvent.class.st +++ b/src/Bloc/BlMiddleMouseUpEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlMiddleMouseUpEvent', - #superclass : 'BlMouseUpEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMiddleMouseUpEvent, + #superclass : #BlMouseUpEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlMonotoneSelection.class.st b/src/Bloc/BlMonotoneSelection.class.st index 5c9446bbc..bf84a86b4 100644 --- a/src/Bloc/BlMonotoneSelection.class.st +++ b/src/Bloc/BlMonotoneSelection.class.st @@ -5,40 +5,38 @@ Monotone selection can not be empty " Class { - #name : 'BlMonotoneSelection', - #superclass : 'BlSelection', + #name : #BlMonotoneSelection, + #superclass : #BlSelection, #instVars : [ 'from', 'to' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMonotoneSelection class >> from: aFromIndex to: aToIndex [ ^ self basicNew initialize from: aFromIndex to: aToIndex ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMonotoneSelection class >> new [ ^ self error: 'Use from:to: instead' ] -{ #category : 'comparing' } +{ #category : #comparing } BlMonotoneSelection >> < aMonotoneTextSelection [ ^ self from < aMonotoneTextSelection from ] -{ #category : 'comparing' } +{ #category : #comparing } BlMonotoneSelection >> <= aMonotoneTextSelection [ ^ self from <= aMonotoneTextSelection from ] -{ #category : 'comparing' } +{ #category : #comparing } BlMonotoneSelection >> = anotherObject [ self == anotherObject @@ -50,19 +48,19 @@ BlMonotoneSelection >> = anotherObject [ and: [ anotherObject to = self to ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlMonotoneSelection >> > aMonotoneTextSelection [ ^ self from > aMonotoneTextSelection from ] -{ #category : 'comparing' } +{ #category : #comparing } BlMonotoneSelection >> >= aMonotoneTextSelection [ ^ self from >= aMonotoneTextSelection from ] -{ #category : 'invariant' } +{ #category : #invariant } BlMonotoneSelection >> assertInvariant [ self @@ -70,14 +68,14 @@ BlMonotoneSelection >> assertInvariant [ description: [ 'Class invariant must always hold' ]. ] -{ #category : 'accessing' } +{ #category : #accessing } BlMonotoneSelection >> children [ ^ #() ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlMonotoneSelection >> complement: aMonotoneTextSelection [ "Answer the complement of me and a given selection. Note: I return an empty selection if complement is empty and composite text selection @@ -104,7 +102,7 @@ BlMonotoneSelection >> complement: aMonotoneTextSelection [ ifFalse: [ self class from: (aMonotoneTextSelection to max: self from) to: self to ] ] ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> contains: anIndex [ "Return true if this selection interval includes a given index, false otherwise. If selection is [0.. 1] both 0 and 1 are within this selection" @@ -113,7 +111,7 @@ BlMonotoneSelection >> contains: anIndex [ ^ self rangeIncludes: anIndex ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> containsIndex: anIndex [ "Return true if selection indices include a given index, false otherwise. I am conceptually same as (self indices includes: anIndex)" @@ -123,7 +121,7 @@ BlMonotoneSelection >> containsIndex: anIndex [ and: [ anIndex <= self to ] ] -{ #category : 'copying' } +{ #category : #copying } BlMonotoneSelection >> copyFrom: aStartIndex to: anEndIndex [ aStartIndex <= self to ifTrue: [ ^ BlMonotoneSelection from: aStartIndex to: aStartIndex ]. @@ -136,12 +134,12 @@ BlMonotoneSelection >> copyFrom: aStartIndex to: anEndIndex [ to: (anEndIndex min: self to) ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlMonotoneSelection >> do: aBlock [ aBlock value: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlMonotoneSelection >> from [ "Return a text index of the first selected character" @@ -149,7 +147,7 @@ BlMonotoneSelection >> from [ ^ from ] -{ #category : 'initialization' } +{ #category : #initialization } BlMonotoneSelection >> from: aFromIndex to: aToIndex [ self assert: [ from isNil and: [ to isNil ] ] @@ -165,12 +163,12 @@ BlMonotoneSelection >> from: aFromIndex to: aToIndex [ self assertInvariant ] -{ #category : 'comparing' } +{ #category : #comparing } BlMonotoneSelection >> hash [ ^ self from hash bitXor: self to hash ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> includes: aMonotoneTextSelection [ "Return true if I include a given selection, false otherwise" @@ -179,7 +177,7 @@ BlMonotoneSelection >> includes: aMonotoneTextSelection [ and: [ aMonotoneTextSelection to <= self to ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlMonotoneSelection >> indices [ "Return a collection of selection indices. If the selection interval is [0..1] then selection indices will only contain @@ -192,7 +190,7 @@ BlMonotoneSelection >> indices [ ^ self from + 1 to: self to ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> inside: aMonotoneTextSelection [ "Return true if I am fully inside a given selection, false otherwise" @@ -201,7 +199,7 @@ BlMonotoneSelection >> inside: aMonotoneTextSelection [ and: [ self to <= aMonotoneTextSelection to ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlMonotoneSelection >> interval [ "Return current text selection as interval" @@ -211,7 +209,7 @@ BlMonotoneSelection >> interval [ ^ self from to: self to ] -{ #category : 'invariant' } +{ #category : #invariant } BlMonotoneSelection >> invariant [ "Return true if class invariant holds, false otherwise. An invariant is that ===from=== must be always smaller or equal to ===to=== and both must not be negative" @@ -222,7 +220,7 @@ BlMonotoneSelection >> invariant [ and: [ to >= 0 ] ] ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> isEmpty [ "Return true if selection is empty, false otherwise" @@ -230,7 +228,7 @@ BlMonotoneSelection >> isEmpty [ ^ self to <= self from ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> isNotEmpty [ "Return true if selection is empty, false otherwise" @@ -238,7 +236,7 @@ BlMonotoneSelection >> isNotEmpty [ ^ self from < self to ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> neighbours: aMonotoneTextSelection [ "Return true if I am a neighour of a given interval, false otherwise. Overlapping intervals are not considered as neighbours" @@ -250,7 +248,7 @@ BlMonotoneSelection >> neighbours: aMonotoneTextSelection [ or: [ self from = aMonotoneTextSelection to ] ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> overlaps: aMonotoneTextSelection [ "Return true I overlap with a given monotone text selection, false otherwise. Intervals such as [6, 7] and [7, 9] are considered to be overllaping, @@ -263,7 +261,7 @@ BlMonotoneSelection >> overlaps: aMonotoneTextSelection [ or: [ (aMonotoneTextSelection rangeIncludes: self to) ] ] ] ] -{ #category : 'printing' } +{ #category : #printing } BlMonotoneSelection >> printOn: aStream [ aStream nextPut: $[. aStream nextPutAll: self from asString. @@ -272,7 +270,7 @@ BlMonotoneSelection >> printOn: aStream [ aStream nextPut: $]. ] -{ #category : 'testing' } +{ #category : #testing } BlMonotoneSelection >> rangeIncludes: aNumber [ "Return true if the number lies in the interval between from and to" @@ -280,14 +278,14 @@ BlMonotoneSelection >> rangeIncludes: aNumber [ ^ aNumber between: self from and: self to ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlMonotoneSelection >> reverseDo: aBlock [ "Evaluate a given block with all recorded selection intervals in reverse direction" aBlock value: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlMonotoneSelection >> to [ "Return a text index of the last selected character" diff --git a/src/Bloc/BlMouseButton.class.st b/src/Bloc/BlMouseButton.class.st index e5fb26dd3..a6cf8188a 100644 --- a/src/Bloc/BlMouseButton.class.st +++ b/src/Bloc/BlMouseButton.class.st @@ -5,54 +5,52 @@ I am used by BlMouseEvent " Class { - #name : 'BlMouseButton', - #superclass : 'Object', + #name : #BlMouseButton, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlMouseButton class >> code: aNumber [ ^ BlMouseOtherButton code: aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseButton class >> middle [ ^ BlMouseMiddleButton uniqueInstance ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseButton class >> primary [ ^ BlMousePrimaryButton uniqueInstance ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseButton class >> secondary [ ^ BlMouseSecondaryButton uniqueInstance ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseButton >> clickEventClass [ ^ BlClickEvent ] -{ #category : 'action dispatching' } +{ #category : #'action dispatching' } BlMouseButton >> ifPrimary: aPrimBlock secondary: aSecBlock middle: aMidBlock other: anotherBlock [ ^ anotherBlock value ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseButton >> mouseDownEventClass [ ^ BlMouseDownEvent ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseButton >> mouseUpEventClass [ ^ BlMouseUpEvent diff --git a/src/Bloc/BlMouseDownEvent.class.st b/src/Bloc/BlMouseDownEvent.class.st index 501e66537..ef134f32c 100644 --- a/src/Bloc/BlMouseDownEvent.class.st +++ b/src/Bloc/BlMouseDownEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlMouseDownEvent', - #superclass : 'BlMousePickEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseDownEvent, + #superclass : #BlMousePickEvent, + #category : 'Bloc-Events' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseDownEvent class >> button: aMouseButton [ "Create a sample button down event for a given button for testing purposes" @@ -18,7 +16,7 @@ BlMouseDownEvent class >> button: aMouseButton [ timestamp: DateAndTime now ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseDownEvent class >> middle [ "Create a sample middle button down event for testing purposes" @@ -26,7 +24,7 @@ BlMouseDownEvent class >> middle [ ^ self button: BlMouseButton middle ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseDownEvent class >> primary [ "Create a sample primary button down event for testing purposes" @@ -34,7 +32,7 @@ BlMouseDownEvent class >> primary [ ^ self button: BlMouseButton primary ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseDownEvent class >> secondary [ "Create a sample secondary button down event for testing purposes" @@ -42,18 +40,18 @@ BlMouseDownEvent class >> secondary [ ^ self button: BlMouseButton secondary ] -{ #category : 'converting' } +{ #category : #converting } BlMouseDownEvent >> asMouseOutsideEvent [ ^ BlMouseDownOutsideEvent new originalEvent: self; canBePropagated: false; yourself ] -{ #category : 'testing' } +{ #category : #testing } BlMouseDownEvent >> isMouseDown [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlMouseDownEvent >> sendTo: anObject [ anObject mouseDownEvent: self ] diff --git a/src/Bloc/BlMouseDownOutsideEvent.class.st b/src/Bloc/BlMouseDownOutsideEvent.class.st index 82a6b05c3..891d78257 100644 --- a/src/Bloc/BlMouseDownOutsideEvent.class.st +++ b/src/Bloc/BlMouseDownOutsideEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlMouseDownOutsideEvent', - #superclass : 'BlMousePickOutsideEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlMouseDownOutsideEvent, + #superclass : #BlMousePickOutsideEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'sending' } +{ #category : #sending } BlMouseDownOutsideEvent >> sendTo: anObject [ anObject mouseDownOutsideEvent: self diff --git a/src/Bloc/BlMouseDragState.class.st b/src/Bloc/BlMouseDragState.class.st index 1e504490b..47f917e5e 100644 --- a/src/Bloc/BlMouseDragState.class.st +++ b/src/Bloc/BlMouseDragState.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlMouseDragState', - #superclass : 'Object', + #name : #BlMouseDragState, + #superclass : #Object, #instVars : [ 'button' ], - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #category : 'Bloc-Space - Support' } -{ #category : 'comparing' } +{ #category : #comparing } BlMouseDragState >> = anotherObject [ self == anotherObject @@ -19,17 +17,17 @@ BlMouseDragState >> = anotherObject [ ^ anotherObject button = self button ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseDragState >> button [ ^ button ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseDragState >> button: anObject [ button := anObject ] -{ #category : 'comparing' } +{ #category : #comparing } BlMouseDragState >> hash [ ^ self class hash bitXor: self button hash ] diff --git a/src/Bloc/BlMouseEnterEvent.class.st b/src/Bloc/BlMouseEnterEvent.class.st index 464342b17..050b02046 100644 --- a/src/Bloc/BlMouseEnterEvent.class.st +++ b/src/Bloc/BlMouseEnterEvent.class.st @@ -11,19 +11,17 @@ https://developer.mozilla.org/en-US/docs/Web/Events/mouseenter " Class { - #name : 'BlMouseEnterEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseEnterEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlMouseEnterEvent >> isMouseEnter [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlMouseEnterEvent >> sendTo: anObject [ anObject mouseEnterEvent: self ] diff --git a/src/Bloc/BlMouseEvent.class.st b/src/Bloc/BlMouseEvent.class.st index 5eb1c548d..1b469bd11 100644 --- a/src/Bloc/BlMouseEvent.class.st +++ b/src/Bloc/BlMouseEvent.class.st @@ -1,23 +1,21 @@ Class { - #name : 'BlMouseEvent', - #superclass : 'BlUIEvent', + #name : #BlMouseEvent, + #superclass : #BlUIEvent, #instVars : [ 'position', 'screenPosition', 'button', 'delta' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'constants' } +{ #category : #constants } BlMouseEvent class >> anyButton [ ^ 7 ] -{ #category : 'constants' } +{ #category : #constants } BlMouseEvent class >> middleButton [ self deprecated: 'Use `BlMouseButton middle` instead' @@ -26,7 +24,7 @@ BlMouseEvent class >> middleButton [ ^ BlMouseButton middle ] -{ #category : 'constants' } +{ #category : #constants } BlMouseEvent class >> primaryButton [ self deprecated: 'Use `BlMouseButton primary` instead' @@ -35,7 +33,7 @@ BlMouseEvent class >> primaryButton [ ^ BlMouseButton primary ] -{ #category : 'constants' } +{ #category : #constants } BlMouseEvent class >> secondaryButton [ self deprecated: 'Use `BlMouseButton secondary` instead' @@ -44,19 +42,19 @@ BlMouseEvent class >> secondaryButton [ ^ BlMouseButton secondary ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> anyButtonPressed [ ^ button isNotNil ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asClickEvent [ ^ self button clickEventClass new copyFrom: self; yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asDictionaryForExport [ ^ super asDictionaryForExport at: #position put: position printString; @@ -65,7 +63,7 @@ BlMouseEvent >> asDictionaryForExport [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asDragEndEvent [ ^ BlDragEndEvent new @@ -73,7 +71,7 @@ BlMouseEvent >> asDragEndEvent [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asDragEnterEvent [ "Convert the receiver into a mouse move" @@ -82,14 +80,14 @@ BlMouseEvent >> asDragEnterEvent [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asDragEvent [ ^ BlDragEvent new copyFrom: self; yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asDragLeaveEvent [ "Convert the receiver into a mouse move" @@ -98,7 +96,7 @@ BlMouseEvent >> asDragLeaveEvent [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asDragStartEvent [ "Convert the receiver into a mouse move" @@ -107,87 +105,87 @@ BlMouseEvent >> asDragStartEvent [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseEvent >> asDropEvent [ ^ BlDropEvent new copyFrom: self; yourself ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> asMouseEnterEvent [ ^ BlMouseEnterEvent new copyFrom: self; yourself ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> asMouseLeaveEvent [ ^ BlMouseLeaveEvent new copyFrom: self; yourself ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> asMouseOutEvent [ ^ BlMouseOutEvent new copyFrom: self; yourself ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> asMouseOverEvent [ ^ BlMouseOverEvent new copyFrom: self; yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseEvent >> button [ ^ button ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseEvent >> button: aBlMouseButton [ button := aBlMouseButton ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> canFindTargetFrom: anElement [ ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseEvent >> delta [ ^ delta ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseEvent >> delta: aPoint [ delta := aPoint ] -{ #category : 'processing' } +{ #category : #processing } BlMouseEvent >> findTargetFrom: aSpaceOrElement [ ^ (aSpaceOrElement findMouseEventTargetAt: self position) ifNil: [ aSpaceOrElement space root ] ] -{ #category : 'action dispatching' } +{ #category : #'action dispatching' } BlMouseEvent >> ifPrimary: aPrimBlock secondary: aSecBlock middle: aMidBlock other: anotherBlock [ ^ self button ifPrimary: aPrimBlock secondary: aSecBlock middle: aMidBlock other: anotherBlock ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> isMouse [ ^ true ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlMouseEvent >> localPosition [ "Return an event position in local coordinates of a #currentTarget" @@ -195,12 +193,12 @@ BlMouseEvent >> localPosition [ ^ self currentTarget globalPointToLocal: self position ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> middleButtonPressed [ ^ button = BlMouseButton middle ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlMouseEvent >> parentPosition [ "Return an event position in parent coordinates of a #currentTarget" @@ -208,22 +206,22 @@ BlMouseEvent >> parentPosition [ ^ self currentTarget globalPointToParent: self position ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlMouseEvent >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseEvent >> position: anObject [ position := anObject ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> primaryButtonPressed [ ^ button = BlMouseButton primary ] -{ #category : 'printing' } +{ #category : #printing } BlMouseEvent >> printOn: aStream [ aStream nextPutAll: self class name; @@ -239,22 +237,22 @@ BlMouseEvent >> printOn: aStream [ nextPut:$) ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlMouseEvent >> screenPosition [ ^ screenPosition ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseEvent >> screenPosition: anObject [ screenPosition := anObject ] -{ #category : 'testing' } +{ #category : #testing } BlMouseEvent >> secondaryButtonPressed [ ^ button = BlMouseButton secondary ] -{ #category : 'sending' } +{ #category : #sending } BlMouseEvent >> sendTo: anObject [ anObject mouseEvent: self ] diff --git a/src/Bloc/BlMouseLeaveEvent.class.st b/src/Bloc/BlMouseLeaveEvent.class.st index 0cc2ec840..0532f89bb 100644 --- a/src/Bloc/BlMouseLeaveEvent.class.st +++ b/src/Bloc/BlMouseLeaveEvent.class.st @@ -10,19 +10,17 @@ https://developer.mozilla.org/en-US/docs/Web/Events/mouseleave " Class { - #name : 'BlMouseLeaveEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseLeaveEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlMouseLeaveEvent >> isMouseLeave [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlMouseLeaveEvent >> sendTo: anObject [ anObject mouseLeaveEvent: self ] diff --git a/src/Bloc/BlMouseMiddleButton.class.st b/src/Bloc/BlMouseMiddleButton.class.st index cea0ef77f..75373bf4e 100644 --- a/src/Bloc/BlMouseMiddleButton.class.st +++ b/src/Bloc/BlMouseMiddleButton.class.st @@ -3,32 +3,30 @@ I am a middle mouse button. Often can be triggered by mouse wheel click " Class { - #name : 'BlMouseMiddleButton', - #superclass : 'BlMouseNamedButton', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseMiddleButton, + #superclass : #BlMouseNamedButton, + #category : 'Bloc-Events' } -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseMiddleButton >> clickEventClass [ ^ BlMiddleClickEvent ] -{ #category : 'action dispatching' } +{ #category : #'action dispatching' } BlMouseMiddleButton >> ifPrimary: aPrimBlock secondary: aSecBlock middle: aMidBlock other: anotherBlock [ ^ aMidBlock value ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseMiddleButton >> mouseDownEventClass [ ^ BlMiddleMouseDownEvent ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseMiddleButton >> mouseUpEventClass [ ^ BlMiddleMouseUpEvent diff --git a/src/Bloc/BlMouseMoveEvent.class.st b/src/Bloc/BlMouseMoveEvent.class.st index 2a15c7878..2dbdb4c9f 100644 --- a/src/Bloc/BlMouseMoveEvent.class.st +++ b/src/Bloc/BlMouseMoveEvent.class.st @@ -5,14 +5,12 @@ https://developer.mozilla.org/en-US/docs/Web/Events/mousemove " Class { - #name : 'BlMouseMoveEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseMoveEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseMoveEvent class >> button: aMouseButton [ "Create a sample button move event" @@ -24,7 +22,7 @@ BlMouseMoveEvent class >> button: aMouseButton [ timestamp: DateAndTime now ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseMoveEvent class >> middle [ "Create a mouse move event for testing purposes" @@ -32,7 +30,7 @@ BlMouseMoveEvent class >> middle [ ^ self button: BlMouseButton middle ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseMoveEvent class >> primary [ "Create a mouse move event for testing purposes" @@ -40,7 +38,7 @@ BlMouseMoveEvent class >> primary [ ^ self button: BlMouseButton primary ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseMoveEvent class >> secondary [ "Create a mouse move event for testing purposes" @@ -48,18 +46,18 @@ BlMouseMoveEvent class >> secondary [ ^ self button: BlMouseButton secondary ] -{ #category : 'testing' } +{ #category : #testing } BlMouseMoveEvent >> canFindTargetFrom: anElement [ ^ anElement notNil and: [anElement containsGlobalPoint: self position] ] -{ #category : 'testing' } +{ #category : #testing } BlMouseMoveEvent >> isMouseMove [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlMouseMoveEvent >> sendTo: anObject [ anObject mouseMoveEvent: self ] diff --git a/src/Bloc/BlMouseNamedButton.class.st b/src/Bloc/BlMouseNamedButton.class.st index 50df3bae4..f79335f42 100644 --- a/src/Bloc/BlMouseNamedButton.class.st +++ b/src/Bloc/BlMouseNamedButton.class.st @@ -3,36 +3,34 @@ I am a root class of all mouse buttons with a name, e.g. ""primary"", ""secondar " Class { - #name : 'BlMouseNamedButton', - #superclass : 'BlMouseButton', + #name : #BlMouseNamedButton, + #superclass : #BlMouseButton, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlMouseNamedButton class >> cleanUp [ super cleanUp. uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseNamedButton class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlMouseNamedButton >> = anotherObject [ self == anotherObject ifTrue: [ ^ true ]. ^ anotherObject class = self class ] -{ #category : 'comparing' } +{ #category : #comparing } BlMouseNamedButton >> hash [ ^ self class hash ] diff --git a/src/Bloc/BlMouseOtherButton.class.st b/src/Bloc/BlMouseOtherButton.class.st index 670755d79..98b2cee2f 100644 --- a/src/Bloc/BlMouseOtherButton.class.st +++ b/src/Bloc/BlMouseOtherButton.class.st @@ -4,22 +4,20 @@ Nowadays there can be any number of mouse buttons, we have to support them " Class { - #name : 'BlMouseOtherButton', - #superclass : 'BlMouseButton', + #name : #BlMouseOtherButton, + #superclass : #BlMouseButton, #instVars : [ 'code' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseOtherButton class >> code: aNumber [ ^ self new code: aNumber ] -{ #category : 'comparing' } +{ #category : #comparing } BlMouseOtherButton >> = anotherObject [ self == anotherObject ifTrue: [ ^ true ]. @@ -28,7 +26,7 @@ BlMouseOtherButton >> = anotherObject [ ^ anotherObject code = self code ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseOtherButton >> code [ "Return a numerical (integer) code of this mouse button" @@ -36,7 +34,7 @@ BlMouseOtherButton >> code [ ^ code ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseOtherButton >> code: aNumber [ self @@ -46,7 +44,7 @@ BlMouseOtherButton >> code: aNumber [ code := aNumber ] -{ #category : 'comparing' } +{ #category : #comparing } BlMouseOtherButton >> hash [ ^ self class hash bitXor: self code hash ] diff --git a/src/Bloc/BlMouseOutEvent.class.st b/src/Bloc/BlMouseOutEvent.class.st index 69b22cb2d..b3a68a579 100644 --- a/src/Bloc/BlMouseOutEvent.class.st +++ b/src/Bloc/BlMouseOutEvent.class.st @@ -7,14 +7,12 @@ https://developer.mozilla.org/en-US/docs/Web/Events/mouseout " Class { - #name : 'BlMouseOutEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseOutEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlMouseOutEvent >> sendTo: anObject [ anObject mouseOutEvent: self ] diff --git a/src/Bloc/BlMouseOverEvent.class.st b/src/Bloc/BlMouseOverEvent.class.st index 027c043e2..6561b8610 100644 --- a/src/Bloc/BlMouseOverEvent.class.st +++ b/src/Bloc/BlMouseOverEvent.class.st @@ -9,14 +9,12 @@ https://developer.mozilla.org/en-US/docs/Web/Events/mouseover " Class { - #name : 'BlMouseOverEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseOverEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'sending' } +{ #category : #sending } BlMouseOverEvent >> sendTo: anObject [ anObject mouseOverEvent: self ] diff --git a/src/Bloc/BlMousePickEvent.class.st b/src/Bloc/BlMousePickEvent.class.st index ae1807e52..e5e608ffa 100644 --- a/src/Bloc/BlMousePickEvent.class.st +++ b/src/Bloc/BlMousePickEvent.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlMousePickEvent', - #superclass : 'BlMouseEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMousePickEvent, + #superclass : #BlMouseEvent, + #category : 'Bloc-Events' } -{ #category : 'converting' } +{ #category : #converting } BlMousePickEvent >> asMouseOutsideEvent [ ^ self subclassResponsibility ] -{ #category : 'processing' } +{ #category : #processing } BlMousePickEvent >> findTargetFrom: aSpaceOrElement [ ^ (aSpaceOrElement findMousePickTargetFromEvent: self) ifNil: [ aSpaceOrElement space root ] diff --git a/src/Bloc/BlMousePickOutsideEvent.class.st b/src/Bloc/BlMousePickOutsideEvent.class.st index aa9041633..41a2ed81f 100644 --- a/src/Bloc/BlMousePickOutsideEvent.class.st +++ b/src/Bloc/BlMousePickOutsideEvent.class.st @@ -1,65 +1,63 @@ Class { - #name : 'BlMousePickOutsideEvent', - #superclass : 'BlElementEvent', + #name : #BlMousePickOutsideEvent, + #superclass : #BlElementEvent, #instVars : [ 'originalEvent', 'lastMouseDownEvent' ], - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #category : 'Bloc-Events-Type-Element' } -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlMousePickOutsideEvent class >> disableIn: anEventDispatcher [ anEventDispatcher disableMousePickedOutside ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlMousePickOutsideEvent class >> enableIn: anEventDispatcher [ anEventDispatcher enableMousePickedOutside ] -{ #category : 'api - enable / disable' } +{ #category : #'api - enable / disable' } BlMousePickOutsideEvent class >> wantedIn: anEventDispatcher [ ^ anEventDispatcher wantsMousePickedOutside ] -{ #category : 'converting' } +{ #category : #converting } BlMousePickOutsideEvent >> asMouseOutsideEvent [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlMousePickOutsideEvent >> lastMouseDownEvent [ ^ lastMouseDownEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMousePickOutsideEvent >> lastMouseDownEvent: aBlEvent [ lastMouseDownEvent := aBlEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMousePickOutsideEvent >> originalEvent [ ^ originalEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMousePickOutsideEvent >> originalEvent: aBlEvent [ aBlEvent consumed: true. originalEvent := aBlEvent ] -{ #category : 'sending' } +{ #category : #sending } BlMousePickOutsideEvent >> sendTo: anObject [ anObject mousePickOutsideEvent: self diff --git a/src/Bloc/BlMousePrimaryButton.class.st b/src/Bloc/BlMousePrimaryButton.class.st index f8324b1a4..70ca19ae2 100644 --- a/src/Bloc/BlMousePrimaryButton.class.st +++ b/src/Bloc/BlMousePrimaryButton.class.st @@ -3,32 +3,30 @@ I am a primary mouse button. In most cases is bound to the left button. " Class { - #name : 'BlMousePrimaryButton', - #superclass : 'BlMouseNamedButton', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMousePrimaryButton, + #superclass : #BlMouseNamedButton, + #category : 'Bloc-Events' } -{ #category : 'event creation' } +{ #category : #'event creation' } BlMousePrimaryButton >> clickEventClass [ ^ BlPrimaryClickEvent ] -{ #category : 'action dispatching' } +{ #category : #'action dispatching' } BlMousePrimaryButton >> ifPrimary: aPrimBlock secondary: aSecBlock middle: aMidBlock other: anotherBlock [ ^ aPrimBlock value ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMousePrimaryButton >> mouseDownEventClass [ ^ BlPrimaryMouseDownEvent ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMousePrimaryButton >> mouseUpEventClass [ ^ BlPrimaryMouseUpEvent diff --git a/src/Bloc/BlMouseProcessor.class.st b/src/Bloc/BlMouseProcessor.class.st index ba702969a..c8b784d5e 100644 --- a/src/Bloc/BlMouseProcessor.class.st +++ b/src/Bloc/BlMouseProcessor.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlMouseProcessor', - #superclass : 'BlBaseEventProcessor', + #name : #BlMouseProcessor, + #superclass : #BlBaseEventProcessor, #instVars : [ 'lastEnteredTargets', 'lastOverTarget', @@ -14,25 +14,23 @@ Class { 'lastMouseMoveEvent', 'lastMouseDownEvent' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor class >> dblClickDelay [ ^ 400 milliSeconds ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlMouseProcessor >> canBeClickAvortedEvent: aMouseUpEvent [ ^ lastMouseDownEvent isNotNil and: [ aMouseUpEvent target ~= lastMouseDownEvent target ] ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlMouseProcessor >> canBeClickEvent: aMouseUpEvent [ ^ dndInProgress not and: [ @@ -40,7 +38,7 @@ BlMouseProcessor >> canBeClickEvent: aMouseUpEvent [ aMouseUpEvent target = lastMouseDownEvent target ] ] ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlMouseProcessor >> canBeDblClickEvent: aMouseUpEvent [ ^ lastClickEvent isNotNil and: [ @@ -50,7 +48,7 @@ BlMouseProcessor >> canBeDblClickEvent: aMouseUpEvent [ < self dblClickDelay ] ] ] ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlMouseProcessor >> canStartDrag: aMouseMoveEvent [ @@ -60,7 +58,7 @@ BlMouseProcessor >> canStartDrag: aMouseMoveEvent [ and: [ (aMouseMoveEvent position - lastMouseDownEvent position) r > self startDragThreshold ] ] ] ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> checkLastOverTarget [ lastOverTarget ifNil: [ ^ self ]. @@ -68,33 +66,33 @@ BlMouseProcessor >> checkLastOverTarget [ lastOverTarget := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> dblClickDelay [ ^ self class dblClickDelay ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> dispatchEvent: anEvent target: aTarget [ " enter/leave events are dispatched to a known target " super dispatchEvent: anEvent target: aTarget ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> enteredTargets [ ^ lastEnteredTargets ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> fillTargetHierarchy: aTarget [ ^ Array streamContents: [ :aStream | aStream nextPut: aTarget. aTarget allParentsDo: [ :aParentElement | aStream nextPut: aParentElement ] ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsDragEndEvent: anEvent [ self fireEvent: @@ -106,7 +104,7 @@ BlMouseProcessor >> fireAsDragEndEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsDragEnterEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -120,7 +118,7 @@ BlMouseProcessor >> fireAsDragEnterEvent: anEvent targets: aCollection [ target: t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsDragEvent: anEvent [ self fireEvent: (anEvent asDragEvent @@ -131,7 +129,7 @@ BlMouseProcessor >> fireAsDragEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsDragLeaveEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -145,7 +143,7 @@ BlMouseProcessor >> fireAsDragLeaveEvent: anEvent targets: aCollection [ target: t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsDragStartEvent: anEvent [ ^ self fireEvent: (anEvent asDragStartEvent @@ -155,7 +153,7 @@ BlMouseProcessor >> fireAsDragStartEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsDropEvent: anEvent [ self fireEvent: @@ -167,7 +165,7 @@ BlMouseProcessor >> fireAsDropEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsEnterEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -179,7 +177,7 @@ BlMouseProcessor >> fireAsEnterEvent: anEvent targets: aCollection [ target: t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsMouseLeaveEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -191,24 +189,24 @@ BlMouseProcessor >> fireAsMouseLeaveEvent: anEvent targets: aCollection [ target:t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsMouseOutEvent: aMouseEvent [ self fireEvent: (aMouseEvent asMouseOutEvent target: lastOverTarget) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsMouseOutEvent: aMouseEvent targets: aCollection [ aCollection do: [ :eachElement | self fireEvent: (aMouseEvent asMouseOutEvent target: eachElement) ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireAsMouseOverEvent: aMouseEvent [ self fireEvent: aMouseEvent asMouseOverEvent ] -{ #category : 'mouse up' } +{ #category : #'mouse up' } BlMouseProcessor >> fireClickAvortedEventFrom: aMouseUpEvent [ "Click avorted is useful to let the mouse down target decide if it can be a click or not " @@ -219,7 +217,7 @@ BlMouseProcessor >> fireClickAvortedEventFrom: aMouseUpEvent [ yourself) ] -{ #category : 'mouse up' } +{ #category : #'mouse up' } BlMouseProcessor >> fireClickEventFrom: aMouseEvent [ | aClickEvent | @@ -228,14 +226,14 @@ BlMouseProcessor >> fireClickEventFrom: aMouseEvent [ lastClickEvent := aClickEvent copy ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlMouseProcessor >> fireEvent: anEvent [ " for events other than entre/leave " ^ super fireEvent: anEvent ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> generateEvents [ (lastEnteredTargets , { lastOverTarget } reject: [ :eachElement | @@ -270,7 +268,7 @@ BlMouseProcessor >> generateEvents [ lastClickEvent := nil ] ] -{ #category : 'mouse move' } +{ #category : #'mouse move' } BlMouseProcessor >> handleLastMouseMove [ | target | @@ -281,7 +279,7 @@ BlMouseProcessor >> handleLastMouseMove [ self processMouseMove: lastMouseMoveEvent. ] -{ #category : 'mouse down' } +{ #category : #'mouse down' } BlMouseProcessor >> handleMouseDown: aMouseDownEvent [ | aTargetElement | @@ -301,11 +299,11 @@ BlMouseProcessor >> handleMouseDown: aMouseDownEvent [ lastMouseDownEvent := aMouseDownEvent ] -{ #category : 'mouse entered / left' } +{ #category : #'mouse entered / left' } BlMouseProcessor >> handleMouseEntered: aSpaceMouseEnterEvent [ ] -{ #category : 'mouse entered / left' } +{ #category : #'mouse entered / left' } BlMouseProcessor >> handleMouseLeft: aSpaceMouseLeaveEvent [ lastEnteredTargets do: [ :eachEnteredTarget | @@ -329,7 +327,7 @@ BlMouseProcessor >> handleMouseLeft: aSpaceMouseLeaveEvent [ lastOverTarget := nil ] -{ #category : 'mouse move' } +{ #category : #'mouse move' } BlMouseProcessor >> handleMouseMove: aMouseMoveEvent [ | aTargetElement shouldTryDragStart | "picking and mouse move" @@ -359,7 +357,7 @@ BlMouseProcessor >> handleMouseMove: aMouseMoveEvent [ ifFalse: [ self processMouseMove: aMouseMoveEvent ] ] ] -{ #category : 'mouse up' } +{ #category : #'mouse up' } BlMouseProcessor >> handleMouseUp: aMouseUpEvent [ "DragEnd, Simple click and Dbl click" | aTargetElement | @@ -382,14 +380,14 @@ BlMouseProcessor >> handleMouseUp: aMouseUpEvent [ ifFalse: [ self processMouseUp: aMouseUpEvent ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlMouseProcessor >> initialize [ super initialize. self reset ] -{ #category : 'testing' } +{ #category : #testing } BlMouseProcessor >> isDragging [ "Return true if drag and drop is in process, false otherwise" @@ -397,7 +395,7 @@ BlMouseProcessor >> isDragging [ ^ dndInProgress ] -{ #category : 'private' } +{ #category : #private } BlMouseProcessor >> isMouseEventValid: anEvent [ anEvent ifNil: [ ^ false ]. @@ -411,51 +409,51 @@ BlMouseProcessor >> isMouseEventValid: anEvent [ ^ true ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlMouseProcessor >> isValidDragTarget: aEvent [ ^ (aEvent target = self space root) not ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> lastClickEvent [ ^ lastClickEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> lastMouseDownEvent [ ^ lastMouseDownEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> lastMouseMoveEvent [ ^ lastMouseMoveEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> lastOverTarget [ ^ lastOverTarget ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlMouseProcessor >> onSpaceClosed [ self reset ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> postProcess: aMouseEvent [ ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> preProcess: aMouseEvent [ | aTarget | @@ -469,7 +467,7 @@ BlMouseProcessor >> preProcess: aMouseEvent [ self updateCursorFrom: aTarget ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> pressedButtons [ "Return a collection of currently pressed mouse buttons" @@ -477,7 +475,7 @@ BlMouseProcessor >> pressedButtons [ ^ pressedButtons ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlMouseProcessor >> processDragEnd: aMouseUpEvent [ self assert: [ self isDragging ] description: [ @@ -495,7 +493,7 @@ BlMouseProcessor >> processDragEnd: aMouseUpEvent [ dragStartMask := 0 ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlMouseProcessor >> processDragMove: aMouseMoveEvent [ "check drag" @@ -508,7 +506,7 @@ BlMouseProcessor >> processDragMove: aMouseMoveEvent [ lastOverTarget := aMouseMoveEvent target ] -{ #category : 'mouse move' } +{ #category : #'mouse move' } BlMouseProcessor >> processMouseEnterLeaveEvent: aMouseEvent [ | newLeavedTargets newEnteredTargets currentEnteredTargets | @@ -538,7 +536,7 @@ BlMouseProcessor >> processMouseEnterLeaveEvent: aMouseEvent [ lastEnteredTargets := currentEnteredTargets ] -{ #category : 'mouse move' } +{ #category : #'mouse move' } BlMouseProcessor >> processMouseMove: aMouseMoveEvent [ lastMouseMoveEvent := aMouseMoveEvent. @@ -552,7 +550,7 @@ BlMouseProcessor >> processMouseMove: aMouseMoveEvent [ ] -{ #category : 'event handling entrypoint' } +{ #category : #'event handling entrypoint' } BlMouseProcessor >> processMouseScroll: aMouseScrollEvent [ "picking and mouse move" self preProcess: aMouseScrollEvent. @@ -560,7 +558,7 @@ BlMouseProcessor >> processMouseScroll: aMouseScrollEvent [ self postProcess: aMouseScrollEvent ] -{ #category : 'mouse up' } +{ #category : #'mouse up' } BlMouseProcessor >> processMouseUp: aMouseUpEvent [ self fireEvent: aMouseUpEvent. @@ -577,7 +575,7 @@ BlMouseProcessor >> processMouseUp: aMouseUpEvent [ self fireClickAvortedEventFrom: aMouseUpEvent ] ] ] -{ #category : 'mouse picking' } +{ #category : #'mouse picking' } BlMouseProcessor >> processPicking: aMouseEvent [ " return the element at event position " @@ -595,7 +593,7 @@ BlMouseProcessor >> processPicking: aMouseEvent [ ^ aTargetElement ifNil: [ aTargetElement := self space root ] ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlMouseProcessor >> reset [ lastEnteredTargets := #(). @@ -609,12 +607,12 @@ BlMouseProcessor >> reset [ dragState := BlMouseDragState new ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseProcessor >> startDragThreshold [ ^ 4 ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlMouseProcessor >> subprocessDragEnterExitEvent: aMouseEvent [ | newEnteredTargets newExitedTargets currentEnteredTargets | @@ -636,7 +634,7 @@ BlMouseProcessor >> subprocessDragEnterExitEvent: aMouseEvent [ lastEnteredTargets := currentEnteredTargets ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlMouseProcessor >> tryDragStart: aMouseEvent [ "Try to start a drag and return true if drag actually started, otherwise false" @@ -659,7 +657,7 @@ BlMouseProcessor >> tryDragStart: aMouseEvent [ ^ dndInProgress := aDragStartEvent isConsumed ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> updateCursorFrom: aTarget [ | t | t := aTarget. @@ -669,12 +667,12 @@ BlMouseProcessor >> updateCursorFrom: aTarget [ self space currentCursor: t mouseCursor ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> updateDragView [ ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlMouseProcessor >> updateFocusOwner: aNode [ ] diff --git a/src/Bloc/BlMouseSecondaryButton.class.st b/src/Bloc/BlMouseSecondaryButton.class.st index 3ea5d22fd..20e697e97 100644 --- a/src/Bloc/BlMouseSecondaryButton.class.st +++ b/src/Bloc/BlMouseSecondaryButton.class.st @@ -3,32 +3,30 @@ I am a secondary mouse button. In most cases is bound to the right button and us " Class { - #name : 'BlMouseSecondaryButton', - #superclass : 'BlMouseNamedButton', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseSecondaryButton, + #superclass : #BlMouseNamedButton, + #category : 'Bloc-Events' } -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseSecondaryButton >> clickEventClass [ ^ BlSecondaryClickEvent ] -{ #category : 'action dispatching' } +{ #category : #'action dispatching' } BlMouseSecondaryButton >> ifPrimary: aPrimBlock secondary: aSecBlock middle: aMidBlock other: anotherBlock [ ^ aSecBlock value ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseSecondaryButton >> mouseDownEventClass [ ^ BlSecondaryMouseDownEvent ] -{ #category : 'event creation' } +{ #category : #'event creation' } BlMouseSecondaryButton >> mouseUpEventClass [ ^ BlSecondaryMouseUpEvent diff --git a/src/Bloc/BlMouseUpEvent.class.st b/src/Bloc/BlMouseUpEvent.class.st index 68e6b8b72..62c889c9e 100644 --- a/src/Bloc/BlMouseUpEvent.class.st +++ b/src/Bloc/BlMouseUpEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlMouseUpEvent', - #superclass : 'BlMousePickEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlMouseUpEvent, + #superclass : #BlMousePickEvent, + #category : 'Bloc-Events' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseUpEvent class >> button: aMouseButton [ "Create a sample button up event for a given button for testing purposes" @@ -18,7 +16,7 @@ BlMouseUpEvent class >> button: aMouseButton [ timestamp: DateAndTime now ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseUpEvent class >> middle [ "Create a sample middle button up event for testing purposes" @@ -26,7 +24,7 @@ BlMouseUpEvent class >> middle [ ^ self button: BlMouseButton middle ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseUpEvent class >> primary [ "Create a sample primary button up event for testing purposes" @@ -34,7 +32,7 @@ BlMouseUpEvent class >> primary [ ^ self button: BlMouseButton primary ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseUpEvent class >> secondary [ "Create a sample secondary button up event for testing purposes" @@ -42,25 +40,25 @@ BlMouseUpEvent class >> secondary [ ^ self button: BlMouseButton secondary ] -{ #category : 'converting' } +{ #category : #converting } BlMouseUpEvent >> asDoubleClickEvent [ ^ BlDoubleClickEvent new copyFrom: self; yourself ] -{ #category : 'converting' } +{ #category : #converting } BlMouseUpEvent >> asMouseOutsideEvent [ ^ BlMouseUpOutsideEvent new originalEvent: self; canBePropagated: false; yourself ] -{ #category : 'testing' } +{ #category : #testing } BlMouseUpEvent >> isMouseUp [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlMouseUpEvent >> sendTo: anObject [ anObject mouseUpEvent: self ] diff --git a/src/Bloc/BlMouseUpOutsideEvent.class.st b/src/Bloc/BlMouseUpOutsideEvent.class.st index f097b4a2a..475167b5c 100644 --- a/src/Bloc/BlMouseUpOutsideEvent.class.st +++ b/src/Bloc/BlMouseUpOutsideEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlMouseUpOutsideEvent', - #superclass : 'BlMousePickOutsideEvent', - #category : 'Bloc-Events-Type-Element', - #package : 'Bloc', - #tag : 'Events-Type-Element' + #name : #BlMouseUpOutsideEvent, + #superclass : #BlMousePickOutsideEvent, + #category : 'Bloc-Events-Type-Element' } -{ #category : 'sending' } +{ #category : #sending } BlMouseUpOutsideEvent >> sendTo: anObject [ anObject mouseUpOutsideEvent: self diff --git a/src/Bloc/BlMouseWheelEvent.class.st b/src/Bloc/BlMouseWheelEvent.class.st index 0dd0a3219..0bd09c491 100644 --- a/src/Bloc/BlMouseWheelEvent.class.st +++ b/src/Bloc/BlMouseWheelEvent.class.st @@ -11,18 +11,16 @@ I use {{gtClass:BlVector2D}}, indicating the user scroll direction and length. " Class { - #name : 'BlMouseWheelEvent', - #superclass : 'BlMouseEvent', + #name : #BlMouseWheelEvent, + #superclass : #BlMouseEvent, #instVars : [ 'vector', 'isTouch' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseWheelEvent class >> down [ ^ self new position: 0@0; @@ -30,7 +28,7 @@ BlMouseWheelEvent class >> down [ direction: Character arrowDown ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseWheelEvent class >> left [ ^ self new position: 0@0; @@ -38,7 +36,7 @@ BlMouseWheelEvent class >> left [ direction: Character arrowLeft ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseWheelEvent class >> right [ ^ self new position: 0@0; @@ -46,7 +44,7 @@ BlMouseWheelEvent class >> right [ direction: Character arrowRight ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMouseWheelEvent class >> up [ ^ self new position: 0@0; @@ -54,14 +52,14 @@ BlMouseWheelEvent class >> up [ direction: Character arrowUp ] -{ #category : 'initialization' } +{ #category : #initialization } BlMouseWheelEvent >> initialize [ super initialize. isTouch := false ] -{ #category : 'testing' } +{ #category : #testing } BlMouseWheelEvent >> isHorizontal [ "Return true if this event has a horizontal scrolling component" @@ -69,7 +67,7 @@ BlMouseWheelEvent >> isHorizontal [ ^ self isScrollLeft or: [ self isScrollRight ] ] -{ #category : 'testing' } +{ #category : #testing } BlMouseWheelEvent >> isScrollDown [ "We scroll down when direction vector has negative y component, because the content should move in the same direction as a hand on a touchpad. @@ -79,7 +77,7 @@ BlMouseWheelEvent >> isScrollDown [ ^ vector y < 0 ] -{ #category : 'testing' } +{ #category : #testing } BlMouseWheelEvent >> isScrollLeft [ "We scroll to the left when direction vector has negative x component, because the content should move in the same direction as a hand on a touchpad. @@ -89,7 +87,7 @@ BlMouseWheelEvent >> isScrollLeft [ ^ vector x < 0 ] -{ #category : 'testing' } +{ #category : #testing } BlMouseWheelEvent >> isScrollRight [ "We scroll to the right when direction vector has positive x component, because the content should move in the same direction as a hand on a touchpad. @@ -99,7 +97,7 @@ BlMouseWheelEvent >> isScrollRight [ ^ vector x > 0 ] -{ #category : 'testing' } +{ #category : #testing } BlMouseWheelEvent >> isScrollUp [ "We scroll up when direction vector has positive y component, because the content should move in the same direction as a hand on a touchpad. @@ -109,7 +107,7 @@ BlMouseWheelEvent >> isScrollUp [ ^ vector y > 0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseWheelEvent >> isTouch [ "Return true if I was generated by a touch input device, and not a real mouse. You might want to ignore such events, if your application already handles touch events" @@ -118,17 +116,17 @@ BlMouseWheelEvent >> isTouch [ ^ isTouch ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseWheelEvent >> isTouch: aBoolean [ isTouch := aBoolean ] -{ #category : 'sending' } +{ #category : #sending } BlMouseWheelEvent >> sendTo: anObject [ anObject mouseWheelEvent: self ] -{ #category : 'printing' } +{ #category : #printing } BlMouseWheelEvent >> storeOn: aStream [ aStream nextPutAll: '('. aStream nextPutAll: self class name. @@ -154,14 +152,14 @@ BlMouseWheelEvent >> storeOn: aStream [ aStream nextPutAll: ')' ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseWheelEvent >> vector [ ^ vector ] -{ #category : 'accessing' } +{ #category : #accessing } BlMouseWheelEvent >> vector: aBlVector [ vector := aBlVector ] diff --git a/src/Bloc/BlMoveCursor.class.st b/src/Bloc/BlMoveCursor.class.st index 5e705b925..0d99f8558 100644 --- a/src/Bloc/BlMoveCursor.class.st +++ b/src/Bloc/BlMoveCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlMoveCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlMoveCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlMultiPolygon.class.st b/src/Bloc/BlMultiPolygon.class.st index 0a173b33c..f1a6da867 100644 --- a/src/Bloc/BlMultiPolygon.class.st +++ b/src/Bloc/BlMultiPolygon.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlMultiPolygon', - #superclass : 'BlMultiPolygonGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlMultiPolygon, + #superclass : #BlMultiPolygonGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlMultiPolygon class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlMultiPolygonGeometry.class.st b/src/Bloc/BlMultiPolygonGeometry.class.st index 9838b646a..278f8a419 100644 --- a/src/Bloc/BlMultiPolygonGeometry.class.st +++ b/src/Bloc/BlMultiPolygonGeometry.class.st @@ -1,30 +1,28 @@ Class { - #name : 'BlMultiPolygonGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlMultiPolygonGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'polygons' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMultiPolygonGeometry class >> polygons: aCollectionOfCollectionOfPoints [ ^ self new polygons: aCollectionOfCollectionOfPoints ] -{ #category : 'geometry' } +{ #category : #geometry } BlMultiPolygonGeometry >> matchExtent: anExtent [ extent := anExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultiPolygonGeometry >> polygons [ ^ polygons ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultiPolygonGeometry >> polygons: aCollectionOfPolygons [ polygons := aCollectionOfPolygons. diff --git a/src/Bloc/BlMultiPolyline.class.st b/src/Bloc/BlMultiPolyline.class.st index a423cf99e..eff8c693a 100644 --- a/src/Bloc/BlMultiPolyline.class.st +++ b/src/Bloc/BlMultiPolyline.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlMultiPolyline', - #superclass : 'BlMultiPolylineGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlMultiPolyline, + #superclass : #BlMultiPolylineGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlMultiPolyline class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlMultiPolylineGeometry.class.st b/src/Bloc/BlMultiPolylineGeometry.class.st index 750a63fd2..9bbaf5d8d 100644 --- a/src/Bloc/BlMultiPolylineGeometry.class.st +++ b/src/Bloc/BlMultiPolylineGeometry.class.st @@ -1,30 +1,28 @@ Class { - #name : 'BlMultiPolylineGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlMultiPolylineGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'polylines' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMultiPolylineGeometry class >> polygons: aCollectionOfCollectionOfPoints [ ^ self new polygons: aCollectionOfCollectionOfPoints ] -{ #category : 'geometry' } +{ #category : #geometry } BlMultiPolylineGeometry >> matchExtent: anExtent [ extent := anExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultiPolylineGeometry >> polylines [ ^ polylines ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultiPolylineGeometry >> polylines: aCollectionOfPolylines [ polylines := aCollectionOfPolylines. diff --git a/src/Bloc/BlMultipleSelection.class.st b/src/Bloc/BlMultipleSelection.class.st index 400d26194..0ac440a64 100644 --- a/src/Bloc/BlMultipleSelection.class.st +++ b/src/Bloc/BlMultipleSelection.class.st @@ -3,40 +3,38 @@ I am just a collection of independent text selections that may overlap. " Class { - #name : 'BlMultipleSelection', - #superclass : 'BlSelection', + #name : #BlMultipleSelection, + #superclass : #BlSelection, #instVars : [ 'selections' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlMultipleSelection class >> withAll: aCollectionOfSelections [ ^ self new withAll: aCollectionOfSelections ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlMultipleSelection >> + aSelection [ ^ self add: aSelection ] -{ #category : 'adding' } +{ #category : #adding } BlMultipleSelection >> add: aSelection [ selections add: aSelection ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultipleSelection >> children [ ^ selections ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlMultipleSelection >> contains: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -45,7 +43,7 @@ BlMultipleSelection >> contains: anIndex [ eachSelection contains: anIndex ] ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlMultipleSelection >> containsIndex: anIndex [ "Return true if selection indices include a given index, false otherwise. I am conceptually same as (self indices includes: anIndex)" @@ -55,7 +53,7 @@ BlMultipleSelection >> containsIndex: anIndex [ eachSelection contains: anIndex ] ] -{ #category : 'copying' } +{ #category : #copying } BlMultipleSelection >> copyFrom: aStartIndex to: anEndIndex [ | newSelectionsSet newSelection | @@ -68,12 +66,12 @@ BlMultipleSelection >> copyFrom: aStartIndex to: anEndIndex [ ^ newSelection ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlMultipleSelection >> do: aBlock [ selections do: [ :aSelection | aSelection do: aBlock ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultipleSelection >> from [ "Return a text index of the first selected character" @@ -82,7 +80,7 @@ BlMultipleSelection >> from [ detectMin: [ :each | each from ]) from ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlMultipleSelection >> includes: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -90,43 +88,43 @@ BlMultipleSelection >> includes: anIndex [ ^ self subclassResponsibility ] -{ #category : 'initialization' } +{ #category : #initialization } BlMultipleSelection >> initialize [ super initialize. selections := OrderedCollection new ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlMultipleSelection >> isEmpty [ ^ selections allSatisfy: #isEmpty ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlMultipleSelection >> isNotEmpty [ ^ selections anySatisfy: #isNotEmpty ] -{ #category : 'copying' } +{ #category : #copying } BlMultipleSelection >> postCopy [ selections := selections collect: [ :eachSelection | eachSelection copy ] ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlMultipleSelection >> reverseDo: aBlock [ "Evaluate a given block with all recorded selection intervals in reverse direction" selections reverseDo: [ :aSelection | aSelection do: aBlock ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultipleSelection >> selections [ ^ selections ] -{ #category : 'accessing' } +{ #category : #accessing } BlMultipleSelection >> to [ "Return a text index of the last selected character" @@ -135,7 +133,7 @@ BlMultipleSelection >> to [ detectMax: [ :each | each to ]) to ] -{ #category : 'initialization' } +{ #category : #initialization } BlMultipleSelection >> withAll: aCollectionOfSelections [ selections addAll: aCollectionOfSelections ] diff --git a/src/Bloc/BlNamedCursor.class.st b/src/Bloc/BlNamedCursor.class.st index c320815d3..76eb6f90a 100644 --- a/src/Bloc/BlNamedCursor.class.st +++ b/src/Bloc/BlNamedCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlNamedCursor', - #superclass : 'BlCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlNamedCursor, + #superclass : #BlCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlNamedCursor >> asForm [ ^ Form extent: 1@1 depth: 32 ] diff --git a/src/Bloc/BlNoDropCursor.class.st b/src/Bloc/BlNoDropCursor.class.st index abf97d387..4f10f134f 100644 --- a/src/Bloc/BlNoDropCursor.class.st +++ b/src/Bloc/BlNoDropCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlNoDropCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlNoDropCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlNodeBasedLayout.class.st b/src/Bloc/BlNodeBasedLayout.class.st index 99940f352..9048a45b6 100644 --- a/src/Bloc/BlNodeBasedLayout.class.st +++ b/src/Bloc/BlNodeBasedLayout.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlNodeBasedLayout', - #superclass : 'BlLayout', - #category : 'Bloc-Layouts-Basic', - #package : 'Bloc', - #tag : 'Layouts-Basic' + #name : #BlNodeBasedLayout, + #superclass : #BlLayout, + #category : 'Bloc-Layouts-Basic' } -{ #category : 'layout' } +{ #category : #layout } BlNodeBasedLayout >> layout: aParentLayoutNode [ ] -{ #category : 'layout' } +{ #category : #layout } BlNodeBasedLayout >> layout: anElement in: aRectangle context: aBlElementBoundsUpdateContext [ | aParentNode | @@ -36,11 +34,11 @@ BlNodeBasedLayout >> layout: anElement in: aRectangle context: aBlElementBoundsU eachChildNode element applyLayoutIn: eachChildNode layoutBounds context: aBlElementBoundsUpdateContext ]. ] -{ #category : 'measure' } +{ #category : #measure } BlNodeBasedLayout >> measure: aParentLayoutNode [ ] -{ #category : 'measure' } +{ #category : #measure } BlNodeBasedLayout >> measure: anElement with: anExtentSpec [ | aParentNode | @@ -59,7 +57,7 @@ BlNodeBasedLayout >> measure: anElement with: anExtentSpec [ self measureIgnored: anElement with: anExtentSpec ] -{ #category : 'private - measurement' } +{ #category : #'private - measurement' } BlNodeBasedLayout >> preMeasureChildNode: aChildNode [ "Perform a basic independent measurement of each child node" @@ -75,7 +73,7 @@ BlNodeBasedLayout >> preMeasureChildNode: aChildNode [ resizer: aChildNode verticalResizer)) ] ] -{ #category : 'private - measurement' } +{ #category : #'private - measurement' } BlNodeBasedLayout >> preMeasureChildrenNodes: aParentNode [ "Perform a basic independent measurement of each child node" diff --git a/src/Bloc/BlNormalizedPolygon.class.st b/src/Bloc/BlNormalizedPolygon.class.st index 596fc6ca0..e476e71a7 100644 --- a/src/Bloc/BlNormalizedPolygon.class.st +++ b/src/Bloc/BlNormalizedPolygon.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlNormalizedPolygon', - #superclass : 'BlNormalizedPolygonGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlNormalizedPolygon, + #superclass : #BlNormalizedPolygonGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlNormalizedPolygon class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlNormalizedPolygonGeometry.class.st b/src/Bloc/BlNormalizedPolygonGeometry.class.st index ca945d944..6f94f1fea 100644 --- a/src/Bloc/BlNormalizedPolygonGeometry.class.st +++ b/src/Bloc/BlNormalizedPolygonGeometry.class.st @@ -1,41 +1,39 @@ Class { - #name : 'BlNormalizedPolygonGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlNormalizedPolygonGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'vertices' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'accessing' } +{ #category : #accessing } BlNormalizedPolygonGeometry class >> vertices: aCollectionOfNormalizedPoints [ ^ self new vertices: aCollectionOfNormalizedPoints ] -{ #category : 'initialization' } +{ #category : #initialization } BlNormalizedPolygonGeometry >> initialize [ super initialize. vertices := #() ] -{ #category : 'geometry' } +{ #category : #geometry } BlNormalizedPolygonGeometry >> matchExtent: aPoint [ "Resize geometry to exactly match provided extent as a Point" extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlNormalizedPolygonGeometry >> vertices [ ^ vertices ] -{ #category : 'accessing' } +{ #category : #accessing } BlNormalizedPolygonGeometry >> vertices: anObject [ vertices := anObject ] diff --git a/src/Bloc/BlNormalizedPolyline.class.st b/src/Bloc/BlNormalizedPolyline.class.st index 2f124befd..8c59a0b05 100644 --- a/src/Bloc/BlNormalizedPolyline.class.st +++ b/src/Bloc/BlNormalizedPolyline.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlNormalizedPolyline', - #superclass : 'BlNormalizedPolylineGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlNormalizedPolyline, + #superclass : #BlNormalizedPolylineGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlNormalizedPolyline class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlNormalizedPolylineGeometry.class.st b/src/Bloc/BlNormalizedPolylineGeometry.class.st index e5fe70b93..bcb719d8b 100644 --- a/src/Bloc/BlNormalizedPolylineGeometry.class.st +++ b/src/Bloc/BlNormalizedPolylineGeometry.class.st @@ -3,41 +3,39 @@ I am a special type of a polyline whose vertices are within [0...1]@[0...1] " Class { - #name : 'BlNormalizedPolylineGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlNormalizedPolylineGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'vertices' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlNormalizedPolylineGeometry class >> vertices: aCollectionOfNormalizedPoints [ ^ self new vertices: aCollectionOfNormalizedPoints ] -{ #category : 'initialization' } +{ #category : #initialization } BlNormalizedPolylineGeometry >> initialize [ super initialize. vertices := #() ] -{ #category : 'geometry' } +{ #category : #geometry } BlNormalizedPolylineGeometry >> matchExtent: aPoint [ "Resize geometry to exactly match provided extent as a Point" extent := aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } BlNormalizedPolylineGeometry >> vertices [ ^ vertices ] -{ #category : 'accessing' } +{ #category : #accessing } BlNormalizedPolylineGeometry >> vertices: anObject [ vertices := anObject ] diff --git a/src/Bloc/BlNotAllowedCursor.class.st b/src/Bloc/BlNotAllowedCursor.class.st index bac7823ac..e4b3afcdf 100644 --- a/src/Bloc/BlNotAllowedCursor.class.st +++ b/src/Bloc/BlNotAllowedCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlNotAllowedCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlNotAllowedCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlNullAlignment.class.st b/src/Bloc/BlNullAlignment.class.st index 7b305c62b..70e0d1449 100644 --- a/src/Bloc/BlNullAlignment.class.st +++ b/src/Bloc/BlNullAlignment.class.st @@ -4,14 +4,12 @@ See BlLayoutAlignment for more info. " Class { - #name : 'BlNullAlignment', - #superclass : 'BlElementAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlNullAlignment, + #superclass : #BlElementAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlNullAlignment class >> initialize [ super initialize. @@ -19,42 +17,42 @@ BlNullAlignment class >> initialize [ horizontal := BlNullHorizontalAlignment new. ] -{ #category : 'factory' } +{ #category : #factory } BlNullAlignment >> directed: aBlLayoutDirection [ ^ self ] -{ #category : 'factory' } +{ #category : #factory } BlNullAlignment >> horizontal [ ^ self class horizontal ] -{ #category : 'testing' } +{ #category : #testing } BlNullAlignment >> ifNotNull: aBlock [ "nothing" ] -{ #category : 'testing' } +{ #category : #testing } BlNullAlignment >> ifNull: aBlock [ aBlock value ] -{ #category : 'factory' } +{ #category : #factory } BlNullAlignment >> leftToRight [ ^ self ] -{ #category : 'factory' } +{ #category : #factory } BlNullAlignment >> oriented: aBlLayoutOrientation [ ^ self ] -{ #category : 'factory' } +{ #category : #factory } BlNullAlignment >> rightToLeft [ ^ self ] -{ #category : 'factory' } +{ #category : #factory } BlNullAlignment >> vertical [ ^ self class vertical ] diff --git a/src/Bloc/BlNullEffect.class.st b/src/Bloc/BlNullEffect.class.st index be8bbd9cf..7b11be723 100644 --- a/src/Bloc/BlNullEffect.class.st +++ b/src/Bloc/BlNullEffect.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlNullEffect', - #superclass : 'BlElementEffect', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #name : #BlNullEffect, + #superclass : #BlElementEffect, + #category : 'Bloc-Effect' } -{ #category : 'testing' } +{ #category : #testing } BlNullEffect >> isNullEffect [ ^ true ] diff --git a/src/Bloc/BlNullHorizontalAlignment.class.st b/src/Bloc/BlNullHorizontalAlignment.class.st index bc392c196..4ccd4b287 100644 --- a/src/Bloc/BlNullHorizontalAlignment.class.st +++ b/src/Bloc/BlNullHorizontalAlignment.class.st @@ -1,21 +1,19 @@ Class { - #name : 'BlNullHorizontalAlignment', - #superclass : 'BlNullAlignment', + #name : #BlNullHorizontalAlignment, + #superclass : #BlNullAlignment, #classInstVars : [ 'rightToLeft', 'leftToRight' ], - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlNullHorizontalAlignment class >> directed: aBlLayoutDirection [ ^ aBlLayoutDirection of: self ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlNullHorizontalAlignment class >> initialize [ super initialize. @@ -23,37 +21,37 @@ BlNullHorizontalAlignment class >> initialize [ leftToRight := BlNullLeftAlignment new ] -{ #category : 'factory' } +{ #category : #factory } BlNullHorizontalAlignment class >> leftToRight [ ^ leftToRight ] -{ #category : 'factory' } +{ #category : #factory } BlNullHorizontalAlignment class >> rightToLeft [ ^ rightToLeft ] -{ #category : 'composition' } +{ #category : #composition } BlNullHorizontalAlignment >> + aVerticalAlignment [ ^ BlCompositeAlignment horizontal: self vertical: aVerticalAlignment ] -{ #category : 'factory' } +{ #category : #factory } BlNullHorizontalAlignment >> directed: aBlLayoutDirection [ ^ self class directed: aBlLayoutDirection ] -{ #category : 'factory' } +{ #category : #factory } BlNullHorizontalAlignment >> leftToRight [ ^ self class leftToRight ] -{ #category : 'factory' } +{ #category : #factory } BlNullHorizontalAlignment >> rightToLeft [ ^ self class rightToLeft ] -{ #category : 'translation' } +{ #category : #translation } BlNullHorizontalAlignment >> translationOf: aBounds in: aContainerBounds [ ^ 0 @ 0 ] diff --git a/src/Bloc/BlNullLeftAlignment.class.st b/src/Bloc/BlNullLeftAlignment.class.st index d3606678d..e5e86a8d5 100644 --- a/src/Bloc/BlNullLeftAlignment.class.st +++ b/src/Bloc/BlNullLeftAlignment.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlNullLeftAlignment', - #superclass : 'BlNullHorizontalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlNullLeftAlignment, + #superclass : #BlNullHorizontalAlignment, + #category : 'Bloc-Layouts-Alignment' } diff --git a/src/Bloc/BlNullRightAlignment.class.st b/src/Bloc/BlNullRightAlignment.class.st index f372d9898..96ad178cc 100644 --- a/src/Bloc/BlNullRightAlignment.class.st +++ b/src/Bloc/BlNullRightAlignment.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlNullRightAlignment', - #superclass : 'BlNullHorizontalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlNullRightAlignment, + #superclass : #BlNullHorizontalAlignment, + #category : 'Bloc-Layouts-Alignment' } diff --git a/src/Bloc/BlNullSpaceReference.class.st b/src/Bloc/BlNullSpaceReference.class.st index 5ce0d385a..2a53c7610 100644 --- a/src/Bloc/BlNullSpaceReference.class.st +++ b/src/Bloc/BlNullSpaceReference.class.st @@ -4,27 +4,25 @@ Null space reference {{gtClass:BlSpaceReference}} is set when an element is `rem " Class { - #name : 'BlNullSpaceReference', - #superclass : 'BlSpaceReference', + #name : #BlNullSpaceReference, + #superclass : #BlSpaceReference, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #category : 'Bloc-Space' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlNullSpaceReference class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlNullSpaceReference class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'testing' } +{ #category : #testing } BlNullSpaceReference >> isNull [ ^ true ] diff --git a/src/Bloc/BlNullTelemetry.class.st b/src/Bloc/BlNullTelemetry.class.st index 1488e7c42..efadb0e03 100644 --- a/src/Bloc/BlNullTelemetry.class.st +++ b/src/Bloc/BlNullTelemetry.class.st @@ -1,25 +1,23 @@ Class { - #name : 'BlNullTelemetry', - #superclass : 'BlTelemetry', + #name : #BlNullTelemetry, + #superclass : #BlTelemetry, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #category : 'Bloc-Space - Telemetry' } -{ #category : 'accessing' } +{ #category : #accessing } BlNullTelemetry class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlNullTelemetry class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlNullTelemetry >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -28,11 +26,11 @@ BlNullTelemetry >> = anObject [ ^ self class = anObject class ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlNullTelemetry >> emit [ ] -{ #category : 'comparing' } +{ #category : #comparing } BlNullTelemetry >> hash [ "Answer an integer value that is related to the identity of the receiver." diff --git a/src/Bloc/BlNullVerticalAlignment.class.st b/src/Bloc/BlNullVerticalAlignment.class.st index 09e28c1e4..90c9653c8 100644 --- a/src/Bloc/BlNullVerticalAlignment.class.st +++ b/src/Bloc/BlNullVerticalAlignment.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlNullVerticalAlignment', - #superclass : 'BlNullAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlNullVerticalAlignment, + #superclass : #BlNullAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'composition' } +{ #category : #composition } BlNullVerticalAlignment >> + aHorizontalAlignment [ ^ BlCompositeAlignment horizontal: aHorizontalAlignment vertical: self ] -{ #category : 'translation' } +{ #category : #translation } BlNullVerticalAlignment >> translationOf: aBounds in: aContainerBounds [ ^ 0 @ 0 ] diff --git a/src/Bloc/BlOMouseProcessor.class.st b/src/Bloc/BlOMouseProcessor.class.st index 1893e8a42..a7699a2a5 100644 --- a/src/Bloc/BlOMouseProcessor.class.st +++ b/src/Bloc/BlOMouseProcessor.class.st @@ -7,8 +7,8 @@ Mouse actions are blocked during drag " Class { - #name : 'BlOMouseProcessor', - #superclass : 'BlBaseEventProcessor', + #name : #BlOMouseProcessor, + #superclass : #BlBaseEventProcessor, #instVars : [ 'lastEnteredTargets', 'lastOverTarget', @@ -21,25 +21,23 @@ Class { 'dragState', 'previousMouseDownEvent' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor class >> dblClickDelay [ ^ 600 milliSeconds ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlOMouseProcessor >> canBeClickEvent: aMouseUpEvent [ ^ dndInProgress not and: [ (previousMouseDownEvent isNotNil and: [ previousMouseDownEvent primaryButtonPressed ]) and: [ aMouseUpEvent target = previousMouseDownEvent target ] ] ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlOMouseProcessor >> canBeDblClickEvent: aMouseUpEvent [ self flag: 'testing aMouseUpEvent target = lastClickEvent target is in fact needed, however, it breaks the Phlow list'. @@ -49,7 +47,7 @@ BlOMouseProcessor >> canBeDblClickEvent: aMouseUpEvent [ and: [ aMouseUpEvent timestamp - lastClickEvent timestamp < self dblClickDelay ] ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlOMouseProcessor >> canStartDrag: aMouseMoveEvent [ @@ -59,26 +57,26 @@ BlOMouseProcessor >> canStartDrag: aMouseMoveEvent [ and: [ (aMouseMoveEvent position - previousMouseDownEvent position) r > self startDragThreshold ] ] ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor >> dblClickDelay [ ^ self class dblClickDelay ] -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor >> enteredTargets [ ^ lastEnteredTargets ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> fillTargetHierarchy: aTarget [ ^ Array streamContents: [ :aStream | aStream nextPut: aTarget. aTarget allParentsDo: [ :aParentElement | aStream nextPut: aParentElement ] ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsDragEndEvent: anEvent [ self fireEvent: @@ -90,7 +88,7 @@ BlOMouseProcessor >> fireAsDragEndEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsDragEnterEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -104,7 +102,7 @@ BlOMouseProcessor >> fireAsDragEnterEvent: anEvent targets: aCollection [ target: t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsDragEvent: anEvent [ self fireEvent: (anEvent asDragEvent @@ -115,7 +113,7 @@ BlOMouseProcessor >> fireAsDragEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsDragLeaveEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -129,7 +127,7 @@ BlOMouseProcessor >> fireAsDragLeaveEvent: anEvent targets: aCollection [ target: t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsDragStartEvent: anEvent [ ^ self fireEvent: (anEvent asDragStartEvent @@ -139,7 +137,7 @@ BlOMouseProcessor >> fireAsDragStartEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsDropEvent: anEvent [ self fireEvent: @@ -151,7 +149,7 @@ BlOMouseProcessor >> fireAsDropEvent: anEvent [ yourself) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsEnterEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -163,7 +161,7 @@ BlOMouseProcessor >> fireAsEnterEvent: anEvent targets: aCollection [ target: t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsMouseLeaveEvent: anEvent targets: aCollection [ aCollection do: [ :t | @@ -175,23 +173,23 @@ BlOMouseProcessor >> fireAsMouseLeaveEvent: anEvent targets: aCollection [ target:t ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsMouseOutEvent: aMouseEvent [ self fireEvent: (aMouseEvent asMouseOutEvent target: lastOverTarget) ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsMouseOutEvent: aMouseEvent targets: aCollection [ aCollection do: [ :eachElement | self fireEvent: (aMouseEvent asMouseOutEvent target: eachElement) ] ] -{ #category : 'event firing' } +{ #category : #'event firing' } BlOMouseProcessor >> fireAsMouseOverEvent: aMouseEvent [ self fireEvent: aMouseEvent asMouseOverEvent ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> generateEvents [ ((lastEnteredTargets, { lastOverTarget }) reject: [ :eachElement | eachElement isNil or: [ eachElement space == self space ] ]) asSet ifNotEmpty: [ :removedEnteredTargets | @@ -216,7 +214,7 @@ BlOMouseProcessor >> generateEvents [ ifFalse: [ lastClickEvent := nil ] ] -{ #category : 'mouse down' } +{ #category : #'mouse down' } BlOMouseProcessor >> handleMouseDown: aMouseDownEvent [ | aTargetElement | @@ -235,11 +233,11 @@ BlOMouseProcessor >> handleMouseDown: aMouseDownEvent [ previousMouseDownEvent := aMouseDownEvent ] -{ #category : 'mouse entered / left' } +{ #category : #'mouse entered / left' } BlOMouseProcessor >> handleMouseEntered: aSpaceMouseEnterEvent [ ] -{ #category : 'mouse entered / left' } +{ #category : #'mouse entered / left' } BlOMouseProcessor >> handleMouseLeft: aSpaceMouseLeaveEvent [ lastEnteredTargets do: [ :eachEnteredTarget | | anEvent | @@ -262,7 +260,7 @@ BlOMouseProcessor >> handleMouseLeft: aSpaceMouseLeaveEvent [ lastOverTarget := nil ] -{ #category : 'mouse move' } +{ #category : #'mouse move' } BlOMouseProcessor >> handleMouseMove: aMouseMoveEvent [ | aTargetElement shouldTryDragStart | "picking and mouse move" @@ -293,7 +291,7 @@ BlOMouseProcessor >> handleMouseMove: aMouseMoveEvent [ ifFalse: [ self processMouseMove: aMouseMoveEvent ] ] ] -{ #category : 'mouse up' } +{ #category : #'mouse up' } BlOMouseProcessor >> handleMouseUp: aMouseUpEvent [ "DragEnd, Simple click and Dbl click" | aTargetElement | @@ -315,7 +313,7 @@ BlOMouseProcessor >> handleMouseUp: aMouseUpEvent [ ifFalse: [ self processMouseUp: aMouseUpEvent ] ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlOMouseProcessor >> initialize [ super initialize. lastEnteredTargets := #(). @@ -327,7 +325,7 @@ BlOMouseProcessor >> initialize [ dragState := BlMouseDragState new ] -{ #category : 'testing' } +{ #category : #testing } BlOMouseProcessor >> isDragging [ "Return true if drag and drop is in process, false otherwise" @@ -335,7 +333,7 @@ BlOMouseProcessor >> isDragging [ ^ dndInProgress ] -{ #category : 'private' } +{ #category : #private } BlOMouseProcessor >> isMouseEventValid: anEvent [ anEvent ifNil: [ ^ false ]. @@ -349,33 +347,33 @@ BlOMouseProcessor >> isMouseEventValid: anEvent [ ^ true ] -{ #category : 'event testing' } +{ #category : #'event testing' } BlOMouseProcessor >> isValidDragTarget: aEvent [ ^ (aEvent target = self space root) not ] -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor >> lastClickEvent [ ^ lastClickEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor >> lastMouseDownEvent [ ^ previousMouseDownEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor >> lastOverTarget [ ^ lastOverTarget ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlOMouseProcessor >> onSpaceClosed [ lastEnteredTargets := #(). lastOverTarget := nil. @@ -388,12 +386,12 @@ BlOMouseProcessor >> onSpaceClosed [ previousMouseDownEvent := nil ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> postProcess: aMouseEvent [ ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> preProcess: aMouseEvent [ | aTarget | @@ -407,7 +405,7 @@ BlOMouseProcessor >> preProcess: aMouseEvent [ self updateCursorFrom: aTarget ] -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor >> pressedButtons [ "Return a collection of currently pressed mouse buttons" @@ -415,7 +413,7 @@ BlOMouseProcessor >> pressedButtons [ ^ pressedButtons ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlOMouseProcessor >> processDragEnd: aMouseUpEvent [ self @@ -437,7 +435,7 @@ BlOMouseProcessor >> processDragEnd: aMouseUpEvent [ dragStartMask := 0 ] ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlOMouseProcessor >> processDragMove: aMouseMoveEvent [ "check drag" @@ -450,7 +448,7 @@ BlOMouseProcessor >> processDragMove: aMouseMoveEvent [ lastOverTarget := aMouseMoveEvent target ] -{ #category : 'mouse move' } +{ #category : #'mouse move' } BlOMouseProcessor >> processMouseEnterLeaveEvent: aMouseEvent [ | newLeavedTargets newEnteredTargets currentEnteredTargets | @@ -481,7 +479,7 @@ BlOMouseProcessor >> processMouseEnterLeaveEvent: aMouseEvent [ lastEnteredTargets := currentEnteredTargets ] -{ #category : 'mouse move' } +{ #category : #'mouse move' } BlOMouseProcessor >> processMouseMove: aMouseMoveEvent [ self processMouseEnterLeaveEvent: aMouseMoveEvent. @@ -492,7 +490,7 @@ BlOMouseProcessor >> processMouseMove: aMouseMoveEvent [ ] -{ #category : 'event handling entrypoint' } +{ #category : #'event handling entrypoint' } BlOMouseProcessor >> processMouseScroll: aMouseScrollEvent [ "picking and mouse move" self preProcess: aMouseScrollEvent. @@ -500,7 +498,7 @@ BlOMouseProcessor >> processMouseScroll: aMouseScrollEvent [ self postProcess: aMouseScrollEvent ] -{ #category : 'mouse up' } +{ #category : #'mouse up' } BlOMouseProcessor >> processMouseUp: aMouseUpEvent [ self fireEvent: aMouseUpEvent. @@ -520,7 +518,7 @@ BlOMouseProcessor >> processMouseUp: aMouseUpEvent [ lastClickEvent := aClickEvent copy ] ] ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> processPicking: aMouseEvent [ @@ -541,12 +539,12 @@ BlOMouseProcessor >> processPicking: aMouseEvent [ ^ aTargetElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlOMouseProcessor >> startDragThreshold [ ^ 4 ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlOMouseProcessor >> subprocessDragEnterExitEvent: aMouseEvent [ | newEnteredTargets newExitedTargets currentEnteredTargets | @@ -566,7 +564,7 @@ BlOMouseProcessor >> subprocessDragEnterExitEvent: aMouseEvent [ lastEnteredTargets := currentEnteredTargets ] -{ #category : 'mouse drag' } +{ #category : #'mouse drag' } BlOMouseProcessor >> tryDragStart: aMouseEvent [ "Try to start a drag and return true if drag actually started, otherwise false" @@ -589,7 +587,7 @@ BlOMouseProcessor >> tryDragStart: aMouseEvent [ ^ dndInProgress := aDragStartEvent isConsumed ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> updateCursorFrom: aTarget [ | t | t := aTarget. @@ -599,12 +597,12 @@ BlOMouseProcessor >> updateCursorFrom: aTarget [ self space currentCursor: t mouseCursor ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> updateDragView [ ] -{ #category : 'event processing' } +{ #category : #'event processing' } BlOMouseProcessor >> updateFocusOwner: aNode [ ] diff --git a/src/Bloc/BlOSpace.class.st b/src/Bloc/BlOSpace.class.st index 6c19774b2..3084cc4bf 100644 --- a/src/Bloc/BlOSpace.class.st +++ b/src/Bloc/BlOSpace.class.st @@ -4,14 +4,12 @@ It should be removed as soon as we convert all the examples as tests and move ev " Class { - #name : 'BlOSpace', - #superclass : 'BlSpace', - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #name : #BlOSpace, + #superclass : #BlSpace, + #category : 'Bloc-Space' } -{ #category : 'change - style' } +{ #category : #'change - style' } BlOSpace class >> doStyle: anElement [ | theInheritedStates childSpecificStatesToInherit | @@ -30,7 +28,7 @@ BlOSpace class >> doStyle: anElement [ theInheritedStates do: [ :eachState | eachState finishedPropagateFrom: anElement ] ] -{ #category : 'change - style' } +{ #category : #'change - style' } BlOSpace class >> doStyle: anElement withInheritedStates: aCollectionOfStates [ | theStatesToInherit allNewStates newInheritedStates | @@ -59,20 +57,20 @@ BlOSpace class >> doStyle: anElement withInheritedStates: aCollectionOfStates [ theStatesToInherit do: [ :eachState | eachState finishedPropagateFrom: anElement ] ] -{ #category : 'api - adding children' } +{ #category : #'api - adding children' } BlOSpace >> addChild: anElement [ "Add a given element as a direct child to the space root" self root addChild: anElement ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlOSpace >> children [ ^ self root children ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlOSpace >> looseFocusFor: anElement [ self @@ -84,7 +82,7 @@ BlOSpace >> looseFocusFor: anElement [ self loseFocusFor: anElement ] -{ #category : 'api - adding children' } +{ #category : #'api - adding children' } BlOSpace >> removeChild: anElement [ "Remove a given element from the space root" diff --git a/src/Bloc/BlOSpaceFrame.class.st b/src/Bloc/BlOSpaceFrame.class.st index 1c085116a..b63cff795 100644 --- a/src/Bloc/BlOSpaceFrame.class.st +++ b/src/Bloc/BlOSpaceFrame.class.st @@ -16,15 +16,13 @@ The list of default phases is initialized in {{gtMethod:BlSpaceFrame>>#initializ " Class { - #name : 'BlOSpaceFrame', - #superclass : 'BlSpaceFrame', + #name : #BlOSpaceFrame, + #superclass : #BlSpaceFrame, #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #category : 'Bloc-Space - Frame' } -{ #category : 'initialization' } +{ #category : #initialization } BlOSpaceFrame >> initializePhases [ self addPhases: { BlSpaceFrameIdlePhase new. diff --git a/src/Bloc/BlObjectPool.class.st b/src/Bloc/BlObjectPool.class.st index 7a27c1592..cfba9b536 100644 --- a/src/Bloc/BlObjectPool.class.st +++ b/src/Bloc/BlObjectPool.class.st @@ -3,19 +3,17 @@ I represent a pool of objects " Class { - #name : 'BlObjectPool', - #superclass : 'Object', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #name : #BlObjectPool, + #superclass : #Object, + #category : 'Bloc-Basic-Support' } -{ #category : 'pool' } +{ #category : #pool } BlObjectPool >> acquire [ ^ self subclassResponsibility ] -{ #category : 'pool' } +{ #category : #pool } BlObjectPool >> release: anObject [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlOnActionHandler.class.st b/src/Bloc/BlOnActionHandler.class.st index 4f29764c2..07900a8b9 100644 --- a/src/Bloc/BlOnActionHandler.class.st +++ b/src/Bloc/BlOnActionHandler.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlOnActionHandler', - #superclass : 'BlActionHandler', + #name : #BlOnActionHandler, + #superclass : #BlActionHandler, #instVars : [ 'action' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlOnActionHandler class >> do: aBlock [ ^ self new action: aBlock; yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlOnActionHandler >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlOnActionHandler >> action: anObject [ action := anObject ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlOnActionHandler >> actionPerformed [ action value ] diff --git a/src/Bloc/BlOutskirts.class.st b/src/Bloc/BlOutskirts.class.st index e7f5c797d..1b381ffb0 100644 --- a/src/Bloc/BlOutskirts.class.st +++ b/src/Bloc/BlOutskirts.class.st @@ -2,41 +2,39 @@ I define the strategy to be used to draw the border (inside/outside/centered) " Class { - #name : 'BlOutskirts', - #superclass : 'Object', + #name : #BlOutskirts, + #superclass : #Object, #classVars : [ 'Centered', 'Inside', 'Outside' ], - #category : 'Bloc-Basic-Border', - #package : 'Bloc', - #tag : 'Basic-Border' + #category : 'Bloc-Basic-Border' } -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlOutskirts class >> centered [ ^ Centered ifNil: [ Centered := BlOutskirtsCentered new ] ] -{ #category : 'cleanup' } +{ #category : #cleanup } BlOutskirts class >> cleanUp [ super cleanUp. Centered := Inside := Outside := nil ] -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlOutskirts class >> inside [ ^ Inside ifNil: [ Inside := BlOutskirtsInside new ] ] -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlOutskirts class >> outside [ ^ Outside ifNil: [ Outside := BlOutskirtsOutside new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlOutskirts >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -45,19 +43,19 @@ BlOutskirts >> = anObject [ ^ self class = anObject class ] -{ #category : 'comparing' } +{ #category : #comparing } BlOutskirts >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ self class hash ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlOutskirts >> strokedBounds: aBlBounds of: anElement [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlOutskirts >> wantsLayerOn: anElement [ "Return true if background and border should be rendered on a separate layer, false otherwise" diff --git a/src/Bloc/BlOutskirtsCentered.class.st b/src/Bloc/BlOutskirtsCentered.class.st index 8c8e70b99..2b80dbb75 100644 --- a/src/Bloc/BlOutskirtsCentered.class.st +++ b/src/Bloc/BlOutskirtsCentered.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlOutskirtsCentered', - #superclass : 'BlOutskirts', - #category : 'Bloc-Basic-Border', - #package : 'Bloc', - #tag : 'Basic-Border' + #name : #BlOutskirtsCentered, + #superclass : #BlOutskirts, + #category : 'Bloc-Basic-Border' } -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlOutskirtsCentered >> strokedBounds: aBlBounds of: anElement [ ^ anElement geometry strokedBoundsCentered: aBlBounds of: anElement ] -{ #category : 'testing' } +{ #category : #testing } BlOutskirtsCentered >> wantsLayerOn: anElement [ "Return true if background and border should be rendered on a separate layer, false otherwise" diff --git a/src/Bloc/BlOutskirtsInside.class.st b/src/Bloc/BlOutskirtsInside.class.st index 8ee5b8c05..82d747281 100644 --- a/src/Bloc/BlOutskirtsInside.class.st +++ b/src/Bloc/BlOutskirtsInside.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlOutskirtsInside', - #superclass : 'BlOutskirts', - #category : 'Bloc-Basic-Border', - #package : 'Bloc', - #tag : 'Basic-Border' + #name : #BlOutskirtsInside, + #superclass : #BlOutskirts, + #category : 'Bloc-Basic-Border' } -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlOutskirtsInside >> strokedBounds: aBlBounds of: anElement [ ^ anElement geometry strokedBoundsInside: aBlBounds of: anElement ] -{ #category : 'testing' } +{ #category : #testing } BlOutskirtsInside >> wantsLayerOn: anElement [ "Return true if background and border should be rendered on a separate layer, false otherwise" diff --git a/src/Bloc/BlOutskirtsOutside.class.st b/src/Bloc/BlOutskirtsOutside.class.st index 2d4dbeaa3..91f66ebfd 100644 --- a/src/Bloc/BlOutskirtsOutside.class.st +++ b/src/Bloc/BlOutskirtsOutside.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlOutskirtsOutside', - #superclass : 'BlOutskirts', - #category : 'Bloc-Basic-Border', - #package : 'Bloc', - #tag : 'Basic-Border' + #name : #BlOutskirtsOutside, + #superclass : #BlOutskirts, + #category : 'Bloc-Basic-Border' } -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlOutskirtsOutside >> strokedBounds: aBlBounds of: anElement [ ^ anElement geometry strokedBoundsOutside: aBlBounds of: anElement ] -{ #category : 'testing' } +{ #category : #testing } BlOutskirtsOutside >> wantsLayerOn: anElement [ "Return true if background and border should be rendered on a separate layer, false otherwise" diff --git a/src/Bloc/BlOverlayAboveEffect.class.st b/src/Bloc/BlOverlayAboveEffect.class.st index 775a7f205..fcf8138c4 100644 --- a/src/Bloc/BlOverlayAboveEffect.class.st +++ b/src/Bloc/BlOverlayAboveEffect.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlOverlayAboveEffect', - #superclass : 'BlOverlayEffect', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #name : #BlOverlayAboveEffect, + #superclass : #BlOverlayEffect, + #category : 'Bloc-Effect' } diff --git a/src/Bloc/BlOverlayBelowEffect.class.st b/src/Bloc/BlOverlayBelowEffect.class.st index 30560c3f9..63ef27816 100644 --- a/src/Bloc/BlOverlayBelowEffect.class.st +++ b/src/Bloc/BlOverlayBelowEffect.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlOverlayBelowEffect', - #superclass : 'BlOverlayEffect', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #name : #BlOverlayBelowEffect, + #superclass : #BlOverlayEffect, + #category : 'Bloc-Effect' } diff --git a/src/Bloc/BlOverlayEffect.class.st b/src/Bloc/BlOverlayEffect.class.st index e5ec440ac..60fbf903e 100644 --- a/src/Bloc/BlOverlayEffect.class.st +++ b/src/Bloc/BlOverlayEffect.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlOverlayEffect', - #superclass : 'BlElementEffect', + #name : #BlOverlayEffect, + #superclass : #BlElementEffect, #instVars : [ 'paint' ], - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'initialization' } +{ #category : #initialization } BlOverlayEffect >> initialize [ super initialize. paint := Color transparent ] -{ #category : 'accessing' } +{ #category : #accessing } BlOverlayEffect >> paint [ ^ paint ] -{ #category : 'accessing' } +{ #category : #accessing } BlOverlayEffect >> paint: anObject [ paint := anObject ] diff --git a/src/Bloc/BlOverlayElement.class.st b/src/Bloc/BlOverlayElement.class.st index fc1c7b3f3..a66bb0ddf 100644 --- a/src/Bloc/BlOverlayElement.class.st +++ b/src/Bloc/BlOverlayElement.class.st @@ -10,23 +10,21 @@ container addChild: overlay. " Class { - #name : 'BlOverlayElement', - #superclass : 'BlElement', + #name : #BlOverlayElement, + #superclass : #BlElement, #instVars : [ 'overlayListener', 'referenceElement' ], - #category : 'Bloc-Overlay', - #package : 'Bloc', - #tag : 'Overlay' + #category : 'Bloc-Overlay' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlOverlayElement class >> on: anElement [ ^ self new attachTo: anElement ] -{ #category : 'api - attaching / detaching' } +{ #category : #'api - attaching / detaching' } BlOverlayElement >> attachTo: anElement [ referenceElement = anElement @@ -39,7 +37,7 @@ BlOverlayElement >> attachTo: anElement [ anElement addEventHandler: overlayListener ] -{ #category : 'api - attaching / detaching' } +{ #category : #'api - attaching / detaching' } BlOverlayElement >> detach [ self isAttached @@ -49,13 +47,13 @@ BlOverlayElement >> detach [ referenceElement := nil ] -{ #category : 'hook - geometry' } +{ #category : #'hook - geometry' } BlOverlayElement >> extentFrom: anExtent [ ^ anExtent ] -{ #category : 'initialization' } +{ #category : #initialization } BlOverlayElement >> initialize [ super initialize. @@ -66,7 +64,7 @@ BlOverlayElement >> initialize [ self preventMouseEvents ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlOverlayElement >> isAttached [ "Return true if I am attached to any element, false otherwise" @@ -74,7 +72,7 @@ BlOverlayElement >> isAttached [ ^ referenceElement isNotNil ] -{ #category : 'hooks - children' } +{ #category : #'hooks - children' } BlOverlayElement >> onAddedToSceneGraph [ super onAddedToSceneGraph. @@ -85,7 +83,7 @@ BlOverlayElement >> onAddedToSceneGraph [ overlayListener resizeTo: referenceElement. ] -{ #category : 'hook - geometry' } +{ #category : #'hook - geometry' } BlOverlayElement >> positionFrom: aPosition [ ^ aPosition diff --git a/src/Bloc/BlOverlayListener.class.st b/src/Bloc/BlOverlayListener.class.st index e5c92935b..28bed3d0a 100644 --- a/src/Bloc/BlOverlayListener.class.st +++ b/src/Bloc/BlOverlayListener.class.st @@ -3,46 +3,44 @@ I am an event listener that overlay element adds to the reference element in ord " Class { - #name : 'BlOverlayListener', - #superclass : 'BlCustomEventHandler', + #name : #BlOverlayListener, + #superclass : #BlCustomEventHandler, #instVars : [ 'overlayElement', 'attachmentsCount' ], - #category : 'Bloc-Overlay', - #package : 'Bloc', - #tag : 'Overlay' + #category : 'Bloc-Overlay' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlOverlayListener class >> for: anOverlayElement [ ^ self basicNew initialize; overlayElement: anOverlayElement ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlOverlayListener class >> new [ self error: 'Do not create an instance of ', self name, ' using new. Please use #for: instead' ] -{ #category : 'element handlers' } +{ #category : #'element handlers' } BlOverlayListener >> elementExtentChangedEvent: anEvent [ self resizeTo: anEvent currentTarget ] -{ #category : 'element handlers' } +{ #category : #'element handlers' } BlOverlayListener >> elementPositionInSpaceChangedEvent: anEvent [ self relocateTo: anEvent currentTarget ] -{ #category : 'element handlers' } +{ #category : #'element handlers' } BlOverlayListener >> elementTransformationInSpaceChangedEvent: anEvent [ self relocateTo: anEvent currentTarget. self resizeTo: anEvent currentTarget. ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlOverlayListener >> eventsToHandle [ ^ { BlElementExtentChangedEvent . @@ -51,7 +49,7 @@ BlOverlayListener >> eventsToHandle [ } ] -{ #category : 'geometry' } +{ #category : #geometry } BlOverlayListener >> extentFor: anElement [ @@ -60,14 +58,14 @@ BlOverlayListener >> extentFor: anElement [ ^ self overlayElement extentFrom: (self overlayElement globalBoundsToLocal: bnds) extent ] -{ #category : 'initialization' } +{ #category : #initialization } BlOverlayListener >> initialize [ super initialize. attachmentsCount := 0 ] -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlOverlayListener >> onInstalledIn: anElement [ self assert: [ attachmentsCount isZero ] @@ -79,7 +77,7 @@ BlOverlayListener >> onInstalledIn: anElement [ self resizeTo: anElement ] -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlOverlayListener >> onUninstalledIn: anObject [ self @@ -89,32 +87,32 @@ BlOverlayListener >> onUninstalledIn: anObject [ attachmentsCount := attachmentsCount - 1 ] -{ #category : 'accessing' } +{ #category : #accessing } BlOverlayListener >> overlayElement [ ^ overlayElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlOverlayListener >> overlayElement: anOverlayElement [ overlayElement := anOverlayElement ] -{ #category : 'geometry' } +{ #category : #geometry } BlOverlayListener >> positionFor: anElement [ ^ self overlayElement positionFrom: (self overlayElement globalPointToParent: anElement bounds inSpace position) ] -{ #category : 'api - updating' } +{ #category : #'api - updating' } BlOverlayListener >> relocateTo: anElement [ self overlayElement position: (self positionFor: anElement) ] -{ #category : 'api - updating' } +{ #category : #'api - updating' } BlOverlayListener >> resizeTo: anElement [ self overlayElement size: (self extentFor: anElement) ] diff --git a/src/Bloc/BlPaint.class.st b/src/Bloc/BlPaint.class.st index c74da1e15..f6fca80d2 100644 --- a/src/Bloc/BlPaint.class.st +++ b/src/Bloc/BlPaint.class.st @@ -6,16 +6,14 @@ All paints are meant to be immutable " Class { - #name : 'BlPaint', - #superclass : 'Object', + #name : #BlPaint, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Paint', - #package : 'Bloc', - #tag : 'Paint' + #category : 'Bloc-Paint' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPaint class >> transparent [ "Return a completely transparent paint" @@ -23,23 +21,23 @@ BlPaint class >> transparent [ ^ BlColorPaint transparent ] -{ #category : 'converting' } +{ #category : #converting } BlPaint >> asBlBackground [ ^ BlBackground paint: self ] -{ #category : 'converting' } +{ #category : #converting } BlPaint >> asBlPaint [ ^ self ] -{ #category : 'testing' } +{ #category : #testing } BlPaint >> isColorPaint [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlPaint >> isOpaque [ "Return true if I am opaque, false otherwise. It is important to implement paint specific logic in subclasses. @@ -49,7 +47,7 @@ BlPaint >> isOpaque [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlPaint >> isTransparent [ "Return true if I am transparent, false otherwise. It is important to implement paint specific logic in subclasses. @@ -59,7 +57,7 @@ BlPaint >> isTransparent [ ^ false ] -{ #category : 'geometry' } +{ #category : #geometry } BlPaint >> matchExtent: anExtent [ self subclassResponsibility ] diff --git a/src/Bloc/BlPaintBackground.class.st b/src/Bloc/BlPaintBackground.class.st index 234d439ff..838791d3f 100644 --- a/src/Bloc/BlPaintBackground.class.st +++ b/src/Bloc/BlPaintBackground.class.st @@ -7,22 +7,20 @@ Examples are provided by the class {{gtClass:BlPaintBackgroundExamples}}. " Class { - #name : 'BlPaintBackground', - #superclass : 'BlBackground', + #name : #BlPaintBackground, + #superclass : #BlBackground, #instVars : [ 'paint' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPaintBackground class >> paint: aBlPaint [ ^ self new paint: aBlPaint ] -{ #category : 'comparing' } +{ #category : #comparing } BlPaintBackground >> = anotherObject [ self == anotherObject ifTrue: [ ^ true ]. @@ -32,44 +30,44 @@ BlPaintBackground >> = anotherObject [ ^ anotherObject paint = self paint ] -{ #category : 'comparing' } +{ #category : #comparing } BlPaintBackground >> hash [ ^ self paint hash bitXor: self class hash ] -{ #category : 'testing' } +{ #category : #testing } BlPaintBackground >> isOpaque [ ^ (self opacity closeTo: 1) and: [ self paint isOpaque ] ] -{ #category : 'testing' } +{ #category : #testing } BlPaintBackground >> isPaintBackground [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlPaintBackground >> isTransparent [ "Paint background is transparent then and only then when paint is transparent or opacity is close to 0" ^ (self opacity closeTo: 0.0) or: [ self paint isTransparent ] ] -{ #category : 'geometry' } +{ #category : #geometry } BlPaintBackground >> matchExtent: anExtent [ self paint matchExtent: anExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlPaintBackground >> paint [ ^ paint ] -{ #category : 'accessing' } +{ #category : #accessing } BlPaintBackground >> paint: aBlPaint [ paint isNotNil diff --git a/src/Bloc/BlPaintBackgroundBuilder.class.st b/src/Bloc/BlPaintBackgroundBuilder.class.st index 33d8b84d8..192822d66 100644 --- a/src/Bloc/BlPaintBackgroundBuilder.class.st +++ b/src/Bloc/BlPaintBackgroundBuilder.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlPaintBackgroundBuilder', - #superclass : 'BlBackgroundBuilder', + #name : #BlPaintBackgroundBuilder, + #superclass : #BlBackgroundBuilder, #instVars : [ 'paint' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'building' } +{ #category : #building } BlPaintBackgroundBuilder >> build [ ^ (BlPaintBackground paint: self paint) opacity: self opacity ] -{ #category : 'accessing' } +{ #category : #accessing } BlPaintBackgroundBuilder >> paint [ ^ paint ] -{ #category : 'accessing' } +{ #category : #accessing } BlPaintBackgroundBuilder >> paint: aBlPaint [ paint := aBlPaint ] diff --git a/src/Bloc/BlParallelUniverse.class.st b/src/Bloc/BlParallelUniverse.class.st index 13012d967..efb54b32a 100644 --- a/src/Bloc/BlParallelUniverse.class.st +++ b/src/Bloc/BlParallelUniverse.class.st @@ -3,8 +3,8 @@ I am a parallel Universe. There can exist multiple parallel universes " Class { - #name : 'BlParallelUniverse', - #superclass : 'Object', + #name : #BlParallelUniverse, + #superclass : #Object, #traits : 'TBlEventTarget', #classTraits : 'TBlEventTarget classTrait', #instVars : [ @@ -21,19 +21,17 @@ Class { 'Universes', 'UniversesMutex' ], - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverse class >> all [ "Return a collection with all the registered instances" ^ Universes ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlParallelUniverse class >> existsForHost: aHostClass [ ^ UniversesMutex critical: [ @@ -43,7 +41,7 @@ BlParallelUniverse class >> existsForHost: aHostClass [ ifNone: [ false ] ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlParallelUniverse class >> forHost: aHostClass [ ^ UniversesMutex critical: [ @@ -56,14 +54,14 @@ BlParallelUniverse class >> forHost: aHostClass [ aUniverse ] ] ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlParallelUniverse class >> initialize [ Universes := #(). UniversesMutex := Mutex new. UniqueIdGenerator := BlUniqueIdGenerator new ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> attachSpace: aSpace [ "Attach a given space to the universe. It is assumed that the space was previously detached from another Universe. Is useful for changing space host." @@ -86,7 +84,7 @@ BlParallelUniverse >> attachSpace: aSpace [ isRunning: aSpace host isRunning) emit ] ] -{ #category : 'private - spaces' } +{ #category : #'private - spaces' } BlParallelUniverse >> attachSpaceSynchronously: aSpace [ "Synchronously attach a given space to the Universe assuming that the message is sent from within the UI process of this universe and the space was previously detached from another universe." @@ -130,14 +128,14 @@ BlParallelUniverse >> attachSpaceSynchronously: aSpace [ spaceId: aSpace id) emit ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> closeSpace: aSpace [ aSpace isOpened ifFalse: [ ^ self ]. self defer: [ self closeSpaceSynchronously: aSpace ] ] -{ #category : 'private - spaces' } +{ #category : #'private - spaces' } BlParallelUniverse >> closeSpaceSynchronously: aSpace [ | aHost | @@ -198,22 +196,22 @@ BlParallelUniverse >> closeSpaceSynchronously: aSpace [ aSpace dispatchEvent: (BlSpaceDestroyedEvent new space: aSpace). ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> closeSpaces [ self spaces copy do: [ :aSpace | self closeSpace: aSpace ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlParallelUniverse >> defaultEventDispatcher [ ^ BlDirectEventDispatcher on: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlParallelUniverse >> defaultEventListener [ ^ BlUniverseEventListener new ] -{ #category : 'api - ui process' } +{ #category : #'api - ui process' } BlParallelUniverse >> defer: aValuable [ "Enqueue a valuable from any process to be executed in the UI process at the beginning of the next pulse. It is useful to update the UI states." @@ -223,7 +221,7 @@ BlParallelUniverse >> defer: aValuable [ deferredActions nextPut: aValuable ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> detachSpace: aSpace [ "Detach a given space from this universe without actually closing the space. Space detaching is useful for switching hosts and transferring spaces between universes." @@ -233,7 +231,7 @@ BlParallelUniverse >> detachSpace: aSpace [ self defer: [ self detachSpaceSynchronously: aSpace ] ] -{ #category : 'private - spaces' } +{ #category : #'private - spaces' } BlParallelUniverse >> detachSpaceSynchronously: aSpace [ "Detaches a given space from this universe without closing that space." @@ -282,7 +280,7 @@ BlParallelUniverse >> detachSpaceSynchronously: aSpace [ aSpace dispatchEvent: (BlSpaceDetachedEvent new space: aSpace). ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } BlParallelUniverse >> eventDispatcher [ "Return an object responsible for event dispatching" @@ -290,7 +288,7 @@ BlParallelUniverse >> eventDispatcher [ ^ eventDispatcher ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> hasSpace: aSpace [ "Return true if a given space is registered, false otherwise" @@ -298,7 +296,7 @@ BlParallelUniverse >> hasSpace: aSpace [ ^ spaceManager hasSpace: aSpace ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> hasSpaces [ "Return true if there are registered spaces, false otherwise" @@ -306,31 +304,31 @@ BlParallelUniverse >> hasSpaces [ ^ spaceManager hasSpaces ] -{ #category : 'api - ui process' } +{ #category : #'api - ui process' } BlParallelUniverse >> hasUIProcess [ self uiProcessDo: [ :aUIProcess | ^ true ]. ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverse >> hostClass [ ^ hostClass ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverse >> hostClass: aHostClass [ hostClass := aHostClass ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverse >> id [ ^ id ] -{ #category : 'initialization' } +{ #category : #initialization } BlParallelUniverse >> initialize [ super initialize. @@ -346,18 +344,18 @@ BlParallelUniverse >> initialize [ self addEventHandler: self defaultEventListener ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverse >> isPulsing [ ^ isPulsing ] -{ #category : 'private - spaces' } +{ #category : #'private - spaces' } BlParallelUniverse >> markAsNotPulsing [ isPulsing := false ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> openSpace: aSpace [ "It should be possible to add a space from the other thread" @@ -384,7 +382,7 @@ BlParallelUniverse >> openSpace: aSpace [ isRunning: aSpace host isRunning) emit ] ] -{ #category : 'private - spaces' } +{ #category : #'private - spaces' } BlParallelUniverse >> openSpaceSynchronously: aSpace [ aSpace isOpened @@ -432,7 +430,7 @@ BlParallelUniverse >> openSpaceSynchronously: aSpace [ spaceId: aSpace id) emit ] -{ #category : 'api - ui process' } +{ #category : #'api - ui process' } BlParallelUniverse >> postpone: aValuable [ "#postpone: can be used from any thread to execute a valuable in the GUI thread after the pulse is completed. @@ -441,7 +439,7 @@ BlParallelUniverse >> postpone: aValuable [ postponedActions nextPut: aValuable ] -{ #category : 'pulse' } +{ #category : #pulse } BlParallelUniverse >> pulse [ isPulsing ifTrue: [ ^ self ]. @@ -451,7 +449,7 @@ BlParallelUniverse >> pulse [ [ self pulseSynchronously ] ensure: [ self requestStopPulsation ] ] -{ #category : 'private - spaces' } +{ #category : #'private - spaces' } BlParallelUniverse >> pulseSynchronously [ "deferred actions must be run before spaces" [ @@ -460,7 +458,7 @@ BlParallelUniverse >> pulseSynchronously [ ] ensure: [ self tryToRunPostponedActions ] ] -{ #category : 'private - spaces' } +{ #category : #'private - spaces' } BlParallelUniverse >> requestStopPulsation [ self uiProcessDo: [ :currentUIProcess | @@ -472,19 +470,19 @@ BlParallelUniverse >> requestStopPulsation [ ifTrue: [ self markAsNotPulsing ] ] ] -{ #category : 'api - lifecycle' } +{ #category : #'api - lifecycle' } BlParallelUniverse >> snapshot: save andQuit: quit [ self postpone: [ Smalltalk snapshot: save andQuit: quit ] ] -{ #category : 'api - spaces' } +{ #category : #'api - spaces' } BlParallelUniverse >> spaces [ ^ spaceManager spaces ] -{ #category : 'private - lifecycle' } +{ #category : #'private - lifecycle' } BlParallelUniverse >> startUniverse [ "A universe must not be running here. I am called outside of the UI loop (there is no UI loop yet)" @@ -493,7 +491,7 @@ BlParallelUniverse >> startUniverse [ self hostClass start ] -{ #category : 'private - lifecycle' } +{ #category : #'private - lifecycle' } BlParallelUniverse >> stopUniverse [ "A universe must be running here. I am called from the UI loop" @@ -503,7 +501,7 @@ BlParallelUniverse >> stopUniverse [ ensure: [ self markAsNotPulsing ] ] -{ #category : 'deferred message' } +{ #category : #'deferred message' } BlParallelUniverse >> tryToRunDeferredActions [ | nextInQueue | @@ -520,7 +518,7 @@ BlParallelUniverse >> tryToRunDeferredActions [ [ nextInQueue value ] on: UnhandledError fork: [ :ex | ex pass ] ] ] -{ #category : 'deferred message' } +{ #category : #'deferred message' } BlParallelUniverse >> tryToRunPostponedActions [ | nextInQueue | @@ -528,7 +526,7 @@ BlParallelUniverse >> tryToRunPostponedActions [ [ nextInQueue value ] on: UnhandledError fork: [ :ex | ex pass ] ] ] -{ #category : 'api - ui process' } +{ #category : #'api - ui process' } BlParallelUniverse >> uiProcessDo: aBlock [ self hostClass uiProcessDo: aBlock diff --git a/src/Bloc/BlParallelUniverseDeferredActionAddedSignal.class.st b/src/Bloc/BlParallelUniverseDeferredActionAddedSignal.class.st index 900b6de1d..4b89e4c7b 100644 --- a/src/Bloc/BlParallelUniverseDeferredActionAddedSignal.class.st +++ b/src/Bloc/BlParallelUniverseDeferredActionAddedSignal.class.st @@ -3,24 +3,22 @@ I am sent when a there was a deferred action added to the universe using `defer: " Class { - #name : 'BlParallelUniverseDeferredActionAddedSignal', - #superclass : 'BlParallelUniverseSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseDeferredActionAddedSignal, + #superclass : #BlParallelUniverseSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseDeferredActionAddedSignal class >> isRepeatable [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseDeferredActionAddedSignal class >> label [ ^ 'Add deferred action' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseDeferredActionAddedSignal class >> nextSignals [ ^ { BlParallelUniverseHostStartRequestSignal . BlParallelUniverseTryToRunDeferredActionsSignal } ] diff --git a/src/Bloc/BlParallelUniverseHostSpaceCreatedSignal.class.st b/src/Bloc/BlParallelUniverseHostSpaceCreatedSignal.class.st index 029e06533..482b664ab 100644 --- a/src/Bloc/BlParallelUniverseHostSpaceCreatedSignal.class.st +++ b/src/Bloc/BlParallelUniverseHostSpaceCreatedSignal.class.st @@ -3,19 +3,17 @@ Is sent after a host space was created and assigned to the space " Class { - #name : 'BlParallelUniverseHostSpaceCreatedSignal', - #superclass : 'BlParallelUniverseSpaceSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseHostSpaceCreatedSignal, + #superclass : #BlParallelUniverseSpaceSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostSpaceCreatedSignal class >> label [ ^ 'Create space host' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostSpaceCreatedSignal class >> nextSignals [ ^ { BlParallelUniverseHostSpaceShownSignal } ] diff --git a/src/Bloc/BlParallelUniverseHostSpaceShownSignal.class.st b/src/Bloc/BlParallelUniverseHostSpaceShownSignal.class.st index 922526608..1c681cf83 100644 --- a/src/Bloc/BlParallelUniverseHostSpaceShownSignal.class.st +++ b/src/Bloc/BlParallelUniverseHostSpaceShownSignal.class.st @@ -3,19 +3,17 @@ Is sent after a host space is shown " Class { - #name : 'BlParallelUniverseHostSpaceShownSignal', - #superclass : 'BlParallelUniverseSpaceSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseHostSpaceShownSignal, + #superclass : #BlParallelUniverseSpaceSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostSpaceShownSignal class >> label [ ^ 'Show space host' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostSpaceShownSignal class >> nextSignals [ ^ { BlParallelUniverseSpaceRootAssignedSignal } ] diff --git a/src/Bloc/BlParallelUniverseHostStartRequestSignal.class.st b/src/Bloc/BlParallelUniverseHostStartRequestSignal.class.st index 16843c94f..43203fa8e 100644 --- a/src/Bloc/BlParallelUniverseHostStartRequestSignal.class.st +++ b/src/Bloc/BlParallelUniverseHostStartRequestSignal.class.st @@ -3,34 +3,32 @@ I am sent when a universe requests a host to start " Class { - #name : 'BlParallelUniverseHostStartRequestSignal', - #superclass : 'BlParallelUniverseSpaceSignal', + #name : #BlParallelUniverseHostStartRequestSignal, + #superclass : #BlParallelUniverseSpaceSignal, #instVars : [ 'host' ], - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartRequestSignal class >> label [ ^ 'Request host start' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartRequestSignal class >> nextSignals [ ^ { BlParallelUniverseHostStartedSignal } ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartRequestSignal >> host [ ^ host ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartRequestSignal >> host: aBlHostClass [ host := aBlHostClass ] diff --git a/src/Bloc/BlParallelUniverseHostStartedSignal.class.st b/src/Bloc/BlParallelUniverseHostStartedSignal.class.st index 263fa5d0b..d66e77050 100644 --- a/src/Bloc/BlParallelUniverseHostStartedSignal.class.st +++ b/src/Bloc/BlParallelUniverseHostStartedSignal.class.st @@ -3,45 +3,43 @@ I am sent when a universe started a host " Class { - #name : 'BlParallelUniverseHostStartedSignal', - #superclass : 'BlParallelUniverseSpaceSignal', + #name : #BlParallelUniverseHostStartedSignal, + #superclass : #BlParallelUniverseSpaceSignal, #instVars : [ 'host', 'isRunning' ], - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartedSignal class >> label [ ^ 'Start host' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartedSignal class >> nextSignals [ ^ { BlParallelUniverseTryToRunDeferredActionsSignal } ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartedSignal >> host [ ^ host ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartedSignal >> host: aBlHostClass [ host := aBlHostClass ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartedSignal >> isRunning [ ^ isRunning ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseHostStartedSignal >> isRunning: anObject [ isRunning := anObject ] diff --git a/src/Bloc/BlParallelUniverseOpenSpaceRequestSignal.class.st b/src/Bloc/BlParallelUniverseOpenSpaceRequestSignal.class.st index e8e576805..6416ab6c4 100644 --- a/src/Bloc/BlParallelUniverseOpenSpaceRequestSignal.class.st +++ b/src/Bloc/BlParallelUniverseOpenSpaceRequestSignal.class.st @@ -3,32 +3,30 @@ Is signalled when someone requests a universe to open a space. " Class { - #name : 'BlParallelUniverseOpenSpaceRequestSignal', - #superclass : 'BlParallelUniverseSpaceSignal', + #name : #BlParallelUniverseOpenSpaceRequestSignal, + #superclass : #BlParallelUniverseSpaceSignal, #instVars : [ 'isRunning' ], - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseOpenSpaceRequestSignal class >> label [ ^ 'Request open space' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseOpenSpaceRequestSignal class >> nextSignals [ ^ { BlParallelUniverseDeferredActionAddedSignal } ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseOpenSpaceRequestSignal >> isRunning [ ^ isRunning ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseOpenSpaceRequestSignal >> isRunning: anObject [ isRunning := anObject ] diff --git a/src/Bloc/BlParallelUniverseRunDeferredActionSignal.class.st b/src/Bloc/BlParallelUniverseRunDeferredActionSignal.class.st index 47c9b800e..6c0e42737 100644 --- a/src/Bloc/BlParallelUniverseRunDeferredActionSignal.class.st +++ b/src/Bloc/BlParallelUniverseRunDeferredActionSignal.class.st @@ -3,24 +3,22 @@ Is sent when a universe performed a deferred action " Class { - #name : 'BlParallelUniverseRunDeferredActionSignal', - #superclass : 'BlParallelUniverseSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseRunDeferredActionSignal, + #superclass : #BlParallelUniverseSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseRunDeferredActionSignal class >> isRepeatable [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseRunDeferredActionSignal class >> label [ ^ 'Run deferred action' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseRunDeferredActionSignal class >> nextSignals [ ^ { BlParallelUniverseRunDeferredActionSignal . BlParallelUniverseSpaceAddedSignal } ] diff --git a/src/Bloc/BlParallelUniverseSignal.class.st b/src/Bloc/BlParallelUniverseSignal.class.st index eea733a1c..b77996fc2 100644 --- a/src/Bloc/BlParallelUniverseSignal.class.st +++ b/src/Bloc/BlParallelUniverseSignal.class.st @@ -1,20 +1,18 @@ Class { - #name : 'BlParallelUniverseSignal', - #superclass : 'BeaconSignal', + #name : #BlParallelUniverseSignal, + #superclass : #BeaconSignal, #instVars : [ 'universeId' ], - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #category : 'Bloc-Universe - Parallel' } -{ #category : 'testing' } +{ #category : #testing } BlParallelUniverseSignal class >> isAbstract [ ^ self = BlParallelUniverseSignal ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSignal class >> isRepeatable [ "Return true if this signal is expected to be emitted regularly" @@ -22,23 +20,23 @@ BlParallelUniverseSignal class >> isRepeatable [ ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSignal class >> label [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSignal class >> nextSignals [ "Return a collection of possible signals after this one" ^ #() ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSignal >> universeId [ ^ universeId ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSignal >> universeId: aNumber [ universeId := aNumber ] diff --git a/src/Bloc/BlParallelUniverseSpaceAddedSignal.class.st b/src/Bloc/BlParallelUniverseSpaceAddedSignal.class.st index 2d9512509..0e39712f0 100644 --- a/src/Bloc/BlParallelUniverseSpaceAddedSignal.class.st +++ b/src/Bloc/BlParallelUniverseSpaceAddedSignal.class.st @@ -3,19 +3,17 @@ Is sent when a space was added to the space manager in a universe " Class { - #name : 'BlParallelUniverseSpaceAddedSignal', - #superclass : 'BlParallelUniverseSpaceSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseSpaceAddedSignal, + #superclass : #BlParallelUniverseSpaceSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSpaceAddedSignal class >> label [ ^ 'Add space' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSpaceAddedSignal class >> nextSignals [ ^ { BlParallelUniverseHostSpaceCreatedSignal } ] diff --git a/src/Bloc/BlParallelUniverseSpaceDispatchAddedToSceneSignal.class.st b/src/Bloc/BlParallelUniverseSpaceDispatchAddedToSceneSignal.class.st index 41c0f0a21..e57d23e19 100644 --- a/src/Bloc/BlParallelUniverseSpaceDispatchAddedToSceneSignal.class.st +++ b/src/Bloc/BlParallelUniverseSpaceDispatchAddedToSceneSignal.class.st @@ -3,14 +3,12 @@ Is sent after we let children know that they were added to the scene graph " Class { - #name : 'BlParallelUniverseSpaceDispatchAddedToSceneSignal', - #superclass : 'BlParallelUniverseSpaceSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseSpaceDispatchAddedToSceneSignal, + #superclass : #BlParallelUniverseSpaceSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSpaceDispatchAddedToSceneSignal class >> label [ ^ 'Dispatch added to scene graph' ] diff --git a/src/Bloc/BlParallelUniverseSpaceRootAssignedSignal.class.st b/src/Bloc/BlParallelUniverseSpaceRootAssignedSignal.class.st index 246fa2c9a..a9e22a63a 100644 --- a/src/Bloc/BlParallelUniverseSpaceRootAssignedSignal.class.st +++ b/src/Bloc/BlParallelUniverseSpaceRootAssignedSignal.class.st @@ -3,19 +3,17 @@ Is sent after a space is attached to the root " Class { - #name : 'BlParallelUniverseSpaceRootAssignedSignal', - #superclass : 'BlParallelUniverseSpaceSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseSpaceRootAssignedSignal, + #superclass : #BlParallelUniverseSpaceSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSpaceRootAssignedSignal class >> label [ ^ 'Assign space to root element' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSpaceRootAssignedSignal class >> nextSignals [ ^ { BlParallelUniverseSpaceDispatchAddedToSceneSignal } ] diff --git a/src/Bloc/BlParallelUniverseSpaceSignal.class.st b/src/Bloc/BlParallelUniverseSpaceSignal.class.st index 8ae6c4e90..c6d460e86 100644 --- a/src/Bloc/BlParallelUniverseSpaceSignal.class.st +++ b/src/Bloc/BlParallelUniverseSpaceSignal.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlParallelUniverseSpaceSignal', - #superclass : 'BlParallelUniverseSignal', + #name : #BlParallelUniverseSpaceSignal, + #superclass : #BlParallelUniverseSignal, #instVars : [ 'spaceId' ], - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #category : 'Bloc-Universe - Parallel' } -{ #category : 'testing' } +{ #category : #testing } BlParallelUniverseSpaceSignal class >> isAbstract [ ^ self = BlParallelUniverseSpaceSignal ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSpaceSignal >> spaceId [ ^ spaceId ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseSpaceSignal >> spaceId: aNumber [ spaceId := aNumber ] diff --git a/src/Bloc/BlParallelUniverseTryToRunDeferredActionsSignal.class.st b/src/Bloc/BlParallelUniverseTryToRunDeferredActionsSignal.class.st index 7136c2f3d..a1fe55ca2 100644 --- a/src/Bloc/BlParallelUniverseTryToRunDeferredActionsSignal.class.st +++ b/src/Bloc/BlParallelUniverseTryToRunDeferredActionsSignal.class.st @@ -3,24 +3,22 @@ Is sent when a universe tries to run deferred actions " Class { - #name : 'BlParallelUniverseTryToRunDeferredActionsSignal', - #superclass : 'BlParallelUniverseSignal', - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #name : #BlParallelUniverseTryToRunDeferredActionsSignal, + #superclass : #BlParallelUniverseSignal, + #category : 'Bloc-Universe - Parallel' } -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseTryToRunDeferredActionsSignal class >> isRepeatable [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseTryToRunDeferredActionsSignal class >> label [ ^ 'Try to run deferred actions' ] -{ #category : 'accessing' } +{ #category : #accessing } BlParallelUniverseTryToRunDeferredActionsSignal class >> nextSignals [ ^ { BlParallelUniverseRunDeferredActionSignal } ] diff --git a/src/Bloc/BlParentChain.class.st b/src/Bloc/BlParentChain.class.st index a53dd876b..7a13874aa 100644 --- a/src/Bloc/BlParentChain.class.st +++ b/src/Bloc/BlParentChain.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlParentChain', - #superclass : 'DoubleLinkedList', - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #name : #BlParentChain, + #superclass : #DoubleLinkedList, + #category : 'Bloc-Space - Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlParentChain class >> of: anElement [ | aChain | @@ -17,7 +15,7 @@ BlParentChain class >> of: anElement [ ^ aChain ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlParentChain class >> of: anElement upToExclusive: aParentElement [ | aChain | diff --git a/src/Bloc/BlPathCache.class.st b/src/Bloc/BlPathCache.class.st index 80908dda3..52b0e4ca1 100644 --- a/src/Bloc/BlPathCache.class.st +++ b/src/Bloc/BlPathCache.class.st @@ -4,20 +4,18 @@ Geometry path is created with the help of backend-specific path builder by BlGeo " Class { - #name : 'BlPathCache', - #superclass : 'Object', + #name : #BlPathCache, + #superclass : #Object, #instVars : [ 'session', 'geometry', 'geometryPath', 'strokedBounds' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPathCache class >> on: aGeometry [ ^ self new @@ -25,7 +23,7 @@ BlPathCache class >> on: aGeometry [ yourself ] -{ #category : 'session management' } +{ #category : #'session management' } BlPathCache >> checkSession [ session == Smalltalk session ifTrue: [ ^ self ]. @@ -33,33 +31,33 @@ BlPathCache >> checkSession [ self releaseCache ] -{ #category : 'accessing' } +{ #category : #accessing } BlPathCache >> geometry [ "Return a `BlElementVectorGeometry` whose path I cache." ^ geometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlPathCache >> geometry: aBlGeometry [ "Attach a geometry which path I should cache" geometry := aBlGeometry ] -{ #category : 'accessing' } +{ #category : #accessing } BlPathCache >> geometryPath [ ^ geometryPath ] -{ #category : 'accessing' } +{ #category : #accessing } BlPathCache >> geometryPath: anObject [ geometryPath := nil ] -{ #category : 'session management' } +{ #category : #'session management' } BlPathCache >> releaseCache [ "Release path caches requiring their fresh creation" @@ -67,14 +65,14 @@ BlPathCache >> releaseCache [ self releaseStrokedBoundsCache ] -{ #category : 'session management' } +{ #category : #'session management' } BlPathCache >> releaseStrokedBoundsCache [ "Release stroked bounds to force its recomputation" strokedBounds := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlPathCache >> strokedBounds: aBlBounds of: anElement [ "Return stroked bounds of a geometry if it would be stroked according to element's outskirts." diff --git a/src/Bloc/BlPercentUnit.class.st b/src/Bloc/BlPercentUnit.class.st index abf15396d..3d31770df 100644 --- a/src/Bloc/BlPercentUnit.class.st +++ b/src/Bloc/BlPercentUnit.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlPercentUnit', - #superclass : 'BlUnit', - #category : 'Bloc-Basic-Units', - #package : 'Bloc', - #tag : 'Basic-Units' + #name : #BlPercentUnit, + #superclass : #BlUnit, + #category : 'Bloc-Basic-Units' } -{ #category : 'printing' } +{ #category : #printing } BlPercentUnit >> printOn: aStream [ aStream nextPutAll: '%' ] -{ #category : 'accessing' } +{ #category : #accessing } BlPercentUnit >> resolveLengthForValue: aCurrentValueOrBlock parent: aParentValueOrBlock global: aGlobalValueOrBlock [ diff --git a/src/Bloc/BlPerspectiveTransformation.class.st b/src/Bloc/BlPerspectiveTransformation.class.st index 11cb4b6ee..b0a778fd4 100644 --- a/src/Bloc/BlPerspectiveTransformation.class.st +++ b/src/Bloc/BlPerspectiveTransformation.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlPerspectiveTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlPerspectiveTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'depth' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPerspectiveTransformation class >> depth: aNumber [ ^ self new @@ -17,25 +15,25 @@ BlPerspectiveTransformation class >> depth: aNumber [ yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlPerspectiveTransformation >> depth [ ^ depth ] -{ #category : 'accessing' } +{ #category : #accessing } BlPerspectiveTransformation >> depth: aPositiveNumber [ depth := aPositiveNumber ] -{ #category : 'testing' } +{ #category : #testing } BlPerspectiveTransformation >> is2D [ ^ false ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlPerspectiveTransformation >> multiplyOn: aBlMatrix [ aBlMatrix perspective: depth diff --git a/src/Bloc/BlPoint.class.st b/src/Bloc/BlPoint.class.st index 8f88bd443..aee9019c7 100644 --- a/src/Bloc/BlPoint.class.st +++ b/src/Bloc/BlPoint.class.st @@ -1,14 +1,12 @@ Class { - #name : 'BlPoint', - #superclass : 'Object', + #name : #BlPoint, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'comparing' } +{ #category : #comparing } BlPoint >> < aPoint [ "Answer whether the receiver is above and to the left of aPoint." @@ -16,7 +14,7 @@ BlPoint >> < aPoint [ ^ self subclassResponsibility ] -{ #category : 'converting' } +{ #category : #converting } BlPoint >> asPoint2D [ "Return a projected version of this point on 2D plane" @@ -24,26 +22,26 @@ BlPoint >> asPoint2D [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlPoint >> isPoint [ ^ true ] -{ #category : 'comparing' } +{ #category : #comparing } BlPoint >> max: aBlPoint [ ^ self subclassResponsibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlPoint >> min: aBlPoint [ ^ self subclassResponsibility ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlPoint >> transformedOn: aBlMatrix [ diff --git a/src/Bloc/BlPoint2D.class.st b/src/Bloc/BlPoint2D.class.st index 52038d78b..3a438b7be 100644 --- a/src/Bloc/BlPoint2D.class.st +++ b/src/Bloc/BlPoint2D.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlPoint2D', - #superclass : 'BlPoint', + #name : #BlPoint2D, + #superclass : #BlPoint, #instVars : [ 'x', 'y' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPoint2D class >> x: aX y: aY [ ^ self new x: aX y: aY ] -{ #category : 'comparing' } +{ #category : #comparing } BlPoint2D >> < aPoint [ "Answer whether the receiver is above and to the left of aPoint." @@ -24,14 +22,14 @@ BlPoint2D >> < aPoint [ ^ x < aPoint x and: [ y < aPoint y ] ] -{ #category : 'converting' } +{ #category : #converting } BlPoint2D >> asPoint2D [ ^ self ] -{ #category : 'initialization' } +{ #category : #initialization } BlPoint2D >> initialize [ super initialize. @@ -39,28 +37,28 @@ BlPoint2D >> initialize [ y := 0.0 ] -{ #category : 'comparing' } +{ #category : #comparing } BlPoint2D >> max: aBlPoint [ ^ (x max: aBlPoint x) @ (y max: aBlPoint y) ] -{ #category : 'comparing' } +{ #category : #comparing } BlPoint2D >> min: aBlPoint [ ^ (x min: aBlPoint x) @ (y min: aBlPoint y) ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlPoint2D >> transformedOn: aBlMatrix [ ^ aBlMatrix transformPoint2D: self ] -{ #category : 'transformations' } +{ #category : #transformations } BlPoint2D >> translateBy: aDelta [ "Answer a 2D Point translated by delta (an instance of Point)." @@ -68,28 +66,28 @@ BlPoint2D >> translateBy: aDelta [ ^ self class x: (aDelta x + x) y: (aDelta y + y) ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint2D >> x [ ^ x ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint2D >> x: anObject [ x := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlPoint2D >> x: aX y: aY [ x := aX. y := aY ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint2D >> y [ ^ y ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint2D >> y: anObject [ y := anObject ] diff --git a/src/Bloc/BlPoint3D.class.st b/src/Bloc/BlPoint3D.class.st index 3afd64582..e95a9ce90 100644 --- a/src/Bloc/BlPoint3D.class.st +++ b/src/Bloc/BlPoint3D.class.st @@ -8,19 +8,17 @@ point3D := 5 @ 10 @ 20. "" x = 5; y = 10; z = 20"" " Class { - #name : 'BlPoint3D', - #superclass : 'BlPoint', + #name : #BlPoint3D, + #superclass : #BlPoint, #instVars : [ 'x', 'y', 'z' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPoint3D class >> x: aX y: aY z: aZ [ ^ self new @@ -28,7 +26,7 @@ BlPoint3D class >> x: aX y: aY z: aZ [ yourself ] -{ #category : 'composition' } +{ #category : #composition } BlPoint3D >> @ aNumber [ "Return a new 4D point with x, y and z represented by components and given number as w." @@ -36,7 +34,7 @@ BlPoint3D >> @ aNumber [ ^ BlPoint4D x: x y: y z: z w: aNumber ] -{ #category : 'initialization' } +{ #category : #initialization } BlPoint3D >> initialize [ super initialize. @@ -45,7 +43,7 @@ BlPoint3D >> initialize [ z := 0.0 ] -{ #category : 'testing' } +{ #category : #testing } BlPoint3D >> isPoint [ "Return true if I represent a point, false otherwise" @@ -53,7 +51,7 @@ BlPoint3D >> isPoint [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlPoint3D >> isPoint2D [ "Return true if I represent a 2D point, false otherwise" @@ -61,7 +59,7 @@ BlPoint3D >> isPoint2D [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlPoint3D >> isPoint3D [ "Return true if I represent a 3D point, false otherwise" @@ -69,7 +67,7 @@ BlPoint3D >> isPoint3D [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlPoint3D >> isZero [ "Return true if all my components are zeros, false otherwise" @@ -77,7 +75,7 @@ BlPoint3D >> isZero [ ^ x isZero and: [ y isZero and: [ z isZero ] ] ] -{ #category : 'printing' } +{ #category : #printing } BlPoint3D >> printOn: aStream [ aStream nextPut: $(. x printOn: aStream. @@ -96,7 +94,7 @@ BlPoint3D >> printOn: aStream [ aStream nextPut: $). ] -{ #category : 'printing' } +{ #category : #printing } BlPoint3D >> storeOn: aStream [ "x@y@z printed form is good for storing too" aStream nextPut: $(. @@ -104,14 +102,14 @@ BlPoint3D >> storeOn: aStream [ aStream nextPut: $). ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlPoint3D >> transformedOn: aBlMatrix [ ^ aBlMatrix transformPoint3D: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint3D >> x [ "Return my x component" @@ -119,7 +117,7 @@ BlPoint3D >> x [ ^ x ] -{ #category : 'initialization' } +{ #category : #initialization } BlPoint3D >> x: aX y: aY z: aZ [ x := aX. @@ -127,7 +125,7 @@ BlPoint3D >> x: aX y: aY z: aZ [ z := aZ ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint3D >> y [ "Return my y component" @@ -135,7 +133,7 @@ BlPoint3D >> y [ ^ y ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint3D >> z [ "Return my z component" diff --git a/src/Bloc/BlPoint4D.class.st b/src/Bloc/BlPoint4D.class.st index 50c5b6141..397b97454 100644 --- a/src/Bloc/BlPoint4D.class.st +++ b/src/Bloc/BlPoint4D.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlPoint4D', - #superclass : 'BlPoint', + #name : #BlPoint4D, + #superclass : #BlPoint, #instVars : [ 'x', 'y', 'z', 'w' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPoint4D class >> x: aX y: aY z: aZ w: aW [ ^ self new @@ -20,14 +18,14 @@ BlPoint4D class >> x: aX y: aY z: aZ w: aW [ yourself ] -{ #category : 'converting' } +{ #category : #converting } BlPoint4D >> asPoint2D [ ^ BlPoint2D x: (self x asFloat / self w) y: (self y asFloat / self w) ] -{ #category : 'initialization' } +{ #category : #initialization } BlPoint4D >> initialize [ super initialize. @@ -37,24 +35,24 @@ BlPoint4D >> initialize [ w := 0.0 ] -{ #category : 'matrix - transforming points' } +{ #category : #'matrix - transforming points' } BlPoint4D >> transformedOn: aBlMatrix [ ^ aBlMatrix transformPoint4D: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint4D >> w [ ^ w ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint4D >> x [ ^ x ] -{ #category : 'initialization' } +{ #category : #initialization } BlPoint4D >> x: aX y: aY z: aZ w: aW [ x := aX. @@ -63,12 +61,12 @@ BlPoint4D >> x: aX y: aY z: aZ w: aW [ w := aW ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint4D >> y [ ^ y ] -{ #category : 'accessing' } +{ #category : #accessing } BlPoint4D >> z [ ^ z ] diff --git a/src/Bloc/BlPolygon.class.st b/src/Bloc/BlPolygon.class.st index c78d75198..b4f4c089d 100644 --- a/src/Bloc/BlPolygon.class.st +++ b/src/Bloc/BlPolygon.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlPolygon', - #superclass : 'BlPolygonGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlPolygon, + #superclass : #BlPolygonGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlPolygon class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlPolygonGeometry.class.st b/src/Bloc/BlPolygonGeometry.class.st index 6acd9295e..3fbe38e18 100644 --- a/src/Bloc/BlPolygonGeometry.class.st +++ b/src/Bloc/BlPolygonGeometry.class.st @@ -10,29 +10,27 @@ BlPolygon vertices: { } " Class { - #name : 'BlPolygonGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlPolygonGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'vertices' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPolygonGeometry class >> vertices: aCollection [ ^ self new vertices: aCollection ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlPolygonGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ "Answer whether aPoint is contained by this geometry." ^ BlPolygonHitTester doPolygonBy: self vertices include: aPoint ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlPolygonGeometry >> geometryBounds: aBlBounds [ "Load my bounds in mutable rectangle. @see #geometryBounds for more info" @@ -42,37 +40,37 @@ BlPolygonGeometry >> geometryBounds: aBlBounds [ corner: (self vertices ifEmpty: [0@0] ifNotEmpty: [self vertices max]) ] -{ #category : 'testing' } +{ #category : #testing } BlPolygonGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlPolygonGeometry >> hasJoins [ ^ true ] -{ #category : 'initialization' } +{ #category : #initialization } BlPolygonGeometry >> initialize [ super initialize. vertices := #() ] -{ #category : 'geometry' } +{ #category : #geometry } BlPolygonGeometry >> matchExtent: anExtent [ extent := anExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlPolygonGeometry >> vertices [ ^ vertices ] -{ #category : 'accessing' } +{ #category : #accessing } BlPolygonGeometry >> vertices: aCollectionOfPoints [ | theNewVertices | theNewVertices := aCollectionOfPoints collect: [ :eachPoint | eachPoint asFloatPoint ]. diff --git a/src/Bloc/BlPolygonHitTester.class.st b/src/Bloc/BlPolygonHitTester.class.st index 8b0d21d39..eb9f9b05c 100644 --- a/src/Bloc/BlPolygonHitTester.class.st +++ b/src/Bloc/BlPolygonHitTester.class.st @@ -7,14 +7,12 @@ See: https://wrfranklin.org/Research/Short_Notes/pnpoly.html " Class { - #name : 'BlPolygonHitTester', - #superclass : 'Object', - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #name : #BlPolygonHitTester, + #superclass : #Object, + #category : 'Bloc-Basic-Geometry' } -{ #category : 'testing' } +{ #category : #testing } BlPolygonHitTester class >> doPolygonBy: vertices include: aPoint [ | inside testX testY i j size | diff --git a/src/Bloc/BlPolyline.class.st b/src/Bloc/BlPolyline.class.st index c1e79f0c0..ba4d1ac4c 100644 --- a/src/Bloc/BlPolyline.class.st +++ b/src/Bloc/BlPolyline.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlPolyline', - #superclass : 'BlPolylineGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlPolyline, + #superclass : #BlPolylineGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlPolyline class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlPolylineGeometry.class.st b/src/Bloc/BlPolylineGeometry.class.st index 9d70dfb70..adeb5a6c2 100644 --- a/src/Bloc/BlPolylineGeometry.class.st +++ b/src/Bloc/BlPolylineGeometry.class.st @@ -10,22 +10,20 @@ BlPolyline vertices: { } " Class { - #name : 'BlPolylineGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlPolylineGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'vertices' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlPolylineGeometry class >> vertices: aCollection [ ^ self new vertices: aCollection ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlPolylineGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ "Answer whether aPoint is contained by this geometry. @@ -37,7 +35,7 @@ BlPolylineGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElemen ^ false ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlPolylineGeometry >> geometryBounds: aBlBounds [ "Load my bounds in mutable rectangle. @see #geometryBounds for more info" @@ -47,31 +45,31 @@ BlPolylineGeometry >> geometryBounds: aBlBounds [ corner: self vertices max ] -{ #category : 'testing' } +{ #category : #testing } BlPolylineGeometry >> hasCaps [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlPolylineGeometry >> hasJoins [ ^ vertices size > 2 ] -{ #category : 'geometry' } +{ #category : #geometry } BlPolylineGeometry >> matchExtent: anExtent [ extent := anExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlPolylineGeometry >> vertices [ ^ vertices ] -{ #category : 'accessing' } +{ #category : #accessing } BlPolylineGeometry >> vertices: aCollectionOfPoints [ vertices := aCollectionOfPoints. diff --git a/src/Bloc/BlPrimaryClickEvent.class.st b/src/Bloc/BlPrimaryClickEvent.class.st index b99bde8c3..674ace038 100644 --- a/src/Bloc/BlPrimaryClickEvent.class.st +++ b/src/Bloc/BlPrimaryClickEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlPrimaryClickEvent', - #superclass : 'BlClickEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlPrimaryClickEvent, + #superclass : #BlClickEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlPrimaryMouseDownEvent.class.st b/src/Bloc/BlPrimaryMouseDownEvent.class.st index cf3dbdcc3..69d0c3aad 100644 --- a/src/Bloc/BlPrimaryMouseDownEvent.class.st +++ b/src/Bloc/BlPrimaryMouseDownEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlPrimaryMouseDownEvent', - #superclass : 'BlMouseDownEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlPrimaryMouseDownEvent, + #superclass : #BlMouseDownEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlPrimaryMouseUpEvent.class.st b/src/Bloc/BlPrimaryMouseUpEvent.class.st index 05e9cd75a..601694389 100644 --- a/src/Bloc/BlPrimaryMouseUpEvent.class.st +++ b/src/Bloc/BlPrimaryMouseUpEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlPrimaryMouseUpEvent', - #superclass : 'BlMouseUpEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlPrimaryMouseUpEvent, + #superclass : #BlMouseUpEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlProcessTelemetry.class.st b/src/Bloc/BlProcessTelemetry.class.st index 9d0ecc672..140d07c2b 100644 --- a/src/Bloc/BlProcessTelemetry.class.st +++ b/src/Bloc/BlProcessTelemetry.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlProcessTelemetry', - #superclass : 'ProcessLocalVariable', + #name : #BlProcessTelemetry, + #superclass : #ProcessLocalVariable, #traits : 'TBlTelemetry', #classTraits : 'TBlTelemetry classTrait', #classInstVars : [ 'DefaultTelemetryClass' ], - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #category : 'Bloc-Space - Telemetry' } -{ #category : 'accessing' } +{ #category : #accessing } BlProcessTelemetry class >> defaultTelemetryClass [ ^ DefaultTelemetryClass ifNil: [ BlNullTelemetry ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlProcessTelemetry class >> defaultTelemetryClass: aClass [ DefaultTelemetryClass := aClass. @@ -27,17 +25,17 @@ BlProcessTelemetry class >> defaultTelemetryClass: aClass [ put: nil ] ] ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry class >> emit [ ^ self soleInstance emit ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry class >> reset [ ^ self soleInstance reset ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry class >> rootTimeSync: aNameBlock during: aBlock [ | aTelemetry aResult | "we store the telemetry on a stack to prevent it from being garbage collected" @@ -52,17 +50,17 @@ BlProcessTelemetry class >> rootTimeSync: aNameBlock during: aBlock [ ^ aResult ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry class >> timeSync: aNameBlock during: aBlock [ ^ self soleInstance timeSync: aNameBlock during: aBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlProcessTelemetry >> default [ ^ self class defaultTelemetryClass new ] -{ #category : 'accessing' } +{ #category : #accessing } BlProcessTelemetry >> ensureValue [ ^ self valueOrNil ifNil: [ @@ -73,22 +71,22 @@ BlProcessTelemetry >> ensureValue [ aNewTelemetry ] ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry >> finishSync [ self value finishSync ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry >> reset [ self value reset ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry >> startSync: aNameBlock [ self value startSync: aNameBlock ] -{ #category : 'tasks' } +{ #category : #tasks } BlProcessTelemetry >> tasks [ ^ self value tasks ] diff --git a/src/Bloc/BlProgressCursor.class.st b/src/Bloc/BlProgressCursor.class.st index 3c21579ce..2c641ce10 100644 --- a/src/Bloc/BlProgressCursor.class.st +++ b/src/Bloc/BlProgressCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlProgressCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlProgressCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlPtUnit.class.st b/src/Bloc/BlPtUnit.class.st index b48e360ae..c7cd149d3 100644 --- a/src/Bloc/BlPtUnit.class.st +++ b/src/Bloc/BlPtUnit.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlPtUnit', - #superclass : 'BlUnit', - #category : 'Bloc-Basic-Units', - #package : 'Bloc', - #tag : 'Basic-Units' + #name : #BlPtUnit, + #superclass : #BlUnit, + #category : 'Bloc-Basic-Units' } -{ #category : 'printing' } +{ #category : #printing } BlPtUnit >> printOn: aStream [ aStream nextPutAll: 'pt' ] -{ #category : 'accessing' } +{ #category : #accessing } BlPtUnit >> resolveLengthForValue: aCurrentValueOrBlock parent: aParentValueOrBlock global: aGlobalValueOrBlock [ diff --git a/src/Bloc/BlPulseEvent.class.st b/src/Bloc/BlPulseEvent.class.st index c2d795d38..b7e2b3899 100644 --- a/src/Bloc/BlPulseEvent.class.st +++ b/src/Bloc/BlPulseEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlPulseEvent', - #superclass : 'BlEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlPulseEvent, + #superclass : #BlEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlQuaternion.class.st b/src/Bloc/BlQuaternion.class.st index eaf9e24e0..8e8c35b77 100644 --- a/src/Bloc/BlQuaternion.class.st +++ b/src/Bloc/BlQuaternion.class.st @@ -6,8 +6,8 @@ https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Using_quaternion_ " Class { - #name : 'BlQuaternion', - #superclass : 'Object', + #name : #BlQuaternion, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -16,12 +16,10 @@ Class { 'z', 'w' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlQuaternion class >> x: aX y: aY z: aZ angle: aTheta [ "Create a quaternion representing a rotation about axis defined by a vector (x,y,z) by angle aTheta in radians" @@ -102,14 +100,14 @@ BlQuaternion class >> x: aX y: aY z: aZ angle: aTheta [ ^ self x: x y: y z: z w: w ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlQuaternion class >> x: aX y: aY z: aZ w: aW [ ^ self new x: aX y: aY z: aZ w: aW; yourself ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlQuaternion >> * aQuaternion [ "Multiply me by a given quaternion and return a new instance representing a multiplication result" | rX rY rZ rW | "components of a resulting quaternion" @@ -123,7 +121,7 @@ BlQuaternion >> * aQuaternion [ ^ self class x: rX y: rY z: rZ w: rW ] -{ #category : 'initialization' } +{ #category : #initialization } BlQuaternion >> initialize [ super initialize. @@ -133,7 +131,7 @@ BlQuaternion >> initialize [ w := 1.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlQuaternion >> length [ "Return euclidian norm (length) of this quaternion" @@ -141,7 +139,7 @@ BlQuaternion >> length [ ^ ((x * x) + (y * y) + (z * z) + (w * w)) sqrt ] -{ #category : 'converting' } +{ #category : #converting } BlQuaternion >> normalize [ "Normalize me in-place" | length | @@ -159,7 +157,7 @@ BlQuaternion >> normalize [ self x: x / length y: y / length z: z / length w: w / length ] ] -{ #category : 'converting' } +{ #category : #converting } BlQuaternion >> normalized [ "Return a new instance of me being normalized" @@ -167,7 +165,7 @@ BlQuaternion >> normalized [ ^ self copy normalize ] -{ #category : 'printing' } +{ #category : #printing } BlQuaternion >> printOn: aStream [ aStream nextPut: $(; @@ -181,17 +179,17 @@ BlQuaternion >> printOn: aStream [ nextPut: $) ] -{ #category : 'accessing' } +{ #category : #accessing } BlQuaternion >> w [ ^ w ] -{ #category : 'accessing' } +{ #category : #accessing } BlQuaternion >> x [ ^ x ] -{ #category : 'initialization' } +{ #category : #initialization } BlQuaternion >> x: aX y: aY z: aZ w: aW [ x := aX. y := aY. @@ -199,12 +197,12 @@ BlQuaternion >> x: aX y: aY z: aZ w: aW [ w := aW ] -{ #category : 'accessing' } +{ #category : #accessing } BlQuaternion >> y [ ^ y ] -{ #category : 'accessing' } +{ #category : #accessing } BlQuaternion >> z [ ^ z ] diff --git a/src/Bloc/BlQuinticInterpolator.class.st b/src/Bloc/BlQuinticInterpolator.class.st index a6a7d8ec2..ad15e75f1 100644 --- a/src/Bloc/BlQuinticInterpolator.class.st +++ b/src/Bloc/BlQuinticInterpolator.class.st @@ -10,14 +10,12 @@ It can be simplified to " Class { - #name : 'BlQuinticInterpolator', - #superclass : 'BlInterpolator', - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #name : #BlQuinticInterpolator, + #superclass : #BlInterpolator, + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'interpolation' } +{ #category : #interpolation } BlQuinticInterpolator >> interpolate: aNumber [ "f(x) = x^5 - 5x^4 + 10x^3 - 10x^2 + 5x diff --git a/src/Bloc/BlRadialGradientPaint.class.st b/src/Bloc/BlRadialGradientPaint.class.st index f07a2e200..f4480d27f 100644 --- a/src/Bloc/BlRadialGradientPaint.class.st +++ b/src/Bloc/BlRadialGradientPaint.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlRadialGradientPaint', - #superclass : 'BlGradientPaint', + #name : #BlRadialGradientPaint, + #superclass : #BlGradientPaint, #instVars : [ 'innerCenter', 'innerRadius', 'outerCenter', 'outerRadius' ], - #category : 'Bloc-Paint', - #package : 'Bloc', - #tag : 'Paint' + #category : 'Bloc-Paint' } { #category : 'accessing' } diff --git a/src/Bloc/BlRay.class.st b/src/Bloc/BlRay.class.st index cf2a3c473..c66ff086a 100644 --- a/src/Bloc/BlRay.class.st +++ b/src/Bloc/BlRay.class.st @@ -5,20 +5,18 @@ I consist of a starting `=#point`= and a direction `=#vector`= " Class { - #name : 'BlRay', - #superclass : 'Object', + #name : #BlRay, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'point', 'vector' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlRay class >> from: aPoint directed: aBlVector [ @@ -27,7 +25,7 @@ BlRay class >> from: aPoint directed: aBlVector [ vector: aBlVector ] -{ #category : 'api - vector functions' } +{ #category : #'api - vector functions' } BlRay >> distanceTo: aPoint [ "The distance (or perpendicular distance) from a point to a line is the shortest distance from a fixed point to any point on a fixed infinite line in Euclidean geometry. It is the length of the line segment which joins the point to the line and is perpendicular to the line. (https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line) @@ -46,7 +44,7 @@ BlRay >> distanceTo: aPoint [ ^ ((self vector y * aPoint x) - (self vector x * aPoint y) + (self point y * (self point x + self vector x)) - (self point x * (self point y + self vector y))) abs / self vector length ] -{ #category : 'initialization' } +{ #category : #initialization } BlRay >> initialize [ super initialize. @@ -54,19 +52,19 @@ BlRay >> initialize [ vector := BlVector x: 0 y: 0. ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlRay >> point [ ^ point ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlRay >> point: aPoint [ point := aPoint ] -{ #category : 'printing' } +{ #category : #printing } BlRay >> printOn: aStream [ aStream print: self point; @@ -74,7 +72,7 @@ BlRay >> printOn: aStream [ print: self vector ] -{ #category : 'api - vector functions' } +{ #category : #'api - vector functions' } BlRay >> projection: aPoint [ "Return a projection of a given point on this ray" @@ -106,14 +104,14 @@ BlRay >> projection: aPoint [ ^ self point + (((aPoint - self point) asBlocVector dotProduct: aNormalizedDirection) * aNormalizedDirection) ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlRay >> vector [ ^ vector ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlRay >> vector: aBlVector [ vector := aBlVector ] diff --git a/src/Bloc/BlRealTime.class.st b/src/Bloc/BlRealTime.class.st index 6af53c00f..5b4da7378 100644 --- a/src/Bloc/BlRealTime.class.st +++ b/src/Bloc/BlRealTime.class.st @@ -9,14 +9,12 @@ I am a just a traditional real time. " Class { - #name : 'BlRealTime', - #superclass : 'BlTime', - #category : 'Bloc-Universe', - #package : 'Bloc', - #tag : 'Universe' + #name : #BlRealTime, + #superclass : #BlTime, + #category : 'Bloc-Universe' } -{ #category : 'private - time' } +{ #category : #'private - time' } BlRealTime >> currentTime [ "Return a 'current' date and time" @@ -24,7 +22,7 @@ BlRealTime >> currentTime [ ^ DateAndTime now ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlRealTime >> every: aDuration while: aWhileBlock do: aDoBlock [ "Evaluate a aDoBlock while aWhileBlock evaluates to true waiting a given amount of time between executions. The first evaluation of a aDoBlock is instant. @@ -46,7 +44,7 @@ BlRealTime >> every: aDuration while: aWhileBlock do: aDoBlock [ 0 seconds < aWaitingTime ifTrue: [ aWaitingTime wait ] ] ] -{ #category : 'api - time' } +{ #category : #'api - time' } BlRealTime >> wait: aDuration [ "Advance clock by waiting for a given amount of time" diff --git a/src/Bloc/BlRectangle.class.st b/src/Bloc/BlRectangle.class.st index a75ad579a..735d92317 100644 --- a/src/Bloc/BlRectangle.class.st +++ b/src/Bloc/BlRectangle.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlRectangle', - #superclass : 'BlRoundedRectangleGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlRectangle, + #superclass : #BlRoundedRectangleGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlRectangle class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlRectangleGeometry.class.st b/src/Bloc/BlRectangleGeometry.class.st index f142218a2..a4c54f88e 100644 --- a/src/Bloc/BlRectangleGeometry.class.st +++ b/src/Bloc/BlRectangleGeometry.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlRectangleGeometry', - #superclass : 'BlElementGeometry', - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #name : #BlRectangleGeometry, + #superclass : #BlElementGeometry, + #category : 'Bloc-Basic-Geometry' } -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlRectangleGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ "Note: we have to pass BlElement in order to give geometry a chance to use element properties as as border during the testing process" @@ -18,7 +16,7 @@ BlRectangleGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlEleme and: [ aPoint y < aBlElement height ] ] -{ #category : 'api - bounds' } +{ #category : #'api - bounds' } BlRectangleGeometry >> geometryBounds: aBlBounds of: aBlElement [ "Load my bounds in mutable rectangle. @see #geometryBounds for more info" @@ -31,39 +29,39 @@ BlRectangleGeometry >> geometryBounds: aBlBounds of: aBlElement [ bottom: aBlElement height ] -{ #category : 'testing' } +{ #category : #testing } BlRectangleGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlRectangleGeometry >> hasJoins [ ^ true ] -{ #category : 'geometry' } +{ #category : #geometry } BlRectangleGeometry >> matchElement: anElement [ "Adapt me to match the size of a given element" ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlRectangleGeometry >> releaseCache [ ] -{ #category : 'api - cache' } +{ #category : #'api - cache' } BlRectangleGeometry >> releaseStrokedBoundsCache [ ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlRectangleGeometry >> strokedBounds: aBlBounds of: anElement [ "Return stroked bounds of a geometry if it would be stroked according to element's outskirts." ^ anElement outskirts strokedBounds: aBlBounds of: anElement ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlRectangleGeometry >> strokedBoundsCentered: aBlBounds of: aBlElement [ | aHalfWidth | @@ -76,7 +74,7 @@ BlRectangleGeometry >> strokedBoundsCentered: aBlBounds of: aBlElement [ bottom: aBlElement height + aHalfWidth ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlRectangleGeometry >> strokedBoundsInside: aBlBounds of: aBlElement [ "Stroked inside bounds property is equal to geometry bounds" @@ -87,7 +85,7 @@ BlRectangleGeometry >> strokedBoundsInside: aBlBounds of: aBlElement [ bottom: aBlElement height ] -{ #category : 'visual bounds' } +{ #category : #'visual bounds' } BlRectangleGeometry >> strokedBoundsOutside: aBlBounds of: aBlElement [ | aBorderWidth | diff --git a/src/Bloc/BlReflectionTransformation.class.st b/src/Bloc/BlReflectionTransformation.class.st index 6cabaeee6..78f3d16f3 100644 --- a/src/Bloc/BlReflectionTransformation.class.st +++ b/src/Bloc/BlReflectionTransformation.class.st @@ -12,17 +12,15 @@ Example: " Class { - #name : 'BlReflectionTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlReflectionTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'reflection' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlReflectionTransformation class >> horizontal [ ^ self new @@ -30,7 +28,7 @@ BlReflectionTransformation class >> horizontal [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlReflectionTransformation class >> vertical [ ^ self new @@ -38,25 +36,25 @@ BlReflectionTransformation class >> vertical [ yourself ] -{ #category : 'testing' } +{ #category : #testing } BlReflectionTransformation >> is2D [ ^ true ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlReflectionTransformation >> multiplyOn: aBlMatrix [ aBlMatrix reflectBy: reflection ] -{ #category : 'accessing' } +{ #category : #accessing } BlReflectionTransformation >> reflection [ ^ reflection ] -{ #category : 'accessing' } +{ #category : #accessing } BlReflectionTransformation >> reflection: aBlVectorOrConvertible [ reflection := aBlVectorOrConvertible asBlocVector diff --git a/src/Bloc/BlRelativeAlignment.class.st b/src/Bloc/BlRelativeAlignment.class.st index 1dbc306e4..75990e9f8 100644 --- a/src/Bloc/BlRelativeAlignment.class.st +++ b/src/Bloc/BlRelativeAlignment.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlRelativeAlignment', - #superclass : 'BlElementAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlRelativeAlignment, + #superclass : #BlElementAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlRelativeAlignment class >> horizontal [ ^ self subclassResponsibility ] -{ #category : 'factory' } +{ #category : #factory } BlRelativeAlignment class >> oriented: aBlLayoutOrientation [ ^ aBlLayoutOrientation of: self ] -{ #category : 'factory' } +{ #category : #factory } BlRelativeAlignment class >> vertical [ ^ self subclassResponsibility ] -{ #category : 'factory' } +{ #category : #factory } BlRelativeAlignment >> horizontal [ ^ self class horizontal ] -{ #category : 'factory' } +{ #category : #factory } BlRelativeAlignment >> oriented: aBlLayoutOrientation [ ^ self class oriented: aBlLayoutOrientation ] -{ #category : 'factory' } +{ #category : #factory } BlRelativeAlignment >> vertical [ ^ self class vertical ] diff --git a/src/Bloc/BlRelativeElevation.class.st b/src/Bloc/BlRelativeElevation.class.st index 6e832bd76..706f18d7f 100644 --- a/src/Bloc/BlRelativeElevation.class.st +++ b/src/Bloc/BlRelativeElevation.class.st @@ -5,14 +5,12 @@ Note: Relative elevation can be negative! " Class { - #name : 'BlRelativeElevation', - #superclass : 'BlElevation', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlRelativeElevation, + #superclass : #BlElevation, + #category : 'Bloc-Basic-Properties' } -{ #category : 'accessing' } +{ #category : #accessing } BlRelativeElevation >> relatedTo: aNumber [ "Resulting elevation is a sum of a given and my relative one" diff --git a/src/Bloc/BlRemUnit.class.st b/src/Bloc/BlRemUnit.class.st index fc1d71d9c..86a1eee9f 100644 --- a/src/Bloc/BlRemUnit.class.st +++ b/src/Bloc/BlRemUnit.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlRemUnit', - #superclass : 'BlUnit', - #category : 'Bloc-Basic-Units', - #package : 'Bloc', - #tag : 'Basic-Units' + #name : #BlRemUnit, + #superclass : #BlUnit, + #category : 'Bloc-Basic-Units' } -{ #category : 'printing' } +{ #category : #printing } BlRemUnit >> printOn: aStream [ aStream nextPutAll: 'rem' ] -{ #category : 'accessing' } +{ #category : #accessing } BlRemUnit >> resolveLengthForValue: aCurrentValueOrBlock parent: aParentValueOrBlock global: aGlobalValueOrBlock [ diff --git a/src/Bloc/BlRepeatedTask.class.st b/src/Bloc/BlRepeatedTask.class.st index 4f83afff9..f015514aa 100644 --- a/src/Bloc/BlRepeatedTask.class.st +++ b/src/Bloc/BlRepeatedTask.class.st @@ -5,8 +5,8 @@ See the {{gtMethod:name=BlRepeatedTask>>#run}} method. " Class { - #name : 'BlRepeatedTask', - #superclass : 'BlTask', + #name : #BlRepeatedTask, + #superclass : #BlTask, #instVars : [ 'delay', 'element', @@ -14,24 +14,22 @@ Class { 'previousRunTime', 'isRunning' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTask >> delay [ ^ delay ] -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTask >> delay: aDuration [ delay := aDuration ] -{ #category : 'private' } +{ #category : #private } BlRepeatedTask >> dequeue [ self @@ -41,19 +39,19 @@ BlRepeatedTask >> dequeue [ self element dequeueTask: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTask >> element [ ^ element ] -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTask >> element: aBlElement [ element := aBlElement ] -{ #category : 'private' } +{ #category : #private } BlRepeatedTask >> enqueue [ self @@ -63,7 +61,7 @@ BlRepeatedTask >> enqueue [ self element enqueueTask: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlRepeatedTask >> initialize [ super initialize. @@ -72,31 +70,31 @@ BlRepeatedTask >> initialize [ isRunning := true ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlRepeatedTask >> isRunning [ ^ isRunning ] -{ #category : 'hooks' } +{ #category : #hooks } BlRepeatedTask >> onEnqueued: aBlSpace [ super onEnqueued: aBlSpace. self time: aBlSpace time ] -{ #category : 'hooks' } +{ #category : #hooks } BlRepeatedTask >> onEnqueuedInElement: aBlElement [ self element: aBlElement ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlRepeatedTask >> onRun [ "Override me to implement a custom action" ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlRepeatedTask >> run [ "Enhancement: a repeated task should re-enqueue itself with its element when that element is removed from the scene graph. @@ -111,19 +109,19 @@ BlRepeatedTask >> run [ at: self time now + self delay ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlRepeatedTask >> stop [ isRunning := false ] -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTask >> time [ ^ time ] -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTask >> time: aBlTime [ time := aBlTime ] diff --git a/src/Bloc/BlRepeatedTaskAction.class.st b/src/Bloc/BlRepeatedTaskAction.class.st index 428d891b1..6f860e1cd 100644 --- a/src/Bloc/BlRepeatedTaskAction.class.st +++ b/src/Bloc/BlRepeatedTaskAction.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlRepeatedTaskAction', - #superclass : 'BlRepeatedTask', + #name : #BlRepeatedTaskAction, + #superclass : #BlRepeatedTask, #instVars : [ 'action' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTaskAction >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlRepeatedTaskAction >> action: aBlock [ action := aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlRepeatedTaskAction >> initialize [ super initialize. action := [ :optionalThisTask | ] ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlRepeatedTaskAction >> onRun [ self action isClosure ifTrue: [ self action cull: self ] diff --git a/src/Bloc/BlResizeBottomCursor.class.st b/src/Bloc/BlResizeBottomCursor.class.st index 5eb81e0b8..a1aca91ab 100644 --- a/src/Bloc/BlResizeBottomCursor.class.st +++ b/src/Bloc/BlResizeBottomCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeBottomCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeBottomCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeBottomCursor >> asForm [ ^ Cursor resizeBottom ] diff --git a/src/Bloc/BlResizeBottomLeftCursor.class.st b/src/Bloc/BlResizeBottomLeftCursor.class.st index 210f603b8..b8640e65c 100644 --- a/src/Bloc/BlResizeBottomLeftCursor.class.st +++ b/src/Bloc/BlResizeBottomLeftCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeBottomLeftCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeBottomLeftCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeBottomLeftCursor >> asForm [ ^ Cursor resizeBottomLeft ] diff --git a/src/Bloc/BlResizeBottomRightCursor.class.st b/src/Bloc/BlResizeBottomRightCursor.class.st index 68ab1d046..2fce52c65 100644 --- a/src/Bloc/BlResizeBottomRightCursor.class.st +++ b/src/Bloc/BlResizeBottomRightCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeBottomRightCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeBottomRightCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeBottomRightCursor >> asForm [ ^ Cursor resizeBottomRight ] diff --git a/src/Bloc/BlResizeColumnCursor.class.st b/src/Bloc/BlResizeColumnCursor.class.st index 51185b924..536de5b95 100644 --- a/src/Bloc/BlResizeColumnCursor.class.st +++ b/src/Bloc/BlResizeColumnCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeColumnCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeColumnCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeColumnCursor >> asForm [ ^ Cursor resizeBottom ] diff --git a/src/Bloc/BlResizeLeftCursor.class.st b/src/Bloc/BlResizeLeftCursor.class.st index 032888233..4309de3d7 100644 --- a/src/Bloc/BlResizeLeftCursor.class.st +++ b/src/Bloc/BlResizeLeftCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeLeftCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeLeftCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeLeftCursor >> asForm [ ^ Cursor resizeLeft ] diff --git a/src/Bloc/BlResizeRightCursor.class.st b/src/Bloc/BlResizeRightCursor.class.st index efdf87583..dab20469c 100644 --- a/src/Bloc/BlResizeRightCursor.class.st +++ b/src/Bloc/BlResizeRightCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeRightCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeRightCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeRightCursor >> asForm [ ^ Cursor resizeRight ] diff --git a/src/Bloc/BlResizeRowCursor.class.st b/src/Bloc/BlResizeRowCursor.class.st index 065ae69b5..a7d86e17a 100644 --- a/src/Bloc/BlResizeRowCursor.class.st +++ b/src/Bloc/BlResizeRowCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeRowCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeRowCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeRowCursor >> asForm [ ^ Cursor resizeBottom ] diff --git a/src/Bloc/BlResizeTopCursor.class.st b/src/Bloc/BlResizeTopCursor.class.st index cacb86949..ff32423c0 100644 --- a/src/Bloc/BlResizeTopCursor.class.st +++ b/src/Bloc/BlResizeTopCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeTopCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeTopCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeTopCursor >> asForm [ ^ Cursor resizeTop ] diff --git a/src/Bloc/BlResizeTopLeftCursor.class.st b/src/Bloc/BlResizeTopLeftCursor.class.st index 53857d025..4e247d52e 100644 --- a/src/Bloc/BlResizeTopLeftCursor.class.st +++ b/src/Bloc/BlResizeTopLeftCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeTopLeftCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeTopLeftCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeTopLeftCursor >> asForm [ ^ Cursor resizeTopLeft ] diff --git a/src/Bloc/BlResizeTopRightCursor.class.st b/src/Bloc/BlResizeTopRightCursor.class.st index fdbc9a6ba..e4edfc22d 100644 --- a/src/Bloc/BlResizeTopRightCursor.class.st +++ b/src/Bloc/BlResizeTopRightCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlResizeTopRightCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlResizeTopRightCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlResizeTopRightCursor >> asForm [ ^ Cursor resizeTopRight ] diff --git a/src/Bloc/BlRightAlignment.class.st b/src/Bloc/BlRightAlignment.class.st index f9c379f51..9d9c1bbcc 100644 --- a/src/Bloc/BlRightAlignment.class.st +++ b/src/Bloc/BlRightAlignment.class.st @@ -4,39 +4,37 @@ See BlLayoutAlignment for more info. " Class { - #name : 'BlRightAlignment', - #superclass : 'BlHorizontalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlRightAlignment, + #superclass : #BlHorizontalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlRightAlignment class >> initialize [ super initialize. ] -{ #category : 'factory' } +{ #category : #factory } BlRightAlignment class >> leftToRight [ ^ self right ] -{ #category : 'factory' } +{ #category : #factory } BlRightAlignment class >> rightToLeft [ ^ self left ] -{ #category : 'factory' } +{ #category : #factory } BlRightAlignment >> inverted [ ^ BlElementAlignment vertical end ] -{ #category : 'factory' } +{ #category : #factory } BlRightAlignment >> swap [ ^ BlElementAlignment left ] -{ #category : 'translation' } +{ #category : #translation } BlRightAlignment >> translationOf: aBounds in: aContainerBounds [ diff --git a/src/Bloc/BlRope.class.st b/src/Bloc/BlRope.class.st index 6ce5aa860..9612aed33 100644 --- a/src/Bloc/BlRope.class.st +++ b/src/Bloc/BlRope.class.st @@ -12,31 +12,29 @@ https://en.wikipedia.org/wiki/Rope_(data_structure) " Class { - #name : 'BlRope', - #superclass : 'Object', + #name : #BlRope, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'types' } +{ #category : #types } BlRope class >> attributeRope [ ^ BlAttributeRope ] -{ #category : 'types' } +{ #category : #types } BlRope class >> collectionRope [ ^ BlCollectionRope ] -{ #category : 'accessing' } +{ #category : #accessing } BlRope class >> combineLength [ ^ 32 ] -{ #category : 'rope' } +{ #category : #rope } BlRope class >> concatenate: aLeftRope and: aRightRope [ | totalSize | @@ -83,23 +81,23 @@ BlRope class >> concatenate: aLeftRope and: aRightRope [ right: aRightRope ] -{ #category : 'types' } +{ #category : #types } BlRope class >> concatenationRope [ ^ BlConcatenationRope ] -{ #category : 'types' } +{ #category : #types } BlRope class >> subRope [ ^ BlSubRope ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> allChildrenBreadthFirstDo: aBlock [ self children do: aBlock. self children do: [ :eachRope | eachRope allChildrenBreadthFirstDo: aBlock ] ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> append: aRope [ "Create and return a new rope by append a given rope to the of end of me" @@ -107,12 +105,12 @@ BlRope >> append: aRope [ ^ self class concatenate: self and: aRope ] -{ #category : 'converting' } +{ #category : #converting } BlRope >> asString [ ^ self printStringLimitedTo: Float infinity ] -{ #category : 'private - asserting' } +{ #category : #'private - asserting' } BlRope >> assertAccessFrom: aStartIndex to: anEndIndex [ "I am an index invariant; I make sure that rope operation that require access by index do not go out of rope bounds" @@ -127,7 +125,7 @@ BlRope >> assertAccessFrom: aStartIndex to: anEndIndex [ ifFalse: [ self error: 'End index must be less or equal than the rope size' ] ] -{ #category : 'private - asserting' } +{ #category : #'private - asserting' } BlRope >> assertIndexForInsert: anIndex [ "I am an insertion index invariant; I make sure that insertion operations do not go out of rope bounds" @@ -136,7 +134,7 @@ BlRope >> assertIndexForInsert: anIndex [ ifTrue: [ self error: 'Insert index ', anIndex asString, ' is out of bounds' ] ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> at: anIndex [ "Return an item at an given index" @@ -144,14 +142,14 @@ BlRope >> at: anIndex [ ^ self subclassResponsibility ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlRope >> attributes: anAttributesCollection [ anAttributesCollection ifEmpty: [ ^self ]. ^ self attributes: anAttributesCollection from: 0 to: self size ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlRope >> attributes: anAttributesCollection from: aStart to: anEnd [ "Apply a given collection of attributes on the interval specified by aStart and anEnd indices. aStart and anEnd are given in `cursor` coordinates. For example, assume we have the following text: @@ -166,7 +164,7 @@ BlRope >> attributes: anAttributesCollection from: aStart to: anEnd [ ^ self subclassResponsibility ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> children [ "Return a collection of ropes that are my children" @@ -174,24 +172,24 @@ BlRope >> children [ ^ { } ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlRope >> clearAttributes: aStart to: anEnd [ "Clear all attributes" ^ self clearAttributes: aStart to: anEnd if: [ :each | true ] ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlRope >> clearAttributes: aStart to: anEnd if: aBlock [ ^ self subclassResponsibility ] -{ #category : 'rope - deleting' } +{ #category : #'rope - deleting' } BlRope >> delete: aStart to: anEnd [ self subclassResponsibility ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> depth [ "Return the max tree height of this rope (composition depth)" @@ -199,12 +197,12 @@ BlRope >> depth [ ^ self subclassResponsibility ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlRope >> do: aBlock [ self from: 0 to: self size do: aBlock ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlRope >> empty [ "Create and return an empty version of this rope" @@ -212,19 +210,19 @@ BlRope >> empty [ ^ self subclassResponsibility ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> from: aStart to: anEnd [ ^ self subclassResponsibility ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlRope >> from: aStart to: anEnd do: aBlock [ self subclassResponsibility ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlRope >> indexOfSubCollection: aCollection startingAt: aStart ifAbsent: exceptionBlock [ "Answer the index of the receiver's first element, such that that element equals the first element of aCollection, and the next elements equal @@ -256,7 +254,7 @@ BlRope >> indexOfSubCollection: aCollection startingAt: aStart ifAbsent: excepti ^ exceptionBlock value ] -{ #category : 'rope - inserting' } +{ #category : #'rope - inserting' } BlRope >> insert: aRope at: anIndex [ "Insert aRope after anIndex" anIndex = 0 @@ -271,7 +269,7 @@ BlRope >> insert: aRope at: anIndex [ ^ ((self from: 0 to: anIndex) append: aRope) append: (self from: anIndex to: self size) ] -{ #category : 'rope - inserting' } +{ #category : #'rope - inserting' } BlRope >> insertItems: aCollection at: anIndex [ "Insert a given collection of items at a provided index. anIndex is given in `cursor` coordinates. For example, assume we have the following collection of characters: @@ -285,7 +283,7 @@ BlRope >> insertItems: aCollection at: anIndex [ ^ self subclassResponsibility ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlRope >> isAttributed [ "Return true if I am an attributed rope" @@ -293,12 +291,12 @@ BlRope >> isAttributed [ ^ false ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlRope >> isConcatenation [ ^ false ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlRope >> isEmpty [ "Return true if rope is empty, false otherwise" @@ -306,12 +304,12 @@ BlRope >> isEmpty [ ^ self size isZero ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlRope >> isLeaf [ ^ self subclassResponsibility ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlRope >> isNotEmpty [ "Return true if rope is not empty, false otherwise" @@ -319,24 +317,24 @@ BlRope >> isNotEmpty [ ^ self isEmpty not ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlRope >> isScoped [ ^ false ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlRope >> iterator [ ^ self iterator: 0 to: self size ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlRope >> iterator: aStart to: anEnd [ ^ self subclassResponsibility ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> last [ "Return the last item in the rope" @@ -344,7 +342,7 @@ BlRope >> last [ ^ self at: self size ] -{ #category : 'rope - printing' } +{ #category : #'rope - printing' } BlRope >> printOn: aStream [ self do: [ :anItem | anItem isCharacter @@ -352,23 +350,23 @@ BlRope >> printOn: aStream [ ifFalse: [ aStream nextPutAll: anItem asString ] ] ] -{ #category : 'rope - streaming' } +{ #category : #'rope - streaming' } BlRope >> putOn: aStream [ self putOn: aStream from: 0 to: self size ] -{ #category : 'rope - streaming' } +{ #category : #'rope - streaming' } BlRope >> putOn: aStream from: aStart to: anEnd [ self from: aStart to: anEnd do: [ :anItem | aStream nextPut: anItem ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlRope >> readStream [ ^ self subclassResponsibility ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlRope >> replaceAll: aCollectionOfAssociations [ "Answer a copy of the receiver in which all occurrences of the collections as keys have been replaced by corresponding values. I preserve text attributes" @@ -389,7 +387,7 @@ BlRope >> replaceAll: aCollectionOfAssociations [ ^ aNewRope ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlRope >> replaceAll: oldSubCollection with: newCollection [ "Answer a copy of the receiver in which all occurrences of oldSubCollection have been replaced by newCollection " @@ -409,28 +407,28 @@ BlRope >> replaceAll: oldSubCollection with: newCollection [ ^ aNewRope ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlRope >> replaceFrom: aStart to: anEnd with: aCollection [ "Replace a piece of the rope with a given collection of items" ^ (self delete: aStart to: anEnd) insertItems: aCollection at: aStart ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlRope >> simplified [ ^ self subclassResponsibility ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> size [ ^ self subclassResponsibility ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlRope >> withAllChildrenBreadthFirst [ diff --git a/src/Bloc/BlRopeIterator.class.st b/src/Bloc/BlRopeIterator.class.st index 03d6b9f94..4b411a7b2 100644 --- a/src/Bloc/BlRopeIterator.class.st +++ b/src/Bloc/BlRopeIterator.class.st @@ -6,8 +6,8 @@ I support forward and reverse directions of enumeration " Class { - #name : 'BlRopeIterator', - #superclass : 'Object', + #name : #BlRopeIterator, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -15,19 +15,17 @@ Class { 'start', 'end' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlRopeIterator class >> rope: aRope from: aStart to: anEnd [ ^ self new rope: aRope from: aStart to: anEnd; yourself ] -{ #category : 'iterator - attributes' } +{ #category : #'iterator - attributes' } BlRopeIterator >> attributes [ "Return a collection of rope attributes at the current *peek* position without duplicates" @@ -35,7 +33,7 @@ BlRopeIterator >> attributes [ ^ self subclassResponsibility ] -{ #category : 'iterator - attributes' } +{ #category : #'iterator - attributes' } BlRopeIterator >> detectAttribute: aBlock ifFound: aFoundBlock ifNone: anExceptionBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. If some element evaluates aBlock to true, then cull this element into @@ -49,34 +47,34 @@ BlRopeIterator >> detectAttribute: aBlock ifFound: aFoundBlock ifNone: anExcepti ifNone: anExceptionBlock ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlRopeIterator >> end [ ^ end ] -{ #category : 'private - errors' } +{ #category : #'private - errors' } BlRopeIterator >> errorOvershootsTheEnd [ self error: 'Overshoots the end of the iterator!' ] -{ #category : 'private - errors' } +{ #category : #'private - errors' } BlRopeIterator >> errorOvershootsTheStart [ self error: 'Reached the end of the rope iterator!' ] -{ #category : 'private - errors' } +{ #category : #'private - errors' } BlRopeIterator >> errorReachedTheEnd [ self error: 'Reached the end of the rope iterator!' ] -{ #category : 'private - errors' } +{ #category : #'private - errors' } BlRopeIterator >> errorReachedTheStart [ self error: 'Overshoots the start of the iterator!' ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlRopeIterator >> hasNext [ "Return true if iterator is be able to return #next item in the rope, false otherwise" @@ -84,7 +82,7 @@ BlRopeIterator >> hasNext [ ^ self subclassResponsibility ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlRopeIterator >> hasPrevious [ "Return true if iterator is be able to return #previous item in the rope, false otherwise" @@ -92,7 +90,7 @@ BlRopeIterator >> hasPrevious [ ^ self subclassResponsibility ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> next [ "Return next element in the rope" @@ -100,7 +98,7 @@ BlRopeIterator >> next [ ^ self subclassResponsibility ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextLine [ "Return a next line without delimiters" @@ -108,7 +106,7 @@ BlRopeIterator >> nextLine [ ^ self nextLineIndicesDo: [ :aStart :anEnd :aLineEndWithDelimiters | self rope from: aStart to: anEnd ] ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextLineIndicesDo: anIndicesBlock [ " execute anIndicesBlock with 3 arguments for each line: - start index of line in cursor coordinates @@ -153,7 +151,7 @@ BlRopeIterator >> nextLineIndicesDo: anIndicesBlock [ value: aDelimitedLineEnd ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextSegment: aBlock [ "Return a segment of item for those aBlock uniformly returns equal value for each consequent item" @@ -163,7 +161,7 @@ BlRopeIterator >> nextSegment: aBlock [ indicesDo: [ :aStart :anEnd :anInitialValue | self rope from: aStart to: anEnd ] ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextSegment: aBlock indicesDo: anIndicesBlock [ "Evaluate aBlock with every item in the forward direction until aBlock returns a different value compared to the value produced by evaluating aBlock with the first item in a sequence or until we run out of items to iterate over. @@ -196,7 +194,7 @@ BlRopeIterator >> nextSegment: aBlock indicesDo: anIndicesBlock [ cull: initialValue ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextSegment: aBlock indicesDo: anIndicesBlock lookahead: aLookaheadAmount [ "Evaluate aBlock with every item in the forward direction until aBlock returns a different value compared to the value produced by evaluating aBlock with the first item in a sequence or until we run out of items to iterate over. @@ -213,7 +211,7 @@ BlRopeIterator >> nextSegment: aBlock indicesDo: anIndicesBlock lookahead: aLook breakWhen: [ :aSegmentValue | false ] ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextSegment: aBlock indicesDo: anIndicesBlock lookahead: aLookaheadAmount breakWhen: aBreakBlock [ "Evaluate aBlock with every item in the forward direction until aBlock returns a different value compared to the value produced by evaluating aBlock with the first item in a sequence or until we run out of items to iterate over. @@ -270,13 +268,13 @@ BlRopeIterator >> nextSegment: aBlock indicesDo: anIndicesBlock lookahead: aLook cull: currentValue ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextSpan [ "Return a next homogeneous subrope based on attributes" ^ self subclassResponsibility ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextSpan: aBlock [ "Evaluate aBlock with each attribute from each span and return a span for which aBlock returns either true or false. The key here is that we can redefine what homogeneity of the span mean" @@ -301,21 +299,21 @@ BlRopeIterator >> nextSpan: aBlock [ ^ self rope from: aStart to: anEnd ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextWhitespace [ ^ self nextSegment: [ :item | item isCharacter not or: [ item isSeparator not ] ] ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> nextWord [ ^ self nextSegment: [ :item | item isCharacter and: [ item isSeparator not ] ] ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> peek [ "Return an element at current #position without changing it. (#peek item is the same that would be returned by #next). @@ -325,7 +323,7 @@ BlRopeIterator >> peek [ ^ self subclassResponsibility ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> peer [ "Return an element before the current #position without moving the cursor. (#peer item is the same that would be returned by #previous). @@ -338,7 +336,7 @@ BlRopeIterator >> peer [ ^ self subclassResponsibility ] -{ #category : 'iterator - accessing' } +{ #category : #'iterator - accessing' } BlRopeIterator >> position [ "Return a *cursor* position. @@ -356,12 +354,12 @@ BlRopeIterator >> position [ ^ self subclassResponsibility ] -{ #category : 'copying' } +{ #category : #copying } BlRopeIterator >> postCopy [ ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> previous [ "Return previous element in the rope" @@ -369,7 +367,7 @@ BlRopeIterator >> previous [ ^ self subclassResponsibility ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> previousSegment: aBlock indicesDo: anIndicesBlock [ "Evaluate aBlock with every item in the backward direction until aBlock returns a different value compared to the value produced by evaluating aBlock with the first item in a sequence or until we run out of items to iterate over. @@ -402,12 +400,12 @@ BlRopeIterator >> previousSegment: aBlock indicesDo: anIndicesBlock [ cull: initialValue ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlRopeIterator >> rope [ ^ rope ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlRopeIterator >> rope: aRope from: aStart to: anEnd [ (aRope isNotEmpty and: [ aStart < 0 or: [ anEnd > aRope size ] ]) ifTrue: [ self error: 'Iterator interval out of bounds!' ]. @@ -419,7 +417,7 @@ BlRopeIterator >> rope: aRope from: aStart to: anEnd [ end := anEnd max: aStart. ] -{ #category : 'iterator - attributes' } +{ #category : #'iterator - attributes' } BlRopeIterator >> selectAttributes: aBlock [ "Evaluate aBlock with each of the receiver's elements as the argument. Collect into a new collection like the receiver, only those elements for @@ -429,7 +427,7 @@ BlRopeIterator >> selectAttributes: aBlock [ ^ self attributes select: aBlock ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlRopeIterator >> skip: aNumber [ "Skip given amount of items (that would be returned by #next or #prevous). aNumber can be negative and positive, sign defines a direction of iteration" @@ -437,7 +435,7 @@ BlRopeIterator >> skip: aNumber [ self subclassResponsibility ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlRopeIterator >> start [ diff --git a/src/Bloc/BlRopeableCollectionFile.class.st b/src/Bloc/BlRopeableCollectionFile.class.st index 4c4d547ec..3c7fc051a 100644 --- a/src/Bloc/BlRopeableCollectionFile.class.st +++ b/src/Bloc/BlRopeableCollectionFile.class.st @@ -46,8 +46,8 @@ Once that has been done, #size should be modified to raise an exception if the a " Class { - #name : 'BlRopeableCollectionFile', - #superclass : 'Object', + #name : #BlRopeableCollectionFile, + #superclass : #Object, #instVars : [ 'fileReference', 'strict', @@ -59,19 +59,17 @@ Class { 'bufferedSize', 'haveSize' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile class >> defaultBufferSize [ "The default number of characters in the receiver's buffer" ^ 200000 ] -{ #category : 'comparing' } +{ #category : #comparing } BlRopeableCollectionFile >> = anObject [ "Compare the contents of the receiver to anObject. Beware: this will be slow for large files" @@ -81,7 +79,7 @@ BlRopeableCollectionFile >> = anObject [ ifNotNil: [ fileReference contents = anObject ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> approximateSize [ "Answer the receiver's size, if known. If not use the file size, which will be either correct or an over-estimate" @@ -92,7 +90,7 @@ BlRopeableCollectionFile >> approximateSize [ ifNotNil: [ fileReference size ] ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> at: anInteger [ "Answer the character at anInteger" @@ -100,12 +98,12 @@ BlRopeableCollectionFile >> at: anInteger [ ^ buffer at: (anInteger - bufferStart + 1) asInteger. ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> bufferSize [ ^ bufferSize ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> bufferSize: anInteger [ bufferSize := anInteger. @@ -114,7 +112,7 @@ BlRopeableCollectionFile >> bufferSize: anInteger [ bufferedSize := 0. ] -{ #category : 'private' } +{ #category : #private } BlRopeableCollectionFile >> characterStream [ "Answer a read stream with character decoding on the receiver's binary stream" @@ -123,13 +121,13 @@ BlRopeableCollectionFile >> characterStream [ encoding: 'utf8' ] -{ #category : 'initialize-release' } +{ #category : #'initialize-release' } BlRopeableCollectionFile >> close [ binaryStream close ] -{ #category : 'copying' } +{ #category : #copying } BlRopeableCollectionFile >> copyFrom: startIndex to: endIndex [ | length results receiverIndex bufferIndex resultIndex | @@ -154,7 +152,7 @@ BlRopeableCollectionFile >> copyFrom: startIndex to: endIndex [ ] -{ #category : 'copying' } +{ #category : #copying } BlRopeableCollectionFile >> copyToEndFrom: startIndex [ "Copy the receiver's contents from startIndex to the end. This should be used instead of #copyFrom:to: since the receiver's length may not be known." @@ -183,7 +181,7 @@ BlRopeableCollectionFile >> copyToEndFrom: startIndex [ ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlRopeableCollectionFile >> do: aBlock [ | characterStream ch | @@ -195,7 +193,7 @@ BlRopeableCollectionFile >> do: aBlock [ ch ifNotNil: [ aBlock value: ch ] ] ] -{ #category : 'private' } +{ #category : #private } BlRopeableCollectionFile >> ensureBuffered: anInteger [ "Ensure the character at anInteger is buffered" | mapEntry characterStream rawBuffer | @@ -224,12 +222,12 @@ BlRopeableCollectionFile >> ensureBuffered: anInteger [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> fileReference [ ^ fileReference ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> fileReference: aFileReference [ binaryStream ifNotNil: [ binaryStream close ]. @@ -241,19 +239,19 @@ BlRopeableCollectionFile >> fileReference: aFileReference [ (BlRopeableCollectionFileFinalizer new binaryStream: binaryStream) ] -{ #category : 'comparing' } +{ #category : #comparing } BlRopeableCollectionFile >> hash [ "Use identity hash to quickly differentiate most objects" ^ self identityHash ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> haveSize [ ^ haveSize ] -{ #category : 'initialization' } +{ #category : #initialization } BlRopeableCollectionFile >> initialize [ super initialize. @@ -267,7 +265,7 @@ BlRopeableCollectionFile >> initialize [ ] -{ #category : 'private' } +{ #category : #private } BlRopeableCollectionFile >> loadNext: aNumber with: aReadStream [ "Answer the next aNumber characters using aReadstream. If an encoding error occurs and strict is false, fall back to null encoding" @@ -284,14 +282,14 @@ BlRopeableCollectionFile >> loadNext: aNumber with: aReadStream [ self loadNext: aNumber with: self nullEncodedStream ] ] ] -{ #category : 'private - testing' } +{ #category : #'private - testing' } BlRopeableCollectionFile >> map [ "Only used for testing" ^ map ] -{ #category : 'private' } +{ #category : #private } BlRopeableCollectionFile >> mapEntryFor: anInteger [ "Answer the map entry with largest character offset less than or equal to anInteger" | left right mid midVal | @@ -328,7 +326,7 @@ BlRopeableCollectionFile >> mapEntryFor: anInteger [ ] -{ #category : 'private' } +{ #category : #private } BlRopeableCollectionFile >> nullEncodedStream [ "Answer a read stream with null (ascii) character decoding on the receiver's binary stream" @@ -337,7 +335,7 @@ BlRopeableCollectionFile >> nullEncodedStream [ encoding: 'null' ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> size [ "Answer the receiver's size. If the entire file has not been scanned use the file size, which will be either correct or an over-estimate" @@ -352,19 +350,19 @@ BlRopeableCollectionFile >> size [ ifFalse: [ BlTextIndexEOS new text: self ] ] -{ #category : 'private' } +{ #category : #private } BlRopeableCollectionFile >> species [ "Answer a class that can be used to create new in-memory ropes" ^ String ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> strict [ ^ strict ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFile >> strict: anObject [ strict := anObject ] diff --git a/src/Bloc/BlRopeableCollectionFileFinalizer.class.st b/src/Bloc/BlRopeableCollectionFileFinalizer.class.st index 961682137..c2ca797ca 100644 --- a/src/Bloc/BlRopeableCollectionFileFinalizer.class.st +++ b/src/Bloc/BlRopeableCollectionFileFinalizer.class.st @@ -1,25 +1,23 @@ Class { - #name : 'BlRopeableCollectionFileFinalizer', - #superclass : 'Object', + #name : #BlRopeableCollectionFileFinalizer, + #superclass : #Object, #instVars : [ 'binaryStream' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFileFinalizer >> binaryStream [ ^ binaryStream ] -{ #category : 'accessing' } +{ #category : #accessing } BlRopeableCollectionFileFinalizer >> binaryStream: anObject [ binaryStream := anObject ] -{ #category : 'finalization' } +{ #category : #finalization } BlRopeableCollectionFileFinalizer >> finalize [ binaryStream close. diff --git a/src/Bloc/BlRotationTransformation.class.st b/src/Bloc/BlRotationTransformation.class.st index 6b724bb18..cccd3747f 100644 --- a/src/Bloc/BlRotationTransformation.class.st +++ b/src/Bloc/BlRotationTransformation.class.st @@ -6,49 +6,47 @@ https://drafts.csswg.org/css-transforms/#valdef-transform-rotate " Class { - #name : 'BlRotationTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlRotationTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'angle', 'axis' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'accessing' } +{ #category : #accessing } BlRotationTransformation >> angle [ ^ angle ] -{ #category : 'accessing' } +{ #category : #accessing } BlRotationTransformation >> angle: aNumberOfDegrees [ "Set a rotation angle in degrees (not radians)" angle := aNumberOfDegrees ] -{ #category : 'converting' } +{ #category : #converting } BlRotationTransformation >> asQuaternion [ ^ BlQuaternion x: self axis x y: self axis y z: self axis z angle: self angle ] -{ #category : 'accessing' } +{ #category : #accessing } BlRotationTransformation >> axis [ ^ axis ] -{ #category : 'accessing' } +{ #category : #accessing } BlRotationTransformation >> axis: aBlVector [ axis := aBlVector ] -{ #category : 'initialization' } +{ #category : #initialization } BlRotationTransformation >> initialize [ super initialize. @@ -56,7 +54,7 @@ BlRotationTransformation >> initialize [ axis := BlVector zAxis ] -{ #category : 'testing' } +{ #category : #testing } BlRotationTransformation >> is2D [ "Return true if I represent a rotation in 2D space, false otherwise. By definition a rotation is in 2D when rotation axis is z-Axis (it has no x or y components)" @@ -64,7 +62,7 @@ BlRotationTransformation >> is2D [ ^ axis = BlVector zAxis ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlRotationTransformation >> multiplyOn: aBlMatrix [ aBlMatrix @@ -72,7 +70,7 @@ BlRotationTransformation >> multiplyOn: aBlMatrix [ around: axis ] -{ #category : 'printing' } +{ #category : #printing } BlRotationTransformation >> printOn: aStream [ aStream diff --git a/src/Bloc/BlRoundedRectangleGeometry.class.st b/src/Bloc/BlRoundedRectangleGeometry.class.st index 334e7487e..5d2ba7421 100644 --- a/src/Bloc/BlRoundedRectangleGeometry.class.st +++ b/src/Bloc/BlRoundedRectangleGeometry.class.st @@ -10,18 +10,16 @@ In order to explicitely create a rectangle use extent: BlRectangle extent: 50@30 ""create a rectangle with width 50 and height 30"" " Class { - #name : 'BlRoundedRectangleGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlRoundedRectangleGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'cornerRadii', 'center' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'factory' } +{ #category : #factory } BlRoundedRectangleGeometry class >> cornerRadii: aBlCornerRadii [ "Create a rounded rectangle with given corner radii" @@ -30,7 +28,7 @@ BlRoundedRectangleGeometry class >> cornerRadii: aBlCornerRadii [ yourself ] -{ #category : 'factory' } +{ #category : #factory } BlRoundedRectangleGeometry class >> cornerRadius: aNumber [ "Change the radii of all corners to a given number. aNumber must not be nil. @@ -41,7 +39,7 @@ BlRoundedRectangleGeometry class >> cornerRadius: aNumber [ yourself ] -{ #category : 'factory' } +{ #category : #factory } BlRoundedRectangleGeometry class >> new [ ^ self basicNew @@ -49,7 +47,7 @@ BlRoundedRectangleGeometry class >> new [ yourself ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlRoundedRectangleGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ | radii cornerRadius cornerX cornerY | @@ -96,25 +94,25 @@ BlRoundedRectangleGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: a < cornerRadius squared ] -{ #category : 'accessing' } +{ #category : #accessing } BlRoundedRectangleGeometry >> cornerRadii [ ^ cornerRadii ] -{ #category : 'testing' } +{ #category : #testing } BlRoundedRectangleGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlRoundedRectangleGeometry >> hasJoins [ ^ false ] -{ #category : 'initialization' } +{ #category : #initialization } BlRoundedRectangleGeometry >> initializeWith: aCornerRadii [ self initialize. @@ -122,14 +120,14 @@ BlRoundedRectangleGeometry >> initializeWith: aCornerRadii [ cornerRadii := aCornerRadii ] -{ #category : 'geometry' } +{ #category : #geometry } BlRoundedRectangleGeometry >> matchExtent: aPoint [ extent := aPoint. center := aPoint / 2.0. ] -{ #category : 'private' } +{ #category : #private } BlRoundedRectangleGeometry >> nonOverlappingCornersForBorderWidth: aNumber [ "Answer either current cornerRadii or a copy of it, that would work with any of the possible outskirts, and considering the current extent." diff --git a/src/Bloc/BlScalingTransformation.class.st b/src/Bloc/BlScalingTransformation.class.st index 6dc1f74bd..6772ebf43 100644 --- a/src/Bloc/BlScalingTransformation.class.st +++ b/src/Bloc/BlScalingTransformation.class.st @@ -8,17 +8,15 @@ https://drafts.csswg.org/css-transforms/#valdef-transform-scale " Class { - #name : 'BlScalingTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlScalingTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'scale' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlScalingTransformation class >> scale: aVector [ ^ self new @@ -26,7 +24,7 @@ BlScalingTransformation class >> scale: aVector [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlScalingTransformation >> initialize [ super initialize. @@ -34,32 +32,32 @@ BlScalingTransformation >> initialize [ scale := BlVector one ] -{ #category : 'testing' } +{ #category : #testing } BlScalingTransformation >> is2D [ ^ scale z closeTo: 1.0 ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlScalingTransformation >> multiplyOn: aBlMatrix [ aBlMatrix scaleBy: scale ] -{ #category : 'printing' } +{ #category : #printing } BlScalingTransformation >> printOn: aStream [ aStream nextPutAll: 'Scaling by '. scale printOn: aStream ] -{ #category : 'accessing' } +{ #category : #accessing } BlScalingTransformation >> scale [ ^ scale ] -{ #category : 'accessing' } +{ #category : #accessing } BlScalingTransformation >> scale: aBlVector3DOrConvertible [ scale := aBlVector3DOrConvertible asScale3D diff --git a/src/Bloc/BlSecondaryClickEvent.class.st b/src/Bloc/BlSecondaryClickEvent.class.st index 9ccb80679..e187f01ba 100644 --- a/src/Bloc/BlSecondaryClickEvent.class.st +++ b/src/Bloc/BlSecondaryClickEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSecondaryClickEvent', - #superclass : 'BlClickEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlSecondaryClickEvent, + #superclass : #BlClickEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlSecondaryMouseDownEvent.class.st b/src/Bloc/BlSecondaryMouseDownEvent.class.st index dcf929da7..3a229d9ed 100644 --- a/src/Bloc/BlSecondaryMouseDownEvent.class.st +++ b/src/Bloc/BlSecondaryMouseDownEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSecondaryMouseDownEvent', - #superclass : 'BlMouseDownEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlSecondaryMouseDownEvent, + #superclass : #BlMouseDownEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlSecondaryMouseUpEvent.class.st b/src/Bloc/BlSecondaryMouseUpEvent.class.st index b448e9f5c..4e16babf7 100644 --- a/src/Bloc/BlSecondaryMouseUpEvent.class.st +++ b/src/Bloc/BlSecondaryMouseUpEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSecondaryMouseUpEvent', - #superclass : 'BlMouseUpEvent', - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #name : #BlSecondaryMouseUpEvent, + #superclass : #BlMouseUpEvent, + #category : 'Bloc-Events' } diff --git a/src/Bloc/BlSelection.class.st b/src/Bloc/BlSelection.class.st index 5a50ea294..2fc9073db 100644 --- a/src/Bloc/BlSelection.class.st +++ b/src/Bloc/BlSelection.class.st @@ -3,41 +3,39 @@ I represent a text selection defined as interval [from...to] " Class { - #name : 'BlSelection', - #superclass : 'Object', + #name : #BlSelection, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #classInstVars : [ 'empty' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlSelection class >> cleanUp [ super cleanUp. empty := nil ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSelection class >> empty [ ^ empty ifNil: [ empty := BlEmptySelection new ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSelection class >> from: aFromIndex to: aToIndex [ ^ BlMonotoneSelection from: aFromIndex to: aToIndex ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlSelection >> + aTextSelection [ ^ BlMultipleSelection withAll: { self . aTextSelection } ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelection >> allSelections [ "Return a collection of all monotone selection intervals within this selection" @@ -45,7 +43,7 @@ BlSelection >> allSelections [ ^ Array streamContents: [ :aStream | self do: [ :aSelection | aStream nextPut: aSelection ] ] ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlSelection >> anySatisfy: aBlock [ "Evaluate aBlock with the elements of the receiver. If aBlock returns true for any element return true. @@ -55,14 +53,14 @@ BlSelection >> anySatisfy: aBlock [ ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelection >> children [ ^ self subclassResponsibility ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlSelection >> contains: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -70,7 +68,7 @@ BlSelection >> contains: anIndex [ ^ self subclassResponsibility ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlSelection >> containsIndex: anIndex [ "Return true if selection indices include a given index, false otherwise. I am conceptually same as (self indices includes: anIndex)" @@ -79,36 +77,36 @@ BlSelection >> containsIndex: anIndex [ ^ self subclassResponsibility ] -{ #category : 'copying' } +{ #category : #copying } BlSelection >> copyFrom: aStartIndex to: anEndIndex [ ^ self subclassResponsibility ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlSelection >> do: aBlock [ "Evaluate a given block with all recorded selection intervals" self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelection >> indices [ ^ Array streamContents: [ :aStream | self do: [ :eachMonotoneSelection | aStream nextPutAll: eachMonotoneSelection indices ] ] ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlSelection >> isEmpty [ ^ self subclassResponsibility ] -{ #category : 'api - testing' } +{ #category : #'api - testing' } BlSelection >> isNotEmpty [ ^ self subclassResponsibility ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } BlSelection >> reverseDo: aBlock [ "Evaluate a given block with all recorded selection intervals in reverse direction" diff --git a/src/Bloc/BlSelectionHandler.class.st b/src/Bloc/BlSelectionHandler.class.st index c2945b303..a272c8da1 100644 --- a/src/Bloc/BlSelectionHandler.class.st +++ b/src/Bloc/BlSelectionHandler.class.st @@ -5,8 +5,8 @@ May be used to implement text selection or desktop like selection behaviour " Class { - #name : 'BlSelectionHandler', - #superclass : 'BlCustomEventHandler', + #name : #BlSelectionHandler, + #superclass : #BlCustomEventHandler, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -16,17 +16,15 @@ Class { 'container', 'selected' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'geometry' } +{ #category : #geometry } BlSelectionHandler >> computeSelectionArea [ area origin: (origin min: corner) corner: (corner max: origin) ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlSelectionHandler >> dragEndEvent: anEvent [ anEvent consumed: true. @@ -35,7 +33,7 @@ BlSelectionHandler >> dragEndEvent: anEvent [ area left: 0 top: 0 right: 0 bottom: 0 ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlSelectionHandler >> dragEvent: anEvent [ "For selection we want to handle only those drag events that began exactly on the elemen I attached to" @@ -51,14 +49,14 @@ BlSelectionHandler >> dragEvent: anEvent [ self selectionChanged ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlSelectionHandler >> dragStartEvent: anEvent [ anEvent consumed: true. origin := anEvent position ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionHandler >> eventsToHandle [ ^ { BlDragEvent. @@ -67,12 +65,12 @@ BlSelectionHandler >> eventsToHandle [ } ] -{ #category : 'selection - handling' } +{ #category : #'selection - handling' } BlSelectionHandler >> handleDeselected: anElement [ anElement eventDispatcher dispatchSelectionLost ] -{ #category : 'selection - handling' } +{ #category : #'selection - handling' } BlSelectionHandler >> handleSelected: anElement in: anIntersection [ "we should make sure that we don't destroy existing BlBounds by performing destructive operation" self @@ -82,7 +80,7 @@ BlSelectionHandler >> handleSelected: anElement in: anIntersection [ ^ anElement eventDispatcher dispatchSelectionAcquired: anIntersection encompass ] -{ #category : 'testing' } +{ #category : #testing } BlSelectionHandler >> hasOrigin [ "Return true if I know selection origin position, false otherwise" @@ -90,7 +88,7 @@ BlSelectionHandler >> hasOrigin [ ^ origin isNotNil ] -{ #category : 'initialization' } +{ #category : #initialization } BlSelectionHandler >> initialize [ super initialize. @@ -98,7 +96,7 @@ BlSelectionHandler >> initialize [ selected := IdentityDictionary new ] -{ #category : 'selection' } +{ #category : #selection } BlSelectionHandler >> intersect: aChildElement in: aSelectionBounds ifNone: aNoneBlock [ "Return selection intersection bounds of a given element and provided selection bounds in local child cordinates if intersection exists @@ -112,14 +110,14 @@ BlSelectionHandler >> intersect: aChildElement in: aSelectionBounds ifNone: aNon ifNone: aNoneBlock ] -{ #category : 'installation' } +{ #category : #installation } BlSelectionHandler >> onInstalledIn: anElement [ super onInstalledIn: anElement. container := anElement ] -{ #category : 'selection' } +{ #category : #selection } BlSelectionHandler >> selectedChildren: anElement in: aBlBounds do: aBlock [ "Evaluate a block with all children of an element that intersect with provided bounds. aBlBounds is given in local coordinates of anElement" @@ -137,7 +135,7 @@ BlSelectionHandler >> selectedChildren: anElement in: aBlBounds do: aBlock [ do: aBlock ] ] -{ #category : 'geometry' } +{ #category : #geometry } BlSelectionHandler >> selectionArea [ "Return bounds representing a selection area in global coordinates" @@ -148,7 +146,7 @@ BlSelectionHandler >> selectionArea [ ^ area ] -{ #category : 'selection - handling' } +{ #category : #'selection - handling' } BlSelectionHandler >> selectionChanged [ "Is sent when #selectionArea changed" | oldSelected | @@ -186,7 +184,7 @@ BlSelectionHandler >> selectionChanged [ oldSelected keysDo: [ :anElement | self handleDeselected: anElement ] ] -{ #category : 'selection' } +{ #category : #selection } BlSelectionHandler >> shouldSelect: aChildElement in: aSelectionBounds [ "Return true if a child element should be selected taking into account provided selection area bounds given int local coordinates of a child element" diff --git a/src/Bloc/BlSelectionNode.class.st b/src/Bloc/BlSelectionNode.class.st index 0091376c5..49391d52f 100644 --- a/src/Bloc/BlSelectionNode.class.st +++ b/src/Bloc/BlSelectionNode.class.st @@ -5,8 +5,8 @@ I am a binary node with `=selection`= playing a role of a key (lowest value) and " Class { - #name : 'BlSelectionNode', - #superclass : 'Object', + #name : #BlSelectionNode, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -16,17 +16,15 @@ Class { 'high', 'parent' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSelectionNode class >> selection: aMonotoneTextSelection [ ^ self new selection: aMonotoneTextSelection ] -{ #category : 'comparing' } +{ #category : #comparing } BlSelectionNode >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -54,7 +52,7 @@ BlSelectionNode >> = anObject [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> children [ "Return a collection of children selection nodes" @@ -66,7 +64,7 @@ BlSelectionNode >> children [ ifTrue: [ aStream nextPut: self right ] ] ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionNode >> contains: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -86,7 +84,7 @@ BlSelectionNode >> contains: anIndex [ ^ false ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionNode >> containsIndex: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -106,14 +104,14 @@ BlSelectionNode >> containsIndex: anIndex [ ^ false ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSelectionNode >> createNode: aSelection [ ^ (self class selection: aSelection) parent: self; yourself ] -{ #category : 'tree - deletion' } +{ #category : #'tree - deletion' } BlSelectionNode >> delete [ "Delete me from the tree" @@ -131,7 +129,7 @@ BlSelectionNode >> delete [ ifFalse: [ self deleteInParent ] ] ] ] -{ #category : 'tree - deletion' } +{ #category : #'tree - deletion' } BlSelectionNode >> deleteInParent [ "Delete me from the parent" self @@ -152,7 +150,7 @@ BlSelectionNode >> deleteInParent [ parent := nil ] -{ #category : 'tree - enumerating' } +{ #category : #'tree - enumerating' } BlSelectionNode >> do: aBlock [ self hasLeft ifTrue: [ self left do: aBlock ]. @@ -163,7 +161,7 @@ BlSelectionNode >> do: aBlock [ ifTrue: [ self right do: aBlock ] ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionNode >> findMax [ "Return a minimum node in a subtree" @@ -175,7 +173,7 @@ BlSelectionNode >> findMax [ ^ aCurrentNode ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionNode >> findMin [ "Return a minimum node in a subtree" @@ -187,27 +185,27 @@ BlSelectionNode >> findMin [ ^ aCurrentNode ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionNode >> hasLeft [ ^ left isNotNil ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionNode >> hasParent [ ^ parent isNotNil ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionNode >> hasRight [ ^ right isNotNil ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> high [ ^ high ] -{ #category : 'tree - inserting' } +{ #category : #'tree - inserting' } BlSelectionNode >> insert: aMonotoneTextSelection [ aMonotoneTextSelection < self selection @@ -222,12 +220,12 @@ BlSelectionNode >> insert: aMonotoneTextSelection [ high := high max: ((left ifNil: [ 0 ] ifNotNil: #high) max: (right ifNil: [ 0 ] ifNotNil: #high)) ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionNode >> isRoot [ ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> left [ self assert: [ left isNotNil ] @@ -236,13 +234,13 @@ BlSelectionNode >> left [ ^ left ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> left: aTextSelectionNode [ left := aTextSelectionNode ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionNode >> overlapping: aMonotoneTextSelection in: aStream [ (left isNotNil and: [ aMonotoneTextSelection from <= left high ]) @@ -255,7 +253,7 @@ BlSelectionNode >> overlapping: aMonotoneTextSelection in: aStream [ ifTrue: [ right overlapping: aMonotoneTextSelection in: aStream ] ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionNode >> overlappingNeighbours: aMonotoneTextSelection in: aStream [ (left isNotNil and: [ aMonotoneTextSelection from <= (left high + 1) ]) @@ -268,7 +266,7 @@ BlSelectionNode >> overlappingNeighbours: aMonotoneTextSelection in: aStream [ ifTrue: [ right overlappingNeighbours: aMonotoneTextSelection in: aStream ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> parent [ self assert: [ parent isNotNil ] @@ -277,12 +275,12 @@ BlSelectionNode >> parent [ ^ parent ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> parent: aBlSelectionNode [ parent := aBlSelectionNode ] -{ #category : 'copying' } +{ #category : #copying } BlSelectionNode >> postCopy [ right := right copy. right ifNotNil: [ right parent: self ]. @@ -297,7 +295,7 @@ BlSelectionNode >> postCopy [ ] -{ #category : 'printing' } +{ #category : #printing } BlSelectionNode >> printOn: aStream [ self hasLeft ifTrue: [ self left printOn: aStream ]. @@ -305,17 +303,17 @@ BlSelectionNode >> printOn: aStream [ self hasRight ifTrue: [ self right printOn: aStream ]. ] -{ #category : 'tree - deletion' } +{ #category : #'tree - deletion' } BlSelectionNode >> removeLeft [ left := nil ] -{ #category : 'tree - deletion' } +{ #category : #'tree - deletion' } BlSelectionNode >> removeRight [ right := nil ] -{ #category : 'tree - deletion' } +{ #category : #'tree - deletion' } BlSelectionNode >> replaceInParent: aTextSelectionNode [ "Replace me in a parent with a given node" @@ -334,7 +332,7 @@ BlSelectionNode >> replaceInParent: aTextSelectionNode [ parent := nil ] -{ #category : 'tree - enumerating' } +{ #category : #'tree - enumerating' } BlSelectionNode >> reverseDo: aBlock [ self hasRight @@ -346,7 +344,7 @@ BlSelectionNode >> reverseDo: aBlock [ ifTrue: [ self left reverseDo: aBlock ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> right [ self assert: [ right isNotNil ] @@ -355,18 +353,18 @@ BlSelectionNode >> right [ ^ right ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> right: aTextSelectionNode [ right := aTextSelectionNode ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionNode >> selection [ ^ selection ] -{ #category : 'initialization' } +{ #category : #initialization } BlSelectionNode >> selection: aMonotoneTextSelection [ selection := aMonotoneTextSelection. high := selection to diff --git a/src/Bloc/BlSelectionTree.class.st b/src/Bloc/BlSelectionTree.class.st index 9ba1b2e98..d0358d854 100644 --- a/src/Bloc/BlSelectionTree.class.st +++ b/src/Bloc/BlSelectionTree.class.st @@ -13,19 +13,17 @@ Both insertions and deletion have logarithmic complexity O(logN) where N is curr " Class { - #name : 'BlSelectionTree', - #superclass : 'Object', + #name : #BlSelectionTree, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'root' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'comparing' } +{ #category : #comparing } BlSelectionTree >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -40,7 +38,7 @@ BlSelectionTree >> = anObject [ ifFalse: [ true ] ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionTree >> contains: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -50,7 +48,7 @@ BlSelectionTree >> contains: anIndex [ ifFalse: [ false ] ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionTree >> containsIndex: anIndex [ "Return true if this selection interval includes a given index, false otherwise" @@ -60,7 +58,7 @@ BlSelectionTree >> containsIndex: anIndex [ ifFalse: [ false ] ] -{ #category : 'tree - deletion' } +{ #category : #'tree - deletion' } BlSelectionTree >> delete: aMonotoneTextSelection [ | theOverlapping | self hasRoot @@ -78,27 +76,27 @@ BlSelectionTree >> delete: aMonotoneTextSelection [ do: [ :aSelection | aSelection isNotEmpty ifTrue: [ self insert: aSelection ] ] ] ] -{ #category : 'tree - enumerating' } +{ #category : #'tree - enumerating' } BlSelectionTree >> do: aBlock [ self hasRoot ifTrue: [ self root do: aBlock ] ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionTree >> findOverlapping: aMonotoneTextSelection [ ^ Array streamContents: [ :aStream | self overlapping: aMonotoneTextSelection in: aStream ] ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionTree >> findOverlappingNeighbours: aMonotoneTextSelection [ ^ Array streamContents: [ :aStream | self overlappingNeighbours: aMonotoneTextSelection in: aStream ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionTree >> first [ self assert: [ self isNotEmpty ] @@ -107,19 +105,19 @@ BlSelectionTree >> first [ ^ self root findMin ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionTree >> hasRoot [ ^ root isNotNil ] -{ #category : 'comparing' } +{ #category : #comparing } BlSelectionTree >> hash [ ^ self hasRoot ifTrue: [ self root hash bitXor: self class hash ] ifFalse: [ self class hash ] ] -{ #category : 'tree - inserting' } +{ #category : #'tree - inserting' } BlSelectionTree >> insert: aMonotoneTextSelection [ | theNeighbours newFrom newTo | @@ -142,22 +140,22 @@ BlSelectionTree >> insert: aMonotoneTextSelection [ self root insert: (BlSelection from: newFrom to: newTo) ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionTree >> isEmpty [ ^ self hasRoot not ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionTree >> isNotEmpty [ ^ self hasRoot ] -{ #category : 'tree - testing' } +{ #category : #'tree - testing' } BlSelectionTree >> isRoot [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionTree >> last [ self assert: [ self hasRoot ] @@ -166,45 +164,45 @@ BlSelectionTree >> last [ ^ self root findMax ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionTree >> overlapping: aMonotoneTextSelection in: aStream [ self hasRoot ifTrue: [ self root overlapping: aMonotoneTextSelection in: aStream ] ] -{ #category : 'tree - searching' } +{ #category : #'tree - searching' } BlSelectionTree >> overlappingNeighbours: aMonotoneTextSelection in: aStream [ self hasRoot ifTrue: [ self root overlappingNeighbours: aMonotoneTextSelection in: aStream ] ] -{ #category : 'copying' } +{ #category : #copying } BlSelectionTree >> postCopy [ root := root copy. root ifNotNil: [ root parent: self ] ] -{ #category : 'printing' } +{ #category : #printing } BlSelectionTree >> printOn: aStream [ self hasRoot ifTrue: [ self root printOn: aStream ] ] -{ #category : 'tree - deletion' } +{ #category : #'tree - deletion' } BlSelectionTree >> removeRoot [ root := nil ] -{ #category : 'tree - enumerating' } +{ #category : #'tree - enumerating' } BlSelectionTree >> reverseDo: aBlock [ self hasRoot ifTrue: [ self root reverseDo: aBlock ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionTree >> root [ @@ -215,7 +213,7 @@ BlSelectionTree >> root [ ^ root ] -{ #category : 'accessing' } +{ #category : #accessing } BlSelectionTree >> root: aTextSelectionNode [ root := aTextSelectionNode ] diff --git a/src/Bloc/BlShadowEffect.class.st b/src/Bloc/BlShadowEffect.class.st index 185efb233..d0fa3945a 100644 --- a/src/Bloc/BlShadowEffect.class.st +++ b/src/Bloc/BlShadowEffect.class.st @@ -3,42 +3,40 @@ I represent an abstract shadow effect applied on an element. " Class { - #name : 'BlShadowEffect', - #superclass : 'BlElementEffect', + #name : #BlShadowEffect, + #superclass : #BlElementEffect, #instVars : [ 'color', 'offset' ], - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #category : 'Bloc-Effect' } -{ #category : 'accessing' } +{ #category : #accessing } BlShadowEffect >> color [ ^ color ] -{ #category : 'geometry' } +{ #category : #geometry } BlShadowEffect >> computeBounds: aBlBounds [ ^ aBlBounds expandByMargin: self shadowMargin ] -{ #category : 'geometry' } +{ #category : #geometry } BlShadowEffect >> extraShadowSpace [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlShadowEffect >> offset [ ^ offset ] -{ #category : 'geometry' } +{ #category : #geometry } BlShadowEffect >> shadowMargin [ | anExtraSpace | diff --git a/src/Bloc/BlSharedEventDistributor.class.st b/src/Bloc/BlSharedEventDistributor.class.st index 504cde01a..494c8fff0 100644 --- a/src/Bloc/BlSharedEventDistributor.class.st +++ b/src/Bloc/BlSharedEventDistributor.class.st @@ -9,36 +9,34 @@ In the following example, {{gtClass:BlMouseOverEvent}}, {{gtClass:BlMouseOutEven " Class { - #name : 'BlSharedEventDistributor', - #superclass : 'BlBasicEventHandler', + #name : #BlSharedEventDistributor, + #superclass : #BlBasicEventHandler, #instVars : [ 'adjustMousePosition', 'elements', 'handledEvents', 'shouldHandle' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSharedEventDistributor class >> shareEvent: anEventClass [ ^ self shareEvents: { anEventClass } ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSharedEventDistributor class >> shareEvents: aCollectionOfEvents [ ^ self new shareEvents: aCollectionOfEvents ] -{ #category : 'accessing' } +{ #category : #accessing } BlSharedEventDistributor >> adjustMousePosition: aBoolean [ adjustMousePosition := aBoolean ] -{ #category : 'private - coordinates' } +{ #category : #'private - coordinates' } BlSharedEventDistributor >> adjustPosition: aNewEvent from: anOldEvent [ | anOldBounds anOldDiagonal aNewBounds aNewDiagonal aRatio aNewPosition | @@ -58,7 +56,7 @@ BlSharedEventDistributor >> adjustPosition: aNewEvent from: anOldEvent [ aNewEvent screenPosition: (anOldEvent screenPosition ifNil: [ 0@0 ]) + (aNewPosition - anOldEvent position) ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlSharedEventDistributor >> dispatch: aBlEvent on: anElement [ | aNewEvent | @@ -76,17 +74,17 @@ BlSharedEventDistributor >> dispatch: aBlEvent on: anElement [ aNewEvent isConsumed ifTrue: [ aBlEvent consumed: true ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSharedEventDistributor >> elements [ ^ elements asArray ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlSharedEventDistributor >> eventsToHandle [ ^ handledEvents ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlSharedEventDistributor >> handleEvent: anEvent [ shouldHandle @@ -97,7 +95,7 @@ BlSharedEventDistributor >> handleEvent: anEvent [ ifFalse: [ self dispatch: anEvent on: eachElement ] ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlSharedEventDistributor >> initialize [ super initialize. elements := Set new. @@ -106,19 +104,19 @@ BlSharedEventDistributor >> initialize [ adjustMousePosition := true ] -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlSharedEventDistributor >> onInstalledIn: anObject [ elements add: anObject ] -{ #category : 'api - hooks' } +{ #category : #'api - hooks' } BlSharedEventDistributor >> onUninstalledIn: anObject [ elements remove: anObject ifAbsent: [ "ignore" ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSharedEventDistributor >> shareEvents: aCollectionOfEvents [ self assert: [ aCollectionOfEvents isCollection ] @@ -130,7 +128,7 @@ BlSharedEventDistributor >> shareEvents: aCollectionOfEvents [ handledEvents := aCollectionOfEvents ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlSharedEventDistributor >> wantsEvent: anEvent [ shouldHandle ifFalse: [ ^ false ]. diff --git a/src/Bloc/BlShearTransformation.class.st b/src/Bloc/BlShearTransformation.class.st index 81c8be003..eba4c91ba 100644 --- a/src/Bloc/BlShearTransformation.class.st +++ b/src/Bloc/BlShearTransformation.class.st @@ -1,61 +1,59 @@ Class { - #name : 'BlShearTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlShearTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'coefficient' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'accessing' } +{ #category : #accessing } BlShearTransformation >> angleX: anAngleInDegrees [ self coefficient: anAngleInDegrees degreesToRadians tan negated @ self coefficient y ] -{ #category : 'accessing' } +{ #category : #accessing } BlShearTransformation >> angleY: anAngleInDegrees [ self coefficient: self coefficient x @ anAngleInDegrees degreesToRadians tan negated ] -{ #category : 'accessing' } +{ #category : #accessing } BlShearTransformation >> coefficient [ ^ coefficient ] -{ #category : 'accessing' } +{ #category : #accessing } BlShearTransformation >> coefficient: aPoint [ coefficient := aPoint ] -{ #category : 'initialization' } +{ #category : #initialization } BlShearTransformation >> initialize [ super initialize. coefficient := 0.0@0.0 ] -{ #category : 'testing' } +{ #category : #testing } BlShearTransformation >> is2D [ "Return true if transformation happens in x-y plane, hence 2D" ^ true ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlShearTransformation >> multiplyOn: aBlMatrix [ aBlMatrix multiplyBy: (BlMatrix2D shear: coefficient) ] -{ #category : 'printing' } +{ #category : #printing } BlShearTransformation >> printOn: aStream [ aStream diff --git a/src/Bloc/BlShortcut.class.st b/src/Bloc/BlShortcut.class.st index cd6aeb54d..2f4b7d6eb 100644 --- a/src/Bloc/BlShortcut.class.st +++ b/src/Bloc/BlShortcut.class.st @@ -4,14 +4,12 @@ Use {{gtClass:BlShortcutWithAction}} instead " Class { - #name : 'BlShortcut', - #superclass : 'BlShortcutWithAction', - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #name : #BlShortcut, + #superclass : #BlShortcutWithAction, + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'testing' } +{ #category : #testing } BlShortcut class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlShortcutEvent.class.st b/src/Bloc/BlShortcutEvent.class.st index 5af834a50..2454c1ed0 100644 --- a/src/Bloc/BlShortcutEvent.class.st +++ b/src/Bloc/BlShortcutEvent.class.st @@ -16,42 +16,40 @@ I must be set to `=consumed`= if there was a matching shortcut. " Class { - #name : 'BlShortcutEvent', - #superclass : 'BlUIEvent', + #name : #BlShortcutEvent, + #superclass : #BlUIEvent, #instVars : [ 'buffer', 'isRepeated' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutEvent >> beRepeated [ isRepeated := true ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutEvent >> buffer [ ^ buffer ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutEvent >> buffer: aBlKeyboardBuffer [ buffer := aBlKeyboardBuffer ] -{ #category : 'initialization' } +{ #category : #initialization } BlShortcutEvent >> initialize [ super initialize. isRepeated := false ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutEvent >> isRepeated [ "Return true if this shortcut is a repeated event giving handlers a chance to ignore such shortcuts" @@ -59,7 +57,7 @@ BlShortcutEvent >> isRepeated [ ^ isRepeated ] -{ #category : 'sending' } +{ #category : #sending } BlShortcutEvent >> sendTo: anObject [ anObject shortcutEvent: self ] diff --git a/src/Bloc/BlShortcutHandler.class.st b/src/Bloc/BlShortcutHandler.class.st index 8ba06429c..2da3da101 100644 --- a/src/Bloc/BlShortcutHandler.class.st +++ b/src/Bloc/BlShortcutHandler.class.st @@ -6,16 +6,14 @@ I am a part of `=BlDirectEventDispatcher`= " Class { - #name : 'BlShortcutHandler', - #superclass : 'BlBasicEventHandler', + #name : #BlShortcutHandler, + #superclass : #BlBasicEventHandler, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandler >> addShortcut: aBlShortcut [ "Return a shortcut handler with an added given shortcut. Note: The returned instance may or may not be the same as the receiver" @@ -24,12 +22,12 @@ BlShortcutHandler >> addShortcut: aBlShortcut [ ^ self subclassResponsibility ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlShortcutHandler >> handleEvent: aShortcutEvent [ self subclassResponsibility ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandler >> removeAllWithCombination: aBlKeyCombination [ "Return a shortcut handler without all shortcuts with a given key combination. Note: The returned instance may or may not be the same as the receiver" @@ -38,7 +36,7 @@ BlShortcutHandler >> removeAllWithCombination: aBlKeyCombination [ ^ self subclassResponsibility ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandler >> removeShortcut: aBlShortcut [ "Return a shortcut handler without a given shortcut. Note: The returned instance may or may not be the same as the receiver" @@ -47,14 +45,14 @@ BlShortcutHandler >> removeShortcut: aBlShortcut [ ^ self subclassResponsibility ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutHandler >> shortcuts [ ^ self subclassResponsibility ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlShortcutHandler >> wantsEvent: anEvent [ ^ self subclassResponsibility ] diff --git a/src/Bloc/BlShortcutHandlerWithShortcuts.class.st b/src/Bloc/BlShortcutHandlerWithShortcuts.class.st index 928e6f691..21b3c6991 100644 --- a/src/Bloc/BlShortcutHandlerWithShortcuts.class.st +++ b/src/Bloc/BlShortcutHandlerWithShortcuts.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlShortcutHandlerWithShortcuts', - #superclass : 'BlShortcutHandler', + #name : #BlShortcutHandlerWithShortcuts, + #superclass : #BlShortcutHandler, #instVars : [ 'shortcutRegistry' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandlerWithShortcuts >> addShortcut: aBlShortcut [ "Return a shortcut handler with an added given shortcut. Note: We do not return a new instance in case of a handler with shortcuts" @@ -19,12 +17,12 @@ BlShortcutHandlerWithShortcuts >> addShortcut: aBlShortcut [ ^ self ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlShortcutHandlerWithShortcuts >> eventClass [ ^ BlShortcutEvent ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlShortcutHandlerWithShortcuts >> eventsToHandle [ "I return a collection of element types I may be interested in" @@ -32,7 +30,7 @@ BlShortcutHandlerWithShortcuts >> eventsToHandle [ ^ { BlShortcutEvent } ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlShortcutHandlerWithShortcuts >> handleEvent: aShortcutEvent [ | matchingShortcuts | @@ -54,14 +52,14 @@ BlShortcutHandlerWithShortcuts >> handleEvent: aShortcutEvent [ aShortcut performDueTo: aShortcutEvent ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlShortcutHandlerWithShortcuts >> initialize [ super initialize. shortcutRegistry := BlShortcutRegistry new ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandlerWithShortcuts >> removeAllWithCombination: aBlKeyCombination [ "Return a shortcut handler without all shortcuts with a given key combination. Note: The returned instance may or may not be the same as the receiver" @@ -74,7 +72,7 @@ BlShortcutHandlerWithShortcuts >> removeAllWithCombination: aBlKeyCombination [ ifNotEmpty: [ self ] ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandlerWithShortcuts >> removeShortcut: aBlShortcut [ "Return a shortcut handler without a given shortcut. Note: If after removing a given shortcut the shortcut registry is empty, return a handler @@ -90,19 +88,19 @@ BlShortcutHandlerWithShortcuts >> removeShortcut: aBlShortcut [ ifNotEmpty: [ self ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutHandlerWithShortcuts >> shortcutRegistry [ ^ shortcutRegistry ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutHandlerWithShortcuts >> shortcuts [ ^ self shortcutRegistry shortcuts ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlShortcutHandlerWithShortcuts >> wantsEvent: anEvent [ ^ anEvent class == self eventClass or: [ anEvent class inheritsFrom: self eventClass ] ] diff --git a/src/Bloc/BlShortcutHandlerWithoutShortcuts.class.st b/src/Bloc/BlShortcutHandlerWithoutShortcuts.class.st index 5bd66d719..e5de1b413 100644 --- a/src/Bloc/BlShortcutHandlerWithoutShortcuts.class.st +++ b/src/Bloc/BlShortcutHandlerWithoutShortcuts.class.st @@ -1,25 +1,23 @@ Class { - #name : 'BlShortcutHandlerWithoutShortcuts', - #superclass : 'BlShortcutHandler', + #name : #BlShortcutHandlerWithoutShortcuts, + #superclass : #BlShortcutHandler, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutHandlerWithoutShortcuts class >> cleanUp [ uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutHandlerWithoutShortcuts class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandlerWithoutShortcuts >> addShortcut: aBlShortcut [ "Return a shortcut handler with an added given shortcut. Note: The returned instance may or may not be the same as the receiver" @@ -28,11 +26,11 @@ BlShortcutHandlerWithoutShortcuts >> addShortcut: aBlShortcut [ ^ BlShortcutHandlerWithShortcuts new addShortcut: aBlShortcut ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlShortcutHandlerWithoutShortcuts >> handleEvent: aShortcutEvent [ ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandlerWithoutShortcuts >> removeAllWithCombination: aBlKeyCombination [ "Return a shortcut handler without all shortcuts with a given key combination. Note: The returned instance may or may not be the same as the receiver" @@ -41,7 +39,7 @@ BlShortcutHandlerWithoutShortcuts >> removeAllWithCombination: aBlKeyCombination ^ self ] -{ #category : 'api - adding / removing' } +{ #category : #'api - adding / removing' } BlShortcutHandlerWithoutShortcuts >> removeShortcut: aBlShortcut [ "Return a shortcut handler without a given shortcut. Note: The returned instance may or may not be the same as the receiver" @@ -50,14 +48,14 @@ BlShortcutHandlerWithoutShortcuts >> removeShortcut: aBlShortcut [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutHandlerWithoutShortcuts >> shortcuts [ ^ #() ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlShortcutHandlerWithoutShortcuts >> wantsEvent: anEvent [ ^ false ] diff --git a/src/Bloc/BlShortcutRegistry.class.st b/src/Bloc/BlShortcutRegistry.class.st index 6e7291a63..8909c639c 100644 --- a/src/Bloc/BlShortcutRegistry.class.st +++ b/src/Bloc/BlShortcutRegistry.class.st @@ -3,43 +3,41 @@ I am a shortcut registry and contain a collection of `=BlShortcut`= " Class { - #name : 'BlShortcutRegistry', - #superclass : 'Collection', + #name : #BlShortcutRegistry, + #superclass : #Collection, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'shortcuts' ], - #category : 'Bloc-Events-Handler', - #package : 'Bloc', - #tag : 'Events-Handler' + #category : 'Bloc-Events-Handler' } -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlShortcutRegistry >> add: aBlShortcut [ self shortcuts add: aBlShortcut ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlShortcutRegistry >> addAll: aCollectionOfaBlShortcut [ self shortcuts addAll: aCollectionOfaBlShortcut ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlShortcutRegistry >> do: aBlock [ "Evaluate aBlock with each of the receiver's elements as the argument." self shortcuts do: aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlShortcutRegistry >> initialize [ super initialize. shortcuts := OrderedCollection new ] -{ #category : 'removing' } +{ #category : #removing } BlShortcutRegistry >> remove: aBlShortcut ifAbsent: anExceptionBlock [ "Remove oldObject from the receiver's elements. If several of the elements are equal to oldObject, only one is removed. If no element is @@ -50,22 +48,22 @@ BlShortcutRegistry >> remove: aBlShortcut ifAbsent: anExceptionBlock [ self shortcuts remove: aBlShortcut ifAbsent: anExceptionBlock ] -{ #category : 'removing' } +{ #category : #removing } BlShortcutRegistry >> removeAllWithCombination: aBlKeyCombination [ self shortcuts removeAllSuchThat: [ :eachShortcut | eachShortcut combination = aBlKeyCombination ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutRegistry >> shortcuts [ ^ shortcuts ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutRegistry >> shortcuts: anObject [ shortcuts := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutRegistry >> size [ ^ shortcuts size ] diff --git a/src/Bloc/BlShortcutWithAction.class.st b/src/Bloc/BlShortcutWithAction.class.st index 307199571..311bcd5c4 100644 --- a/src/Bloc/BlShortcutWithAction.class.st +++ b/src/Bloc/BlShortcutWithAction.class.st @@ -16,65 +16,63 @@ BlShortcutWithAction new " Class { - #name : 'BlShortcutWithAction', - #superclass : 'BlBasicShortcut', + #name : #BlShortcutWithAction, + #superclass : #BlBasicShortcut, #instVars : [ 'name', 'description', 'action' ], - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutWithAction >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutWithAction >> action: aBlockClosure [ "An action should be a block closure in a form [ :aShortcutEvent :aShortcut | ]" action := aBlockClosure ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutWithAction >> description [ ^ description ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutWithAction >> description: anObject [ description := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlShortcutWithAction >> initialize [ super initialize. action := [ :aShortcutEvent :aShortcut | ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutWithAction >> name [ ^ name ] -{ #category : 'accessing' } +{ #category : #accessing } BlShortcutWithAction >> name: anObject [ name := anObject ] -{ #category : 'evaluation' } +{ #category : #evaluation } BlShortcutWithAction >> performDueTo: aShortcutEvent [ self action cull: aShortcutEvent cull: self ] -{ #category : 'printing' } +{ #category : #printing } BlShortcutWithAction >> printOn: aStream [ super printOn: aStream. aStream nextPut: $(. diff --git a/src/Bloc/BlSigmoid.class.st b/src/Bloc/BlSigmoid.class.st index 681de2643..05f3f84ac 100644 --- a/src/Bloc/BlSigmoid.class.st +++ b/src/Bloc/BlSigmoid.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlSigmoid', - #superclass : 'BlSigmoidGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlSigmoid, + #superclass : #BlSigmoidGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlSigmoid class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlSigmoidGeometry.class.st b/src/Bloc/BlSigmoidGeometry.class.st index 81db3da93..e4c942bab 100644 --- a/src/Bloc/BlSigmoidGeometry.class.st +++ b/src/Bloc/BlSigmoidGeometry.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlSigmoidGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlSigmoidGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'from', 'to', @@ -15,34 +15,32 @@ Class { 'HorizontalOrientation', 'VerticalOrientation' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlSigmoidGeometry class >> initialize [ AutomaticOrientation := #automatic. VerticalOrientation := #vertical. HorizontalOrientation := #horizontal ] -{ #category : 'accessing' } +{ #category : #accessing } BlSigmoidGeometry >> beAutomatic [ self orientation: AutomaticOrientation ] -{ #category : 'accessing' } +{ #category : #accessing } BlSigmoidGeometry >> beHorizontal [ self orientation: HorizontalOrientation ] -{ #category : 'accessing' } +{ #category : #accessing } BlSigmoidGeometry >> beVertical [ self orientation: VerticalOrientation ] -{ #category : 'accessing' } +{ #category : #accessing } BlSigmoidGeometry >> bendingPoint: aFloatNumber [ "aFloatNumber must be within interval [0...1]" | aNewBendingPoint | @@ -56,7 +54,7 @@ BlSigmoidGeometry >> bendingPoint: aFloatNumber [ self releaseCache ] -{ #category : 'private' } +{ #category : #private } BlSigmoidGeometry >> computeFromControlPoint [ "I compute the location of the from control point related to the start of the sigmoid based on sharpness and bending point" @@ -86,7 +84,7 @@ BlSigmoidGeometry >> computeFromControlPoint [ ifFalse: [ (0 @ ((to - from) y sign * aDistanceToControlPoint)) + from ] ] -{ #category : 'private' } +{ #category : #private } BlSigmoidGeometry >> computeToControlPoint [ "I compute the location of the to control point related to the start of the sigmoid based on sharpness and bending point" @@ -116,7 +114,7 @@ BlSigmoidGeometry >> computeToControlPoint [ ifFalse: [ (0 @ ((from - to) y sign * aDistanceToControlPoint)) + to ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSigmoidGeometry >> from: aFromPoint to: aToPoint [ (from = aFromPoint and: [ to = aToPoint ]) @@ -128,7 +126,7 @@ BlSigmoidGeometry >> from: aFromPoint to: aToPoint [ self updateControlPoints ] -{ #category : 'initialization' } +{ #category : #initialization } BlSigmoidGeometry >> initialize [ super initialize. @@ -141,29 +139,29 @@ BlSigmoidGeometry >> initialize [ orientation := AutomaticOrientation ] -{ #category : 'private' } +{ #category : #private } BlSigmoidGeometry >> isAutomatic [ ^ orientation = AutomaticOrientation ] -{ #category : 'private' } +{ #category : #private } BlSigmoidGeometry >> isHorizontal [ ^ orientation = HorizontalOrientation ] -{ #category : 'private' } +{ #category : #private } BlSigmoidGeometry >> isVertical [ ^ orientation = VerticalOrientation ] -{ #category : 'geometry' } +{ #category : #geometry } BlSigmoidGeometry >> matchExtent: aPoint [ "Resize geometry to exactly match provided extent as a Point" extent := aPoint ] -{ #category : 'private' } +{ #category : #private } BlSigmoidGeometry >> orientation: anOrientation [ orientation = anOrientation ifTrue: [ ^ self ]. @@ -173,7 +171,7 @@ BlSigmoidGeometry >> orientation: anOrientation [ self releaseCache ] -{ #category : 'accessing' } +{ #category : #accessing } BlSigmoidGeometry >> sharpness: aFloatNumber [ "aFloatNumber must be within interval [0...1]" | aNewSharpness | @@ -187,7 +185,7 @@ BlSigmoidGeometry >> sharpness: aFloatNumber [ self releaseCache ] -{ #category : 'private' } +{ #category : #private } BlSigmoidGeometry >> updateControlPoints [ fromControl := self computeFromControlPoint. toControl := self computeToControlPoint. diff --git a/src/Bloc/BlSimpleShadowEffect.class.st b/src/Bloc/BlSimpleShadowEffect.class.st index 83238774c..c43720471 100644 --- a/src/Bloc/BlSimpleShadowEffect.class.st +++ b/src/Bloc/BlSimpleShadowEffect.class.st @@ -3,14 +3,12 @@ I am very simple shadow effect. I just render a plain flat colored geometry of a " Class { - #name : 'BlSimpleShadowEffect', - #superclass : 'BlShadowEffect', - #category : 'Bloc-Effect', - #package : 'Bloc', - #tag : 'Effect' + #name : #BlSimpleShadowEffect, + #superclass : #BlShadowEffect, + #category : 'Bloc-Effect' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSimpleShadowEffect class >> color: aColor offset: anOffset [ ^ self basicNew @@ -18,7 +16,7 @@ BlSimpleShadowEffect class >> color: aColor offset: anOffset [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSimpleShadowEffect class >> default [ self @@ -28,13 +26,13 @@ BlSimpleShadowEffect class >> default [ ^ self color: (Color black alpha: 0.3) offset: 10 @ 10 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSimpleShadowEffect class >> new [ ^ self color: Color black offset: 0@0 ] -{ #category : 'copying' } +{ #category : #copying } BlSimpleShadowEffect >> copyWithColor: aColor [ ^ self class @@ -42,7 +40,7 @@ BlSimpleShadowEffect >> copyWithColor: aColor [ offset: offset ] -{ #category : 'copying' } +{ #category : #copying } BlSimpleShadowEffect >> copyWithOffset: aPoint [ ^ self class @@ -50,7 +48,7 @@ BlSimpleShadowEffect >> copyWithOffset: aPoint [ offset: aPoint ] -{ #category : 'geometry' } +{ #category : #geometry } BlSimpleShadowEffect >> extraShadowSpace [ "Compute extra space that should be freed for shadow around element. Since I am not a gaussian shadow, the extra shadow space should be equal to the shadow width" @@ -58,7 +56,7 @@ BlSimpleShadowEffect >> extraShadowSpace [ ^ 0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlSimpleShadowEffect >> initializeColor: aColor offset: aPoint [ self initialize. diff --git a/src/Bloc/BlSimulatedTime.class.st b/src/Bloc/BlSimulatedTime.class.st index b22ec1605..59672f339 100644 --- a/src/Bloc/BlSimulatedTime.class.st +++ b/src/Bloc/BlSimulatedTime.class.st @@ -11,22 +11,20 @@ I am a simulated time that must be progressed manually by setting `=#date:`= dir " Class { - #name : 'BlSimulatedTime', - #superclass : 'BlTime', + #name : #BlSimulatedTime, + #superclass : #BlTime, #instVars : [ 'date' ], - #category : 'Bloc-Universe', - #package : 'Bloc', - #tag : 'Universe' + #category : 'Bloc-Universe' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSimulatedTime class >> date: aDateAndTime [ ^ self new date: aDateAndTime ] -{ #category : 'private - time' } +{ #category : #'private - time' } BlSimulatedTime >> currentTime [ "Return a 'current' date and time" @@ -34,12 +32,12 @@ BlSimulatedTime >> currentTime [ ^ date ] -{ #category : 'initialization' } +{ #category : #initialization } BlSimulatedTime >> date: aDateAndTime [ date := aDateAndTime ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlSimulatedTime >> every: aDuration while: aWhileBlock do: aDoBlock [ "Evaluate a aDoBlock while aWhileBlock evaluates to true waiting a given amount of time between executions. The first evaluation of a aDoBlock is instant. @@ -50,14 +48,14 @@ BlSimulatedTime >> every: aDuration while: aWhileBlock do: aDoBlock [ self date: self now + aDuration ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlSimulatedTime >> initialize [ super initialize. date := DateAndTime now ] -{ #category : 'api - time' } +{ #category : #'api - time' } BlSimulatedTime >> wait: aDuration [ "Advance clock by waiting for a given amount of time" diff --git a/src/Bloc/BlSineInterpolator.class.st b/src/Bloc/BlSineInterpolator.class.st index 2d3bd2b7a..424a19914 100644 --- a/src/Bloc/BlSineInterpolator.class.st +++ b/src/Bloc/BlSineInterpolator.class.st @@ -5,24 +5,22 @@ I am a cosinus interpolator defined by the following function: " Class { - #name : 'BlSineInterpolator', - #superclass : 'BlInterpolator', + #name : #BlSineInterpolator, + #superclass : #BlInterpolator, #instVars : [ 'range' ], - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'initialization' } +{ #category : #initialization } BlSineInterpolator >> initialize [ super initialize. range := 2 * Float pi ] -{ #category : 'interpolation' } +{ #category : #interpolation } BlSineInterpolator >> interpolate: aNumber [ "f(x) = sin(x)" @@ -30,14 +28,14 @@ BlSineInterpolator >> interpolate: aNumber [ ^ (aNumber * self range) sin ] -{ #category : 'accessing' } +{ #category : #accessing } BlSineInterpolator >> range [ ^ range ] -{ #category : 'accessing' } +{ #category : #accessing } BlSineInterpolator >> range: aNumberInRadians [ range := aNumberInRadians ] diff --git a/src/Bloc/BlSingleErrorHandler.class.st b/src/Bloc/BlSingleErrorHandler.class.st index d909ab910..995774556 100644 --- a/src/Bloc/BlSingleErrorHandler.class.st +++ b/src/Bloc/BlSingleErrorHandler.class.st @@ -1,50 +1,48 @@ Class { - #name : 'BlSingleErrorHandler', - #superclass : 'BlErrorHandler', + #name : #BlSingleErrorHandler, + #superclass : #BlErrorHandler, #instVars : [ 'error' ], - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #category : 'Bloc-Basic-Errors' } -{ #category : 'comparing' } +{ #category : #comparing } BlSingleErrorHandler >> = anObject [ ^ self class = anObject class ] -{ #category : 'accessing' } +{ #category : #accessing } BlSingleErrorHandler >> error [ ^ error ] -{ #category : 'accessing' } +{ #category : #accessing } BlSingleErrorHandler >> error: aHandledError [ error := aHandledError ] -{ #category : 'accessing' } +{ #category : #accessing } BlSingleErrorHandler >> errors [ ^ { self error } ] -{ #category : 'testing' } +{ #category : #testing } BlSingleErrorHandler >> hasError [ ^ error isNotNil ] -{ #category : 'comparing' } +{ #category : #comparing } BlSingleErrorHandler >> hash [ ^ self class hash ] -{ #category : 'error handling' } +{ #category : #'error handling' } BlSingleErrorHandler >> registerError: aHandledError [ "Register a given handled error for further debugging" diff --git a/src/Bloc/BlSingleKeyCombination.class.st b/src/Bloc/BlSingleKeyCombination.class.st index 4ebbe7626..d68b99d23 100644 --- a/src/Bloc/BlSingleKeyCombination.class.st +++ b/src/Bloc/BlSingleKeyCombination.class.st @@ -29,22 +29,20 @@ Internal Representation and Key Implementation Points. " Class { - #name : 'BlSingleKeyCombination', - #superclass : 'BlKeyCombination', + #name : #BlSingleKeyCombination, + #superclass : #BlKeyCombination, #instVars : [ 'key' ], - #category : 'Bloc-Events-KeyBinding', - #package : 'Bloc', - #tag : 'Events-KeyBinding' + #category : 'Bloc-Events-KeyBinding' } -{ #category : 'accessing' } +{ #category : #accessing } BlSingleKeyCombination class >> key: aKey [ ^ self new key: aKey ] -{ #category : 'comparing' } +{ #category : #comparing } BlSingleKeyCombination >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -55,61 +53,61 @@ BlSingleKeyCombination >> = anObject [ ^ key = anObject key ] -{ #category : 'visiting' } +{ #category : #visiting } BlSingleKeyCombination >> accept: aKeyCombinationVisitor [ ^ aKeyCombinationVisitor visitKey: self ] -{ #category : 'converting' } +{ #category : #converting } BlSingleKeyCombination >> asBufferKeys [ ^ { key } asSet ] -{ #category : 'comparing' } +{ #category : #comparing } BlSingleKeyCombination >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ key hash ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlSingleKeyCombination >> includes: aKey [ ^ self key = aKey ] -{ #category : 'accessing' } +{ #category : #accessing } BlSingleKeyCombination >> key [ ^ key ] -{ #category : 'accessing' } +{ #category : #accessing } BlSingleKeyCombination >> key: aKey [ key := aKey ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlSingleKeyCombination >> match: aKeyboardBuffer [ ^ (self matches: aKeyboardBuffer) asBit ] -{ #category : 'key matching' } +{ #category : #'key matching' } BlSingleKeyCombination >> matches: aKeyboardBuffer [ ^ aKeyboardBuffer hasExactlyAll: { self key } ] -{ #category : 'printing' } +{ #category : #printing } BlSingleKeyCombination >> printOn: aStream [ aStream nextPutAll: self key name asString ] -{ #category : 'printing' } +{ #category : #printing } BlSingleKeyCombination >> storeOn: aStream [ aStream diff --git a/src/Bloc/BlSingularMatrixError.class.st b/src/Bloc/BlSingularMatrixError.class.st index a8d94a6ad..77d25ed2d 100644 --- a/src/Bloc/BlSingularMatrixError.class.st +++ b/src/Bloc/BlSingularMatrixError.class.st @@ -3,9 +3,7 @@ I am signaled when matrix is singular and therefore can not be used for mathemat " Class { - #name : 'BlSingularMatrixError', - #superclass : 'ArithmeticError', - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #name : #BlSingularMatrixError, + #superclass : #ArithmeticError, + #category : 'Bloc-Basic-Math' } diff --git a/src/Bloc/BlSpace.class.st b/src/Bloc/BlSpace.class.st index e007ab719..1c68cfbce 100644 --- a/src/Bloc/BlSpace.class.st +++ b/src/Bloc/BlSpace.class.st @@ -18,8 +18,8 @@ A common use case is to quit the application when some particular space is close " Class { - #name : 'BlSpace', - #superclass : 'Object', + #name : #BlSpace, + #superclass : #Object, #traits : 'TBlEventTarget + TBlSpaceProperties + TBlDebug', #classTraits : 'TBlEventTarget classTrait + TBlSpaceProperties classTrait + TBlDebug classTrait', #instVars : [ @@ -62,12 +62,10 @@ Class { #classVars : [ 'UniqueIdGenerator' ], - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #category : #'Bloc-Space' } -{ #category : 'private - change' } +{ #category : #'private - change' } BlSpace class >> extractRoots: aSetOfElements [ | roots | " feenk version 2022-02-01 that eliminate recursion from allParentsDo: " @@ -88,12 +86,12 @@ BlSpace class >> extractRoots: aSetOfElements [ ^ roots ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlSpace class >> initialize [ UniqueIdGenerator := BlUniqueIdGenerator new ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> locationInside: anElement [ "Return a random space location outside of element bounds" | theBounds aPosition | @@ -109,7 +107,7 @@ BlSpace class >> locationInside: anElement [ ^ aPosition ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> locationOutside: anElement [ "Return a random space location outside of element bounds" | theBounds aPosition | @@ -130,7 +128,7 @@ BlSpace class >> locationOutside: anElement [ ^ aPosition ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> pulseUntilEmptyTaskQueue: aSpace timeout: aDuration [ "Wait until a BlSpace doesn't have available tasks to execute. @@ -151,7 +149,7 @@ BlSpace class >> pulseUntilEmptyTaskQueue: aSpace timeout: aDuration [ ^ aSpace taskQueue isEmpty ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateClickOn: anElement [ "Simulate a click event in the middle of a given element by performing mouse down and mouse up events in a sequence" @@ -159,7 +157,7 @@ BlSpace class >> simulateClickOn: anElement [ ^ self simulateClickOn: anElement button: BlMouseButton primary ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateClickOn: anElement button: aButton [ "Simulate a click event in the middle of a given element by performing mouse down and mouse up events in a sequence." @@ -180,7 +178,7 @@ BlSpace class >> simulateClickOn: anElement button: aButton [ ^ aPosition ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateClickOutside: anElement [ "Simulate a click event in outside of a given element by performing mouse down and mouse up events in a sequence" @@ -195,7 +193,7 @@ BlSpace class >> simulateClickOutside: anElement [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateDoubleClickOn: anElement [ "Simulate a double click event in the middle of a given element by performing mouse down and mouse up events in a sequence" @@ -215,7 +213,7 @@ BlSpace class >> simulateDoubleClickOn: anElement [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateDragOn: anElement by: aBlVector [ "Simulate a click event in the middle of a given element by performing mouse down and mouse up events in a sequence" @@ -236,7 +234,7 @@ BlSpace class >> simulateDragOn: anElement by: aBlVector [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateDragOn: anElement byAll: aSequenceOfBlVectors [ "Simulate a drag in the center of a given element by performing mouse down, mouse move, and mouse up events." @@ -273,7 +271,7 @@ BlSpace class >> simulateDragOn: anElement byAll: aSequenceOfBlVectors [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateEvent: anEvent on: anElement [ "I simulate a given low level space UI event such as MouseUp/MouseDown or keyboard. If you would like to simulate a higher level event you could directly fire or dispatch them @@ -286,7 +284,7 @@ BlSpace class >> simulateEvent: anEvent on: anElement [ self simulateEvents: { anEvent } on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateEvents: aCollectionOfEvents on: anElement [ "I simulate a given sequence of low level space UI events such as MouseUp/MouseDown or keyboard. If you would like to simulate a higher level event you could directly fire or dispatch them @@ -320,7 +318,7 @@ BlSpace class >> simulateEvents: aCollectionOfEvents on: anElement [ ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateKeyDownOn: anElement key: aBlKeyboardKey [ "Simulate a key down event" @@ -329,7 +327,7 @@ BlSpace class >> simulateKeyDownOn: anElement key: aBlKeyboardKey [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateKeyUpOn: anElement key: aBlKeyboardKey [ "Simulate a key up event" @@ -338,7 +336,7 @@ BlSpace class >> simulateKeyUpOn: anElement key: aBlKeyboardKey [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseDownOn: anElement [ "Simulate a mouse down event in the middle of a given element" | aPosition | @@ -352,7 +350,7 @@ BlSpace class >> simulateMouseDownOn: anElement [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseDownOn: anElement at: aPoint [ "Simulate a mouse down event at a given location in the space of the element" @@ -361,7 +359,7 @@ BlSpace class >> simulateMouseDownOn: anElement at: aPoint [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseMoveInside: anElement [ "Simulate a mouse move event at a random location within element's bounds" | aPosition | @@ -373,7 +371,7 @@ BlSpace class >> simulateMouseMoveInside: anElement [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseMoveOn: anElement at: aPoint [ "Simulate a mouse move event at a given location in the space of the element" @@ -382,7 +380,7 @@ BlSpace class >> simulateMouseMoveOn: anElement at: aPoint [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseMoveOn: anElement from: aFromPoint to: aToPoint [ "Simulate a mouse move event at a given location in the space of the element" @@ -393,7 +391,7 @@ BlSpace class >> simulateMouseMoveOn: anElement from: aFromPoint to: aToPoint [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseMoveOutside: anElement [ "Simulate a mouse move event at a random location outside of element's bounds" | aPosition | @@ -405,7 +403,7 @@ BlSpace class >> simulateMouseMoveOutside: anElement [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseUpOn: anElement [ "Simulate a mouse up event in the middle of a given element" | aPosition | @@ -419,7 +417,7 @@ BlSpace class >> simulateMouseUpOn: anElement [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseUpOn: anElement at: aPoint [ "Simulate a mouse up event at a given location in the space of the element" @@ -428,7 +426,7 @@ BlSpace class >> simulateMouseUpOn: anElement at: aPoint [ on: anElement ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateMouseWheelOn: anElement by: aBlVector [ "Simulate a mouse wheel event in the middle of a given element" | aPosition aBlocEvent | @@ -450,7 +448,7 @@ BlSpace class >> simulateMouseWheelOn: anElement by: aBlVector [ ^ aPosition ] -{ #category : 'debug - simulation' } +{ #category : #'debug - simulation' } BlSpace class >> simulateSecondaryClickOn: anElement [ "Simulate a secondary click event in the middle of a given element by performing mouse down and mouse up events in a sequence" @@ -458,7 +456,7 @@ BlSpace class >> simulateSecondaryClickOn: anElement [ ^ self simulateClickOn: anElement button: BlMouseButton secondary ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlSpace class >> spaceWithId: aSpaceId do: aBlock [ ^ self allSubInstances detect: [ :eachSpace | eachSpace id = aSpaceId ] @@ -466,40 +464,40 @@ BlSpace class >> spaceWithId: aSpaceId do: aBlock [ ifNone: [ nil ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> asReference [ ^ reference ifNil: [ reference := BlAttachedCachedSpaceReference forSpace: self ] ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> becomeVisible [ "Notify root element that it is now visible to the user" self root space: self ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> borderless [ ^ self hostSpaceDo: [ :aHostSpace | aHostSpace borderless ] ifAbsent: [ borderless ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> borderless: aBoolean [ borderless := aBoolean. self hostSpaceDo: [ :aHostSpace | aHostSpace borderless: aBoolean ]. ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> bounds [ ^ BlBounds origin: self position extent: self extent ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> canComputeProperties: anElement [ "Return true if properties of the given element can be computed" @@ -507,34 +505,34 @@ BlSpace >> canComputeProperties: anElement [ ^ anElement hasParent and: [ anElement parent needsPropertiesComputation not ] ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> center [ "Tell host to change my position to be centered. Do nothing if host space is not present (e.g. not shown)." self hostSpace ifNotNil: [ :hw | hw center ] ] -{ #category : 'children - accessing' } +{ #category : #'children - accessing' } BlSpace >> children [ ^ self root children ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> clearDirtyElements [ "Clear dirty elements collection, which means there are no pending graphic operations." elementsNeedingPaint removeAll ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> close [ "Delegate closing work to the Universe" (BlParallelUniverse forHost: self host class) closeSpace: self ] -{ #category : 'composition layer' } +{ #category : #'composition layer' } BlSpace >> compositionLayer [ "Return my composition layer if I have one or nil otherwise" @@ -542,12 +540,12 @@ BlSpace >> compositionLayer [ ^ self root compositionLayer ] -{ #category : 'cursor managing' } +{ #category : #'cursor managing' } BlSpace >> currentCursor [ ^ currentCursor ] -{ #category : 'cursor managing' } +{ #category : #'cursor managing' } BlSpace >> currentCursor: aCursor [ currentCursor ifNotNil: [ :cc | cc deactivateOn: self ]. @@ -556,27 +554,27 @@ BlSpace >> currentCursor: aCursor [ currentCursor activateOn: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultEventDispatcher [ ^ BlDirectEventDispatcher on: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultEventListener [ ^ BlSpaceEventListener space: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultEventRecorder [ ^ BlEmptyEventRecorder new ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultExtent [ ^ 800@600 ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultRoot [ ^ BlElement new @@ -589,28 +587,28 @@ BlSpace >> defaultRoot [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultRootBackground [ ^ Color white ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultRootElevation [ ^ 0 ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultRootLabel [ ^ 'Space root' ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> defaultTitle [ ^ '' ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> densityDpi [ "Return the screen density expressed as dots-per-inch" @@ -621,20 +619,20 @@ BlSpace >> densityDpi [ ifAbsent: [ 96.0 ] ] -{ #category : 'api - tasks' } +{ #category : #'api - tasks' } BlSpace >> dequeueTask: aBlTask [ self taskQueue dequeue: aBlTask. self requestNextPulse ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> detachHostSpace [ "Detach my current host space if I have one" hostSpace := nil ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlSpace >> dispatchAddedToSceneGraph [ "Sent after any of my parents or I was added to scene graph. I dispatch or fire all necessary events, clean internal caches and send a corresponding hooks" @@ -643,13 +641,13 @@ BlSpace >> dispatchAddedToSceneGraph [ ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlSpace >> dispatchMousePickedOutside: aMouseOutsideEvent [ self root dispatchMousePickedOutside: aMouseOutsideEvent ] -{ #category : 'children dispatching' } +{ #category : #'children dispatching' } BlSpace >> dispatchRemovedFromSceneGraph [ "Sent after topFrame was removed from scene graph. I dispatch or fire all necessary events, clean internal caches and send a corresponding hooks" @@ -657,7 +655,7 @@ BlSpace >> dispatchRemovedFromSceneGraph [ self root dispatchRemovedFromSceneGraph ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpace >> dispatchTimeEvent: aSpaceStepEventClass during: aBlock [ | aStartTime | @@ -670,7 +668,7 @@ BlSpace >> dispatchTimeEvent: aSpaceStepEventClass during: aBlock [ yourself) ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> doComputeProperties [ | theElementToProcess | @@ -694,7 +692,7 @@ BlSpace >> doComputeProperties [ ifFalse: [ self doComputePropertiesOf: theElementToProcess ] ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> doComputeProperties: anElement withGlobalProperties: aGlobalResolvedProperties [ self assert: [ anElement hasParent ] @@ -710,7 +708,7 @@ BlSpace >> doComputeProperties: anElement withGlobalProperties: aGlobalResolvedP withGlobalProperties: aGlobalResolvedProperties ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> doComputeProperties: anElement withParentProperties: aParentResolvedProperties withGlobalProperties: aGlobalResolvedProperties [ | theResolvedProperties thePropagatableProperties | @@ -743,7 +741,7 @@ BlSpace >> doComputeProperties: anElement withParentProperties: aParentResolvedP anElement properties flushPropertiesToRemove ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> doComputePropertiesFromRoot: aRootElement [ | theGlobalResolvedProperties | @@ -759,7 +757,7 @@ BlSpace >> doComputePropertiesFromRoot: aRootElement [ withGlobalProperties: theGlobalResolvedProperties ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> doComputePropertiesOf: aCollectionOfElements [ | theGlobalResolvedProperties | @@ -778,7 +776,7 @@ BlSpace >> doComputePropertiesOf: aCollectionOfElements [ withGlobalProperties: theGlobalResolvedProperties ] ] ] -{ #category : 'change - layout' } +{ #category : #'change - layout' } BlSpace >> doLayout [ self isLayoutRequested ifFalse: [ ^ self ]. @@ -806,7 +804,7 @@ BlSpace >> doLayout [ [ layoutError debug ] ensure: [ layoutError := nil ] ] ] -{ #category : 'NOT-USED-change - style' } +{ #category : #'NOT-USED-change - style' } BlSpace >> doStyle [ | theElementsToStyle | @@ -827,12 +825,12 @@ BlSpace >> doStyle [ theElementsToStyle do: [ :eachElement | self doStyle: eachElement ] ] -{ #category : 'NOT-USED-change - style' } +{ #category : #'NOT-USED-change - style' } BlSpace >> doStyle: anElement [ "anElement applyStyles" ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> doUpdateFocus [ (self focusOwner notNil and: [ self focusOwner isAttachedToSceneGraph not ]) ifTrue: [ @@ -845,7 +843,7 @@ BlSpace >> doUpdateFocus [ ifNil: [ self initializeFocus ] ] -{ #category : 'change - layout' } +{ #category : #'change - layout' } BlSpace >> doUpdateLayout [ | elementsToLayout aBlElementBoundsUpdater | @@ -899,7 +897,7 @@ BlSpace >> doUpdateLayout [ aBlElementBoundsUpdater commitChanges ] -{ #category : 'change - layout' } +{ #category : #'change - layout' } BlSpace >> doUpdateLayout: anElement context: aBlElementBoundsUpdater [ "Perform layout of a given element (e.g. root or glass)" @@ -923,7 +921,7 @@ BlSpace >> doUpdateLayout: anElement context: aBlElementBoundsUpdater [ ] -{ #category : 'change - layout' } +{ #category : #'change - layout' } BlSpace >> doUpdateLayoutBoundary: anElement context: aBlElementBoundsUpdater [ "Perform layout of a given element (e.g. root or glass)" @@ -934,46 +932,46 @@ BlSpace >> doUpdateLayoutBoundary: anElement context: aBlElementBoundsUpdater [ anElement applyLayoutIn: (anElement position extent: anElement measuredBounds extent) context: aBlElementBoundsUpdater ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> dragboard [ ^ dragboard ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> dragboard: anObject [ dragboard := anObject ] -{ #category : 'change - layout' } +{ #category : #'change - layout' } BlSpace >> elementsNeedingLayout [ ^ elementsNeedingLayout ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> elementsNeedingPaint [ ^ elementsNeedingPaint ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> elementsNeedingPropertiesComputation [ ^ elementsNeedingPropertiesComputation ifNil: [ elementsNeedingPropertiesComputation := Set new ] ] -{ #category : 'NOT-USED-change - style' } +{ #category : #'NOT-USED-change - style' } BlSpace >> elementsNeedingStyle [ ^ elementsNeedingStyle ifNil: [ elementsNeedingStyle := Set new ] ] -{ #category : 'api - tasks' } +{ #category : #'api - tasks' } BlSpace >> enqueueTask: aBlTask [ aBlTask onEnqueued: self. self taskQueue enqueue: aBlTask. self requestNextPulse ] -{ #category : 'api - tasks' } +{ #category : #'api - tasks' } BlSpace >> enqueueTasksFrom: aTaskQueue [ aTaskQueue isEmpty ifTrue: [ ^ self ]. @@ -982,7 +980,7 @@ BlSpace >> enqueueTasksFrom: aTaskQueue [ self requestNextPulse ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpace >> ensureSession [ "Check current session and perform required operations if it changed since last frame" @@ -992,53 +990,53 @@ BlSpace >> ensureSession [ self onSessionChanged: Smalltalk session ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } BlSpace >> eventDispatcher [ ^ eventDispatcher ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> eventListener [ ^ eventListener ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> eventListener: anObject [ eventListener := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> eventRecorder [ ^ eventRecorder ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> eventRecorder: anEventRecorder [ eventRecorder := anEventRecorder ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> extent [ ^ self windowExtent ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> extent: aNewExtent [ self windowExtent: aNewExtent ] -{ #category : 'NOT-USED-private-change' } +{ #category : #'NOT-USED-private-change' } BlSpace >> extractAttachedElements: aSetOfElements [ ^ aSetOfElements select: [ :eachElement | eachElement isAttachedToSceneGraph and: [ eachElement space == self ] ] ] -{ #category : 'NOT-USED-private-change' } +{ #category : #'NOT-USED-private-change' } BlSpace >> extractParents: aSetOfElements suchThat: aConditionBlock [ | theElementToProcess | @@ -1053,26 +1051,26 @@ BlSpace >> extractParents: aSetOfElements suchThat: aConditionBlock [ ^ theElementToProcess ] -{ #category : 'private - change' } +{ #category : #'private - change' } BlSpace >> extractRoots: aSetOfElements [ ^ self class extractRoots: aSetOfElements ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> extractUnresolvedToComputeProperties: aSetOfElements [ ^ self extractParents: aSetOfElements suchThat: [ :eachParent | eachParent needsPropertiesComputation ] ] -{ #category : 'NOT-USED-change - style' } +{ #category : #'NOT-USED-change - style' } BlSpace >> extractUnstyled: aSetOfElements [ ^ self extractParents: aSetOfElements suchThat: [ :eachParent | eachParent needsStyle ] ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlSpace >> findMouseEventTargetAt: aPoint [ "Return the deepest child element starting from root that may be a target for mouse event at provided location. @@ -1083,7 +1081,7 @@ BlSpace >> findMouseEventTargetAt: aPoint [ ^ self root findMouseEventTargetAt: aPoint ] -{ #category : 'event handling' } +{ #category : #'event handling' } BlSpace >> findMousePickTargetFromEvent: anEvent [ "Return the deepest child element among all my children or myself that may be a target for mouse event at provided location. The coordinate point is given in space coordinates. @@ -1095,57 +1093,57 @@ BlSpace >> findMousePickTargetFromEvent: anEvent [ :found | " test found because if the result is the root then it means that no element has been found " found ~~ self root ifTrue: [ " ok, dispatch outside event through all the space elements " " dispatch the mouse outside event to all alements of the scene graph " - self dispatchMousePickedOutside: ((anEvent newCopyFor: found) asMouseOutsideEvent lastMouseDownEvent: self mouseProcessor lastMouseDownEvent; yourself). + self dispatchMousePickedOutside: ((anEvent newCopyFor: found) asMouseOutsideEvent lastMouseDownEvent: self testMouseProcessor lastMouseDownEvent; yourself). ^ found ] ]. " no element found at all: all elements receive a outside event" - self dispatchMousePickedOutside: (anEvent clone asMouseOutsideEvent lastMouseDownEvent: self mouseProcessor lastMouseDownEvent; yourself). + self dispatchMousePickedOutside: (anEvent clone asMouseOutsideEvent lastMouseDownEvent: self testMouseProcessor lastMouseDownEvent; yourself). ^ nil ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> focusOwner [ ^ focusChain ifNotNil: [ :aFocusChain | aFocusChain last ] ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> focusOwner: anElement [ focusChain := anElement ifNotNil: [ BlFocusChain of: anElement ] ] -{ #category : 'accessing - processors' } +{ #category : #'accessing - processors' } BlSpace >> focusProcessor [ ^ focusProcessor ] -{ #category : 'accessing - processors' } +{ #category : #'accessing - processors' } BlSpace >> focusProcessor: aFocusProcessor [ focusProcessor := aFocusProcessor ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> focused [ ^ focused ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> focused: aBoolean [ focused := aBoolean ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> frame [ ^ frame ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> fullscreen [ "Return true if an underlying window is in fullscreen mode, false otherwise" @@ -1156,7 +1154,7 @@ BlSpace >> fullscreen [ ifAbsent: [ fullscreen ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> fullscreen: aBoolean [ "Switch underlying window to fullscreen if true is given and exit fullscreen mode if false is given" @@ -1165,7 +1163,7 @@ BlSpace >> fullscreen: aBoolean [ self hostSpaceDo: [ :aHostSpace | aHostSpace fullscreen: aBoolean ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> fullsize [ "Return true if an underlying window is in fullsize mode, false otherwise. @@ -1178,7 +1176,7 @@ BlSpace >> fullsize [ ifAbsent: [ fullsize ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> fullsize: aBoolean [ "Switch underlying window to fullsize if true is given and exit fullsize mode if false is given. @@ -1188,18 +1186,18 @@ BlSpace >> fullsize: aBoolean [ self hostSpaceDo: [ :aHostSpace | aHostSpace fullsize: aBoolean ] ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> grabFocus [ self focused: true ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> hasDirtyElements [ ^ elementsNeedingPaint notEmpty ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> hasFocus: anElement [ "Return true if a given element is within the focus chain" @@ -1212,7 +1210,7 @@ BlSpace >> hasFocus: anElement [ ^ self focusOwner hasParent: anElement ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> hasHostSpace [ "Return true if I have a host space, false otherwise" @@ -1220,13 +1218,13 @@ BlSpace >> hasHostSpace [ ^ self hostSpace isNotNil ] -{ #category : 'testing' } +{ #category : #testing } BlSpace >> hasInParentChain: anElement [ ^ anElement = self ] -{ #category : 'testing' } +{ #category : #testing } BlSpace >> hasLayoutError [ "Return true if there was a layout error, false otherwise" @@ -1234,7 +1232,7 @@ BlSpace >> hasLayoutError [ ^ layoutError isNotNil ] -{ #category : 'testing' } +{ #category : #testing } BlSpace >> hasOwner [ "To be polymorphic with BlElement's traversal API. Space does not have an owner" @@ -1243,30 +1241,30 @@ BlSpace >> hasOwner [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpace >> hasParent: anElement [ ^ false ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> height [ ^ self extent y ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> hide [ self hostSpace ifNotNil: [ :hw | hw hide ] ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> host [ ^ host ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> host: aHost [ "Change the host of this space. Asynchronous. If the space is opened, first destroy the host window and then open the space with a new host" | aDetachedEventHandler | @@ -1285,12 +1283,12 @@ BlSpace >> host: aHost [ ifFalse: [ host := aHost ] ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> hostSpace [ ^ hostSpace ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> hostSpace: aHostSpace [ "Assign a host space window that will be a source of UI events and will provide a rendering surface on which I will be rendered. @@ -1301,7 +1299,7 @@ BlSpace >> hostSpace: aHostSpace [ self hostSpaceChanged. ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> hostSpaceChanged [ "When host space changed we might want to adapt sizes" self windowExtent: self windowExtent. @@ -1309,12 +1307,12 @@ BlSpace >> hostSpaceChanged [ self invalidateAll ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> hostSpaceDo: aBlock [ ^ self hostSpaceDo: aBlock ifAbsent: [ self ] ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } BlSpace >> hostSpaceDo: aBlock ifAbsent: anAbsentBlock [ self hasHostSpace ifFalse: [ ^ anAbsentBlock value ]. @@ -1325,13 +1323,13 @@ BlSpace >> hostSpaceDo: aBlock ifAbsent: anAbsentBlock [ ^ aBlock cull: self hostSpace ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> icon [ "Return an object that understands #asElement, or nil" ^ iconStencil ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> icon: aStencil [ "aStencil is an object that undestands #asElement and returns ${class:BlElement}$" @@ -1342,19 +1340,19 @@ BlSpace >> icon: aStencil [ self fireEvent: (BlSpaceIconChangedEvent new iconStencil: aStencil) ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> id [ ^ id ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> initDispatcher [ self eventDispatcher addEventFilter: self eventListener ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpace >> initialize [ super initialize. @@ -1399,27 +1397,27 @@ BlSpace >> initialize [ ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> initializeFocus [ self root isFocusable ifTrue: [ self root requestFocus ] ] -{ #category : '-- extensions-spec2 --' } +{ #category : #'-- extensions-spec2 --' } BlSpace >> inspectionPreview: aBuilder [ "" ^ self root inspectionPreview: aBuilder ] -{ #category : '-- extensions-spec2 --' } +{ #category : #'-- extensions-spec2 --' } BlSpace >> inspectionTree: aBuilder [ ^ self root inspectionTree: aBuilder ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> invalidRect: aBlBounds from: anElement [ self flag: #todo. "aBlBounds is ignored. Rename selector!" @@ -1428,7 +1426,7 @@ BlSpace >> invalidRect: aBlBounds from: anElement [ self requestNextPulse ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> invalidateAll [ "Always mark root" @@ -1440,12 +1438,12 @@ BlSpace >> invalidateAll [ self markNeedsPaint: each from: each ] ] ] -{ #category : 'testing' } +{ #category : #testing } BlSpace >> isFocused [ ^ self focused ] -{ #category : 'change - layout' } +{ #category : #'change - layout' } BlSpace >> isLayoutRequested [ "Indicates whether or not root element's layout needs to be updated next frame" @@ -1453,7 +1451,7 @@ BlSpace >> isLayoutRequested [ ^ self root isLayoutRequested or: [ self elementsNeedingLayout isNotEmpty ] ] -{ #category : 'testing' } +{ #category : #testing } BlSpace >> isOpened [ "Return true if the space was shown (by sending #show message), false otherwise. Please note, that an opened space can be hidden which does not influence the result of #isOpened" @@ -1463,33 +1461,33 @@ BlSpace >> isOpened [ and: [ (BlParallelUniverse forHost: self host class) hasSpace: self ] ] -{ #category : 'host space - text input' } +{ #category : #'host space - text input' } BlSpace >> isTextInputActive [ "Check whether or not Unicode text input events are enabled" ^ self hostSpaceDo: [:hs | hs isTextInputActive] ifAbsent: [ false ] ] -{ #category : 'testing' } +{ #category : #testing } BlSpace >> isVisible [ ^ self hasHostSpace ifTrue: [ self hostSpace isVisible ] ifFalse: [ false ] ] -{ #category : 'accessing - processors' } +{ #category : #'accessing - processors' } BlSpace >> keyboardProcessor [ ^ keyboardProcessor ] -{ #category : 'accessing - processors' } +{ #category : #'accessing - processors' } BlSpace >> keyboardProcessor: aKeyboardProcessor [ keyboardProcessor := aKeyboardProcessor ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> knowsPosition [ "Return true if this space knows its position. By default, spaces don't know their position and allow the window manager to choose one. @@ -1499,19 +1497,19 @@ BlSpace >> knowsPosition [ ^ position notNil ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> loseFocusFor: anElement [ self focusProcessor loseFor: anElement ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> markNeedsCompositionPaint: anElement from: aSourceElement [ self flag: #todo. self markNeedsPaint: anElement from: aSourceElement ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> markNeedsPaint: anElement from: aSourceElement [ elementsNeedingPaint add: anElement. @@ -1519,18 +1517,18 @@ BlSpace >> markNeedsPaint: anElement from: aSourceElement [ self requestNextPulse ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> maximize [ self hostSpace ifNotNil: [ :hw | hw maximize ] ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> maximized [ self hostSpace ifNotNil: [ :hw | ^ hw maximized ]. ^ false ] -{ #category : 'dispatch' } +{ #category : #dispatch } BlSpace >> measureTextParagraph: aBlTextParagraph [ self @@ -1543,30 +1541,23 @@ BlSpace >> measureTextParagraph: aBlTextParagraph [ host offscreenMeasureTextParagraph: aBlTextParagraph ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> minimize [ self hostSpace ifNotNil: [ :hw | hw minimize ] ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> minimized [ self hostSpace ifNotNil: [ :hw | ^ hw minimized ]. ^ false ] -{ #category : 'accessing - processors' } -BlSpace >> mouseProcessor [ - - - ^ mouseProcessor -] - -{ #category : 'accessing - processors' } +{ #category : #'accessing - processors' } BlSpace >> mouseProcessor: aMouseProcessor [ mouseProcessor := aMouseProcessor ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> needsPropertiesComputation [ @@ -1574,7 +1565,7 @@ BlSpace >> needsPropertiesComputation [ or: [ self root needsPropertiesComputation ] ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> needsPropertiesComputation: anElement [ "Return true if a given element or any of its children wants properties computation" @@ -1587,14 +1578,14 @@ BlSpace >> needsPropertiesComputation: anElement [ and: [ anElement parent needsPropertiesComputation not ] ] ] ] -{ #category : 'NOT-USED-change - style' } +{ #category : #'NOT-USED-change - style' } BlSpace >> needsStyleComputation [ ^ self elementsNeedingStyle isNotEmpty ] -{ #category : 'NOT-USED-change - style' } +{ #category : #'NOT-USED-change - style' } BlSpace >> needsStyleComputation: anElement [ "Return true if a given element or any of its children wants style computation" @@ -1603,7 +1594,7 @@ BlSpace >> needsStyleComputation: anElement [ anySatisfy: [ :eachElement | eachElement = anElement or: [ eachElement hasParent: anElement ] ] ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpace >> onSessionChanged: aNewSession [ session := aNewSession. @@ -1613,7 +1604,7 @@ BlSpace >> onSessionChanged: aNewSession [ self root onSessionChanged: aNewSession ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> position [ "Return window's position in screen coordinates" @@ -1623,7 +1614,7 @@ BlSpace >> position [ ifAbsent: [ position ifNil: [ 0@0 ] ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> position: aPoint [ "Request to change window's position to a given point in screen coordinates" @@ -1631,7 +1622,7 @@ BlSpace >> position: aPoint [ self hostSpaceDo: [ :aHostSpace | aHostSpace position: aPoint ] ] -{ #category : 'printing' } +{ #category : #printing } BlSpace >> printOn: aStream [ super printOn: aStream. @@ -1641,7 +1632,7 @@ BlSpace >> printOn: aStream [ << ')' ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpace >> processPulse [ self ensureSession. @@ -1653,12 +1644,12 @@ BlSpace >> processPulse [ self frame runOn: self ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpace >> pulse [ self processPulse ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> pulseRequested [ "Return true if space pulse was requested, false otherwise" @@ -1667,7 +1658,7 @@ BlSpace >> pulseRequested [ ^ nextPulseRequested ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpace >> render [ "Render this space in my host window if it is assigned, otherwise do nothing" @@ -1678,7 +1669,7 @@ BlSpace >> render [ ifAbsent: [ self clearDirtyElements ] ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> requestFocusFor: anElement dueTo: aFocusReason [ self assert: [ anElement space = self ] @@ -1687,37 +1678,37 @@ BlSpace >> requestFocusFor: anElement dueTo: aFocusReason [ self focusProcessor requestFor: anElement dueTo: aFocusReason ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> requestHostSpaceRedraw [ self hostSpaceDo: [ :aHostSpace | aHostSpace requestRedraw ] ] -{ #category : 'change - layout' } +{ #category : #'change - layout' } BlSpace >> requestLayout: anElement [ elementsNeedingLayout add: anElement. self requestNextPulse ] -{ #category : 'change - rendering' } +{ #category : #'change - rendering' } BlSpace >> requestNextPulse [ nextPulseRequested := true ] -{ #category : 'NOT-USED-change - properties' } +{ #category : #'NOT-USED-change - properties' } BlSpace >> requestPropertiesComputation: anElement [ self elementsNeedingPropertiesComputation add: anElement. self requestNextPulse ] -{ #category : 'NOT-USED-change - style' } +{ #category : #'NOT-USED-change - style' } BlSpace >> requestStyle: anElement [ self elementsNeedingStyle add: anElement. self requestNextPulse ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> resizable [ "Return true if underlying window is resizable, false otherwise" @@ -1727,7 +1718,7 @@ BlSpace >> resizable [ ifAbsent: [ resizable ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> resizable: aBoolean [ "Make underlying window resizable if true is given" @@ -1735,7 +1726,7 @@ BlSpace >> resizable: aBoolean [ self hostSpaceDo: [ :aHostSpace | aHostSpace resizable: aBoolean ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> root [ "Return my current root element. root can not be nil" @@ -1743,7 +1734,7 @@ BlSpace >> root [ ^ rootElement ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> root: anElement [ "Make a given element my root element. anElement must not be nil. @@ -1769,7 +1760,7 @@ BlSpace >> root: anElement [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> rootDo: aBlock [ "A helper method to evaluate a given block with the root element as its argument. May be useful for scripting" @@ -1777,19 +1768,19 @@ BlSpace >> rootDo: aBlock [ aBlock value: self root ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpace >> runTasks [ "Run animations and other runnable tasks" self taskQueue runOn: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> session [ ^ session ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlSpace >> setExtent: anExtent [ "Actually change space and root extent to a given one" @@ -1797,14 +1788,14 @@ BlSpace >> setExtent: anExtent [ self root requestLayout ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlSpace >> setPosition: aPoint [ "Actually change space, root and glass extent to a given one" position := aPoint ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> show [ "Open me in a window and show it to the user" @@ -1812,19 +1803,19 @@ BlSpace >> show [ (BlParallelUniverse forHost: self host class) openSpace: self ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> showSpace: aSpace [ "I show a given space either inside of me or let it open by default" aSpace show ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> space [ ^ self ] -{ #category : 'host space - text input' } +{ #category : #'host space - text input' } BlSpace >> startTextInput [ "Start accepting Unicode text input events. I will start accepting Unicode text input events in the focused window, and start emitting text input and text editing events. @@ -1834,7 +1825,7 @@ BlSpace >> startTextInput [ self hostSpaceDo: [:hs | hs startTextInput] ] -{ #category : 'host space - text input' } +{ #category : #'host space - text input' } BlSpace >> startTextInputAtRectangle: aRectangle [ "Start accepting Unicode text input events. @@ -1845,45 +1836,52 @@ BlSpace >> startTextInputAtRectangle: aRectangle [ self hostSpaceDo: [:hs | hs startTextInputAtRectangle: aRectangle] ] -{ #category : 'host space - text input' } +{ #category : #'host space - text input' } BlSpace >> stopTextInput [ "Stop receiving any text input events" self hostSpaceDo: [:hs | hs stopTextInput] ] -{ #category : 'api - tasks' } +{ #category : #'api - tasks' } BlSpace >> taskQueue [ ^ tasks ] -{ #category : 'NOT-USED-telemetry' } +{ #category : #'NOT-USED-telemetry' } BlSpace >> telemetry [ ^ telemetry ] -{ #category : 'NOT-USED-telemetry' } +{ #category : #'NOT-USED-telemetry' } BlSpace >> telemetry: aBlTelemetry [ telemetry := aBlTelemetry ] -{ #category : 'accessing' } +{ #category : #'accessing - processors' } +BlSpace >> testMouseProcessor [ + + + ^ mouseProcessor +] + +{ #category : #accessing } BlSpace >> time [ ^ time ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> time: aBlTime [ time := aBlTime ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> title [ "Return window's title as a string" @@ -1893,7 +1891,7 @@ BlSpace >> title [ ifAbsent: [ title ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> title: aString [ "Change window's title" @@ -1901,40 +1899,40 @@ BlSpace >> title: aString [ self hostSpaceDo: [ :aHostSpace | aHostSpace title: aString ] ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> toBack [ self hostSpace ifNotNil: [ :hw | hw toBack ] ] -{ #category : 'api - displaying' } +{ #category : #'api - displaying' } BlSpace >> toFront [ self hostSpace ifNotNil: [ :hw | hw toFront ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> topMostParent [ ^ self root ] -{ #category : 'focus managing' } +{ #category : #'focus managing' } BlSpace >> ungrabFocus [ self focused: false ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> universe [ ^ BlParallelUniverse forHost: self host class ] -{ #category : 'cursor managing' } +{ #category : #'cursor managing' } BlSpace >> updateCursor: aBlCursor [ self hostSpaceDo: [ :aHostSpace | aHostSpace cursor: aBlCursor ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpace >> userData [ "Returns a Dictionary that holds application dependent and temporary objects. Be careful to limit the use of such facility and prefer clean instance variables when it is possible to define them." @@ -1942,20 +1940,20 @@ BlSpace >> userData [ ^ userData ifNil: [ userData := IdentityDictionary new ] ] -{ #category : 'composition layer' } +{ #category : #'composition layer' } BlSpace >> wantsSeparateCompositingLayer [ ^ false ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> width [ ^ self extent x ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> windowExtent [ "Return the window size in screen coordinates. This size may differ from the size in pixels on high dpi (retina) screens. @@ -1967,7 +1965,7 @@ BlSpace >> windowExtent [ ifAbsent: [ extent ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> windowExtent: anExtent [ "Request to change a window size to aNewExtent. Note, that window size may be different from renderer size on high dpi (retina) displays" @@ -1976,7 +1974,7 @@ BlSpace >> windowExtent: anExtent [ self hostSpaceDo: [ :aHostSpace | aHostSpace windowExtent: anExtent ] ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } BlSpace >> windowScale [ "Return a scaling factor from space to window coordinates. On high dpi (retina) displays scaling factor is > 1" @@ -1987,14 +1985,14 @@ BlSpace >> windowScale [ ifAbsent: [ 1.0 asPoint ] ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlSpace >> withAllChildrenBreadthFirst [ ^ self root withAllChildrenBreadthFirst ] -{ #category : 'api - children enumeration' } +{ #category : #'api - children enumeration' } BlSpace >> withAllChildrenBreadthFirstDo: aBlock [ ^ self root withAllChildrenBreadthFirstDo: aBlock diff --git a/src/Bloc/BlSpaceCloseRequest.class.st b/src/Bloc/BlSpaceCloseRequest.class.st index 65dd63bec..1246749f3 100644 --- a/src/Bloc/BlSpaceCloseRequest.class.st +++ b/src/Bloc/BlSpaceCloseRequest.class.st @@ -10,19 +10,17 @@ After that space sents an actual BlSpaceClosedEvent that indicates that windows " Class { - #name : 'BlSpaceCloseRequest', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceCloseRequest, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceCloseRequest >> isSpaceCloseRequest [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceCloseRequest >> sendTo: anObject [ anObject spaceCloseRequest: self ] diff --git a/src/Bloc/BlSpaceClosedEvent.class.st b/src/Bloc/BlSpaceClosedEvent.class.st index 9126698fe..30d3f1264 100644 --- a/src/Bloc/BlSpaceClosedEvent.class.st +++ b/src/Bloc/BlSpaceClosedEvent.class.st @@ -17,28 +17,26 @@ space close " Class { - #name : 'BlSpaceClosedEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceClosedEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'space' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'sending' } +{ #category : #sending } BlSpaceClosedEvent >> sendTo: anObject [ anObject spaceClosedEvent: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceClosedEvent >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceClosedEvent >> space: aSpace [ space := aSpace ] diff --git a/src/Bloc/BlSpaceDestroyedEvent.class.st b/src/Bloc/BlSpaceDestroyedEvent.class.st index bc2290b9e..91f8e2cde 100644 --- a/src/Bloc/BlSpaceDestroyedEvent.class.st +++ b/src/Bloc/BlSpaceDestroyedEvent.class.st @@ -5,23 +5,21 @@ This event is used by the debugger to stop the UI process so it should be used w " Class { - #name : 'BlSpaceDestroyedEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceDestroyedEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'space' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDestroyedEvent >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDestroyedEvent >> space: aSpace [ space := aSpace ] diff --git a/src/Bloc/BlSpaceDetachedEvent.class.st b/src/Bloc/BlSpaceDetachedEvent.class.st index 234ed9342..b17fa4234 100644 --- a/src/Bloc/BlSpaceDetachedEvent.class.st +++ b/src/Bloc/BlSpaceDetachedEvent.class.st @@ -2,22 +2,20 @@ Is sent by the space after is it detached from the universe. " Class { - #name : 'BlSpaceDetachedEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceDetachedEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'space' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDetachedEvent >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDetachedEvent >> space: anObject [ space := anObject ] diff --git a/src/Bloc/BlSpaceDragCancelEvent.class.st b/src/Bloc/BlSpaceDragCancelEvent.class.st index 56a3c8077..cd5809b4e 100644 --- a/src/Bloc/BlSpaceDragCancelEvent.class.st +++ b/src/Bloc/BlSpaceDragCancelEvent.class.st @@ -1,36 +1,34 @@ Class { - #name : 'BlSpaceDragCancelEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceDragCancelEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'delegate', 'position' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragCancelEvent >> delegate [ ^ delegate ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragCancelEvent >> delegate: anObject [ delegate := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragCancelEvent >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragCancelEvent >> position: anObject [ position := anObject ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceDragCancelEvent >> sendTo: anObject [ anObject spaceDragCancelEvent: self ] diff --git a/src/Bloc/BlSpaceDragLiftEvent.class.st b/src/Bloc/BlSpaceDragLiftEvent.class.st index a8fa8908b..55e4f8a01 100644 --- a/src/Bloc/BlSpaceDragLiftEvent.class.st +++ b/src/Bloc/BlSpaceDragLiftEvent.class.st @@ -1,36 +1,34 @@ Class { - #name : 'BlSpaceDragLiftEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceDragLiftEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'delegate', 'position' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragLiftEvent >> delegate [ ^ delegate ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragLiftEvent >> delegate: anObject [ delegate := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragLiftEvent >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceDragLiftEvent >> position: anObject [ position := anObject ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceDragLiftEvent >> sendTo: anObject [ anObject spaceDragLiftEvent: self ] diff --git a/src/Bloc/BlSpaceEvent.class.st b/src/Bloc/BlSpaceEvent.class.st index d32fdc2ff..d2f0a77a6 100644 --- a/src/Bloc/BlSpaceEvent.class.st +++ b/src/Bloc/BlSpaceEvent.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlSpaceEvent', - #superclass : 'BlEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceEvent, + #superclass : #BlEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceEvent >> isSpaceCloseRequest [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceEvent >> isSpaceEvent [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceEvent >> isSpaceResizedEvent [ ^ false ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceEvent >> sendTo: anObject [ anObject spaceEvent: self ] diff --git a/src/Bloc/BlSpaceEventListener.class.st b/src/Bloc/BlSpaceEventListener.class.st index 9956f8276..adf2d7077 100644 --- a/src/Bloc/BlSpaceEventListener.class.st +++ b/src/Bloc/BlSpaceEventListener.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlSpaceEventListener', - #superclass : 'BlEventListener', + #name : #BlSpaceEventListener, + #superclass : #BlEventListener, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -8,104 +8,96 @@ Class { 'mouseDragListener', 'dragCollectionElement' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : #'Bloc-Space - Events' } -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlSpaceEventListener class >> space: aStage [ ^ self new space: aStage; yourself ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceEventListener >> focusProcessor [ ^ self space focusProcessor ] -{ #category : 'other handlers' } +{ #category : #'other handlers' } BlSpaceEventListener >> inputMethodEvent: anEvent [ ] -{ #category : 'keyboard handlers' } +{ #category : #'keyboard handlers' } BlSpaceEventListener >> keyDownEvent: anEvent [ self keyboardProcessor processKeyDown: anEvent ] -{ #category : 'keyboard handlers' } +{ #category : #'keyboard handlers' } BlSpaceEventListener >> keyUpEvent: anEvent [ self keyboardProcessor processKeyUp: anEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceEventListener >> keyboardProcessor [ ^ self space keyboardProcessor ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlSpaceEventListener >> mouseDownEvent: anEvent [ - self mouseProcessor handleMouseDown: anEvent. + self testMouseProcessor handleMouseDown: anEvent. self focusProcessor handleMouseDown: anEvent ] -{ #category : 'other handlers' } +{ #category : #'other handlers' } BlSpaceEventListener >> mouseEvent: anEvent [ ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlSpaceEventListener >> mouseMoveEvent: anEvent [ - self mouseProcessor handleMouseMove: anEvent + self testMouseProcessor handleMouseMove: anEvent ] -{ #category : 'accessing' } -BlSpaceEventListener >> mouseProcessor [ - - ^ self space mouseProcessor -] - -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlSpaceEventListener >> mouseUpEvent: anEvent [ - self mouseProcessor handleMouseUp: anEvent + self testMouseProcessor handleMouseUp: anEvent ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlSpaceEventListener >> mouseWheelEvent: anEvent [ - self mouseProcessor processMouseScroll: anEvent + self testMouseProcessor processMouseScroll: anEvent ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceEventListener >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceEventListener >> space: aBlSpace [ space := aBlSpace ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceCloseRequest: anEvent [ self space close ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceClosedEvent: anEvent [ - self mouseProcessor onSpaceClosed + self testMouseProcessor onSpaceClosed ] -{ #category : 'drag and drop' } +{ #category : #'drag and drop' } BlSpaceEventListener >> spaceDragCancelEvent: anEvent [ anEvent delegate cancel: anEvent position. self space removeEventHandler: mouseDragListener ] -{ #category : 'drag and drop' } +{ #category : #'drag and drop' } BlSpaceEventListener >> spaceDragLiftEvent: anEvent [ | aDelegate aPosition | @@ -121,65 +113,71 @@ BlSpaceEventListener >> spaceDragLiftEvent: anEvent [ self space addEventHandler: mouseDragListener ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceEventsProcessedEvent: anEvent [ self space keyboardProcessor handleSpaceEventProcessedEvent: anEvent ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceFocusInEvent: anEvent [ self focusProcessor processWindowFocusIn: anEvent ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceFocusOutEvent: anEvent [ self focusProcessor processWindowFocusOut: anEvent. self keyboardProcessor processWindowFocusOut: anEvent ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceMouseEnterEvent: anEvent [ - self mouseProcessor handleMouseEntered: anEvent + self testMouseProcessor handleMouseEntered: anEvent ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceMouseLeaveEvent: anEvent [ - self mouseProcessor handleMouseLeft: anEvent + self testMouseProcessor handleMouseLeft: anEvent ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceMovedEvent: anEvent [ self space setPosition: anEvent position ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceRedrawRequestedEvent: anEvent [ self space invalidateAll; requestNextPulse ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceResizedEvent: anEvent [ "Is sent after window size was changed" self space setExtent: anEvent extent ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceScaleFactorChangedEvent: anEvent [ self space invalidateAll; requestNextPulse ] -{ #category : 'window handlers' } +{ #category : #'window handlers' } BlSpaceEventListener >> spaceWakeUpEvent: anEvent [ self space requestNextPulse ] -{ #category : 'keyboard handlers' } +{ #category : #accessing } +BlSpaceEventListener >> testMouseProcessor [ + + ^ self space testMouseProcessor +] + +{ #category : #'keyboard handlers' } BlSpaceEventListener >> textInputEvent: anEvent [ self keyboardProcessor processTextInput: anEvent ] diff --git a/src/Bloc/BlSpaceEventRecorder.class.st b/src/Bloc/BlSpaceEventRecorder.class.st index fc15d2810..a2990569c 100644 --- a/src/Bloc/BlSpaceEventRecorder.class.st +++ b/src/Bloc/BlSpaceEventRecorder.class.st @@ -3,19 +3,17 @@ I am used to record space events coming from the host window " Class { - #name : 'BlSpaceEventRecorder', - #superclass : 'Object', - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #name : #BlSpaceEventRecorder, + #superclass : #Object, + #category : 'Bloc-Space - Events' } -{ #category : 'api - recording' } +{ #category : #'api - recording' } BlSpaceEventRecorder >> onPulse [ "Is sent by the space right before it starts fetching events" ] -{ #category : 'api - recording' } +{ #category : #'api - recording' } BlSpaceEventRecorder >> record: anEvent [ self subclassResponsibility ] diff --git a/src/Bloc/BlSpaceEventsProcessedEvent.class.st b/src/Bloc/BlSpaceEventsProcessedEvent.class.st index 586a0ab74..dafadc5ff 100644 --- a/src/Bloc/BlSpaceEventsProcessedEvent.class.st +++ b/src/Bloc/BlSpaceEventsProcessedEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlSpaceEventsProcessedEvent', - #superclass : 'BlSpaceStepEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceEventsProcessedEvent, + #superclass : #BlSpaceStepEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'sending' } +{ #category : #sending } BlSpaceEventsProcessedEvent >> sendTo: anObject [ anObject spaceEventsProcessedEvent: self ] diff --git a/src/Bloc/BlSpaceExposeEvent.class.st b/src/Bloc/BlSpaceExposeEvent.class.st index 327f36d32..818e786c7 100644 --- a/src/Bloc/BlSpaceExposeEvent.class.st +++ b/src/Bloc/BlSpaceExposeEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpaceExposeEvent', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceExposeEvent, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceFocusInEvent.class.st b/src/Bloc/BlSpaceFocusInEvent.class.st index 8ddc0bf94..8644f006c 100644 --- a/src/Bloc/BlSpaceFocusInEvent.class.st +++ b/src/Bloc/BlSpaceFocusInEvent.class.st @@ -3,14 +3,12 @@ Is sent to the space when a window receives focus " Class { - #name : 'BlSpaceFocusInEvent', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceFocusInEvent, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'sending' } +{ #category : #sending } BlSpaceFocusInEvent >> sendTo: anObject [ anObject spaceFocusInEvent: self ] diff --git a/src/Bloc/BlSpaceFocusOutEvent.class.st b/src/Bloc/BlSpaceFocusOutEvent.class.st index 317c7ed01..e69e5acd6 100644 --- a/src/Bloc/BlSpaceFocusOutEvent.class.st +++ b/src/Bloc/BlSpaceFocusOutEvent.class.st @@ -3,14 +3,12 @@ Is sent to the space when a window loses focus " Class { - #name : 'BlSpaceFocusOutEvent', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceFocusOutEvent, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'sending' } +{ #category : #sending } BlSpaceFocusOutEvent >> sendTo: anObject [ anObject spaceFocusOutEvent: self ] diff --git a/src/Bloc/BlSpaceFrame.class.st b/src/Bloc/BlSpaceFrame.class.st index 021e1c1c3..d10b7367d 100644 --- a/src/Bloc/BlSpaceFrame.class.st +++ b/src/Bloc/BlSpaceFrame.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlSpaceFrame', - #superclass : 'Object', + #name : #BlSpaceFrame, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -8,48 +8,46 @@ Class { 'phases', 'currentPhaseLink' ], - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #category : 'Bloc-Space - Frame' } -{ #category : 'adding' } +{ #category : #adding } BlSpaceFrame >> addPhase: aFramePhase [ self phases add: aFramePhase ] -{ #category : 'adding' } +{ #category : #adding } BlSpaceFrame >> addPhase: aPhase before: otherPhase [ self phases add: aPhase before: otherPhase ] -{ #category : 'adding' } +{ #category : #adding } BlSpaceFrame >> addPhases: aCollectonOfPhases [ aCollectonOfPhases do: [ :aFramePhase | self addPhase: aFramePhase ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrame >> currentPhase [ ^ currentPhaseLink value ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlSpaceFrame >> detectPhase: aBlock [ ^ self phases detect: aBlock ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceFrame >> hasNextPhase [ ^ currentPhaseLink nextLink isNotNil ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrame >> id [ "Return the frame id, which is a linearly increasing counter of frames" @@ -57,12 +55,12 @@ BlSpaceFrame >> id [ ^ id ] -{ #category : 'private' } +{ #category : #private } BlSpaceFrame >> incrementFrameId [ id := id + 1 ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpaceFrame >> initialize [ super initialize. @@ -72,7 +70,7 @@ BlSpaceFrame >> initialize [ currentPhaseLink := phases firstLink ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpaceFrame >> initializePhases [ self addPhases: { @@ -85,7 +83,7 @@ BlSpaceFrame >> initializePhases [ BlSpaceFrameDrawingPhase new " drawing invalidate elements "} ] -{ #category : 'private' } +{ #category : #private } BlSpaceFrame >> nextPhaseLink [ "Return the link with a next frame after the current one" @@ -95,7 +93,7 @@ BlSpaceFrame >> nextPhaseLink [ ifFalse: [ phases firstLink ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrame >> phases [ "Return a collection of all phases" @@ -103,19 +101,19 @@ BlSpaceFrame >> phases [ ^ phases ] -{ #category : 'removing' } +{ #category : #removing } BlSpaceFrame >> removePhase: aFramePhase [ self phases remove: aFramePhase ifAbsent: [ Error signal: 'Phase not found'] ] -{ #category : 'running' } +{ #category : #running } BlSpaceFrame >> runCurrentPhaseOn: aSpace [ self currentPhase runOn: aSpace ] -{ #category : 'running' } +{ #category : #running } BlSpaceFrame >> runOn: aSpace [ self incrementFrameId. self runCurrentPhaseOn: aSpace. @@ -128,7 +126,7 @@ BlSpaceFrame >> runOn: aSpace [ self switchToNextPhase ] -{ #category : 'running' } +{ #category : #running } BlSpaceFrame >> switchToNextPhase [ "Switch to the next phase" diff --git a/src/Bloc/BlSpaceFrameDrawingPhase.class.st b/src/Bloc/BlSpaceFrameDrawingPhase.class.st index f56ca26c1..38d208ac3 100644 --- a/src/Bloc/BlSpaceFrameDrawingPhase.class.st +++ b/src/Bloc/BlSpaceFrameDrawingPhase.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlSpaceFrameDrawingPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameDrawingPhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceFrameDrawingPhase >> isDrawingPhase [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameDrawingPhase >> name [ ^ 'Drawing' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameDrawingPhase >> runOn: aSpace [ aSpace dispatchTimeEvent: BlSpaceRenderEndEvent diff --git a/src/Bloc/BlSpaceFrameDrawingValidationPhase.class.st b/src/Bloc/BlSpaceFrameDrawingValidationPhase.class.st index 506e633a3..88b19a39b 100644 --- a/src/Bloc/BlSpaceFrameDrawingValidationPhase.class.st +++ b/src/Bloc/BlSpaceFrameDrawingValidationPhase.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlSpaceFrameDrawingValidationPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameDrawingValidationPhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameDrawingValidationPhase >> name [ ^ 'Drawing validation' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameDrawingValidationPhase >> runOn: aSpace [ aSpace hasHostSpace diff --git a/src/Bloc/BlSpaceFrameEventPhase.class.st b/src/Bloc/BlSpaceFrameEventPhase.class.st index d8f53df26..e2062f74e 100644 --- a/src/Bloc/BlSpaceFrameEventPhase.class.st +++ b/src/Bloc/BlSpaceFrameEventPhase.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlSpaceFrameEventPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameEventPhase, + #superclass : #BlSpaceFramePhase, + #category : #'Bloc-Space - Frame' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceFrameEventPhase >> isEventPhase [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameEventPhase >> name [ ^ 'Event processing' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameEventPhase >> runOn: aSpace [ aSpace @@ -44,5 +42,5 @@ BlSpaceFrameEventPhase >> runOn: aSpace [ theSpace eventDispatcher dispatchEvent: anEvent ] ] ] ]. theSpace hostSpaceDo: [ :aHostSpace | aHostSpace generateEvents ] ]. - theSpace mouseProcessor generateEvents ] + theSpace testMouseProcessor generateEvents ] ] diff --git a/src/Bloc/BlSpaceFrameHostValidationPhase.class.st b/src/Bloc/BlSpaceFrameHostValidationPhase.class.st index 0cdb61d59..be3d0b004 100644 --- a/src/Bloc/BlSpaceFrameHostValidationPhase.class.st +++ b/src/Bloc/BlSpaceFrameHostValidationPhase.class.st @@ -3,26 +3,24 @@ I make sure that a host space is valid and re-create it if needed " Class { - #name : 'BlSpaceFrameHostValidationPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameHostValidationPhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameHostValidationPhase >> name [ ^ 'Host validation' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameHostValidationPhase >> reopenSpace: aSpace [ aSpace host: BlHost pickHost ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameHostValidationPhase >> runOn: aSpace [ aSpace hasHostSpace ifFalse: [ ^ self ]. @@ -32,7 +30,7 @@ BlSpaceFrameHostValidationPhase >> runOn: aSpace [ ifFalse: [ self reopenSpace: aSpace ] ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameHostValidationPhase >> validateHostSpace: aSpace [ aSpace hostSpace needsRebuild ifFalse: [ ^ self ]. diff --git a/src/Bloc/BlSpaceFrameIdlePhase.class.st b/src/Bloc/BlSpaceFrameIdlePhase.class.st index 9a2c47827..22a192708 100644 --- a/src/Bloc/BlSpaceFrameIdlePhase.class.st +++ b/src/Bloc/BlSpaceFrameIdlePhase.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlSpaceFrameIdlePhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameIdlePhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceFrameIdlePhase >> isIdlePhase [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameIdlePhase >> name [ ^ 'Idle' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameIdlePhase >> runOn: aSpace [ ] diff --git a/src/Bloc/BlSpaceFrameLayoutPhase.class.st b/src/Bloc/BlSpaceFrameLayoutPhase.class.st index 3f8b8b2a4..234a33ba6 100644 --- a/src/Bloc/BlSpaceFrameLayoutPhase.class.st +++ b/src/Bloc/BlSpaceFrameLayoutPhase.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlSpaceFrameLayoutPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameLayoutPhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceFrameLayoutPhase >> isLayoutPhase [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameLayoutPhase >> name [ ^ 'Layout' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameLayoutPhase >> runOn: aSpace [ aSpace dispatchTimeEvent: BlSpaceLayoutEndEvent diff --git a/src/Bloc/BlSpaceFramePhase.class.st b/src/Bloc/BlSpaceFramePhase.class.st index b974f4bd2..09d33f9bd 100644 --- a/src/Bloc/BlSpaceFramePhase.class.st +++ b/src/Bloc/BlSpaceFramePhase.class.st @@ -5,46 +5,44 @@ Each phase knows about its start time and send a corresponding event once the ph " Class { - #name : 'BlSpaceFramePhase', - #superclass : 'Object', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFramePhase, + #superclass : #Object, + #category : 'Bloc-Space - Frame' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceFramePhase >> isDrawingPhase [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceFramePhase >> isEventPhase [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceFramePhase >> isIdlePhase [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceFramePhase >> isLayoutPhase [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceFramePhase >> isTaskPhase [ ^ false ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFramePhase >> name [ ^ self subclassResponsibility ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFramePhase >> runOn: aSpace [ self subclassResponsibility ] diff --git a/src/Bloc/BlSpaceFramePropertiesPhase.class.st b/src/Bloc/BlSpaceFramePropertiesPhase.class.st index 0dc95927d..692d5175e 100644 --- a/src/Bloc/BlSpaceFramePropertiesPhase.class.st +++ b/src/Bloc/BlSpaceFramePropertiesPhase.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlSpaceFramePropertiesPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFramePropertiesPhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFramePropertiesPhase >> name [ ^ 'Properties' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFramePropertiesPhase >> runOn: aSpace [ aSpace dispatchTimeEvent: BlSpacePropertiesEndEvent diff --git a/src/Bloc/BlSpaceFrameStylePhase.class.st b/src/Bloc/BlSpaceFrameStylePhase.class.st index a7f58d56b..d581915c7 100644 --- a/src/Bloc/BlSpaceFrameStylePhase.class.st +++ b/src/Bloc/BlSpaceFrameStylePhase.class.st @@ -1,19 +1,17 @@ Class { - #name : 'BlSpaceFrameStylePhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameStylePhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameStylePhase >> name [ ^ 'Style' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameStylePhase >> runOn: aSpace [ aSpace dispatchTimeEvent: BlSpaceStyleEndEvent diff --git a/src/Bloc/BlSpaceFrameTaskPhase.class.st b/src/Bloc/BlSpaceFrameTaskPhase.class.st index ec62ac11f..a91b407cf 100644 --- a/src/Bloc/BlSpaceFrameTaskPhase.class.st +++ b/src/Bloc/BlSpaceFrameTaskPhase.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlSpaceFrameTaskPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameTaskPhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceFrameTaskPhase >> isTaskPhase [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameTaskPhase >> name [ ^ 'Tasks processing' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameTaskPhase >> runOn: aSpace [ "process animations and other runnable tasks" aSpace diff --git a/src/Bloc/BlSpaceFrameUnknownPhase.class.st b/src/Bloc/BlSpaceFrameUnknownPhase.class.st index 308c98c73..b9add2425 100644 --- a/src/Bloc/BlSpaceFrameUnknownPhase.class.st +++ b/src/Bloc/BlSpaceFrameUnknownPhase.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlSpaceFrameUnknownPhase', - #superclass : 'BlSpaceFramePhase', - #category : 'Bloc-Space - Frame', - #package : 'Bloc', - #tag : 'Space - Frame' + #name : #BlSpaceFrameUnknownPhase, + #superclass : #BlSpaceFramePhase, + #category : 'Bloc-Space - Frame' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceFrameUnknownPhase >> name [ ^ 'Unknown' ] -{ #category : 'actions' } +{ #category : #actions } BlSpaceFrameUnknownPhase >> runOn: aSpace [ ] diff --git a/src/Bloc/BlSpaceIconChangedEvent.class.st b/src/Bloc/BlSpaceIconChangedEvent.class.st index b34e4709f..1cb9dcfaa 100644 --- a/src/Bloc/BlSpaceIconChangedEvent.class.st +++ b/src/Bloc/BlSpaceIconChangedEvent.class.st @@ -3,31 +3,29 @@ I am fired by {{gtMethod:BlSpace>>#icon:}} when {{gtMethod:BlSpace>>#icon}} is c " Class { - #name : 'BlSpaceIconChangedEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceIconChangedEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'iconStencil' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceIconChangedEvent >> iconStencil [ "Return an object that understands #asElement, or nil" ^ iconStencil ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceIconChangedEvent >> iconStencil: aStencil [ "aStencil is an object that undestands #asElement and returns ${class:BlElement}$" iconStencil := aStencil ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceIconChangedEvent >> sendTo: anObject [ anObject spaceIconChangedEvent: self ] diff --git a/src/Bloc/BlSpaceLayoutEndEvent.class.st b/src/Bloc/BlSpaceLayoutEndEvent.class.st index 01bda1c9c..fa302a444 100644 --- a/src/Bloc/BlSpaceLayoutEndEvent.class.st +++ b/src/Bloc/BlSpaceLayoutEndEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpaceLayoutEndEvent', - #superclass : 'BlSpaceStepEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceLayoutEndEvent, + #superclass : #BlSpaceStepEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceManager.class.st b/src/Bloc/BlSpaceManager.class.st index f31e737fb..7aa6ffbac 100644 --- a/src/Bloc/BlSpaceManager.class.st +++ b/src/Bloc/BlSpaceManager.class.st @@ -11,19 +11,17 @@ Here are some of my core operations: " Class { - #name : 'BlSpaceManager', - #superclass : 'Object', + #name : #BlSpaceManager, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'spaces' ], - #category : 'Bloc-Universe', - #package : 'Bloc', - #tag : 'Universe' + #category : 'Bloc-Universe' } -{ #category : 'adding' } +{ #category : #adding } BlSpaceManager >> addSpace: aSpace [ self @@ -33,12 +31,12 @@ BlSpaceManager >> addSpace: aSpace [ spaces := spaces copyWith: aSpace ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlSpaceManager >> do: aBlock [ self spaces do: aBlock ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceManager >> hasSpace: aSpace [ "Return true if a given space is registered, false otherwise" @@ -46,7 +44,7 @@ BlSpaceManager >> hasSpace: aSpace [ ^ self spaces includes: aSpace ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceManager >> hasSpaces [ "Return true if there are registered spaces, false otherwise" @@ -54,14 +52,14 @@ BlSpaceManager >> hasSpaces [ ^ self spaces isNotEmpty ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpaceManager >> initialize [ super initialize. spaces := #() ] -{ #category : 'printing' } +{ #category : #printing } BlSpaceManager >> printOn: aStream [ super printOn: aStream. @@ -72,12 +70,12 @@ BlSpaceManager >> printOn: aStream [ ] -{ #category : 'pulse' } +{ #category : #pulse } BlSpaceManager >> pulse [ spaces do: [ :aSpace | aSpace pulse ] ] -{ #category : 'adding' } +{ #category : #adding } BlSpaceManager >> removeSpace: aSpace [ self @@ -87,7 +85,7 @@ BlSpaceManager >> removeSpace: aSpace [ spaces := spaces copyWithout: aSpace ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceManager >> spaces [ "Return a collection of all existing spaces" diff --git a/src/Bloc/BlSpaceMaximizedEvent.class.st b/src/Bloc/BlSpaceMaximizedEvent.class.st index 94c322da1..21b04533e 100644 --- a/src/Bloc/BlSpaceMaximizedEvent.class.st +++ b/src/Bloc/BlSpaceMaximizedEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpaceMaximizedEvent', - #superclass : 'BlSpaceResizedEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceMaximizedEvent, + #superclass : #BlSpaceResizedEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceMinimizedEvent.class.st b/src/Bloc/BlSpaceMinimizedEvent.class.st index ba034e42a..e8881334f 100644 --- a/src/Bloc/BlSpaceMinimizedEvent.class.st +++ b/src/Bloc/BlSpaceMinimizedEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpaceMinimizedEvent', - #superclass : 'BlSpaceResizedEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceMinimizedEvent, + #superclass : #BlSpaceResizedEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceMouseEnterEvent.class.st b/src/Bloc/BlSpaceMouseEnterEvent.class.st index 51ddd7e51..b27924e6f 100644 --- a/src/Bloc/BlSpaceMouseEnterEvent.class.st +++ b/src/Bloc/BlSpaceMouseEnterEvent.class.st @@ -3,14 +3,12 @@ Is sent to the space when mouse cursor enters the window " Class { - #name : 'BlSpaceMouseEnterEvent', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceMouseEnterEvent, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'sending' } +{ #category : #sending } BlSpaceMouseEnterEvent >> sendTo: anObject [ anObject spaceMouseEnterEvent: self ] diff --git a/src/Bloc/BlSpaceMouseLeaveEvent.class.st b/src/Bloc/BlSpaceMouseLeaveEvent.class.st index 389cf92a8..d842fe095 100644 --- a/src/Bloc/BlSpaceMouseLeaveEvent.class.st +++ b/src/Bloc/BlSpaceMouseLeaveEvent.class.st @@ -3,14 +3,12 @@ Is sent to the space when mouse cursor leaves the window " Class { - #name : 'BlSpaceMouseLeaveEvent', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceMouseLeaveEvent, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'sending' } +{ #category : #sending } BlSpaceMouseLeaveEvent >> sendTo: anObject [ anObject spaceMouseLeaveEvent: self ] diff --git a/src/Bloc/BlSpaceMovedEvent.class.st b/src/Bloc/BlSpaceMovedEvent.class.st index 2632ed19c..6b77f71c4 100644 --- a/src/Bloc/BlSpaceMovedEvent.class.st +++ b/src/Bloc/BlSpaceMovedEvent.class.st @@ -1,25 +1,23 @@ Class { - #name : 'BlSpaceMovedEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceMovedEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'position' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceMovedEvent >> position [ ^ position ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceMovedEvent >> position: anObject [ position := anObject ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceMovedEvent >> sendTo: anObject [ anObject spaceMovedEvent: self ] diff --git a/src/Bloc/BlSpacePropertiesEndEvent.class.st b/src/Bloc/BlSpacePropertiesEndEvent.class.st index 086706c83..62be896c0 100644 --- a/src/Bloc/BlSpacePropertiesEndEvent.class.st +++ b/src/Bloc/BlSpacePropertiesEndEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpacePropertiesEndEvent', - #superclass : 'BlSpaceStepEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpacePropertiesEndEvent, + #superclass : #BlSpaceStepEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceRedrawRequestedEvent.class.st b/src/Bloc/BlSpaceRedrawRequestedEvent.class.st index 157633024..389183b20 100644 --- a/src/Bloc/BlSpaceRedrawRequestedEvent.class.st +++ b/src/Bloc/BlSpaceRedrawRequestedEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlSpaceRedrawRequestedEvent', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceRedrawRequestedEvent, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceRedrawRequestedEvent >> sendTo: anObject [ anObject spaceRedrawRequestedEvent: self ] diff --git a/src/Bloc/BlSpaceReference.class.st b/src/Bloc/BlSpaceReference.class.st index d57c72f33..fdead8939 100644 --- a/src/Bloc/BlSpaceReference.class.st +++ b/src/Bloc/BlSpaceReference.class.st @@ -15,43 +15,41 @@ When the attachment state of an element is changed from `removed` to `attached` " Class { - #name : 'BlSpaceReference', - #superclass : 'Object', - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #name : #BlSpaceReference, + #superclass : #Object, + #category : 'Bloc-Space' } -{ #category : 'testing' } +{ #category : #testing } BlSpaceReference >> isAttachedToSceneGraph [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceReference >> isDetachedFromSceneGraph [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceReference >> isNull [ ^ false ] -{ #category : 'text input' } +{ #category : #'text input' } BlSpaceReference >> isTextInputActive [ "Check whether or not Unicode text input events are enabled" self spaceDo: [:sp | ^sp isTextInputActive]. ^ false ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlSpaceReference >> spaceDo: aBlock [ "Evaluate a given block with a bloc space as an argument" ] -{ #category : 'text input' } +{ #category : #'text input' } BlSpaceReference >> startTextInput [ "Start accepting Unicode text input events. I will start accepting Unicode text input events in the focused window, and start emitting text input and text editing events. @@ -61,7 +59,7 @@ BlSpaceReference >> startTextInput [ ] -{ #category : 'text input' } +{ #category : #'text input' } BlSpaceReference >> startTextInputAtRectangle: aRectangle [ "Start accepting Unicode text input events. I will start accepting Unicode text input events in the focused window, and start emitting text input and text editing events. @@ -71,7 +69,7 @@ BlSpaceReference >> startTextInputAtRectangle: aRectangle [ ] -{ #category : 'text input' } +{ #category : #'text input' } BlSpaceReference >> stopTextInput [ "Stop receiving any text input events" self spaceDo: [ :sp | sp stopTextInput ] diff --git a/src/Bloc/BlSpaceRenderEndEvent.class.st b/src/Bloc/BlSpaceRenderEndEvent.class.st index d913ada54..d7570e686 100644 --- a/src/Bloc/BlSpaceRenderEndEvent.class.st +++ b/src/Bloc/BlSpaceRenderEndEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpaceRenderEndEvent', - #superclass : 'BlSpaceStepEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceRenderEndEvent, + #superclass : #BlSpaceStepEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceRenderSignal.class.st b/src/Bloc/BlSpaceRenderSignal.class.st index f885c3ae6..8776a8fa7 100644 --- a/src/Bloc/BlSpaceRenderSignal.class.st +++ b/src/Bloc/BlSpaceRenderSignal.class.st @@ -20,8 +20,8 @@ Internal Representation and Key Implementation Points. " Class { - #name : 'BlSpaceRenderSignal', - #superclass : 'BeaconSignal', + #name : #BlSpaceRenderSignal, + #superclass : #BeaconSignal, #instVars : [ 'space', 'action' @@ -29,18 +29,16 @@ Class { #classVars : [ 'Ignore' ], - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #category : 'Bloc-Space - Support' } -{ #category : 'filtering' } +{ #category : #filtering } BlSpaceRenderSignal class >> dontIgnore [ Ignore := false. ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSpaceRenderSignal class >> endSpace: aSpace [ ^self new @@ -49,7 +47,7 @@ BlSpaceRenderSignal class >> endSpace: aSpace [ emit ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSpaceRenderSignal class >> for: aSpace block: aBlock [ Ignore == false ifFalse: @@ -59,7 +57,7 @@ BlSpaceRenderSignal class >> for: aSpace block: aBlock [ self endSpace: aSpace. ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSpaceRenderSignal class >> fromSton: stonReader [ | signal | @@ -76,14 +74,14 @@ BlSpaceRenderSignal class >> fromSton: stonReader [ ^signal ] -{ #category : 'filtering' } +{ #category : #filtering } BlSpaceRenderSignal class >> ignore [ "Don't emit the signal" Ignore := true. ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSpaceRenderSignal class >> startSpace: aSpace [ ^self new @@ -92,17 +90,17 @@ BlSpaceRenderSignal class >> startSpace: aSpace [ emit ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceRenderSignal >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceRenderSignal >> action: anObject [ action := anObject ] -{ #category : 'ston persistence' } +{ #category : #'ston persistence' } BlSpaceRenderSignal >> asDictionary [ | spaceSton | @@ -118,7 +116,7 @@ BlSpaceRenderSignal >> asDictionary [ yourself. ] -{ #category : 'printing' } +{ #category : #printing } BlSpaceRenderSignal >> printOneLineContentsOn: stream [ stream @@ -128,17 +126,17 @@ BlSpaceRenderSignal >> printOneLineContentsOn: stream [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceRenderSignal >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceRenderSignal >> space: anObject [ space := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceRenderSignal >> target [ "Answer the object that is the target of this signal" diff --git a/src/Bloc/BlSpaceResizedEvent.class.st b/src/Bloc/BlSpaceResizedEvent.class.st index 5f8341668..86c0eb3e9 100644 --- a/src/Bloc/BlSpaceResizedEvent.class.st +++ b/src/Bloc/BlSpaceResizedEvent.class.st @@ -1,31 +1,29 @@ Class { - #name : 'BlSpaceResizedEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceResizedEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'extent' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceResizedEvent >> extent [ "Return window size in screen coordinates" ^ extent ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceResizedEvent >> extent: anObject [ extent := anObject ] -{ #category : 'testing' } +{ #category : #testing } BlSpaceResizedEvent >> isSpaceResizedEvent [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceResizedEvent >> sendTo: anObject [ anObject spaceResizedEvent: self ] diff --git a/src/Bloc/BlSpaceScaleFactorChangedEvent.class.st b/src/Bloc/BlSpaceScaleFactorChangedEvent.class.st index d410b149a..715e6e37d 100644 --- a/src/Bloc/BlSpaceScaleFactorChangedEvent.class.st +++ b/src/Bloc/BlSpaceScaleFactorChangedEvent.class.st @@ -3,27 +3,25 @@ I am sent by a windowing system when a scaling factor of the window changes " Class { - #name : 'BlSpaceScaleFactorChangedEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceScaleFactorChangedEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'scaleFactor' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceScaleFactorChangedEvent >> scaleFactor [ ^ scaleFactor ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceScaleFactorChangedEvent >> scaleFactor: anObject [ scaleFactor := anObject ] -{ #category : 'sending' } +{ #category : #sending } BlSpaceScaleFactorChangedEvent >> sendTo: anObject [ anObject spaceScaleFactorChangedEvent: self ] diff --git a/src/Bloc/BlSpaceShownEvent.class.st b/src/Bloc/BlSpaceShownEvent.class.st index adb910370..ec7b83f8d 100644 --- a/src/Bloc/BlSpaceShownEvent.class.st +++ b/src/Bloc/BlSpaceShownEvent.class.st @@ -16,22 +16,20 @@ Behaves as SDL_WINDOWEVENT_SHOWN " Class { - #name : 'BlSpaceShownEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceShownEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'space' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceShownEvent >> space [ ^ space ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceShownEvent >> space: anObject [ space := anObject ] diff --git a/src/Bloc/BlSpaceShutdownOnCloseListener.class.st b/src/Bloc/BlSpaceShutdownOnCloseListener.class.st index 9c794f96f..98f27249e 100644 --- a/src/Bloc/BlSpaceShutdownOnCloseListener.class.st +++ b/src/Bloc/BlSpaceShutdownOnCloseListener.class.st @@ -16,45 +16,43 @@ space show " Class { - #name : 'BlSpaceShutdownOnCloseListener', - #superclass : 'BlBasicEventHandler', + #name : #BlSpaceShutdownOnCloseListener, + #superclass : #BlBasicEventHandler, #instVars : [ 'shouldSave' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlSpaceShutdownOnCloseListener >> handleEvent: anEvent [ | aSpace | aSpace := anEvent currentTarget. aSpace universe snapshot: shouldSave andQuit: true. ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpaceShutdownOnCloseListener >> initialize [ super initialize. shouldSave := false ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceShutdownOnCloseListener >> shouldSave [ ^ shouldSave ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceShutdownOnCloseListener >> shouldSave: aBoolean [ "When set to true the image will be saved before quitting" shouldSave := aBoolean ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlSpaceShutdownOnCloseListener >> wantsEvent: anEvent [ ^ anEvent class == BlSpaceClosedEvent ] diff --git a/src/Bloc/BlSpaceStepEvent.class.st b/src/Bloc/BlSpaceStepEvent.class.st index b1c9998e1..333344fdc 100644 --- a/src/Bloc/BlSpaceStepEvent.class.st +++ b/src/Bloc/BlSpaceStepEvent.class.st @@ -1,35 +1,33 @@ Class { - #name : 'BlSpaceStepEvent', - #superclass : 'BlSpaceEvent', + #name : #BlSpaceStepEvent, + #superclass : #BlSpaceEvent, #instVars : [ 'start', 'end' ], - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #category : 'Bloc-Events-Type-Space' } -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceStepEvent >> end [ ^ end ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceStepEvent >> end: aDateAndTime [ end := aDateAndTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceStepEvent >> start [ ^ start ] -{ #category : 'accessing' } +{ #category : #accessing } BlSpaceStepEvent >> start: aDateAndTime [ start := aDateAndTime ] diff --git a/src/Bloc/BlSpaceStyleEndEvent.class.st b/src/Bloc/BlSpaceStyleEndEvent.class.st index 91922bac7..c059618d1 100644 --- a/src/Bloc/BlSpaceStyleEndEvent.class.st +++ b/src/Bloc/BlSpaceStyleEndEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpaceStyleEndEvent', - #superclass : 'BlSpaceStepEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceStyleEndEvent, + #superclass : #BlSpaceStepEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceTaskQueue.class.st b/src/Bloc/BlSpaceTaskQueue.class.st index 00951a8e4..e39a6f453 100644 --- a/src/Bloc/BlSpaceTaskQueue.class.st +++ b/src/Bloc/BlSpaceTaskQueue.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlSpaceTaskQueue', - #superclass : 'BlTaskQueue', + #name : #BlSpaceTaskQueue, + #superclass : #BlTaskQueue, #instVars : [ 'space' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSpaceTaskQueue class >> space: aBlSpace [ ^ self new initializeWith: aBlSpace ] -{ #category : 'initialization' } +{ #category : #initialization } BlSpaceTaskQueue >> initializeWith: aBlSpace [ space := aBlSpace ] -{ #category : 'private' } +{ #category : #private } BlSpaceTaskQueue >> requeue: aBlTask [ super requeue: aBlTask. diff --git a/src/Bloc/BlSpaceTasksEndEvent.class.st b/src/Bloc/BlSpaceTasksEndEvent.class.st index 2cdc39983..47cebae7a 100644 --- a/src/Bloc/BlSpaceTasksEndEvent.class.st +++ b/src/Bloc/BlSpaceTasksEndEvent.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlSpaceTasksEndEvent', - #superclass : 'BlSpaceStepEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceTasksEndEvent, + #superclass : #BlSpaceStepEvent, + #category : 'Bloc-Events-Type-Space' } diff --git a/src/Bloc/BlSpaceWakeUpEvent.class.st b/src/Bloc/BlSpaceWakeUpEvent.class.st index f8a1482e3..442650cb2 100644 --- a/src/Bloc/BlSpaceWakeUpEvent.class.st +++ b/src/Bloc/BlSpaceWakeUpEvent.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlSpaceWakeUpEvent', - #superclass : 'BlSpaceEvent', - #category : 'Bloc-Events-Type-Space', - #package : 'Bloc', - #tag : 'Events-Type-Space' + #name : #BlSpaceWakeUpEvent, + #superclass : #BlSpaceEvent, + #category : 'Bloc-Events-Type-Space' } -{ #category : 'sending' } +{ #category : #sending } BlSpaceWakeUpEvent >> sendTo: anObject [ anObject spaceWakeUpEvent: self ] diff --git a/src/Bloc/BlSquare.class.st b/src/Bloc/BlSquare.class.st index 5a790f2dc..3a4fd0867 100644 --- a/src/Bloc/BlSquare.class.st +++ b/src/Bloc/BlSquare.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlSquare', - #superclass : 'BlSquareGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlSquare, + #superclass : #BlSquareGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlSquare class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlSquareGeometry.class.st b/src/Bloc/BlSquareGeometry.class.st index 6073ad69b..10d930e8a 100644 --- a/src/Bloc/BlSquareGeometry.class.st +++ b/src/Bloc/BlSquareGeometry.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlSquareGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlSquareGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'length', 'origin' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlSquareGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ ^ true ] -{ #category : 'geometry bounds' } +{ #category : #'geometry bounds' } BlSquareGeometry >> geometryBounds: aBlBounds [ "Load my bounds in mutable rectangle. @see #geometryBounds for more info" @@ -26,24 +24,24 @@ BlSquareGeometry >> geometryBounds: aBlBounds [ extent: (self length * 2.0) asPoint ] -{ #category : 'testing' } +{ #category : #testing } BlSquareGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlSquareGeometry >> hasJoins [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlSquareGeometry >> length [ ^ length ] -{ #category : 'geometry' } +{ #category : #geometry } BlSquareGeometry >> matchExtent: anExtent [ length := anExtent min / 2.0. origin := (anExtent - anExtent min asPoint) / 2.0. @@ -51,7 +49,7 @@ BlSquareGeometry >> matchExtent: anExtent [ self extent: anExtent ] -{ #category : 'accessing' } +{ #category : #accessing } BlSquareGeometry >> origin [ ^ origin ] diff --git a/src/Bloc/BlStadium.class.st b/src/Bloc/BlStadium.class.st index 2c76ce8ac..7f7c70bdc 100644 --- a/src/Bloc/BlStadium.class.st +++ b/src/Bloc/BlStadium.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlStadium', - #superclass : 'BlStadiumGeometry', - #category : 'Bloc-Basic-Geometry-Deprecated', - #package : 'Bloc', - #tag : 'Basic-Geometry-Deprecated' + #name : #BlStadium, + #superclass : #BlStadiumGeometry, + #category : 'Bloc-Basic-Geometry-Deprecated' } -{ #category : 'testing' } +{ #category : #testing } BlStadium class >> isDeprecated [ ^ true ] diff --git a/src/Bloc/BlStadiumGeometry.class.st b/src/Bloc/BlStadiumGeometry.class.st index a63b7f871..b043ff895 100644 --- a/src/Bloc/BlStadiumGeometry.class.st +++ b/src/Bloc/BlStadiumGeometry.class.st @@ -2,19 +2,17 @@ A stadium is a geometric figure consisting of a rectangle with top and bottom lengths a whose ends are capped off with semicircles of radius r. " Class { - #name : 'BlStadiumGeometry', - #superclass : 'BlElementVectorGeometry', - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #name : #BlStadiumGeometry, + #superclass : #BlElementVectorGeometry, + #category : 'Bloc-Basic-Geometry' } -{ #category : 'geometry' } +{ #category : #geometry } BlStadiumGeometry >> matchExtent: aPoint [ extent := aPoint ] -{ #category : 'geometry' } +{ #category : #geometry } BlStadiumGeometry >> radius [ "Compute the radius of the semicircles" diff --git a/src/Bloc/BlStartAlignment.class.st b/src/Bloc/BlStartAlignment.class.st index a8ecdda17..0ca47f99e 100644 --- a/src/Bloc/BlStartAlignment.class.st +++ b/src/Bloc/BlStartAlignment.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlStartAlignment', - #superclass : 'BlRelativeAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlStartAlignment, + #superclass : #BlRelativeAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlStartAlignment class >> horizontal [ ^ BlHorizontalAlignment start ] -{ #category : 'factory' } +{ #category : #factory } BlStartAlignment class >> vertical [ ^ BlVerticalAlignment top ] diff --git a/src/Bloc/BlStaticCursor.class.st b/src/Bloc/BlStaticCursor.class.st index e7e80bf94..578dbe555 100644 --- a/src/Bloc/BlStaticCursor.class.st +++ b/src/Bloc/BlStaticCursor.class.st @@ -1,27 +1,25 @@ Class { - #name : 'BlStaticCursor', - #superclass : 'BlCursor', + #name : #BlStaticCursor, + #superclass : #BlCursor, #instVars : [ 'image' ], - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlStaticCursor >> asForm [ ^ self image ] -{ #category : 'accessing' } +{ #category : #accessing } BlStaticCursor >> image [ ^ image ] -{ #category : 'accessing' } +{ #category : #accessing } BlStaticCursor >> image: aForm [ image := aForm ] diff --git a/src/Bloc/BlStencil.class.st b/src/Bloc/BlStencil.class.st index eb624332a..42695b533 100644 --- a/src/Bloc/BlStencil.class.st +++ b/src/Bloc/BlStencil.class.st @@ -35,34 +35,32 @@ anElement := aStencil create. " Class { - #name : 'BlStencil', - #superclass : 'Object', - #category : 'Bloc-Stencil', - #package : 'Bloc', - #tag : 'Stencil' + #name : #BlStencil, + #superclass : #Object, + #category : 'Bloc-Stencil' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlStencil class >> asStencil [ ^ self new ] -{ #category : 'converting' } +{ #category : #converting } BlStencil >> asElement [ ^ self create asElement ] -{ #category : 'converting' } +{ #category : #converting } BlStencil >> asStencil [ ^ self ] -{ #category : 'api - instantiation' } +{ #category : #'api - instantiation' } BlStencil >> create [ diff --git a/src/Bloc/BlStrokeLineBevelJoin.class.st b/src/Bloc/BlStrokeLineBevelJoin.class.st index e721ac82e..3cb38f703 100644 --- a/src/Bloc/BlStrokeLineBevelJoin.class.st +++ b/src/Bloc/BlStrokeLineBevelJoin.class.st @@ -5,14 +5,12 @@ See BlStrokeLineJoin for other types " Class { - #name : 'BlStrokeLineBevelJoin', - #superclass : 'BlStrokeLineJoin', - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #name : #BlStrokeLineBevelJoin, + #superclass : #BlStrokeLineJoin, + #category : 'Bloc-Paint-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineBevelJoin class >> joinName [ ^ 'Bevel' ] diff --git a/src/Bloc/BlStrokeLineButtCap.class.st b/src/Bloc/BlStrokeLineButtCap.class.st index 30740b326..72c1d6a88 100644 --- a/src/Bloc/BlStrokeLineButtCap.class.st +++ b/src/Bloc/BlStrokeLineButtCap.class.st @@ -6,14 +6,12 @@ See BlStrokeLineCap for other types " Class { - #name : 'BlStrokeLineButtCap', - #superclass : 'BlStrokeLineCap', - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #name : #BlStrokeLineButtCap, + #superclass : #BlStrokeLineCap, + #category : 'Bloc-Paint-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineButtCap class >> capName [ ^ 'Butt' ] diff --git a/src/Bloc/BlStrokeLineCap.class.st b/src/Bloc/BlStrokeLineCap.class.st index f004d84fd..d7fb58fcc 100644 --- a/src/Bloc/BlStrokeLineCap.class.st +++ b/src/Bloc/BlStrokeLineCap.class.st @@ -13,8 +13,8 @@ Evaluate to see a visual preview: " Class { - #name : 'BlStrokeLineCap', - #superclass : 'Object', + #name : #BlStrokeLineCap, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #classInstVars : [ @@ -22,22 +22,20 @@ Class { 'round', 'square' ], - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #category : 'Bloc-Paint-Support' } -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlStrokeLineCap class >> butt [ ^ butt ifNil: [ butt := BlStrokeLineButtCap new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineCap class >> capName [ ^ self subclassResponsibility ] -{ #category : 'cleanup' } +{ #category : #cleanup } BlStrokeLineCap class >> cleanUp [ super cleanUp. @@ -45,17 +43,17 @@ BlStrokeLineCap class >> cleanUp [ square := round := butt := nil ] -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlStrokeLineCap class >> round [ ^ round ifNil: [ round := BlStrokeLineRoundCap new ] ] -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlStrokeLineCap class >> square [ ^ square ifNil: [ square := BlStrokeLineSquareCap new ] ] -{ #category : 'printing' } +{ #category : #printing } BlStrokeLineCap >> printOn: aStream [ self class ~= BlStrokeLineCap diff --git a/src/Bloc/BlStrokeLineJoin.class.st b/src/Bloc/BlStrokeLineJoin.class.st index f1b07dd47..059dc3ffc 100644 --- a/src/Bloc/BlStrokeLineJoin.class.st +++ b/src/Bloc/BlStrokeLineJoin.class.st @@ -13,8 +13,8 @@ Evaluate to see a visual preview: " Class { - #name : 'BlStrokeLineJoin', - #superclass : 'Object', + #name : #BlStrokeLineJoin, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #classInstVars : [ @@ -22,17 +22,15 @@ Class { 'miter', 'round' ], - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #category : 'Bloc-Paint-Support' } -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlStrokeLineJoin class >> bevel [ ^ bevel ifNil: [ bevel := BlStrokeLineBevelJoin new ] ] -{ #category : 'cleanup' } +{ #category : #cleanup } BlStrokeLineJoin class >> cleanUp [ super cleanUp. @@ -40,22 +38,22 @@ BlStrokeLineJoin class >> cleanUp [ bevel := miter := round := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineJoin class >> joinName [ ^ self subclassResponsibility ] -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlStrokeLineJoin class >> miter [ ^ miter ifNil: [ miter := BlStrokeLineMiterJoin new ] ] -{ #category : 'predefined instances' } +{ #category : #'predefined instances' } BlStrokeLineJoin class >> round [ ^ round ifNil: [ round := BlStrokeLineRoundJoin new ] ] -{ #category : 'printing' } +{ #category : #printing } BlStrokeLineJoin >> printOn: aStream [ self class ~= BlStrokeLineJoin diff --git a/src/Bloc/BlStrokeLineMiterJoin.class.st b/src/Bloc/BlStrokeLineMiterJoin.class.st index cdbd2e8fa..a8b266f62 100644 --- a/src/Bloc/BlStrokeLineMiterJoin.class.st +++ b/src/Bloc/BlStrokeLineMiterJoin.class.st @@ -6,14 +6,12 @@ See BlStrokeLineJoin for other types " Class { - #name : 'BlStrokeLineMiterJoin', - #superclass : 'BlStrokeLineJoin', - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #name : #BlStrokeLineMiterJoin, + #superclass : #BlStrokeLineJoin, + #category : 'Bloc-Paint-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineMiterJoin class >> joinName [ ^ 'Miter' ] diff --git a/src/Bloc/BlStrokeLineRoundCap.class.st b/src/Bloc/BlStrokeLineRoundCap.class.st index 194d59891..c999df72b 100644 --- a/src/Bloc/BlStrokeLineRoundCap.class.st +++ b/src/Bloc/BlStrokeLineRoundCap.class.st @@ -5,14 +5,12 @@ See BlStrokeLineCap for other types " Class { - #name : 'BlStrokeLineRoundCap', - #superclass : 'BlStrokeLineCap', - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #name : #BlStrokeLineRoundCap, + #superclass : #BlStrokeLineCap, + #category : 'Bloc-Paint-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineRoundCap class >> capName [ ^ 'Round' ] diff --git a/src/Bloc/BlStrokeLineRoundJoin.class.st b/src/Bloc/BlStrokeLineRoundJoin.class.st index cdc3c790d..3f022fec6 100644 --- a/src/Bloc/BlStrokeLineRoundJoin.class.st +++ b/src/Bloc/BlStrokeLineRoundJoin.class.st @@ -5,14 +5,12 @@ See BlStrokeLineJoin for other types " Class { - #name : 'BlStrokeLineRoundJoin', - #superclass : 'BlStrokeLineJoin', - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #name : #BlStrokeLineRoundJoin, + #superclass : #BlStrokeLineJoin, + #category : 'Bloc-Paint-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineRoundJoin class >> joinName [ ^ 'Round' ] diff --git a/src/Bloc/BlStrokeLineSquareCap.class.st b/src/Bloc/BlStrokeLineSquareCap.class.st index 36fe007ea..eedeadda6 100644 --- a/src/Bloc/BlStrokeLineSquareCap.class.st +++ b/src/Bloc/BlStrokeLineSquareCap.class.st @@ -5,14 +5,12 @@ See BlStrokeLineCap for other types " Class { - #name : 'BlStrokeLineSquareCap', - #superclass : 'BlStrokeLineCap', - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #name : #BlStrokeLineSquareCap, + #superclass : #BlStrokeLineCap, + #category : 'Bloc-Paint-Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeLineSquareCap class >> capName [ ^ 'Square' ] diff --git a/src/Bloc/BlStrokeStyle.class.st b/src/Bloc/BlStrokeStyle.class.st index 19d198ee9..d7ebdb495 100644 --- a/src/Bloc/BlStrokeStyle.class.st +++ b/src/Bloc/BlStrokeStyle.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlStrokeStyle', - #superclass : 'Object', + #name : #BlStrokeStyle, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -10,12 +10,10 @@ Class { 'dashArray', 'dashOffset' ], - #category : 'Bloc-Paint-Support', - #package : 'Bloc', - #tag : 'Paint-Support' + #category : 'Bloc-Paint-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlStrokeStyle class >> dashed [ ^ self new @@ -26,7 +24,7 @@ BlStrokeStyle class >> dashed [ dashOffset: 0 ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlStrokeStyle class >> default [ ^ self new @@ -37,7 +35,7 @@ BlStrokeStyle class >> default [ dashOffset: 0 ] -{ #category : 'comparing' } +{ #category : #comparing } BlStrokeStyle >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -51,37 +49,37 @@ BlStrokeStyle >> = anObject [ and: [ lineCap = anObject lineCap and: [ lineJoin = anObject lineJoin ] ] ] ] ] -{ #category : 'copying' } +{ #category : #copying } BlStrokeStyle >> copyWithLineCap: aLineCap [ ^ self copy lineCap: aLineCap ] -{ #category : 'copying' } +{ #category : #copying } BlStrokeStyle >> copyWithLineJoin: aLineJoin [ ^ self copy lineJoin: aLineJoin ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> dashArray [ ^ dashArray ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> dashArray: anArray [ dashArray := anArray ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> dashOffset [ ^ dashOffset ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> dashOffset: aNumber [ dashOffset := aNumber ] -{ #category : 'comparing' } +{ #category : #comparing } BlStrokeStyle >> hash [ "Answer an integer value that is related to the identity of the receiver." @@ -91,38 +89,38 @@ BlStrokeStyle >> hash [ bitXor: (dashOffset hash bitXor: (lineCap hash bitXor: lineJoin hash))) ] -{ #category : 'testing' } +{ #category : #testing } BlStrokeStyle >> isDashed [ ^ dashArray notEmpty ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> lineCap [ ^ lineCap ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> lineCap: aBlStrokeLineCap [ lineCap := aBlStrokeLineCap ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> lineJoin [ ^ lineJoin ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> lineJoin: aBlStrokeLineJoin [ lineJoin := aBlStrokeLineJoin ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> miterLimit [ ^ miterLimit ] -{ #category : 'accessing' } +{ #category : #accessing } BlStrokeStyle >> miterLimit: aNumber [ miterLimit := aNumber ] diff --git a/src/Bloc/BlStyles.class.st b/src/Bloc/BlStyles.class.st index 469dfc18f..31d8e3d92 100644 --- a/src/Bloc/BlStyles.class.st +++ b/src/Bloc/BlStyles.class.st @@ -22,19 +22,17 @@ A `BlElementStyle` can be removed from the styles with the help of `BlStyles>>#r " Class { - #name : 'BlStyles', - #superclass : 'Object', + #name : #BlStyles, + #superclass : #Object, #traits : 'TBlElementCommonStyles + TBlElementStyles', #classTraits : 'TBlElementCommonStyles classTrait + TBlElementStyles classTrait', #instVars : [ 'styles' ], - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #category : 'Bloc-Basic-Style' } -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlStyles >> addStyle: aStyle [ self @@ -44,13 +42,13 @@ BlStyles >> addStyle: aStyle [ ifNone: [ self basicAddStyle: aStyle copy ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlStyles >> addStyles: aCollectionOfStyles [ aCollectionOfStyles do: [ :eachStyle | self addStyle: eachStyle ] ] -{ #category : 'converting' } +{ #category : #converting } BlStyles >> asForwarded: aTargetObject [ ^ BlForwardedStyles new @@ -61,19 +59,19 @@ BlStyles >> asForwarded: aTargetObject [ yourself ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlStyles >> basicAddStyle: aStyle [ styles add: aStyle ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlStyles >> basicRemovePropertiesOf: aStyleToRemove fromStyle: anExistingStyle [ anExistingStyle removeProperties: aStyleToRemove properties ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlStyles >> basicRemovePropertiesOrStyleOf: aStyleToRemove fromStyle: anExistingStyle [ self @@ -84,19 +82,19 @@ BlStyles >> basicRemovePropertiesOrStyleOf: aStyleToRemove fromStyle: anExisting self basicRemoveStyle: anExistingStyle ] ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlStyles >> basicRemoveStyle: aStyle [ styles remove: aStyle ifAbsent: [ ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlStyles >> createStylesCollection [ ^ OrderedCollection new: 10 ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } BlStyles >> for: aTargetObject [ ^ BlForwardedStyles new @@ -105,7 +103,7 @@ BlStyles >> for: aTargetObject [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlStyles >> initialize [ super initialize. @@ -113,13 +111,13 @@ BlStyles >> initialize [ styles := self createStylesCollection ] -{ #category : 'private' } +{ #category : #private } BlStyles >> matchingStyles: theStates [ ^ styles select: [ :aStyle | aStyle state matches: theStates ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlStyles >> removeStyle: aStyle [ self @@ -131,13 +129,13 @@ BlStyles >> removeStyle: aStyle [ ifNone: [ ] ] -{ #category : 'adding / removing' } +{ #category : #'adding / removing' } BlStyles >> removeStyles: aCollectionOfStyles [ aCollectionOfStyles do: [ :eachStyle | self removeStyle: eachStyle ] ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlStyles >> styleForState: aState ifFound: aFoundBlock ifNone: aNoneBlock [ ^ styles detect: [ :eachStyle | eachStyle isForwarded not and: [ eachStyle state = aState ] ] @@ -145,7 +143,7 @@ BlStyles >> styleForState: aState ifFound: aFoundBlock ifNone: aNoneBlock [ ifNone: aNoneBlock ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } BlStyles >> styleForStyle: aStyle ifFound: aFoundBlock ifNone: aNoneBlock [ ^ styles detect: [ :eachStyle | @@ -156,13 +154,13 @@ BlStyles >> styleForStyle: aStyle ifFound: aFoundBlock ifNone: aNoneBlock [ ifNone: aNoneBlock ] -{ #category : 'private' } +{ #category : #private } BlStyles >> styles [ ^ styles ] -{ #category : 'private' } +{ #category : #private } BlStyles >> styles: aCollectionOfStyles [ "Private! #styles must be correctly initialized with a proper sorted collection" diff --git a/src/Bloc/BlSubRope.class.st b/src/Bloc/BlSubRope.class.st index a5aded97e..a0f584e28 100644 --- a/src/Bloc/BlSubRope.class.st +++ b/src/Bloc/BlSubRope.class.st @@ -3,19 +3,17 @@ I a special type of rope used to represent a sub rope for the case when rebuildi " Class { - #name : 'BlSubRope', - #superclass : 'BlRope', + #name : #BlSubRope, + #superclass : #BlRope, #instVars : [ 'rope', 'offset', 'length' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSubRope class >> combineScoped: aLeftRope and: aRightRope [ ^ self @@ -24,7 +22,7 @@ BlSubRope class >> combineScoped: aLeftRope and: aRightRope [ length: aLeftRope size + aRightRope size ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSubRope class >> rope: aRope offset: anOffset length: aLength [ ^ self new @@ -32,7 +30,7 @@ BlSubRope class >> rope: aRope offset: anOffset length: aLength [ yourself ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlSubRope >> at: anIndex [ anIndex > length ifTrue: [ self error: 'Sub rope index out of bounds: ', anIndex asString ]. @@ -40,7 +38,7 @@ BlSubRope >> at: anIndex [ ^ rope at: offset + anIndex ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlSubRope >> attributes: anAttributesCollection from: aStart to: anEnd [ "See BlRope>>#attributes:from:to: for the detailed explanation on start and end indices" @@ -68,12 +66,12 @@ BlSubRope >> attributes: anAttributesCollection from: aStart to: anEnd [ ^ (self from: 0 to: aStart) append: (anAttributeRope append: (self from: anEnd to: self size)) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlSubRope >> children [ ^ { rope } ] -{ #category : 'rope - attributes' } +{ #category : #'rope - attributes' } BlSubRope >> clearAttributes: aStart to: anEnd if: aBlock [ | anClearedRope | @@ -85,13 +83,13 @@ BlSubRope >> clearAttributes: aStart to: anEnd if: aBlock [ ifFalse: [ anClearedRope from: offset to: offset + length ] ] -{ #category : 'copying' } +{ #category : #copying } BlSubRope >> copyFrom: startIndex to: endIndex [ ^ self from: startIndex-1 to: endIndex ] -{ #category : 'rope - deleting' } +{ #category : #'rope - deleting' } BlSubRope >> delete: aStart to: anEnd [ | afterDeletion | @@ -110,14 +108,14 @@ BlSubRope >> delete: aStart to: anEnd [ to: offset + length - (anEnd - aStart) ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlSubRope >> depth [ ^ rope depth ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlSubRope >> empty [ "I delegate creation to the rope which I constrain" @@ -125,14 +123,14 @@ BlSubRope >> empty [ ^ self rope empty ] -{ #category : 'accessing' } +{ #category : #accessing } BlSubRope >> end [ ^ self start + self size ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlSubRope >> from: aStart to: anEnd [ self assertAccessFrom: aStart to: anEnd. @@ -149,12 +147,12 @@ BlSubRope >> from: aStart to: anEnd [ length: anEnd - aStart ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlSubRope >> from: aStart to: anEnd do: aBlock [ self rope from: aStart + offset to: anEnd + offset do: aBlock ] -{ #category : 'rope - inserting' } +{ #category : #'rope - inserting' } BlSubRope >> insertItems: aCollection at: anIndex [ | afterInsertion | @@ -164,46 +162,46 @@ BlSubRope >> insertItems: aCollection at: anIndex [ ^ afterInsertion from: offset to: offset + length + aCollection size ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlSubRope >> isLeaf [ ^ false ] -{ #category : 'rope - testing' } +{ #category : #'rope - testing' } BlSubRope >> isScoped [ ^ true ] -{ #category : 'rope - enumeration' } +{ #category : #'rope - enumeration' } BlSubRope >> iterator: aStart to: anEnd [ ^ BlSubRopeIterator rope: self from: aStart to: anEnd ] -{ #category : 'accessing' } +{ #category : #accessing } BlSubRope >> offset [ ^ offset ] -{ #category : 'accessing' } +{ #category : #accessing } BlSubRope >> readStream [ ^ ReadStream on: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlSubRope >> rope [ ^ rope ] -{ #category : 'initialization' } +{ #category : #initialization } BlSubRope >> rope: aRope offset: anOffset length: aLength [ anOffset < 0 @@ -218,7 +216,7 @@ BlSubRope >> rope: aRope offset: anOffset length: aLength [ length := aLength ] -{ #category : 'rope - replacing' } +{ #category : #'rope - replacing' } BlSubRope >> simplified [ @@ -229,14 +227,14 @@ BlSubRope >> simplified [ ^ self ] -{ #category : 'rope - accessing' } +{ #category : #'rope - accessing' } BlSubRope >> size [ ^ length ] -{ #category : 'accessing' } +{ #category : #accessing } BlSubRope >> start [ diff --git a/src/Bloc/BlSubRopeIterator.class.st b/src/Bloc/BlSubRopeIterator.class.st index 96785b61a..deb2ee6b7 100644 --- a/src/Bloc/BlSubRopeIterator.class.st +++ b/src/Bloc/BlSubRopeIterator.class.st @@ -3,75 +3,73 @@ I am a special iterator used to iterate over sub-rope " Class { - #name : 'BlSubRopeIterator', - #superclass : 'BlRopeIterator', + #name : #BlSubRopeIterator, + #superclass : #BlRopeIterator, #instVars : [ 'subIterator' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'iterator - accessing' } +{ #category : #'iterator - accessing' } BlSubRopeIterator >> attributes [ ^ subIterator attributes ] -{ #category : 'iterator - testing' } +{ #category : #'iterator - testing' } BlSubRopeIterator >> hasNext [ ^ subIterator hasNext ] -{ #category : 'accessing' } +{ #category : #accessing } BlSubRopeIterator >> hasPrevious [ ^ subIterator hasPrevious ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlSubRopeIterator >> next [ ^ subIterator next ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlSubRopeIterator >> nextSpan [ ^ subIterator nextSpan ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlSubRopeIterator >> peek [ ^ subIterator peek ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlSubRopeIterator >> peer [ ^ subIterator peer ] -{ #category : 'iterator - accessing' } +{ #category : #'iterator - accessing' } BlSubRopeIterator >> position [ ^ subIterator position - rope offset ] -{ #category : 'copying' } +{ #category : #copying } BlSubRopeIterator >> postCopy [ super postCopy. subIterator := subIterator copy ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlSubRopeIterator >> previous [ ^ subIterator previous ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSubRopeIterator >> rope: aRope from: aStart to: anEnd [ super rope: aRope from: aStart to: anEnd. subIterator := aRope rope iterator: aStart + aRope offset to: anEnd + aRope offset ] -{ #category : 'iterator - enumeration' } +{ #category : #'iterator - enumeration' } BlSubRopeIterator >> skip: aNumber [ subIterator skip: aNumber ] diff --git a/src/Bloc/BlSynchronizedObjectPool.class.st b/src/Bloc/BlSynchronizedObjectPool.class.st index ca5cccc40..b556221e9 100644 --- a/src/Bloc/BlSynchronizedObjectPool.class.st +++ b/src/Bloc/BlSynchronizedObjectPool.class.st @@ -1,38 +1,36 @@ Class { - #name : 'BlSynchronizedObjectPool', - #superclass : 'BlObjectPool', + #name : #BlSynchronizedObjectPool, + #superclass : #BlObjectPool, #instVars : [ 'pool', 'monitor' ], - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlSynchronizedObjectPool class >> pool: anObjectPool [ ^ self new initializeWith: anObjectPool ] -{ #category : 'pool' } +{ #category : #pool } BlSynchronizedObjectPool >> acquire [ ^ monitor critical: [ pool acquire ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlSynchronizedObjectPool >> initialize [ super initialize. monitor := Mutex new ] -{ #category : 'initialization' } +{ #category : #initialization } BlSynchronizedObjectPool >> initializeWith: anObjectPool [ pool := anObjectPool ] -{ #category : 'pool' } +{ #category : #pool } BlSynchronizedObjectPool >> release: anObject [ ^ monitor critical: [ pool release: anObject ] ] diff --git a/src/Bloc/BlTask.class.st b/src/Bloc/BlTask.class.st index 85f7c53c2..304251b0e 100644 --- a/src/Bloc/BlTask.class.st +++ b/src/Bloc/BlTask.class.st @@ -17,8 +17,8 @@ The task state was introduced after duplicate tasks were being found during the " Class { - #name : 'BlTask', - #superclass : 'Object', + #name : #BlTask, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -28,22 +28,20 @@ Class { #classVars : [ 'UniqueIdGenerator' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlTask class >> initialize [ UniqueIdGenerator := BlUniqueIdGenerator new ] -{ #category : 'converting' } +{ #category : #converting } BlTask >> asBeaconLoggingTask [ ^ BlBeaconLoggingTask subtask: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlTask >> id [ "Return a unique id of this task" @@ -51,7 +49,7 @@ BlTask >> id [ ^ id ] -{ #category : 'initialization' } +{ #category : #initialization } BlTask >> initialize [ super initialize. @@ -59,49 +57,49 @@ BlTask >> initialize [ state := #new. ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> isComplete [ ^ state == #complete ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> isExecuting [ ^ state = #executing ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> isNew [ ^ state == #new ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> isPendingExecution [ ^ state == #pendingExecution ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> isQueued [ ^ state == #queued ] -{ #category : 'hooks' } +{ #category : #hooks } BlTask >> onEnqueued: aBlSpace [ "Is self when a task is enqueued in a space. It gives subclasses a possibility to synchronize time with the space" ] -{ #category : 'hooks' } +{ #category : #hooks } BlTask >> onEnqueuedInElement: aBlElement [ "Is sent when a task is enqueued in a element. It gives subclasses a possibility to re-enqueue themselves in the same element" ] -{ #category : 'private - testing' } +{ #category : #'private - testing' } BlTask >> requeueTaskAfterExecution [ "Answer a boolean indicating whether the receiver should be requeued after execution. Subclasses will override this with the appropriate response" @@ -109,42 +107,42 @@ BlTask >> requeueTaskAfterExecution [ ^ false ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlTask >> run [ self subclassResponsibility ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> setComplete [ state := #complete ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> setExecuting [ state := #executing ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> setNew [ state := #new. ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> setPendingExecution [ state := #pendingExecution. ] -{ #category : 'private - state' } +{ #category : #'private - state' } BlTask >> setQueued [ state := #queued. ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlTask >> value [ "To support defer:" self run diff --git a/src/Bloc/BlTaskAction.class.st b/src/Bloc/BlTaskAction.class.st index dd8d11926..306a9ef87 100644 --- a/src/Bloc/BlTaskAction.class.st +++ b/src/Bloc/BlTaskAction.class.st @@ -1,32 +1,30 @@ Class { - #name : 'BlTaskAction', - #superclass : 'BlTask', + #name : #BlTaskAction, + #superclass : #BlTask, #instVars : [ 'action' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAction >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAction >> action: aBlock [ action := aBlock ] -{ #category : 'initialization' } +{ #category : #initialization } BlTaskAction >> initialize [ super initialize. action := [ :optionalThisTask | ] ] -{ #category : 'printing' } +{ #category : #printing } BlTaskAction >> printOn: aStream [ aStream print: self class name; @@ -36,7 +34,7 @@ BlTaskAction >> printOn: aStream [ nextPut: $) ] -{ #category : 'running' } +{ #category : #running } BlTaskAction >> run [ self action isClosure ifTrue: [ self action cull: self ] diff --git a/src/Bloc/BlTaskAtErrorSignal.class.st b/src/Bloc/BlTaskAtErrorSignal.class.st index dbc87e275..32dfc22e3 100644 --- a/src/Bloc/BlTaskAtErrorSignal.class.st +++ b/src/Bloc/BlTaskAtErrorSignal.class.st @@ -15,44 +15,42 @@ BlTaskAtErrorSignal is used when BlTaskAtQueue encounters an error during execut " Class { - #name : 'BlTaskAtErrorSignal', - #superclass : 'BeaconSignal', + #name : #BlTaskAtErrorSignal, + #superclass : #BeaconSignal, #instVars : [ 'exception', 'message', 'task' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtErrorSignal >> exception [ ^ exception ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtErrorSignal >> exception: anObject [ exception := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtErrorSignal >> message [ ^ message ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtErrorSignal >> message: anObject [ message := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtErrorSignal >> task [ ^ task ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtErrorSignal >> task: anObject [ task := anObject ] diff --git a/src/Bloc/BlTaskAtQueue.class.st b/src/Bloc/BlTaskAtQueue.class.st index f6832fe35..2d513dfe3 100644 --- a/src/Bloc/BlTaskAtQueue.class.st +++ b/src/Bloc/BlTaskAtQueue.class.st @@ -28,8 +28,8 @@ The queue executes tasks within a single pharo process at #userSchedulingPriorit " Class { - #name : 'BlTaskAtQueue', - #superclass : 'Object', + #name : #BlTaskAtQueue, + #superclass : #Object, #instVars : [ 'queue', 'scheduleSemaphore', @@ -42,18 +42,16 @@ Class { #classVars : [ 'Default' ], - #category : 'Bloc-DataStructure - Priority Queue', - #package : 'Bloc', - #tag : 'DataStructure - Priority Queue' + #category : 'Bloc-DataStructure - Priority Queue' } -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueue class >> default [ ^Default ifNil: [ Default := self new start ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueue >> clock [ "Answer the clock used to schedule the receiver" @@ -61,7 +59,7 @@ BlTaskAtQueue >> clock [ ^ clock ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlTaskAtQueue >> clock: aBlTime [ "Set the clock used to schedule the receiver. This is normally only changed for testing purposes." @@ -69,7 +67,7 @@ BlTaskAtQueue >> clock: aBlTime [ clock := aBlTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueue >> cutoffDuration [ "Answer the duration used to determine whether to execute a task. I.e. tasks scheduled for less than cutoffDuration from now are run." @@ -78,12 +76,12 @@ BlTaskAtQueue >> cutoffDuration [ ^ cutoffDuration ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueue >> cutoffDuration: anObject [ cutoffDuration := anObject ] -{ #category : 'private' } +{ #category : #private } BlTaskAtQueue >> forceProcess [ "Force #processNextEntry to scan the queue. For testing purposes" @@ -91,7 +89,7 @@ BlTaskAtQueue >> forceProcess [ scheduleSemaphore signal. ] -{ #category : 'private' } +{ #category : #private } BlTaskAtQueue >> forkExecutorProcess [ self @@ -103,7 +101,7 @@ BlTaskAtQueue >> forkExecutorProcess [ named: 'BlTaskAtQueue Executor'. ] -{ #category : 'initialization' } +{ #category : #initialization } BlTaskAtQueue >> initialize [ super initialize. @@ -114,7 +112,7 @@ BlTaskAtQueue >> initialize [ clock := BlTime real. ] -{ #category : 'private' } +{ #category : #private } BlTaskAtQueue >> next [ "Answer the next item from the receiver's queue. For testing purposes only." @@ -122,7 +120,7 @@ BlTaskAtQueue >> next [ ^queue next ] -{ #category : 'private' } +{ #category : #private } BlTaskAtQueue >> processNextEntry [ | entry timeRemaining | @@ -150,7 +148,7 @@ BlTaskAtQueue >> processNextEntry [ ifNotNil: [ entry scheduledTime - clock now ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueue >> processTime [ "Answer the time that should be used for determining task priority and whether the task should be run now" @@ -158,7 +156,7 @@ BlTaskAtQueue >> processTime [ ^ processTime ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } BlTaskAtQueue >> processTime: aDateAndTime [ "Set the time for processing the current entry. This is only used for testing." @@ -166,7 +164,7 @@ BlTaskAtQueue >> processTime: aDateAndTime [ processTime := aDateAndTime. ] -{ #category : 'private' } +{ #category : #private } BlTaskAtQueue >> queueReaderLoop [ [ @@ -186,7 +184,7 @@ BlTaskAtQueue >> queueReaderLoop [ ] repeat ] -{ #category : 'operations' } +{ #category : #operations } BlTaskAtQueue >> schedule: aBlTaskAtTask [ "Add the supplied task to the queue and trigger the semaphore (which will either run the task immediately, or update the timeout, if required). Return the scheduled task or a similar previously scheduled task." @@ -201,26 +199,26 @@ BlTaskAtQueue >> schedule: aBlTaskAtTask [ ^ aBlTaskAtTask. ] -{ #category : 'operations' } +{ #category : #operations } BlTaskAtQueue >> schedule: aValuable at: aTime [ "Add the supplied task to the queue and trigger the semaphore at the appropriate time" self schedule: (BlTaskAtQueueTask valuable: aValuable at: aTime) ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueue >> size [ ^ queue size ] -{ #category : 'control' } +{ #category : #control } BlTaskAtQueue >> start [ self forkExecutorProcess. ] -{ #category : 'control' } +{ #category : #control } BlTaskAtQueue >> stop [ executorProcess ifNil: [ ^self ]. diff --git a/src/Bloc/BlTaskAtQueueTask.class.st b/src/Bloc/BlTaskAtQueueTask.class.st index 56db93148..90fac105d 100644 --- a/src/Bloc/BlTaskAtQueueTask.class.st +++ b/src/Bloc/BlTaskAtQueueTask.class.st @@ -11,8 +11,8 @@ BlTaskAtTask is the object added to the queue by BlTaskAtQueue. It stores the v " Class { - #name : 'BlTaskAtQueueTask', - #superclass : 'Object', + #name : #BlTaskAtQueueTask, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ @@ -20,18 +20,16 @@ Class { 'scheduledTime', 'queue' ], - #category : 'Bloc-DataStructure - Priority Queue', - #package : 'Bloc', - #tag : 'DataStructure - Priority Queue' + #category : 'Bloc-DataStructure - Priority Queue' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTaskAtQueueTask class >> valuable: aValuable at: aTime [ ^self new initialize: aValuable at: aTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueueTask >> entryPriority [ "Answer the receiver's priority. 0 is highest, so earlier scheduled tasks have a higher priority" @@ -40,19 +38,19 @@ BlTaskAtQueueTask >> entryPriority [ ] -{ #category : 'handling' } +{ #category : #handling } BlTaskAtQueueTask >> handleNotScheduledBecauseOfPreviousTask: aBlTaskAtTask [ "subclasses can act on this event" ] -{ #category : 'initialization' } +{ #category : #initialization } BlTaskAtQueueTask >> initialize: aValuable at: aTime [ valuable := aValuable. scheduledTime := aTime. ] -{ #category : 'printing' } +{ #category : #printing } BlTaskAtQueueTask >> printOn: aStream [ super printOn: aStream. @@ -62,32 +60,32 @@ BlTaskAtQueueTask >> printOn: aStream [ << ')' ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueueTask >> queue [ ^ queue ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueueTask >> queue: anObject [ queue := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueueTask >> scheduledTime [ ^ scheduledTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueueTask >> scheduledTime: aTime [ scheduledTime := aTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskAtQueueTask >> valuable [ ^ valuable ] -{ #category : 'evaluating' } +{ #category : #evaluating } BlTaskAtQueueTask >> value [ "evaluate valuable" ^ self valuable value diff --git a/src/Bloc/BlTaskErrorHandler.class.st b/src/Bloc/BlTaskErrorHandler.class.st index 5e3887cc7..faa6c9ef9 100644 --- a/src/Bloc/BlTaskErrorHandler.class.st +++ b/src/Bloc/BlTaskErrorHandler.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlTaskErrorHandler', - #superclass : 'BlSingleErrorHandler', - #category : 'Bloc-Basic-Errors', - #package : 'Bloc', - #tag : 'Basic-Errors' + #name : #BlTaskErrorHandler, + #superclass : #BlSingleErrorHandler, + #category : 'Bloc-Basic-Errors' } -{ #category : 'testing' } +{ #category : #testing } BlTaskErrorHandler >> matches: aFramePhase [ ^ aFramePhase isTaskPhase ] diff --git a/src/Bloc/BlTaskExecutionSignal.class.st b/src/Bloc/BlTaskExecutionSignal.class.st index 9e573170e..004234565 100644 --- a/src/Bloc/BlTaskExecutionSignal.class.st +++ b/src/Bloc/BlTaskExecutionSignal.class.st @@ -20,8 +20,8 @@ Internal Representation and Key Implementation Points. " Class { - #name : 'BlTaskExecutionSignal', - #superclass : 'BeaconSignal', + #name : #BlTaskExecutionSignal, + #superclass : #BeaconSignal, #instVars : [ 'task', 'action' @@ -30,18 +30,16 @@ Class { 'Enabled', 'IgnoredTasks' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'filtering' } +{ #category : #filtering } BlTaskExecutionSignal class >> clearIgnored [ IgnoredTasks := nil ] -{ #category : 'filtering' } +{ #category : #filtering } BlTaskExecutionSignal class >> dontIgnoreClass: aBlTask [ IgnoredTasks ifNil: [ ^self ]. @@ -49,19 +47,19 @@ BlTaskExecutionSignal class >> dontIgnoreClass: aBlTask [ [ IgnoredTasks := IgnoredTasks copyWithout: aBlTask ]. ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal class >> enabled [ ^Enabled ifNil: [ ^false ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal class >> enabled: aBoolean [ Enabled := aBoolean ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTaskExecutionSignal class >> endTask: aTask [ ^self new @@ -70,7 +68,7 @@ BlTaskExecutionSignal class >> endTask: aTask [ emit ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTaskExecutionSignal class >> for: aTask block: aBlock [ self enabled ifFalse: [ ^aBlock value ]. @@ -81,7 +79,7 @@ BlTaskExecutionSignal class >> for: aTask block: aBlock [ self endTask: aTask. ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTaskExecutionSignal class >> fromSton: stonReader [ | signal | @@ -98,7 +96,7 @@ BlTaskExecutionSignal class >> fromSton: stonReader [ ^signal ] -{ #category : 'filtering' } +{ #category : #filtering } BlTaskExecutionSignal class >> ignoreClass: aBlTask [ IgnoredTasks ifNil: [ IgnoredTasks := #() ]. @@ -106,14 +104,14 @@ BlTaskExecutionSignal class >> ignoreClass: aBlTask [ [ IgnoredTasks := IgnoredTasks copyWith: aBlTask ]. ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal class >> ignoreRepeatedTasks [ BlRepeatedTask withAllSubclasses do: [ :each | self ignoreClass: each ]. ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTaskExecutionSignal class >> startTask: aTask [ ^self new @@ -122,17 +120,17 @@ BlTaskExecutionSignal class >> startTask: aTask [ emit ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal >> action [ ^ action ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal >> action: anObject [ action := anObject ] -{ #category : 'ston persistence' } +{ #category : #'ston persistence' } BlTaskExecutionSignal >> asDictionary [ | taskSton | @@ -151,7 +149,7 @@ BlTaskExecutionSignal >> asDictionary [ yourself. ] -{ #category : 'printing' } +{ #category : #printing } BlTaskExecutionSignal >> printOneLineContentsOn: stream [ stream @@ -161,26 +159,26 @@ BlTaskExecutionSignal >> printOneLineContentsOn: stream [ ] -{ #category : 'ston persistence' } +{ #category : #'ston persistence' } BlTaskExecutionSignal >> stonOn: stonWriter [ stonWriter writeObject: self streamShortList: [ :array | array add: self asDictionary ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal >> target [ "Answer the object that is the target of this signal" ^task ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal >> task [ ^ task ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskExecutionSignal >> task: anObject [ task := anObject ] diff --git a/src/Bloc/BlTaskQueue.class.st b/src/Bloc/BlTaskQueue.class.st index 0d47f93bf..1b307368c 100644 --- a/src/Bloc/BlTaskQueue.class.st +++ b/src/Bloc/BlTaskQueue.class.st @@ -1,24 +1,22 @@ Class { - #name : 'BlTaskQueue', - #superclass : 'Object', + #name : #BlTaskQueue, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'tasks', 'lock' ], - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #category : 'Bloc-Space - Tasks' } -{ #category : 'private' } +{ #category : #private } BlTaskQueue >> critical: aBlock [ ^ lock critical: aBlock ] -{ #category : 'api - enqueue' } +{ #category : #'api - enqueue' } BlTaskQueue >> dequeue: aBlTask [ "Remove the task from the queue. If complete, mark the task as new so it may be reused." @@ -30,7 +28,7 @@ BlTaskQueue >> dequeue: aBlTask [ aBlTask setNew ] ] ]. ] -{ #category : 'api - enqueue' } +{ #category : #'api - enqueue' } BlTaskQueue >> enqueue: aBlTask [ | taskExists | @@ -54,7 +52,7 @@ BlTaskQueue >> enqueue: aBlTask [ ] -{ #category : 'api - enqueue' } +{ #category : #'api - enqueue' } BlTaskQueue >> enqueueAll: aCollectionOfBlTask [ | taskExists | @@ -72,7 +70,7 @@ BlTaskQueue >> enqueueAll: aCollectionOfBlTask [ ] -{ #category : 'api - enqueue' } +{ #category : #'api - enqueue' } BlTaskQueue >> enqueueFrom: aBlTaskQueue [ "Transfer a queue." @@ -81,7 +79,7 @@ BlTaskQueue >> enqueueFrom: aBlTaskQueue [ aBlTaskQueue flush ] ] -{ #category : 'api - enqueue' } +{ #category : #'api - enqueue' } BlTaskQueue >> flush [ | theTasks | @@ -94,27 +92,27 @@ BlTaskQueue >> flush [ ] -{ #category : 'initialization' } +{ #category : #initialization } BlTaskQueue >> initialize [ super initialize. lock := Monitor new ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlTaskQueue >> isEmpty [ ^ self critical: [ tasks isNil or: [ tasks isEmpty ] ] ] -{ #category : 'private' } +{ #category : #private } BlTaskQueue >> newTasks [ "Answer a new collection for storing tasks" ^ OrderedCollection new. ] -{ #category : 'printing' } +{ #category : #printing } BlTaskQueue >> printOn: aStream [ super printOn: aStream. @@ -124,7 +122,7 @@ BlTaskQueue >> printOn: aStream [ nextPut: $) ] -{ #category : 'private' } +{ #category : #private } BlTaskQueue >> requeue: aBlTask [ "Requeue the supplied task" @@ -137,7 +135,7 @@ BlTaskQueue >> requeue: aBlTask [ self enqueue: aBlTask ] -{ #category : 'api - running' } +{ #category : #'api - running' } BlTaskQueue >> runOn: aSpace [ | theTasks | @@ -165,7 +163,7 @@ BlTaskQueue >> runOn: aSpace [ ] -{ #category : 'accessing' } +{ #category : #accessing } BlTaskQueue >> size [ ^ tasks @@ -173,7 +171,7 @@ BlTaskQueue >> size [ ifNotNil: [ tasks size ] ] -{ #category : 'api - accessing' } +{ #category : #'api - accessing' } BlTaskQueue >> tasks [ "Return a new collection instance holding all my tasks" diff --git a/src/Bloc/BlTelemetry.class.st b/src/Bloc/BlTelemetry.class.st index 7d87f959f..0d218091e 100644 --- a/src/Bloc/BlTelemetry.class.st +++ b/src/Bloc/BlTelemetry.class.st @@ -1,9 +1,7 @@ Class { - #name : 'BlTelemetry', - #superclass : 'Object', + #name : #BlTelemetry, + #superclass : #Object, #traits : 'TBlTelemetry', #classTraits : 'TBlTelemetry classTrait', - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #category : 'Bloc-Space - Telemetry' } diff --git a/src/Bloc/BlTelemetryLogger.class.st b/src/Bloc/BlTelemetryLogger.class.st index 994840e93..26d486d7f 100644 --- a/src/Bloc/BlTelemetryLogger.class.st +++ b/src/Bloc/BlTelemetryLogger.class.st @@ -1,22 +1,20 @@ Class { - #name : 'BlTelemetryLogger', - #superclass : 'MemoryLogger', + #name : #BlTelemetryLogger, + #superclass : #MemoryLogger, #instVars : [ 'telemetryClass' ], - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #category : 'Bloc-Space - Telemetry' } -{ #category : 'initialize' } +{ #category : #initialize } BlTelemetryLogger >> initialize [ super initialize. telemetryClass := BlMemoryTelemetry ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryLogger >> nextPut: aSignal [ (aSignal class == BlTelemetrySignal and: [ aSignal telemetry class == self telemetryClass ]) @@ -25,38 +23,38 @@ BlTelemetryLogger >> nextPut: aSignal [ super nextPut: aSignal ] -{ #category : 'registering' } +{ #category : #registering } BlTelemetryLogger >> start [ super start. self announcer announce: BlTelemetryLoggerStarted new ] -{ #category : 'registering' } +{ #category : #registering } BlTelemetryLogger >> stop [ super stop. self announcer announce: BlTelemetryLoggerStopped new ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryLogger >> telemetryClass [ ^ telemetryClass ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryLogger >> telemetryClass: anObject [ telemetryClass := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryLogger >> totalDuration [ ^ recordings inject: 0 milliSeconds into: [ :total :each | total + each totalDuration ] ] -{ #category : 'announcer - subscription' } +{ #category : #'announcer - subscription' } BlTelemetryLogger >> when: anAnnouncementClass send: aSelector to: anObject [ >#whenSendToTemplate'> (announcer ifNil: [ announcer := Announcer new ]) weak diff --git a/src/Bloc/BlTelemetryLoggerStarted.class.st b/src/Bloc/BlTelemetryLoggerStarted.class.st index 6a7ffd592..81cefa359 100644 --- a/src/Bloc/BlTelemetryLoggerStarted.class.st +++ b/src/Bloc/BlTelemetryLoggerStarted.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlTelemetryLoggerStarted', - #superclass : 'Announcement', - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #name : #BlTelemetryLoggerStarted, + #superclass : #Announcement, + #category : 'Bloc-Space - Telemetry' } diff --git a/src/Bloc/BlTelemetryLoggerStopped.class.st b/src/Bloc/BlTelemetryLoggerStopped.class.st index ad48e62ec..ba74a0463 100644 --- a/src/Bloc/BlTelemetryLoggerStopped.class.st +++ b/src/Bloc/BlTelemetryLoggerStopped.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlTelemetryLoggerStopped', - #superclass : 'Announcement', - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #name : #BlTelemetryLoggerStopped, + #superclass : #Announcement, + #category : 'Bloc-Space - Telemetry' } diff --git a/src/Bloc/BlTelemetrySignal.class.st b/src/Bloc/BlTelemetrySignal.class.st index b828ef009..54901a160 100644 --- a/src/Bloc/BlTelemetrySignal.class.st +++ b/src/Bloc/BlTelemetrySignal.class.st @@ -1,21 +1,19 @@ Class { - #name : 'BlTelemetrySignal', - #superclass : 'BeaconSignal', + #name : #BlTelemetrySignal, + #superclass : #BeaconSignal, #instVars : [ 'task', 'telemetry' ], - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #category : 'Bloc-Space - Telemetry' } -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetrySignal >> duration [ ^ self task duration ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetrySignal >> signal [ @@ -23,24 +21,24 @@ BlTelemetrySignal >> signal [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetrySignal >> task [ ^ task ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetrySignal >> task: aBlTelemetryTask [ task := aBlTelemetryTask ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetrySignal >> telemetry [ ^ telemetry ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetrySignal >> telemetry: anObject [ telemetry := anObject ] diff --git a/src/Bloc/BlTelemetryTask.class.st b/src/Bloc/BlTelemetryTask.class.st index cfdd9cdad..0333c9518 100644 --- a/src/Bloc/BlTelemetryTask.class.st +++ b/src/Bloc/BlTelemetryTask.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlTelemetryTask', - #superclass : 'Object', + #name : #BlTelemetryTask, + #superclass : #Object, #instVars : [ 'startTime', 'endTime', @@ -11,96 +11,94 @@ Class { 'name', 'tasks' ], - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #category : 'Bloc-Space - Telemetry' } -{ #category : 'adding' } +{ #category : #adding } BlTelemetryTask >> addTask: aTelemetryTask [ tasks add: aTelemetryTask ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> childrenOverhead [ ^ self tasks inject: 0 into: [ :aSum :eachTask | aSum + eachTask totalOverhead ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> duration [ ^ self endTime - self startTime - self childrenOverhead ] -{ #category : 'printing' } +{ #category : #printing } BlTelemetryTask >> durationInMilliseconds [ ^ self duration / 1000.0 ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> endTime [ ^ endTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> endTime: anObject [ endTime := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> gcDurationInMilliseconds [ ^ (self gcEndTime - self gcStartTime) ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> gcEndTime [ ^ gcEndTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> gcEndTime: anObject [ gcEndTime := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> gcStartTime [ ^ gcStartTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> gcStartTime: anObject [ gcStartTime := anObject ] -{ #category : 'initialization' } +{ #category : #initialization } BlTelemetryTask >> initialize [ super initialize. tasks := OrderedCollection new ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> name [ ^ name ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> name: anObject [ name := anObject ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> overhead [ ^ (self realEndTime - self realStartTime) - (self endTime - self startTime) ] -{ #category : 'printing' } +{ #category : #printing } BlTelemetryTask >> printDurationInMilliseconds [ ^ self durationInMilliseconds asString, 'ms' ] -{ #category : 'printing' } +{ #category : #printing } BlTelemetryTask >> printOn: aStream [ aStream nextPutAll: self name; space; @@ -109,47 +107,47 @@ BlTelemetryTask >> printOn: aStream [ nextPut: $) ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> realEndTime [ ^ realEndTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> realEndTime: aNumberOfMicroseconds [ realEndTime := aNumberOfMicroseconds ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> realStartTime [ ^ realStartTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> realStartTime: aNumberOfMicroseconds [ realStartTime := aNumberOfMicroseconds ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> startTime [ ^ startTime ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> startTime: aNumberOfMicroseconds [ startTime := aNumberOfMicroseconds ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> tasks [ ^ tasks ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> tasks: aCollectionOfTasks [ tasks := aCollectionOfTasks asOrderedCollection ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTask >> totalOverhead [ ^ self overhead + self childrenOverhead ] diff --git a/src/Bloc/BlTelemetryTasks.class.st b/src/Bloc/BlTelemetryTasks.class.st index 82f2b971b..0544a473f 100644 --- a/src/Bloc/BlTelemetryTasks.class.st +++ b/src/Bloc/BlTelemetryTasks.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlTelemetryTasks', - #superclass : 'LinkedList', - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #name : #BlTelemetryTasks, + #superclass : #LinkedList, + #category : 'Bloc-Space - Telemetry' } -{ #category : 'converting' } +{ #category : #converting } BlTelemetryTasks >> asTask [ ^ self size = 1 ifTrue: [ self first ] @@ -17,7 +15,7 @@ BlTelemetryTasks >> asTask [ tasks: self copy ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTelemetryTasks >> totalDuration [ ^ self ifEmpty: [ 0 seconds ] diff --git a/src/Bloc/BlTextCursor.class.st b/src/Bloc/BlTextCursor.class.st index 21b929eb5..6b5ca32b1 100644 --- a/src/Bloc/BlTextCursor.class.st +++ b/src/Bloc/BlTextCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlTextCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlTextCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlTextCursor >> asForm [ ^ Cursor overEditableText ] diff --git a/src/Bloc/BlTextIndex.class.st b/src/Bloc/BlTextIndex.class.st index 63ead1a1b..51798d936 100644 --- a/src/Bloc/BlTextIndex.class.st +++ b/src/Bloc/BlTextIndex.class.st @@ -6,63 +6,61 @@ See BlTextIndexEOS. " Class { - #name : 'BlTextIndex', - #superclass : 'Magnitude', - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #name : #BlTextIndex, + #superclass : #Magnitude, + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'testing' } +{ #category : #testing } BlTextIndex >> < aNumber [ ^ self index < aNumber ] -{ #category : 'comparing' } +{ #category : #comparing } BlTextIndex >> = anObject [ ^ self index = anObject ] -{ #category : 'converting' } +{ #category : #converting } BlTextIndex >> adaptToInteger: anInteger andCompare: aSymbol [ ^ anInteger perform: aSymbol with: self index ] -{ #category : 'converting' } +{ #category : #converting } BlTextIndex >> adaptToNumber: aNumber andSend: aSymbol [ ^ aNumber perform: aSymbol with: self index ] -{ #category : 'converting' } +{ #category : #converting } BlTextIndex >> asInteger [ ^ self index ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTextIndex >> between: min and: max [ ^ self index between: min and: max ] -{ #category : 'comparing' } +{ #category : #comparing } BlTextIndex >> hash [ ^ self index hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndex >> index [ "Answer the receiver's index as a Number" self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlTextIndex >> isNumber [ "Answer true so that an expression such as: aSmallInteger = aBlCollectionRope size @@ -71,19 +69,19 @@ BlTextIndex >> isNumber [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlTextIndex >> isTextIndex [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlTextIndex >> isZero [ ^ self index isZero ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndex >> max: aMagnitude [ ^ self index > aMagnitude @@ -91,7 +89,7 @@ BlTextIndex >> max: aMagnitude [ ifFalse: [^aMagnitude] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndex >> min: aMagnitude [ ^ self index < aMagnitude diff --git a/src/Bloc/BlTextIndexEOS.class.st b/src/Bloc/BlTextIndexEOS.class.st index 16d2741ed..243b09197 100644 --- a/src/Bloc/BlTextIndexEOS.class.st +++ b/src/Bloc/BlTextIndexEOS.class.st @@ -21,19 +21,17 @@ BlTextIndexEOS defers actual calculation of the index as long as possible, i.e. " Class { - #name : 'BlTextIndexEOS', - #superclass : 'BlTextIndex', + #name : #BlTextIndexEOS, + #superclass : #BlTextIndex, #instVars : [ 'text', 'offset', 'approximateSize' ], - #category : 'Bloc-DataStructure - Rope', - #package : 'Bloc', - #tag : 'DataStructure - Rope' + #category : 'Bloc-DataStructure - Rope' } -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlTextIndexEOS >> + aNumber [ ^ self class new @@ -42,7 +40,7 @@ BlTextIndexEOS >> + aNumber [ yourself ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlTextIndexEOS >> - aNumber [ ^ self class new @@ -51,19 +49,19 @@ BlTextIndexEOS >> - aNumber [ yourself ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlTextIndexEOS >> // aNumber [ ^ self index // aNumber ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlTextIndexEOS >> \\ aNumber [ ^ self index \\ aNumber ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndexEOS >> approximateSize [ "Answer the receiver's text's approximate size. While the text size is not known, use an approximation, e.g. the file size. @@ -75,13 +73,13 @@ BlTextIndexEOS >> approximateSize [ ifFalse: [ approximateSize ifNil: [ approximateSize := text approximateSize ] ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndexEOS >> haveSize [ ^ text isNotNil and: [ text haveSize ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndexEOS >> index [ ^ text @@ -89,24 +87,24 @@ BlTextIndexEOS >> index [ ifNotNil: [ self approximateSize + offset ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlTextIndexEOS >> initialize [ super initialize. offset := 0. ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndexEOS >> offset [ ^ offset ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndexEOS >> offset: anObject [ offset := anObject ] -{ #category : 'printing' } +{ #category : #printing } BlTextIndexEOS >> printOn: aStream [ aStream @@ -116,12 +114,12 @@ BlTextIndexEOS >> printOn: aStream [ << ')' ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndexEOS >> text [ ^ text ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextIndexEOS >> text: anObject [ text := anObject ] diff --git a/src/Bloc/BlTextInputBuffer.class.st b/src/Bloc/BlTextInputBuffer.class.st index 1982dd4ea..1637b6a91 100644 --- a/src/Bloc/BlTextInputBuffer.class.st +++ b/src/Bloc/BlTextInputBuffer.class.st @@ -4,31 +4,29 @@ Collects all the text input events during a frame " Class { - #name : 'BlTextInputBuffer', - #superclass : 'Object', + #name : #BlTextInputBuffer, + #superclass : #Object, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'inputs' ], - #category : 'Bloc-Space - Events', - #package : 'Bloc', - #tag : 'Space - Events' + #category : 'Bloc-Space - Events' } -{ #category : 'enumerating' } +{ #category : #enumerating } BlTextInputBuffer >> initialize [ super initialize. inputs := OrderedCollection new ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlTextInputBuffer >> reset [ inputs removeAll ] -{ #category : 'adding' } +{ #category : #adding } BlTextInputBuffer >> text: aString modifiers: aBlKeyModifiers [ inputs ifEmpty: [ inputs add: (aString -> aBlKeyModifiers copy) ] @@ -38,7 +36,7 @@ BlTextInputBuffer >> text: aString modifiers: aBlKeyModifiers [ ifFalse: [ inputs add: (aString -> aBlKeyModifiers copy) ] ] ] -{ #category : 'enumerating' } +{ #category : #enumerating } BlTextInputBuffer >> textInputEventsDo: aBlock [ inputs do: [ :eachAssoc | aBlock value: (BlTextInputEvent new diff --git a/src/Bloc/BlTextInputEvent.class.st b/src/Bloc/BlTextInputEvent.class.st index a1f26e2fd..4dc69abf0 100644 --- a/src/Bloc/BlTextInputEvent.class.st +++ b/src/Bloc/BlTextInputEvent.class.st @@ -5,32 +5,30 @@ I usually represent a single character, but I can be composed of multiples code " Class { - #name : 'BlTextInputEvent', - #superclass : 'BlUIEvent', + #name : #BlTextInputEvent, + #superclass : #BlUIEvent, #instVars : [ 'text' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'testing' } +{ #category : #testing } BlTextInputEvent >> isTextInput [ ^ true ] -{ #category : 'sending' } +{ #category : #sending } BlTextInputEvent >> sendTo: anObject [ anObject textInputEvent: self ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextInputEvent >> text [ ^ text ] -{ #category : 'accessing' } +{ #category : #accessing } BlTextInputEvent >> text: anObject [ text := anObject ] diff --git a/src/Bloc/BlTime.class.st b/src/Bloc/BlTime.class.st index 07e6c8978..63d6d201d 100644 --- a/src/Bloc/BlTime.class.st +++ b/src/Bloc/BlTime.class.st @@ -5,38 +5,36 @@ Bloc components must not directly rely on system time or hardcode it in any plac " Class { - #name : 'BlTime', - #superclass : 'Object', + #name : #BlTime, + #superclass : #Object, #instVars : [ 'frozenTime', 'frozen' ], - #category : 'Bloc-Universe', - #package : 'Bloc', - #tag : 'Universe' + #category : 'Bloc-Universe' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTime class >> fastForwarded [ ^ BlFastForwardedTime new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTime class >> real [ ^ BlRealTime new ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTime class >> simulated [ ^ BlSimulatedTime new ] -{ #category : 'private - time' } +{ #category : #'private - time' } BlTime >> currentTime [ ^ self subclassResponsibility ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlTime >> every: aDuration during: aLoopDuration do: aDoBlock [ | aStartTime | @@ -48,7 +46,7 @@ BlTime >> every: aDuration during: aLoopDuration do: aDoBlock [ do: aDoBlock ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlTime >> every: aDuration times: aCountOfRepeats do: aDoBlock [ "Evaluate a aDoBlock a given amount of times waiting a provided amount of time between executions. The first evaluation of a aDoBlock is instant. @@ -62,7 +60,7 @@ BlTime >> every: aDuration times: aCountOfRepeats do: aDoBlock [ do: aDoBlock ] -{ #category : 'api - enumeration' } +{ #category : #'api - enumeration' } BlTime >> every: aDuration while: aWhileBlock do: aDoBlock [ "Evaluate a aDoBlock while aWhileBlock evaluates to true waiting a given amount of time between executions. The first evaluation of a aDoBlock is instant. @@ -71,14 +69,14 @@ BlTime >> every: aDuration while: aWhileBlock do: aDoBlock [ self subclassResponsibility ] -{ #category : 'initialization' } +{ #category : #initialization } BlTime >> initialize [ super initialize. frozen := false ] -{ #category : 'api - time' } +{ #category : #'api - time' } BlTime >> now [ "Return a 'current' date and time, it is not necessarily a real one" @@ -88,12 +86,12 @@ BlTime >> now [ ifFalse: [ self currentTime ] ] -{ #category : 'printing' } +{ #category : #printing } BlTime >> printOn: aStream [ self now printOn: aStream ] -{ #category : 'api - time' } +{ #category : #'api - time' } BlTime >> synchronized: aBlock [ "Make this time instance synchronized among all users. During evaluation of aBlock #now will return the same time, independent of @@ -106,7 +104,7 @@ BlTime >> synchronized: aBlock [ frozenTime := nil ] ] -{ #category : 'api - time' } +{ #category : #'api - time' } BlTime >> wait: aDuration [ "Advance clock by waiting for a given amount of time" diff --git a/src/Bloc/BlTopAlignment.class.st b/src/Bloc/BlTopAlignment.class.st index 41e64950d..a0e2005f0 100644 --- a/src/Bloc/BlTopAlignment.class.st +++ b/src/Bloc/BlTopAlignment.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlTopAlignment', - #superclass : 'BlVerticalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlTopAlignment, + #superclass : #BlVerticalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlTopAlignment class >> initialize [ super initialize. ] -{ #category : 'factory' } +{ #category : #factory } BlTopAlignment class >> leftToRight [ ^ self top ] -{ #category : 'factory' } +{ #category : #factory } BlTopAlignment class >> rightToLeft [ ^ self top ] -{ #category : 'factory' } +{ #category : #factory } BlTopAlignment >> inverted [ ^ BlElementAlignment horizontal start ] -{ #category : 'factory' } +{ #category : #factory } BlTopAlignment >> swap [ ^ BlElementAlignment bottom ] -{ #category : 'translation' } +{ #category : #translation } BlTopAlignment >> translationOf: aBounds in: aContainerBounds [ diff --git a/src/Bloc/BlTransformationBuilder.class.st b/src/Bloc/BlTransformationBuilder.class.st index 19d883f88..3b2aa05b1 100644 --- a/src/Bloc/BlTransformationBuilder.class.st +++ b/src/Bloc/BlTransformationBuilder.class.st @@ -12,19 +12,17 @@ element transform " Class { - #name : 'BlTransformationBuilder', - #superclass : 'Object', + #name : #BlTransformationBuilder, + #superclass : #Object, #instVars : [ 'origin', 'target', 'affineCompositeTransformation' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTransformationBuilder class >> on: anObject [ ^ self new @@ -32,7 +30,7 @@ BlTransformationBuilder class >> on: anObject [ yourself ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> apply [ "Replace element's transformation chain with our new one that we just have built" @@ -40,13 +38,13 @@ BlTransformationBuilder >> apply [ (BlElementLocalTransformation newWith: affineCompositeTransformation) ] -{ #category : 'origin' } +{ #category : #origin } BlTransformationBuilder >> centerOrigin [ self origin: BlAffineTransformationCenterOrigin defaultInstance ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> flipX [ affineCompositeTransformation addTransformation: @@ -55,7 +53,7 @@ BlTransformationBuilder >> flipX [ yourself) ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> flipY [ affineCompositeTransformation addTransformation: @@ -64,7 +62,7 @@ BlTransformationBuilder >> flipY [ yourself) ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> inherit [ "Append existing element's transformations to the new transformation list" @@ -72,7 +70,7 @@ BlTransformationBuilder >> inherit [ affineCompositeTransformation addTransformation: each ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlTransformationBuilder >> initialize [ super initialize. @@ -81,7 +79,7 @@ BlTransformationBuilder >> initialize [ origin := BlAffineTransformationCenterOrigin defaultInstance ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> matrix: aMatrix [ "Note: matrix transformation is not influenced by origin (it is always top left corner or 0@0)" @@ -92,7 +90,7 @@ BlTransformationBuilder >> matrix: aMatrix [ yourself) ] -{ #category : 'origin' } +{ #category : #origin } BlTransformationBuilder >> normalizedOrigin: aPoint [ "Set a normalized position, where top-left is 0@0 and bottom-right is 1@1. Negative and greater-than-one values are allowed." @@ -100,7 +98,7 @@ BlTransformationBuilder >> normalizedOrigin: aPoint [ origin := BlAffineTransformationNormalizedPositionOrigin position: aPoint ] -{ #category : 'origin' } +{ #category : #origin } BlTransformationBuilder >> origin: anAffineTransformationOrigin [ "Change transformation origin for all future transformations. Note: I do not change origins of already exisiting transformations" @@ -108,13 +106,13 @@ BlTransformationBuilder >> origin: anAffineTransformationOrigin [ origin := anAffineTransformationOrigin ] -{ #category : 'origin' } +{ #category : #origin } BlTransformationBuilder >> rightCenterOrigin [ self origin: BlAffineTransformationRightCenterOrigin new ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> rotateBy: aDegreesAngle [ affineCompositeTransformation addTransformation: @@ -125,7 +123,7 @@ BlTransformationBuilder >> rotateBy: aDegreesAngle [ yourself) ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> rotateBy: aDegreesAngle around: aVector [ affineCompositeTransformation addTransformation: @@ -136,7 +134,7 @@ BlTransformationBuilder >> rotateBy: aDegreesAngle around: aVector [ yourself) ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> scaleBy: aVector [ | aScaleVector | @@ -150,7 +148,7 @@ BlTransformationBuilder >> scaleBy: aVector [ yourself) ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> shearBy: aCoefficientPoint [ affineCompositeTransformation addTransformation: @@ -160,7 +158,7 @@ BlTransformationBuilder >> shearBy: aCoefficientPoint [ yourself) ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> skewX: anAngleInDegrees [ affineCompositeTransformation addTransformation: @@ -170,7 +168,7 @@ BlTransformationBuilder >> skewX: anAngleInDegrees [ yourself) ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> skewY: anAngleInDegrees [ affineCompositeTransformation addTransformation: @@ -180,7 +178,7 @@ BlTransformationBuilder >> skewY: anAngleInDegrees [ yourself) ] -{ #category : 'accessing' } +{ #category : #accessing } BlTransformationBuilder >> target [ "Return a target object whose transformation we build" @@ -188,19 +186,19 @@ BlTransformationBuilder >> target [ ^ target ] -{ #category : 'accessing' } +{ #category : #accessing } BlTransformationBuilder >> target: anObject [ target := anObject ] -{ #category : 'origin' } +{ #category : #origin } BlTransformationBuilder >> topLeftOrigin [ self origin: BlAffineTransformationTopLeftOrigin new ] -{ #category : 'transformations' } +{ #category : #transformations } BlTransformationBuilder >> translateBy: aBlVector [ "Append a translation transformation by a given vector" diff --git a/src/Bloc/BlTranslationTransformation.class.st b/src/Bloc/BlTranslationTransformation.class.st index 6578d4d0d..9db733a1c 100644 --- a/src/Bloc/BlTranslationTransformation.class.st +++ b/src/Bloc/BlTranslationTransformation.class.st @@ -6,17 +6,15 @@ https://drafts.csswg.org/css-transforms/#valdef-transform-translate " Class { - #name : 'BlTranslationTransformation', - #superclass : 'BlAffineTransformation', + #name : #BlTranslationTransformation, + #superclass : #BlAffineTransformation, #instVars : [ 'translation' ], - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #category : 'Bloc-Basic-Transformations' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTranslationTransformation class >> translation: aBlVector [ ^ self new @@ -24,7 +22,7 @@ BlTranslationTransformation class >> translation: aBlVector [ yourself ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTranslationTransformation class >> x: aX y: aY z: aZ [ ^ self new @@ -32,7 +30,7 @@ BlTranslationTransformation class >> x: aX y: aY z: aZ [ yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlTranslationTransformation >> initialize [ super initialize. @@ -40,25 +38,25 @@ BlTranslationTransformation >> initialize [ translation := BlVector zero ] -{ #category : 'testing' } +{ #category : #testing } BlTranslationTransformation >> is2D [ ^ translation z isZero ] -{ #category : 'testing' } +{ #category : #testing } BlTranslationTransformation >> isTranslation [ ^ true ] -{ #category : 'mathematical functions' } +{ #category : #'mathematical functions' } BlTranslationTransformation >> multiplyOn: aBlMatrix [ aBlMatrix translateBy: translation ] -{ #category : 'printing' } +{ #category : #printing } BlTranslationTransformation >> printOn: aStream [ aStream nextPutAll: 'Translation by '. @@ -66,13 +64,13 @@ BlTranslationTransformation >> printOn: aStream [ translation printOn: aStream ] -{ #category : 'accessing' } +{ #category : #accessing } BlTranslationTransformation >> translation [ ^ translation ] -{ #category : 'accessing' } +{ #category : #accessing } BlTranslationTransformation >> translation: aVector [ translation := aVector asTranslate3D diff --git a/src/Bloc/BlTransparentBackground.class.st b/src/Bloc/BlTransparentBackground.class.st index 3e36b46b5..5bffaaed0 100644 --- a/src/Bloc/BlTransparentBackground.class.st +++ b/src/Bloc/BlTransparentBackground.class.st @@ -4,24 +4,22 @@ It is recommended to refer my unique instance since I am stateless and my superc " Class { - #name : 'BlTransparentBackground', - #superclass : 'BlBackground', + #name : #BlTransparentBackground, + #superclass : #BlBackground, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-Background', - #package : 'Bloc', - #tag : 'Basic-Background' + #category : 'Bloc-Basic-Background' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlTransparentBackground class >> cleanUp [ super cleanUp. uniqueInstance := nil ] -{ #category : 'accessing' } +{ #category : #accessing } BlTransparentBackground class >> uniqueInstance [ "Return a unique instance of transparent backgrond. It is preferable to use unique instance than create a new every time" @@ -30,14 +28,14 @@ BlTransparentBackground class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'testing' } +{ #category : #testing } BlTransparentBackground >> isTransparent [ "I am transparent by definition" ^ true ] -{ #category : 'geometry' } +{ #category : #geometry } BlTransparentBackground >> matchExtent: anExtent [ "Do nothing for the transparent background" ] diff --git a/src/Bloc/BlTransparentPaint.class.st b/src/Bloc/BlTransparentPaint.class.st index 93476d886..4485ca694 100644 --- a/src/Bloc/BlTransparentPaint.class.st +++ b/src/Bloc/BlTransparentPaint.class.st @@ -6,34 +6,32 @@ It is prefereable to refer my unique instance, since I am stateless " Class { - #name : 'BlTransparentPaint', - #superclass : 'BlColorPaint', + #name : #BlTransparentPaint, + #superclass : #BlColorPaint, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Paint', - #package : 'Bloc', - #tag : 'Paint' + #category : 'Bloc-Paint' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlTransparentPaint class >> cleanUp [ super cleanUp. uniqueInstance := nil ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTransparentPaint class >> color: aColor [ self shouldNotImplement ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlTransparentPaint class >> transparent [ self shouldNotImplement ] -{ #category : 'accessing' } +{ #category : #accessing } BlTransparentPaint class >> uniqueInstance [ "Return a unique instance of transparent paint. It is preferable to use unique instance than create a new every time" @@ -42,19 +40,19 @@ BlTransparentPaint class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlTransparentPaint >> color: aColor [ self shouldNotImplement ] -{ #category : 'initialization' } +{ #category : #initialization } BlTransparentPaint >> initialize [ super initialize. color := Color transparent ] -{ #category : 'testing' } +{ #category : #testing } BlTransparentPaint >> isOpaque [ "I am transparent by definition and therefore always return false" @@ -62,7 +60,7 @@ BlTransparentPaint >> isOpaque [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlTransparentPaint >> isTransparent [ "I am transparent by definition and therefore always return true" diff --git a/src/Bloc/BlTriangleGeometry.class.st b/src/Bloc/BlTriangleGeometry.class.st index 0c99bf727..7ae13b1ba 100644 --- a/src/Bloc/BlTriangleGeometry.class.st +++ b/src/Bloc/BlTriangleGeometry.class.st @@ -1,6 +1,6 @@ Class { - #name : 'BlTriangleGeometry', - #superclass : 'BlElementVectorGeometry', + #name : #BlTriangleGeometry, + #superclass : #BlElementVectorGeometry, #instVars : [ 'orientation' ], @@ -10,12 +10,10 @@ Class { 'Right', 'Top' ], - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #category : 'Bloc-Basic-Geometry' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlTriangleGeometry class >> initialize [ Top := #top. Right := #right. @@ -23,31 +21,31 @@ BlTriangleGeometry class >> initialize [ Left := #left ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlTriangleGeometry >> beBottom [ orientation := Bottom. self releaseCache ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlTriangleGeometry >> beLeft [ orientation := Left. self releaseCache ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlTriangleGeometry >> beRight [ orientation := Right. self releaseCache ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } BlTriangleGeometry >> beTop [ orientation := Top. self releaseCache ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlTriangleGeometry >> computeBottomVertices [ | aHeight aWidth aHalfWidth | @@ -62,7 +60,7 @@ BlTriangleGeometry >> computeBottomVertices [ } ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlTriangleGeometry >> computeLeftVertices [ | aHeight aWidth aHalfHeight | @@ -77,7 +75,7 @@ BlTriangleGeometry >> computeLeftVertices [ } ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlTriangleGeometry >> computeRightVertices [ | aHeight aWidth aHalfHeight | @@ -92,7 +90,7 @@ BlTriangleGeometry >> computeRightVertices [ } ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlTriangleGeometry >> computeTopVertices [ | aHeight aWidth aHalfWidth | @@ -107,7 +105,7 @@ BlTriangleGeometry >> computeTopVertices [ } ] -{ #category : 'private - geometry' } +{ #category : #'private - geometry' } BlTriangleGeometry >> computeVertices [ ^ self isTop ifTrue: [ self computeTopVertices ] @@ -123,52 +121,52 @@ BlTriangleGeometry >> computeVertices [ ifFalse: [ self error: ('Triangle has unsupported orientation ({1})' format: { orientation }) ] ] ] ] ] -{ #category : 'geometry testing' } +{ #category : #'geometry testing' } BlTriangleGeometry >> containsPoint: aPoint alreadyInGeometryBoundsOf: aBlElement [ ^ BlPolygonHitTester doPolygonBy: self computeVertices include: aPoint ] -{ #category : 'testing' } +{ #category : #testing } BlTriangleGeometry >> hasCaps [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlTriangleGeometry >> hasJoins [ ^ true ] -{ #category : 'initialization' } +{ #category : #initialization } BlTriangleGeometry >> initialize [ super initialize. orientation := Right. ] -{ #category : 'testing' } +{ #category : #testing } BlTriangleGeometry >> isBottom [ ^ orientation = Bottom ] -{ #category : 'testing' } +{ #category : #testing } BlTriangleGeometry >> isLeft [ ^ orientation = Left ] -{ #category : 'testing' } +{ #category : #testing } BlTriangleGeometry >> isRight [ ^ orientation = Right ] -{ #category : 'testing' } +{ #category : #testing } BlTriangleGeometry >> isTop [ ^ orientation = Top ] -{ #category : 'geometry' } +{ #category : #geometry } BlTriangleGeometry >> matchExtent: aPoint [ extent := aPoint ] diff --git a/src/Bloc/BlUIEvent.class.st b/src/Bloc/BlUIEvent.class.st index 44eb30da2..1dc7e5211 100644 --- a/src/Bloc/BlUIEvent.class.st +++ b/src/Bloc/BlUIEvent.class.st @@ -1,46 +1,44 @@ Class { - #name : 'BlUIEvent', - #superclass : 'BlEvent', + #name : #BlUIEvent, + #superclass : #BlEvent, #instVars : [ 'modifiers' ], - #category : 'Bloc-Events', - #package : 'Bloc', - #tag : 'Events' + #category : 'Bloc-Events' } -{ #category : 'converting' } +{ #category : #converting } BlUIEvent >> asDictionaryForExport [ ^ super asDictionaryForExport at: #modifiers put: modifiers printString; yourself ] -{ #category : 'initialization' } +{ #category : #initialization } BlUIEvent >> initialize [ super initialize. modifiers := BlKeyModifiers new ] -{ #category : 'testing' } +{ #category : #testing } BlUIEvent >> isUIEvent [ ^ true ] -{ #category : 'accessing' } +{ #category : #accessing } BlUIEvent >> modifiers [ ^ modifiers ] -{ #category : 'accessing' } +{ #category : #accessing } BlUIEvent >> modifiers: aBlKeyModifiers [ modifiers := aBlKeyModifiers ] -{ #category : 'printing' } +{ #category : #printing } BlUIEvent >> printOn: aStream [ aStream nextPutAll: self class name; diff --git a/src/Bloc/BlUniqueIdGenerator.class.st b/src/Bloc/BlUniqueIdGenerator.class.st index 5481eba3b..02854f998 100644 --- a/src/Bloc/BlUniqueIdGenerator.class.st +++ b/src/Bloc/BlUniqueIdGenerator.class.st @@ -1,16 +1,14 @@ Class { - #name : 'BlUniqueIdGenerator', - #superclass : 'Object', + #name : #BlUniqueIdGenerator, + #superclass : #Object, #instVars : [ 'mutex', 'nextUniqueId' ], - #category : 'Bloc-Space - Support', - #package : 'Bloc', - #tag : 'Space - Support' + #category : 'Bloc-Space - Support' } -{ #category : 'accessing' } +{ #category : #accessing } BlUniqueIdGenerator >> generateUniqueId [ ^ mutex critical: [ | uniqueId | @@ -20,7 +18,7 @@ BlUniqueIdGenerator >> generateUniqueId [ uniqueId ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlUniqueIdGenerator >> initialize [ super initialize. diff --git a/src/Bloc/BlUnit.class.st b/src/Bloc/BlUnit.class.st index 84781710c..b0eccaf0d 100644 --- a/src/Bloc/BlUnit.class.st +++ b/src/Bloc/BlUnit.class.st @@ -1,51 +1,49 @@ Class { - #name : 'BlUnit', - #superclass : 'Object', + #name : #BlUnit, + #superclass : #Object, #classInstVars : [ 'uniqueInstance' ], - #category : 'Bloc-Basic-Units', - #package : 'Bloc', - #tag : 'Basic-Units' + #category : 'Bloc-Basic-Units' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlUnit class >> em [ ^ BlEmUnit uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlUnit class >> percent [ ^ BlPercentUnit uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlUnit class >> pt [ ^ BlPtUnit uniqueInstance ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlUnit class >> rem [ ^ BlRemUnit uniqueInstance ] -{ #category : 'accessing' } +{ #category : #accessing } BlUnit class >> uniqueInstance [ ^ uniqueInstance ifNil: [ uniqueInstance := self new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlUnit >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'comparing' } +{ #category : #comparing } BlUnit >> hash [ ^ self class hash ] -{ #category : 'accessing' } +{ #category : #accessing } BlUnit >> resolveLengthForValue: aCurrentValueOrBlock parent: aParentValueOrBlock global: aGlobalValueOrBlock [ diff --git a/src/Bloc/BlUniverseEventListener.class.st b/src/Bloc/BlUniverseEventListener.class.st index 1c9075e70..7cfbb5979 100644 --- a/src/Bloc/BlUniverseEventListener.class.st +++ b/src/Bloc/BlUniverseEventListener.class.st @@ -1,26 +1,24 @@ Class { - #name : 'BlUniverseEventListener', - #superclass : 'BlBasicEventHandler', + #name : #BlUniverseEventListener, + #superclass : #BlBasicEventHandler, #traits : 'TBlDebug', #classTraits : 'TBlDebug classTrait', #instVars : [ 'lastTime' ], - #category : 'Bloc-Universe - Parallel', - #package : 'Bloc', - #tag : 'Universe - Parallel' + #category : 'Bloc-Universe - Parallel' } -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlUniverseEventListener >> handleEvent: anEvent [ anEvent sendTo: self ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlUniverseEventListener >> universeEventsArrived: anEvent [ ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlUniverseEventListener >> universeEventsCleared: anEvent [ | nowTime | "Once all events are handled it is time to tell spaces to redraw themselves" @@ -42,15 +40,15 @@ BlUniverseEventListener >> universeEventsCleared: anEvent [ lastTime := nowTime ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlUniverseEventListener >> universeResumed: anEvent [ ] -{ #category : 'as yet unclassified' } +{ #category : #'as yet unclassified' } BlUniverseEventListener >> universeSuspended: anEvent [ ] -{ #category : 'api - event managing' } +{ #category : #'api - event managing' } BlUniverseEventListener >> wantsEvent: anEvent [ ^ anEvent isUniverseEvent ] diff --git a/src/Bloc/BlUseAsyncFeatures.class.st b/src/Bloc/BlUseAsyncFeatures.class.st index 4df095462..dff4ae6a2 100644 --- a/src/Bloc/BlUseAsyncFeatures.class.st +++ b/src/Bloc/BlUseAsyncFeatures.class.st @@ -12,19 +12,17 @@ In the cases where the async should be disabled, {{gtMethod:BlUseAsyncFeatures c " Class { - #name : 'BlUseAsyncFeatures', - #superclass : 'DynamicVariable', - #category : 'Bloc-Space - Tasks', - #package : 'Bloc', - #tag : 'Space - Tasks' + #name : #BlUseAsyncFeatures, + #superclass : #DynamicVariable, + #category : 'Bloc-Space - Tasks' } -{ #category : 'controlling' } +{ #category : #controlling } BlUseAsyncFeatures class >> disableDuring: aBlock [ ^ self value: false during: aBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlUseAsyncFeatures class >> enabled [ "Answer true if using async operations (TaskIt) is enabled in a particular process. The default is true." @@ -34,24 +32,24 @@ BlUseAsyncFeatures class >> enabled [ ifNotNil: [ :value | value ] ] -{ #category : 'controlling' } +{ #category : #controlling } BlUseAsyncFeatures class >> ifDisabledDo: aSyncBlock [ ^ self ifEnabledDo: [ "do nothing" ] otherwise: aSyncBlock ] -{ #category : 'controlling' } +{ #category : #controlling } BlUseAsyncFeatures class >> ifEnabledDo: anAsyncBlock [ ^ self ifEnabledDo: anAsyncBlock otherwise: [ "do nothing" ] ] -{ #category : 'controlling' } +{ #category : #controlling } BlUseAsyncFeatures class >> ifEnabledDo: anAsyncBlock otherwise: aSyncBlock [ ^ self enabled ifTrue: anAsyncBlock ifFalse: aSyncBlock ] -{ #category : 'accessing' } +{ #category : #accessing } BlUseAsyncFeatures >> enabled [ "Answer if converting to TaskIt is enabled. The default is true." diff --git a/src/Bloc/BlValueWithUnit.class.st b/src/Bloc/BlValueWithUnit.class.st index d417e0866..068ed1193 100644 --- a/src/Bloc/BlValueWithUnit.class.st +++ b/src/Bloc/BlValueWithUnit.class.st @@ -6,46 +6,44 @@ The {{gtMethod:BlValueWithUnit>>#value|label=value}} can be any object, but in m " Class { - #name : 'BlValueWithUnit', - #superclass : 'Object', + #name : #BlValueWithUnit, + #superclass : #Object, #instVars : [ 'value', 'unit' ], - #category : 'Bloc-Basic-Units', - #package : 'Bloc', - #tag : 'Basic-Units' + #category : 'Bloc-Basic-Units' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlValueWithUnit class >> em: aNumber [ ^ self new value: aNumber; unit: BlUnit em ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlValueWithUnit class >> percent: aNumber [ ^ self new value: aNumber; unit: BlUnit percent ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlValueWithUnit class >> pt: aNumber [ ^ self new value: aNumber; unit: BlUnit pt ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlValueWithUnit class >> rem: aNumber [ ^ self new value: aNumber; unit: BlUnit rem ] -{ #category : 'comparing' } +{ #category : #comparing } BlValueWithUnit >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -56,14 +54,14 @@ BlValueWithUnit >> = anObject [ ^ value = anObject value and: [ unit = anObject unit ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlValueWithUnit >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ value hash bitXor: unit hash ] -{ #category : 'initialization' } +{ #category : #initialization } BlValueWithUnit >> initialize [ super initialize. @@ -71,31 +69,31 @@ BlValueWithUnit >> initialize [ unit := BlUnit pt. ] -{ #category : 'printing' } +{ #category : #printing } BlValueWithUnit >> printOn: aStream [ aStream print: self value; print: self unit ] -{ #category : 'accessing' } +{ #category : #accessing } BlValueWithUnit >> unit [ ^ unit ] -{ #category : 'accessing' } +{ #category : #accessing } BlValueWithUnit >> unit: aBlUnit [ unit := aBlUnit ] -{ #category : 'accessing' } +{ #category : #accessing } BlValueWithUnit >> value [ ^ value ] -{ #category : 'accessing' } +{ #category : #accessing } BlValueWithUnit >> value: anObject [ value := anObject ] diff --git a/src/Bloc/BlVector.class.st b/src/Bloc/BlVector.class.st index f35b2616a..ef23e3a92 100644 --- a/src/Bloc/BlVector.class.st +++ b/src/Bloc/BlVector.class.st @@ -23,8 +23,8 @@ Create a 3D vector: " Class { - #name : 'BlVector', - #superclass : 'Object', + #name : #BlVector, + #superclass : #Object, #classVars : [ 'One', 'XAxis', @@ -32,12 +32,10 @@ Class { 'ZAxis', 'Zero' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlVector class >> cleanUp [ super cleanUp. @@ -48,7 +46,7 @@ BlVector class >> cleanUp [ One := nil ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlVector class >> one [ "Return a vector with all components being ones." @@ -56,19 +54,19 @@ BlVector class >> one [ ^ One ifNil: [ One := self x: 1 y: 1 z: 1 ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlVector class >> x: aX y: aY [ ^ BlVector2D new x: aX y: aY ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlVector class >> x: aX y: aY z: aZ [ "Return a 3 dimensional vector." ^ BlVector3D new x: aX y: aY z: aZ ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlVector class >> xAxis [ "Return a vector that corresponds to x-axis" @@ -76,7 +74,7 @@ BlVector class >> xAxis [ ^ XAxis ifNil: [ XAxis := self x: 1 y: 0 z: 0 ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlVector class >> yAxis [ "Return a vector that corresponds to y-axis" @@ -84,7 +82,7 @@ BlVector class >> yAxis [ ^ YAxis ifNil: [ YAxis := self x: 0 y: 1 z: 0 ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlVector class >> zAxis [ "Return a vector that corresponds to z-axis" @@ -92,7 +90,7 @@ BlVector class >> zAxis [ ^ ZAxis ifNil: [ ZAxis := self x: 0 y: 0 z: 1 ] ] -{ #category : 'instance creation' } +{ #category : #'instance creation' } BlVector class >> zero [ "Return a vector of zero length." @@ -100,148 +98,148 @@ BlVector class >> zero [ ^ Zero ifNil: [ Zero := self x: 0 y: 0 z: 0 ] ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> * aScalar [ "Return a new vector as a multiplicate of the receiver by a given scalar (it can be a number, point, or vector)." ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> + anotherVector [ "Perform an addition of a given vector and me" ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> - anotherVector [ "Perform a subtraction of a given vector from me and return a resulting vector" ^ self subclassResponsibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlVector >> = anObject [ ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> add2D: aVector2D [ "Add the receiver to a given 2D vector." ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> add3D: aVector3D [ "Add the receiver to a given 3D vector." ^ self subclassResponsibility ] -{ #category : 'converting' } +{ #category : #converting } BlVector >> asBlocVector [ ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlVector >> asScale3D [ "Return a `BlVector3D` representing a scale factor." ^ self subclassResponsibility ] -{ #category : 'converting' } +{ #category : #converting } BlVector >> asTranslate3D [ "Return a `BlVector3D` representing a translation vector." ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> dotProduct2D: anotherVector [ ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> dotProduct: anotherVector [ ^ self subclassResponsibility ] -{ #category : 'comparing' } +{ #category : #comparing } BlVector >> hash [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlVector >> isOne [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : #testing } BlVector >> isParallel: aBlVector [ ^ (self dotProduct: aBlVector) abs closeTo: 1.0 ] -{ #category : 'testing' } +{ #category : #testing } BlVector >> isZero [ ^ self length isZero ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector >> length [ ^ self subclassResponsibility ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector >> negated [ ^ self subclassResponsibility ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector >> normal [ "Return a unit vector rotated clockwise. For the zero length vector return (-1, 0)." ^ self subclassResponsibility ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector >> normalized [ ^ self subclassResponsibility ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector >> rotateBy: anAngleInRadians [ self rotateBy: anAngleInRadians about: 0 @ 0 ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector >> rotateBy: anAngleInRadians about: aCenterPoint [ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> scalarMultiplicate2D: aVector2D [ "Answer a new `BlVector2D` with the multiplication of me with the received argument." ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> scalarMultiplicate3D: aVector3D [ "Return a new vector by performing a scalar multiplication of a given 3D vector by me." @@ -249,12 +247,12 @@ BlVector >> scalarMultiplicate3D: aVector3D [ ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> sign [ ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> subtract2D: aVector2D [ "Substruct me from a given 2D vector" @@ -262,7 +260,7 @@ BlVector >> subtract2D: aVector2D [ ^ self subclassResponsibility ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector >> subtract3D: aVector3D [ "Substruct me from a given 3D vector" diff --git a/src/Bloc/BlVector2D.class.st b/src/Bloc/BlVector2D.class.st index 2ffcb1f12..4be8d35d2 100644 --- a/src/Bloc/BlVector2D.class.st +++ b/src/Bloc/BlVector2D.class.st @@ -16,39 +16,37 @@ Instance creation: " Class { - #name : 'BlVector2D', - #superclass : 'BlVector', + #name : #BlVector2D, + #superclass : #BlVector, #instVars : [ 'x', 'y' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> * aScalar [ "Return a new vector as a multiplicate of the receiver by a given scalar (it can be a number, point, or vector)." ^ aScalar scalarMultiplicate2D: self ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> + anotherVector [ "Answer a new vector that represents the addition of a given vector and me." ^ anotherVector add2D: self ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> - anotherVector [ "Answer a new vector that represents the subtraction of a given vector from me." ^ anotherVector subtract2D: self ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> / aVectorizable [ "Answer a new `BlVector2D` that represents the division of self by the argument, which can be either a `BlVector`, a `Point` or an `Integer`." @@ -60,7 +58,7 @@ BlVector2D >> / aVectorizable [ y: y / vector y ] -{ #category : 'comparing' } +{ #category : #comparing } BlVector2D >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -69,21 +67,21 @@ BlVector2D >> = anObject [ ^ x = anObject x and: [ y = anObject y ] ] -{ #category : 'converting' } +{ #category : #converting } BlVector2D >> adaptToNumber: aNumber andSend: aSelector [ "If I am involved in arithmetic with an Integer, convert it to a Vector of the same dimension" ^ (self class x: aNumber y: aNumber) perform: aSelector with: self ] -{ #category : 'converting' } +{ #category : #converting } BlVector2D >> adaptToPoint: aPoint andSend: aSelector [ "If I am involved in arithmetic with an Point, convert me to a point and perform that operation" ^ aPoint perform: aSelector with: self asPoint ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> add2D: aVector2D [ "Answer a new vector that represents the addition of a given vector and me." @@ -92,7 +90,7 @@ BlVector2D >> add2D: aVector2D [ y: aVector2D y + y ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> add3D: aVector3D [ "Answer a new 3D vector that represents the addition of a given vector and me." @@ -102,76 +100,76 @@ BlVector2D >> add3D: aVector3D [ z: aVector3D z ] -{ #category : 'converting' } +{ #category : #converting } BlVector2D >> asPoint [ ^ x @ y ] -{ #category : 'converting' } +{ #category : #converting } BlVector2D >> asScale3D [ "Return a 3D vector representing a scale factor." ^ BlVector3D x: x y: y z: 1 ] -{ #category : 'converting' } +{ #category : #converting } BlVector2D >> asTranslate3D [ "Return a 3D vector representing a translation vector." ^ BlVector3D x: x y: y z: 0 ] -{ #category : 'comparing' } +{ #category : #comparing } BlVector2D >> closeTo: anotherVector [ ^ (x closeTo: anotherVector x) and: [ y closeTo: anotherVector y ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlVector2D >> degrees [ "Return the receiver degrees" ^ self radians * 180.0 / Float pi ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> dotProduct2D: anotherVector [ ^ x * anotherVector x + (y * anotherVector y) ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> dotProduct: anotherVector [ ^ anotherVector dotProduct2D: self ] -{ #category : 'comparing' } +{ #category : #comparing } BlVector2D >> hash [ ^ x hash bitXor: y hash ] -{ #category : 'testing' } +{ #category : #testing } BlVector2D >> isOne [ ^ (x closeTo: 1.0) and: [ y closeTo: 1.0 ] ] -{ #category : 'testing' } +{ #category : #testing } BlVector2D >> isZero [ ^ x isZero and: [ y isZero ] ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector2D >> length [ ^ ((x * x) + (y * y)) sqrt ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector2D >> negated [ ^ self class @@ -179,14 +177,14 @@ BlVector2D >> negated [ y: y negated ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector2D >> normal [ "Return a unit vector rotated clockwise. For the zero length vector, return (-1, 0)." ^ self asPoint normal asBlocVector ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector2D >> normalized [ | aLength | @@ -200,7 +198,7 @@ BlVector2D >> normalized [ y: y / aLength ] -{ #category : 'printing' } +{ #category : #printing } BlVector2D >> printOn: aStream [ aStream @@ -211,7 +209,7 @@ BlVector2D >> printOn: aStream [ nextPut: $) ] -{ #category : 'accessing' } +{ #category : #accessing } BlVector2D >> radians [ "Return vector radians" @@ -230,7 +228,7 @@ BlVector2D >> radians [ ^ aResult ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector2D >> rotateBy: anAngleInRadians about: aCenterPoint [ "Rotate me by an angle in CCW radians. Warning 1: Even though Point.theta is measured CW, this rotates with the more conventional CCW interpretateion of angle. @@ -246,7 +244,7 @@ BlVector2D >> rotateBy: anAngleInRadians about: aCenterPoint [ y: aCenterPoint y asFloat - (r * theta sin) ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> scalarMultiplicate2D: aVector2D [ "Answer a new `BlVector2D` with the multiplication of me with the received argument." @@ -255,14 +253,14 @@ BlVector2D >> scalarMultiplicate2D: aVector2D [ y: aVector2D y * y ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> sign [ "Returns a vector as the receiver sign." ^ self class x: x sign y: y sign ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> subtract2D: aVector2D [ "Answer a new `BlVector2D` with the substraction of self to the received argument." @@ -271,7 +269,7 @@ BlVector2D >> subtract2D: aVector2D [ y: aVector2D y - self y ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector2D >> subtract3D: aVector3D [ "Answer a new `BlVector3D` with the substraction of self to the received argument." @@ -281,20 +279,20 @@ BlVector2D >> subtract3D: aVector3D [ z: aVector3D z ] -{ #category : 'accessing' } +{ #category : #accessing } BlVector2D >> x [ ^ x ] -{ #category : 'initialization' } +{ #category : #initialization } BlVector2D >> x: aX y: aY [ x := aX. y := aY ] -{ #category : 'accessing' } +{ #category : #accessing } BlVector2D >> y [ ^ y diff --git a/src/Bloc/BlVector3D.class.st b/src/Bloc/BlVector3D.class.st index 08a7a1ac8..c58268b30 100644 --- a/src/Bloc/BlVector3D.class.st +++ b/src/Bloc/BlVector3D.class.st @@ -9,19 +9,17 @@ Instance creation: " Class { - #name : 'BlVector3D', - #superclass : 'BlVector', + #name : #BlVector3D, + #superclass : #BlVector, #instVars : [ 'x', 'y', 'z' ], - #category : 'Bloc-Basic-Math', - #package : 'Bloc', - #tag : 'Basic-Math' + #category : 'Bloc-Basic-Math' } -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector3D >> * aScalar [ "Return a new vector as a multiplicate of the receiver by a given scalar (it can be a number, point, or vector)." @@ -29,7 +27,7 @@ BlVector3D >> * aScalar [ ^ aScalar scalarMultiplicate3D: self ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector3D >> + anotherVector [ "Return the addition of a given vector and the receiver." @@ -37,7 +35,7 @@ BlVector3D >> + anotherVector [ ^ anotherVector add3D: self ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector3D >> - anotherVector [ "Perform a subtraction of a given vector from me and return a resulting vector" @@ -45,7 +43,7 @@ BlVector3D >> - anotherVector [ ^ anotherVector subtract3D: self ] -{ #category : 'comparing' } +{ #category : #comparing } BlVector3D >> = anObject [ self == anObject ifTrue: [ ^ true ]. @@ -57,7 +55,7 @@ BlVector3D >> = anObject [ and: [ self z = anObject z ] ] ] -{ #category : 'converting' } +{ #category : #converting } BlVector3D >> adaptToNumber: aNumber andSend: aSelector [ "If I am involved in arithmetic with an Integer, convert it to a Vector of the same dimension" @@ -65,7 +63,7 @@ BlVector3D >> adaptToNumber: aNumber andSend: aSelector [ ^ (BlVector x: aNumber y: aNumber z: aNumber) perform: aSelector with: self ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector3D >> add2D: aVector2D [ "Add me from a given 2D vector" @@ -76,7 +74,7 @@ BlVector3D >> add2D: aVector2D [ z: self z ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector3D >> add3D: aVector3D [ "Add me to a given 3D vector" @@ -87,39 +85,39 @@ BlVector3D >> add3D: aVector3D [ z: aVector3D z + self z ] -{ #category : 'converting' } +{ #category : #converting } BlVector3D >> asScale3D [ "Return a 3D vector representing a scale factor" ^ self ] -{ #category : 'converting' } +{ #category : #converting } BlVector3D >> asTranslate3D [ "Return a 3D vector representing a translation vector" ^ self ] -{ #category : 'comparing' } +{ #category : #comparing } BlVector3D >> hash [ ^ (self x hash bitXor: self y hash) bitXor: self z hash ] -{ #category : 'testing' } +{ #category : #testing } BlVector3D >> isOne [ ^ (self x closeTo: 1) and: [ (self y closeTo: 1) and: [ self z closeTo: 1 ] ] ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector3D >> length [ ^ ((self x * self x) + (self y * self y) + (self z * self z)) sqrt ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector3D >> negated [ @@ -129,7 +127,7 @@ BlVector3D >> negated [ z: self z negated ] -{ #category : 'vector functions' } +{ #category : #'vector functions' } BlVector3D >> normalized [ | aLength | @@ -144,7 +142,7 @@ BlVector3D >> normalized [ z: z / aLength ] -{ #category : 'printing' } +{ #category : #printing } BlVector3D >> printOn: aStream [ aStream nextPut: $(; @@ -156,7 +154,7 @@ BlVector3D >> printOn: aStream [ nextPut: $) ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector3D >> subtract2D: aVector2D [ "Substruct me from a given 2D vector" @@ -167,7 +165,7 @@ BlVector3D >> subtract2D: aVector2D [ z: self z negated ] -{ #category : 'arithmetic' } +{ #category : #arithmetic } BlVector3D >> subtract3D: aVector3D [ "Substruct me from a given 3D vector" @@ -178,28 +176,28 @@ BlVector3D >> subtract3D: aVector3D [ z: aVector3D z - self z ] -{ #category : 'accessing' } +{ #category : #accessing } BlVector3D >> x [ ^ x ] -{ #category : 'initialization' } +{ #category : #initialization } BlVector3D >> x: aX y: aY z: aZ [ x := aX. y := aY. z := aZ ] -{ #category : 'accessing' } +{ #category : #accessing } BlVector3D >> y [ ^ y ] -{ #category : 'accessing' } +{ #category : #accessing } BlVector3D >> z [ diff --git a/src/Bloc/BlVerticalAlignment.class.st b/src/Bloc/BlVerticalAlignment.class.st index 617a47bb8..20b0990a6 100644 --- a/src/Bloc/BlVerticalAlignment.class.st +++ b/src/Bloc/BlVerticalAlignment.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlVerticalAlignment', - #superclass : 'BlElementAlignment', + #name : #BlVerticalAlignment, + #superclass : #BlElementAlignment, #classInstVars : [ 'bottom', 'center', 'top' ], - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> bottom [ ^ bottom ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> center [ ^ center ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> directed: aBlLayoutDirection [ ^ aBlLayoutDirection of: self ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> end [ ^ self bottom ] -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlVerticalAlignment class >> initialize [ super initialize. @@ -40,67 +38,67 @@ BlVerticalAlignment class >> initialize [ bottom := BlBottomAlignment new ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> leftToRight [ ^ self subclassResponsibility ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> null [ ^ BlElementAlignment null vertical ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> rightToLeft [ ^ self subclassResponsibility ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> start [ ^ self top ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment class >> top [ ^ top ] -{ #category : 'composition' } +{ #category : #composition } BlVerticalAlignment >> + aHorizontalAlignment [ ^ BlCompositeAlignment horizontal: aHorizontalAlignment vertical: self ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment >> center [ ^ self class center ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment >> directed: aBlLayoutDirection [ ^ self class directed: aBlLayoutDirection ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment >> end [ ^ self class end ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment >> leftToRight [ ^ self class leftToRight ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment >> null [ ^ self class null ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment >> rightToLeft [ ^ self class rightToLeft ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalAlignment >> start [ ^ self class start ] diff --git a/src/Bloc/BlVerticalCenterAlignment.class.st b/src/Bloc/BlVerticalCenterAlignment.class.st index 49dfd5140..46a8a992b 100644 --- a/src/Bloc/BlVerticalCenterAlignment.class.st +++ b/src/Bloc/BlVerticalCenterAlignment.class.st @@ -1,37 +1,35 @@ Class { - #name : 'BlVerticalCenterAlignment', - #superclass : 'BlVerticalAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlVerticalCenterAlignment, + #superclass : #BlVerticalAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'class initialization' } +{ #category : #'class initialization' } BlVerticalCenterAlignment class >> initialize [ super initialize ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalCenterAlignment class >> leftToRight [ ^ self center ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalCenterAlignment class >> rightToLeft [ ^ self center ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalCenterAlignment >> inverted [ ^ BlElementAlignment horizontal center ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalCenterAlignment >> swap [ ^ self ] -{ #category : 'translation' } +{ #category : #translation } BlVerticalCenterAlignment >> translationOf: aBounds in: aContainerBounds [ diff --git a/src/Bloc/BlVerticalCoordinateAlignment.class.st b/src/Bloc/BlVerticalCoordinateAlignment.class.st index 2c54cea37..4281e60f2 100644 --- a/src/Bloc/BlVerticalCoordinateAlignment.class.st +++ b/src/Bloc/BlVerticalCoordinateAlignment.class.st @@ -28,33 +28,31 @@ Internal Representation and Key Implementation Points. " Class { - #name : 'BlVerticalCoordinateAlignment', - #superclass : 'BlVerticalAlignment', + #name : #BlVerticalCoordinateAlignment, + #superclass : #BlVerticalAlignment, #instVars : [ 'coordinate', 'relativeAlignment' ], - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'accessing' } +{ #category : #accessing } BlVerticalCoordinateAlignment >> coordinate [ ^ coordinate ] -{ #category : 'accessing' } +{ #category : #accessing } BlVerticalCoordinateAlignment >> coordinate: anObject [ coordinate := anObject ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalCoordinateAlignment >> directed: aBlLayoutDirection [ ^ aBlLayoutDirection of: self ] -{ #category : 'initialization' } +{ #category : #initialization } BlVerticalCoordinateAlignment >> initialize [ super initialize. @@ -62,24 +60,24 @@ BlVerticalCoordinateAlignment >> initialize [ relativeAlignment := BlElementAlignment horizontal center ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalCoordinateAlignment >> leftToRight [ ^ self class new coordinate: coordinate; relativeAlignment: relativeAlignment leftToRight ] -{ #category : 'accessing' } +{ #category : #accessing } BlVerticalCoordinateAlignment >> relativeAlignment [ ^ relativeAlignment ] -{ #category : 'accessing' } +{ #category : #accessing } BlVerticalCoordinateAlignment >> relativeAlignment: anObject [ relativeAlignment := anObject ] -{ #category : 'factory' } +{ #category : #factory } BlVerticalCoordinateAlignment >> rightToLeft [ ^ self class new coordinate: coordinate; diff --git a/src/Bloc/BlVerticalCoordinateBottomAlignment.class.st b/src/Bloc/BlVerticalCoordinateBottomAlignment.class.st index 13161d83e..a0ced1548 100644 --- a/src/Bloc/BlVerticalCoordinateBottomAlignment.class.st +++ b/src/Bloc/BlVerticalCoordinateBottomAlignment.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlVerticalCoordinateBottomAlignment', - #superclass : 'BlVerticalCoordinateAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlVerticalCoordinateBottomAlignment, + #superclass : #BlVerticalCoordinateAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'translation' } +{ #category : #translation } BlVerticalCoordinateBottomAlignment >> translationOf: aBounds in: aContainerBounds [ | aRelativeDelta anExpectedBottom | diff --git a/src/Bloc/BlVerticalCoordinateTopAlignment.class.st b/src/Bloc/BlVerticalCoordinateTopAlignment.class.st index 54343001f..aa7f3aa2d 100644 --- a/src/Bloc/BlVerticalCoordinateTopAlignment.class.st +++ b/src/Bloc/BlVerticalCoordinateTopAlignment.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlVerticalCoordinateTopAlignment', - #superclass : 'BlVerticalCoordinateAlignment', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #BlVerticalCoordinateTopAlignment, + #superclass : #BlVerticalCoordinateAlignment, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'translation' } +{ #category : #translation } BlVerticalCoordinateTopAlignment >> translationOf: aBounds in: aContainerBounds [ | aRelativeDelta anExpectedTop | diff --git a/src/Bloc/BlVerticalTextCursor.class.st b/src/Bloc/BlVerticalTextCursor.class.st index b93ef9225..1398d6497 100644 --- a/src/Bloc/BlVerticalTextCursor.class.st +++ b/src/Bloc/BlVerticalTextCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlVerticalTextCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlVerticalTextCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlVerticesFromRectanglesOperator.class.st b/src/Bloc/BlVerticesFromRectanglesOperator.class.st index dd6c9580b..c6953f284 100644 --- a/src/Bloc/BlVerticesFromRectanglesOperator.class.st +++ b/src/Bloc/BlVerticesFromRectanglesOperator.class.st @@ -1,17 +1,15 @@ Class { - #name : 'BlVerticesFromRectanglesOperator', - #superclass : 'Object', - #category : 'Bloc-Basic-Geometry', - #package : 'Bloc', - #tag : 'Basic-Geometry' + #name : #BlVerticesFromRectanglesOperator, + #superclass : #Object, + #category : 'Bloc-Basic-Geometry' } -{ #category : 'accessing' } +{ #category : #accessing } BlVerticesFromRectanglesOperator class >> oppositeDelimiterBackgroundColor [ ^ Color lightGray ] -{ #category : 'private - vertices computing' } +{ #category : #'private - vertices computing' } BlVerticesFromRectanglesOperator >> maxXRightCoord: yCoord fromRectangles: aListOfRectangles [ " optimized with compiled in-line primitives " @@ -22,7 +20,7 @@ BlVerticesFromRectanglesOperator >> maxXRightCoord: yCoord fromRectangles: aList ^ mostRight ] -{ #category : 'private - vertices computing' } +{ #category : #'private - vertices computing' } BlVerticesFromRectanglesOperator >> minXLeftCoord: yCoord fromRectangles: aListOfRectangles [ "optimized with compiled in-line primitives " @@ -33,7 +31,7 @@ BlVerticesFromRectanglesOperator >> minXLeftCoord: yCoord fromRectangles: aListO ^ mostLeft ] -{ #category : 'private - vertices computing' } +{ #category : #'private - vertices computing' } BlVerticesFromRectanglesOperator >> rectanglesAtY: anY fromRectangles: aListOfRectangles [ | rectsAtYExcBottomLines | @@ -42,21 +40,21 @@ BlVerticesFromRectanglesOperator >> rectanglesAtY: anY fromRectangles: aListOfRe ^ self rectsAtYIncBottomLines: anY fromRectangles: aListOfRectangles ] -{ #category : 'private - vertices computing' } +{ #category : #'private - vertices computing' } BlVerticesFromRectanglesOperator >> rectsAtYExcBottomLines: anY fromRectangles: aListOfRectangles [ ^ Array streamContents: [ :stream | aListOfRectangles do: [ :rect | (rect top <= anY and: [ rect bottom > anY ]) ifTrue: [ stream nextPut: rect ] ]] ] -{ #category : 'private - vertices computing' } +{ #category : #'private - vertices computing' } BlVerticesFromRectanglesOperator >> rectsAtYIncBottomLines: anY fromRectangles: aListOfRectangles [ ^ Array streamContents: [ :stream | aListOfRectangles do: [ :rect | (rect top <= anY and: [ rect bottom = anY ]) ifTrue: [ stream nextPut: rect ] ]] ] -{ #category : 'private - vertices computing' } +{ #category : #'private - vertices computing' } BlVerticesFromRectanglesOperator >> verticesFromRectangles: aListOfRectangles [ | ret yCoords previousLeftCoord previousRightCoord | @@ -82,7 +80,7 @@ BlVerticesFromRectanglesOperator >> verticesFromRectangles: aListOfRectangles [ ^ ret ] -{ #category : 'private - vertices computing' } +{ #category : #'private - vertices computing' } BlVerticesFromRectanglesOperator >> yCoordsFromRectangles: aListOfRectangles [ | allBotoms allTops allCoords | diff --git a/src/Bloc/BlViscousFluidInterpolator.class.st b/src/Bloc/BlViscousFluidInterpolator.class.st index fa64c591a..2f4e65a96 100644 --- a/src/Bloc/BlViscousFluidInterpolator.class.st +++ b/src/Bloc/BlViscousFluidInterpolator.class.st @@ -1,18 +1,16 @@ Class { - #name : 'BlViscousFluidInterpolator', - #superclass : 'BlInterpolator', + #name : #BlViscousFluidInterpolator, + #superclass : #BlInterpolator, #classVars : [ 'FluidNormalize', 'FluidOffset', 'FluidScale', 'InvertedExponent' ], - #category : 'Bloc-Basic-Interpolators', - #package : 'Bloc', - #tag : 'Basic-Interpolators' + #category : 'Bloc-Basic-Interpolators' } -{ #category : 'initialization' } +{ #category : #initialization } BlViscousFluidInterpolator class >> initialize [ super initialize. @@ -25,7 +23,7 @@ BlViscousFluidInterpolator class >> initialize [ FluidOffset := 1.0 - (FluidNormalize * (self viscousFluid: 1.0)) ] -{ #category : 'interpolation' } +{ #category : #interpolation } BlViscousFluidInterpolator class >> viscousFluid: aNumber [ | value | value := aNumber * FluidScale. @@ -37,7 +35,7 @@ BlViscousFluidInterpolator class >> viscousFluid: aNumber [ ^ value ] -{ #category : 'interpolation' } +{ #category : #interpolation } BlViscousFluidInterpolator >> interpolate: aNumber [ | interpolated | diff --git a/src/Bloc/BlVisibility.class.st b/src/Bloc/BlVisibility.class.st index a2317530c..71d395ac0 100644 --- a/src/Bloc/BlVisibility.class.st +++ b/src/Bloc/BlVisibility.class.st @@ -12,19 +12,17 @@ If you want to make element transparent and preserve ability to handle events se " Class { - #name : 'BlVisibility', - #superclass : 'Object', + #name : #BlVisibility, + #superclass : #Object, #classInstVars : [ 'gone', 'hidden', 'visible' ], - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #category : 'Bloc-Basic-Properties' } -{ #category : 'cleanup' } +{ #category : #cleanup } BlVisibility class >> cleanUp [ super cleanUp. @@ -33,59 +31,59 @@ BlVisibility class >> cleanUp [ visible := nil ] -{ #category : 'visibilities' } +{ #category : #visibilities } BlVisibility class >> gone [ ^ gone ifNil: [ gone := BlVisibilityGone new ] ] -{ #category : 'visibilities' } +{ #category : #visibilities } BlVisibility class >> hidden [ ^ hidden ifNil: [ hidden := BlVisibilityHidden new ] ] -{ #category : 'visibilities' } +{ #category : #visibilities } BlVisibility class >> visible [ ^ visible ifNil: [ visible := BlVisibilityVisible new ] ] -{ #category : 'comparing' } +{ #category : #comparing } BlVisibility >> = anObject [ self == anObject ifTrue: [ ^ true ]. ^ self class = anObject class ] -{ #category : 'comparing' } +{ #category : #comparing } BlVisibility >> hash [ ^ self class hash ] -{ #category : 'testing' } +{ #category : #testing } BlVisibility >> isGone [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlVisibility >> isHidden [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlVisibility >> isVisible [ ^ false ] -{ #category : 'testing' } +{ #category : #testing } BlVisibility >> shouldDraw [ ^ self isVisible ] -{ #category : 'testing' } +{ #category : #testing } BlVisibility >> shouldLayout [ ^ self isVisible and: [ self isGone not ] ] -{ #category : 'testing' } +{ #category : #testing } BlVisibility >> shouldMeasure [ ^ self isVisible ] diff --git a/src/Bloc/BlVisibilityGone.class.st b/src/Bloc/BlVisibilityGone.class.st index 66e9443bc..059ad23eb 100644 --- a/src/Bloc/BlVisibilityGone.class.st +++ b/src/Bloc/BlVisibilityGone.class.st @@ -4,19 +4,17 @@ Once set, element should not be rendered and should not participate in layout (s " Class { - #name : 'BlVisibilityGone', - #superclass : 'BlVisibility', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlVisibilityGone, + #superclass : #BlVisibility, + #category : 'Bloc-Basic-Properties' } -{ #category : 'testing' } +{ #category : #testing } BlVisibilityGone >> isGone [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } BlVisibilityGone >> isHidden [ ^ true ] diff --git a/src/Bloc/BlVisibilityHidden.class.st b/src/Bloc/BlVisibilityHidden.class.st index 36593f2fe..d8d6e9f88 100644 --- a/src/Bloc/BlVisibilityHidden.class.st +++ b/src/Bloc/BlVisibilityHidden.class.st @@ -4,14 +4,12 @@ Once set, element should not be rendered but should participate in layout and ta " Class { - #name : 'BlVisibilityHidden', - #superclass : 'BlVisibility', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlVisibilityHidden, + #superclass : #BlVisibility, + #category : 'Bloc-Basic-Properties' } -{ #category : 'testing' } +{ #category : #testing } BlVisibilityHidden >> isHidden [ ^ true ] diff --git a/src/Bloc/BlVisibilityVisible.class.st b/src/Bloc/BlVisibilityVisible.class.st index bd5fc54cb..9b98b6ba3 100644 --- a/src/Bloc/BlVisibilityVisible.class.st +++ b/src/Bloc/BlVisibilityVisible.class.st @@ -4,14 +4,12 @@ Once set, element should be rendered and should participate in layout and take s " Class { - #name : 'BlVisibilityVisible', - #superclass : 'BlVisibility', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #BlVisibilityVisible, + #superclass : #BlVisibility, + #category : 'Bloc-Basic-Properties' } -{ #category : 'testing' } +{ #category : #testing } BlVisibilityVisible >> isVisible [ ^ true ] diff --git a/src/Bloc/BlVisualSelectionHandler.class.st b/src/Bloc/BlVisualSelectionHandler.class.st index df9fc62b5..41028f691 100644 --- a/src/Bloc/BlVisualSelectionHandler.class.st +++ b/src/Bloc/BlVisualSelectionHandler.class.st @@ -5,43 +5,41 @@ I simulate Desktop behaviour of most OS " Class { - #name : 'BlVisualSelectionHandler', - #superclass : 'BlSelectionHandler', + #name : #BlVisualSelectionHandler, + #superclass : #BlSelectionHandler, #instVars : [ 'selection' ], - #category : 'Bloc-Utilities - Selection', - #package : 'Bloc', - #tag : 'Utilities - Selection' + #category : 'Bloc-Utilities - Selection' } -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlVisualSelectionHandler >> dragEndEvent: anEvent [ super dragEndEvent: anEvent. container removeChild: selection ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlVisualSelectionHandler >> dragEvent: anEvent [ super dragEvent: anEvent. ] -{ #category : 'dnd handlers' } +{ #category : #'dnd handlers' } BlVisualSelectionHandler >> dragStartEvent: anEvent [ super dragStartEvent: anEvent. container addChild: selection ] -{ #category : 'accessing' } +{ #category : #accessing } BlVisualSelectionHandler >> eventsToHandle [ ^ super eventsToHandle, { BlMouseDownEvent } ] -{ #category : 'mouse handlers' } +{ #category : #'mouse handlers' } BlVisualSelectionHandler >> mouseDownEvent: anEvent [ | oldSelected | @@ -50,7 +48,7 @@ BlVisualSelectionHandler >> mouseDownEvent: anEvent [ oldSelected keysDo: [ :anElement | self handleDeselected: anElement ] ] -{ #category : 'installation' } +{ #category : #installation } BlVisualSelectionHandler >> onInstalledIn: anElement [ super onInstalledIn: anElement. @@ -61,7 +59,7 @@ BlVisualSelectionHandler >> onInstalledIn: anElement [ yourself ] -{ #category : 'selection - handling' } +{ #category : #'selection - handling' } BlVisualSelectionHandler >> selectionChanged [ | aSelectionBounds | super selectionChanged. diff --git a/src/Bloc/BlWaitCursor.class.st b/src/Bloc/BlWaitCursor.class.st index 4f0502210..bddb1f40a 100644 --- a/src/Bloc/BlWaitCursor.class.st +++ b/src/Bloc/BlWaitCursor.class.st @@ -1,12 +1,10 @@ Class { - #name : 'BlWaitCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlWaitCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } -{ #category : 'converting' } +{ #category : #converting } BlWaitCursor >> asForm [ ^ Cursor wait ] diff --git a/src/Bloc/BlWidthEqualizer.class.st b/src/Bloc/BlWidthEqualizer.class.st index db7f9c030..fd8581958 100644 --- a/src/Bloc/BlWidthEqualizer.class.st +++ b/src/Bloc/BlWidthEqualizer.class.st @@ -1,15 +1,13 @@ Class { - #name : 'BlWidthEqualizer', - #superclass : 'BlEqualizer', + #name : #BlWidthEqualizer, + #superclass : #BlEqualizer, #instVars : [ 'widthBlock' ], - #category : 'Bloc-Utilities - Equalizer', - #package : 'Bloc', - #tag : 'Utilities - Equalizer' + #category : 'Bloc-Utilities - Equalizer' } -{ #category : 'element handlers' } +{ #category : #'element handlers' } BlWidthEqualizer >> elementExtentChangedEvent: anEvent [ | maxWidth | @@ -17,14 +15,14 @@ BlWidthEqualizer >> elementExtentChangedEvent: anEvent [ self targetElements do: [ :anElement | widthBlock value: anElement value: maxWidth ] ] -{ #category : 'initialization' } +{ #category : #initialization } BlWidthEqualizer >> initialize [ super initialize. widthBlock := [ :anElement :aWidth | anElement width: aWidth ] ] -{ #category : 'accessing' } +{ #category : #accessing } BlWidthEqualizer >> width: aBlock [ widthBlock := aBlock ] diff --git a/src/Bloc/BlZoomInCursor.class.st b/src/Bloc/BlZoomInCursor.class.st index 9018f19b0..177159e8f 100644 --- a/src/Bloc/BlZoomInCursor.class.st +++ b/src/Bloc/BlZoomInCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlZoomInCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlZoomInCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/BlZoomOutCursor.class.st b/src/Bloc/BlZoomOutCursor.class.st index 52d2176af..51e1a1f77 100644 --- a/src/Bloc/BlZoomOutCursor.class.st +++ b/src/Bloc/BlZoomOutCursor.class.st @@ -1,7 +1,5 @@ Class { - #name : 'BlZoomOutCursor', - #superclass : 'BlNamedCursor', - #category : 'Bloc-Space - Cursor', - #package : 'Bloc', - #tag : 'Space - Cursor' + #name : #BlZoomOutCursor, + #superclass : #BlNamedCursor, + #category : 'Bloc-Space - Cursor' } diff --git a/src/Bloc/Bloc.class.st b/src/Bloc/Bloc.class.st index b7543633e..3b881262a 100644 --- a/src/Bloc/Bloc.class.st +++ b/src/Bloc/Bloc.class.st @@ -6,89 +6,87 @@ I allow users to: " Class { - #name : 'Bloc', - #superclass : 'Object', + #name : #Bloc, + #superclass : #Object, #classVars : [ 'AssertionsEnabled', 'DebugModeEnabled', 'PreferableChildrenDataStructure' ], - #category : 'Bloc-Settings', - #package : 'Bloc', - #tag : 'Settings' + #category : 'Bloc-Settings' } -{ #category : 'assertions' } +{ #category : #assertions } Bloc class >> assertionsEnabled [ ^ AssertionsEnabled ifNil: [ true ] ] -{ #category : 'assertions' } +{ #category : #assertions } Bloc class >> assertionsEnabled: aBoolean [ AssertionsEnabled := aBoolean ] -{ #category : 'debugging' } +{ #category : #debugging } Bloc class >> debugModeEnabled [ ^ DebugModeEnabled ifNil: [ false ] ] -{ #category : 'debugging' } +{ #category : #debugging } Bloc class >> debugModeEnabled: aBoolean [ DebugModeEnabled := aBoolean ] -{ #category : 'children' } +{ #category : #children } Bloc class >> defaultChildrenDataStructure [ ^ BlChildrenArray ] -{ #category : 'assertions' } +{ #category : #assertions } Bloc class >> disableAssertions [ self assertionsEnabled: false ] -{ #category : 'debugging' } +{ #category : #debugging } Bloc class >> disableDebugMode [ self debugModeEnabled: false ] -{ #category : 'assertions' } +{ #category : #assertions } Bloc class >> enableAssertions [ self assertionsEnabled: true ] -{ #category : 'debugging' } +{ #category : #debugging } Bloc class >> enableDebugMode [ self debugModeEnabled: true ] -{ #category : 'settings' } +{ #category : #settings } Bloc class >> groupSymbolForAppearance [ ^ #appearance ] -{ #category : 'settings' } +{ #category : #settings } Bloc class >> groupSymbolForBloc [ ^ #Bloc ] -{ #category : 'children' } +{ #category : #children } Bloc class >> preferableChildrenDataStructure [ "Answer a `BlChildrenCollection class`." ^ PreferableChildrenDataStructure ifNil: [ self defaultChildrenDataStructure ] ] -{ #category : 'children' } +{ #category : #children } Bloc class >> preferableChildrenDataStructure: anChildrenCollectionClass [ PreferableChildrenDataStructure := anChildrenCollectionClass ] -{ #category : 'settings' } +{ #category : #settings } Bloc class >> preferencesOn: aBuilder [ (aBuilder group: self groupSymbolForBloc) diff --git a/src/Bloc/BlockClosure.extension.st b/src/Bloc/BlockClosure.extension.st index fda38cd56..e00f59936 100644 --- a/src/Bloc/BlockClosure.extension.st +++ b/src/Bloc/BlockClosure.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'BlockClosure' } +Extension { #name : #BlockClosure } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } BlockClosure >> asBlocResolvedElementsFrom: anElement [ self argumentCount isZero ifTrue: [ ^ self value ]. @@ -10,7 +10,7 @@ BlockClosure >> asBlocResolvedElementsFrom: anElement [ aStream nextPut: eachElement ] ] ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } BlockClosure >> blocDefiningMethod [ ^ self asContext blocDefiningMethod ] diff --git a/src/Bloc/Character.extension.st b/src/Bloc/Character.extension.st index 2a6675d8b..4bccc82e5 100644 --- a/src/Bloc/Character.extension.st +++ b/src/Bloc/Character.extension.st @@ -1,11 +1,11 @@ -Extension { #name : 'Character' } +Extension { #name : #Character } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Character >> isLineBreak [ ^ self = self class cr or: [ self = self class lf or: [ self = self class nel ] ] ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Character >> isPureSeparator [ ^ self isSeparator and: [ self isLineBreak not ] ] diff --git a/src/Bloc/Collection.extension.st b/src/Bloc/Collection.extension.st index cfc5a2afd..cf2617e45 100644 --- a/src/Bloc/Collection.extension.st +++ b/src/Bloc/Collection.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'Collection' } +Extension { #name : #Collection } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Collection >> copyWithMergedAttributesWith: anotherCollectionOfAttributes [ "Answer the merge of two collections of attributes, letting anotherCollectionOfAttributes to override attributes from self, @@ -17,7 +17,7 @@ Collection >> copyWithMergedAttributesWith: anotherCollectionOfAttributes [ ^ anOrderedDictionary values ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Collection >> copyWithoutDuplicatedRopeAttributes [ "Answer a collection without duplicates from a given collection, preserving the original order" diff --git a/src/Bloc/Color.extension.st b/src/Bloc/Color.extension.st index 148c26fcd..48848953e 100644 --- a/src/Bloc/Color.extension.st +++ b/src/Bloc/Color.extension.st @@ -1,16 +1,16 @@ -Extension { #name : 'Color' } +Extension { #name : #Color } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Color >> asBlBackground [ ^ BlBackground paint: self ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Color >> asBlBorder [ ^ BlBorder paint: self ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Color >> asBlPaint [ ^ BlColorPaint color: self ] diff --git a/src/Bloc/Context.extension.st b/src/Bloc/Context.extension.st index 917803fc8..6203ddecf 100644 --- a/src/Bloc/Context.extension.st +++ b/src/Bloc/Context.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'Context' } +Extension { #name : #Context } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Context >> blocDefiningMethod [ "Return a CompiledMethod this context belongs to" | anOuterMostContext aCompiledCode | @@ -17,7 +17,7 @@ Context >> blocDefiningMethod [ ifFalse: [ anOuterMostContext blocDefiningMethod ] ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Context >> blocMethodDefinition [ "Return a Ring method definition for the CompiledMethod this context belongs to" diff --git a/src/Bloc/Form.extension.st b/src/Bloc/Form.extension.st index 74382379b..71de69333 100644 --- a/src/Bloc/Form.extension.st +++ b/src/Bloc/Form.extension.st @@ -1,11 +1,11 @@ -Extension { #name : 'Form' } +Extension { #name : #Form } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Form >> asBlBackground [ ^ BlBackground image: self ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Form >> asElement [ ^ BlElement new size: self extent; @@ -13,7 +13,7 @@ Form >> asElement [ yourself ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Form >> asForm [ ^ self ] diff --git a/src/Bloc/KeyboardKey.extension.st b/src/Bloc/KeyboardKey.extension.st index 8d40d068e..adf3fbf98 100644 --- a/src/Bloc/KeyboardKey.extension.st +++ b/src/Bloc/KeyboardKey.extension.st @@ -1,12 +1,12 @@ -Extension { #name : 'KeyboardKey' } +Extension { #name : #KeyboardKey } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } KeyboardKey >> isShift [ ^ self = self class shiftLeft or: [ self = self class shiftRight ] ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } KeyboardKey class >> unknown [ | aKeyboardKey | diff --git a/src/Bloc/MacOSPlatform.extension.st b/src/Bloc/MacOSPlatform.extension.st index a87491c45..eaa6fd2f4 100644 --- a/src/Bloc/MacOSPlatform.extension.st +++ b/src/Bloc/MacOSPlatform.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'MacOSPlatform' } +Extension { #name : #MacOSPlatform } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } MacOSPlatform >> primaryModifier [ ^ BlAlternativeCombination new key: KeyboardKey metaLeft; @@ -10,7 +10,7 @@ MacOSPlatform >> primaryModifier [ yourself ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } MacOSPlatform >> secondaryModifier [ ^ BlAlternativeCombination new key: KeyboardKey controlLeft; diff --git a/src/Bloc/ManifestBloc.class.st b/src/Bloc/ManifestBloc.class.st index a54bf0e44..374b08784 100644 --- a/src/Bloc/ManifestBloc.class.st +++ b/src/Bloc/ManifestBloc.class.st @@ -19,14 +19,12 @@ Most recently, [feenk](https://feenk.com) has put in a ton of work, bringing the " Class { - #name : 'ManifestBloc', - #superclass : 'PackageManifest', - #category : 'Bloc-Manifest', - #package : 'Bloc', - #tag : 'Manifest' + #name : #ManifestBloc, + #superclass : #PackageManifest, + #category : 'Bloc-Manifest' } -{ #category : 'code-critics' } +{ #category : #'code-critics' } ManifestBloc class >> ruleRBNotEliminationRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#BlRope #isNotEmpty #false)) #'2019-01-05T19:54:41.211552+01:00') ) ] diff --git a/src/Bloc/Number.extension.st b/src/Bloc/Number.extension.st index 6d71beb4c..0323f915f 100644 --- a/src/Bloc/Number.extension.st +++ b/src/Bloc/Number.extension.st @@ -1,34 +1,34 @@ -Extension { #name : 'Number' } +Extension { #name : #Number } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Number >> asBlocVector [ "Return a 2D vector of the receiver by using the receiver as the two dimensions." ^ BlVector x: self y: self ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Number >> asScale3D [ "Return a 3D vector representing a scale factor" ^ BlVector x: self y: self z: 1 ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Number >> asTranslate3D [ "Return a 3D vector representing a translation vector" ^ BlVector x: self y: self z: 0 ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Number >> closeTo: num epsilon: anEpsilon [ "are these two numbers close?" ^ (self - num) abs <= anEpsilon ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Number >> scalarMultiplicate2D: aVector2D [ "Perform a scalar multiplication of a given 2D vector by me" @@ -38,7 +38,7 @@ Number >> scalarMultiplicate2D: aVector2D [ y: aVector2D y * self ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Number >> scalarMultiplicate3D: aVector3D [ "Return a new vector by performing a scalar multiplication of a given 3D vector by me." @@ -49,7 +49,7 @@ Number >> scalarMultiplicate3D: aVector3D [ z: aVector3D z * self ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Number >> timesCollect: aBlock [ ^ (1 to: self) collect: [ :anIndex | aBlock cull: anIndex ] ] diff --git a/src/Bloc/OSPlatform.extension.st b/src/Bloc/OSPlatform.extension.st index 9080c6de7..72230bfd9 100644 --- a/src/Bloc/OSPlatform.extension.st +++ b/src/Bloc/OSPlatform.extension.st @@ -1,17 +1,17 @@ -Extension { #name : 'OSPlatform' } +Extension { #name : #OSPlatform } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } OSPlatform >> defaultScrollingVelocity [ ^ 20 ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } OSPlatform >> primaryModifier [ ^ self subclassResponsibility ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } OSPlatform >> secondaryModifier [ ^ self subclassResponsibility ] diff --git a/src/Bloc/Object.extension.st b/src/Bloc/Object.extension.st index fb40a8628..8cc47fd9c 100644 --- a/src/Bloc/Object.extension.st +++ b/src/Bloc/Object.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'Object' } +Extension { #name : #Object } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Object >> entryIdentifier [ "Answer the object used to identify this task. nil = unidentified (and thus can be queued multiple times)" @@ -8,13 +8,13 @@ Object >> entryIdentifier [ ^nil ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Object >> isBlocElementId [ ^ false ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Object >> ropeAttributeType [ "Return an object that is used to compare attribute by type The rule is the following: attributes of the same type must overwrite each other." diff --git a/src/Bloc/Point.extension.st b/src/Bloc/Point.extension.st index 3f1b5174c..ef4c80fdc 100644 --- a/src/Bloc/Point.extension.st +++ b/src/Bloc/Point.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'Point' } +Extension { #name : #Point } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Point >> @ aNumber [ "Create a new 3D point with x and y represented by me and given number as z" @@ -8,27 +8,27 @@ Point >> @ aNumber [ ^ BlPoint3D x: x y: y z: aNumber ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Point >> asBlocVector [ "Return a 2D vector of the receiver by using the receiver as the two dimensions of the vector." ^ BlVector x: x y: y ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Point >> asScale3D [ "Return a 3D vector representing a scale factor" ^ BlVector x: self x y: self y z: 1 ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Point >> asTranslate3D [ "Return a 3D vector representing a translation vector" ^ BlVector x: self x y: self y z: 0 ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Point >> closeTo: anotherPoint epsilon: anEpsilon [ "are these two Points close?" @@ -36,7 +36,7 @@ Point >> closeTo: anotherPoint epsilon: anEpsilon [ and: [ y closeTo: anotherPoint y epsilon: anEpsilon ] ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Point >> scalarMultiplicate2D: aVector2D [ "Perform a scalar multiplication of a given 2D vector by me" @@ -46,7 +46,7 @@ Point >> scalarMultiplicate2D: aVector2D [ y: aVector2D y * self y ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Point >> transformedOn: aBlMatrix [ diff --git a/src/Bloc/ProcessList.extension.st b/src/Bloc/ProcessList.extension.st index 477635f31..0d03a0e1c 100644 --- a/src/Bloc/ProcessList.extension.st +++ b/src/Bloc/ProcessList.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'ProcessList' } +Extension { #name : #ProcessList } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } ProcessList >> firstOrNil [ "Answer the first link or nil if the receiver is empty." ^firstLink ifNotNil: [ :fl | fl value ] diff --git a/src/Bloc/SharedPriorityUniqueQueue.class.st b/src/Bloc/SharedPriorityUniqueQueue.class.st index ca1e8168c..3e0f11ba6 100644 --- a/src/Bloc/SharedPriorityUniqueQueue.class.st +++ b/src/Bloc/SharedPriorityUniqueQueue.class.st @@ -26,14 +26,12 @@ Some care is taken to ensure that the queue is not corrupted by some other proce " Class { - #name : 'SharedPriorityUniqueQueue', - #superclass : 'SharedQueue', - #category : 'Bloc-DataStructure - Priority Queue', - #package : 'Bloc', - #tag : 'DataStructure - Priority Queue' + #name : #SharedPriorityUniqueQueue, + #superclass : #SharedQueue, + #category : 'Bloc-DataStructure - Priority Queue' } -{ #category : 'private' } +{ #category : #private } SharedPriorityUniqueQueue >> basicNext [ "Answer the next highest priority item. This should only be called within the monitor." @@ -58,7 +56,7 @@ SharedPriorityUniqueQueue >> basicNext [ ^item ] -{ #category : 'private' } +{ #category : #private } SharedPriorityUniqueQueue >> basicPeek [ "Answer the next highest priority item. This should only be called within the monitor." @@ -82,7 +80,7 @@ SharedPriorityUniqueQueue >> basicPeek [ ^item ] -{ #category : 'flushing' } +{ #category : #flushing } SharedPriorityUniqueQueue >> flush [ "Remove from the queue all objects Ensure that the operation isn't terminated while within the monitor" @@ -90,7 +88,7 @@ SharedPriorityUniqueQueue >> flush [ ^[ super flush ] valueNoContextSwitch ] -{ #category : 'flushing' } +{ #category : #flushing } SharedPriorityUniqueQueue >> flushAllSuchThat: aBlock [ "Remove from the queue all objects that satisfy aBlock. Ensure that the operation isn't terminated while within the monitor" @@ -98,7 +96,7 @@ SharedPriorityUniqueQueue >> flushAllSuchThat: aBlock [ ^[ super flushAllSuchThat: aBlock ] valueNoContextSwitch ] -{ #category : 'size' } +{ #category : #size } SharedPriorityUniqueQueue >> isEmpty [ "Answer a boolean indicating whether the receiver has no entries. Ensure that the operation isn't terminated while within the monitor" @@ -106,7 +104,7 @@ SharedPriorityUniqueQueue >> isEmpty [ ^[ super isEmpty ] valueNoContextSwitch ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> itemArray [ "Answer the number of entries in the receiver. Ensure that the operation isn't terminated while within the monitor" @@ -114,7 +112,7 @@ SharedPriorityUniqueQueue >> itemArray [ ^[ super itemArray ] valueNoContextSwitch ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> next [ ^[ monitor critical: [ monitor waitWhile: [ items isEmpty ]. @@ -123,14 +121,14 @@ SharedPriorityUniqueQueue >> next [ ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> nextOrNil [ ^[ monitor critical: [ items isEmpty ifTrue: [ nil ] ifFalse: [ self basicNext ] ] ] valueNoContextSwitch ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> nextOrNilSuchThat: aBlock [ "Answer the next object that satisfies aBlock, skipping any intermediate objects. If no object has been sent, answer and leave me intact. @@ -144,7 +142,7 @@ SharedPriorityUniqueQueue >> nextOrNilSuchThat: aBlock [ ^ [ super nextOrNilSuchThat: aBlock ] valueNoContextSwitch ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> nextPut: anObject [ ^[ monitor critical: [ | result itemAdded | @@ -161,7 +159,7 @@ SharedPriorityUniqueQueue >> nextPut: anObject [ ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> peek [ "Answer the object that was sent through the receiver first and has not yet been received by anyone but do not remove it from the receiver. If @@ -171,7 +169,7 @@ SharedPriorityUniqueQueue >> peek [ ^[ monitor critical: [ self basicPeek ] ] valueNoContextSwitch ] -{ #category : 'copying' } +{ #category : #copying } SharedPriorityUniqueQueue >> postCopy [ "Finish off the copy operation. Ensure that the operation isn't terminated while within the monitor" @@ -179,7 +177,7 @@ SharedPriorityUniqueQueue >> postCopy [ ^[ super postCopy ] valueNoContextSwitch ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> removeAll [ "Empty the queue. Ensure that the operation isn't terminated while within the monitor" @@ -187,7 +185,7 @@ SharedPriorityUniqueQueue >> removeAll [ ^[ super removeAll ] valueNoContextSwitch ] -{ #category : 'accessing' } +{ #category : #accessing } SharedPriorityUniqueQueue >> size [ "Answer the number of entries in the receiver. Ensure that the operation isn't terminated while within the monitor" diff --git a/src/Bloc/String.extension.st b/src/Bloc/String.extension.st index 80f4ecbed..73c317099 100644 --- a/src/Bloc/String.extension.st +++ b/src/Bloc/String.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'String' } +Extension { #name : #String } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } String >> asBlocElementId [ ^ BlElementId named: self asSymbol diff --git a/src/Bloc/TBlAlignable.trait.st b/src/Bloc/TBlAlignable.trait.st index 56688b8a9..2be19e746 100644 --- a/src/Bloc/TBlAlignable.trait.st +++ b/src/Bloc/TBlAlignable.trait.st @@ -4,162 +4,160 @@ I add alignment api in both axis simultaneously. My users are layout related classes " Trait { - #name : 'TBlAlignable', - #category : 'Bloc-Layouts-Alignment', - #package : 'Bloc', - #tag : 'Layouts-Alignment' + #name : #TBlAlignable, + #category : 'Bloc-Layouts-Alignment' } -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignBottomCenter [ self verticalAlignment: BlElementAlignment vertical end. self horizontalAlignment: BlElementAlignment horizontal center ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignBottomLeft [ self verticalAlignment: BlElementAlignment vertical end. self horizontalAlignment: BlElementAlignment horizontal start ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignBottomRight [ self verticalAlignment: BlElementAlignment vertical end. self horizontalAlignment: BlElementAlignment horizontal end ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignCenter [ self verticalAlignment: BlElementAlignment vertical center. self horizontalAlignment: BlElementAlignment horizontal center ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignCenterLeft [ self verticalAlignment: BlElementAlignment vertical center. self horizontalAlignment: BlElementAlignment horizontal start ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignCenterRight [ self verticalAlignment: BlElementAlignment vertical center. self horizontalAlignment: BlElementAlignment horizontal end ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignNone [ self verticalAlignment: BlElementAlignment vertical null. self horizontalAlignment: BlElementAlignment horizontal null ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignTopCenter [ self verticalAlignment: BlElementAlignment vertical start. self horizontalAlignment: BlElementAlignment horizontal center ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignTopLeft [ self verticalAlignment: BlElementAlignment vertical start. self horizontalAlignment: BlElementAlignment horizontal start ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> alignTopRight [ self verticalAlignment: BlElementAlignment vertical start. self horizontalAlignment: BlElementAlignment horizontal end ] -{ #category : 'accessing' } +{ #category : #accessing } TBlAlignable >> horizontalAlignment [ ^ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlAlignable >> horizontalAlignment: aBlElementAlignment [ self explicitRequirement ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignBottomCenter [ ^ self verticalAlignment = BlElementAlignment vertical end and: [ self horizontalAlignment = BlElementAlignment horizontal center ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignBottomLeft [ ^ self verticalAlignment = BlElementAlignment vertical end and: [ self horizontalAlignment = BlElementAlignment horizontal start ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignBottomRight [ ^ self verticalAlignment = BlElementAlignment vertical end and: [ self horizontalAlignment = BlElementAlignment horizontal end ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignCenter [ ^ self verticalAlignment = BlElementAlignment vertical center and: [ self horizontalAlignment = BlElementAlignment horizontal center ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignCenterLeft [ ^ self verticalAlignment = BlElementAlignment vertical center and: [ self horizontalAlignment = BlElementAlignment horizontal start ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignCenterRight [ ^ self verticalAlignment = BlElementAlignment vertical center and: [ self horizontalAlignment = BlElementAlignment horizontal end ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignNone [ ^ self verticalAlignment = BlElementAlignment vertical null and: [ self horizontalAlignment = BlElementAlignment horizontal null ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignTopCenter [ ^ self verticalAlignment = BlElementAlignment vertical start and: [ self horizontalAlignment = BlElementAlignment horizontal center ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignTopLeft [ ^ self verticalAlignment = BlElementAlignment vertical start and: [ self horizontalAlignment = BlElementAlignment horizontal start ] ] -{ #category : 'api - alignment' } +{ #category : #'api - alignment' } TBlAlignable >> isAlignTopRight [ ^ self verticalAlignment = BlElementAlignment vertical start and: [ self horizontalAlignment = BlElementAlignment horizontal end ] ] -{ #category : 'accessing' } +{ #category : #accessing } TBlAlignable >> verticalAlignment [ ^ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlAlignable >> verticalAlignment: aBlElementAlignment [ self explicitRequirement ] diff --git a/src/Bloc/TBlAnnounceable.trait.st b/src/Bloc/TBlAnnounceable.trait.st index d3e6eba67..4cb963337 100644 --- a/src/Bloc/TBlAnnounceable.trait.st +++ b/src/Bloc/TBlAnnounceable.trait.st @@ -4,19 +4,17 @@ I'm an utility Trait for objects that own an Announcer. " Trait { - #name : 'TBlAnnounceable', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #name : #TBlAnnounceable, + #category : 'Bloc-Basic-Support' } -{ #category : 'event management' } +{ #category : #'event management' } TBlAnnounceable >> announce: anAnnouncement [ self announcerDo: [ :ann | ann announce: anAnnouncement ] ] -{ #category : 'event management' } +{ #category : #'event management' } TBlAnnounceable >> announcerDo: aBlockClosure [ "Evaluate a given block closure with an announcer as an argument if it is initialized" @@ -24,19 +22,19 @@ TBlAnnounceable >> announcerDo: aBlockClosure [ aBlockClosure value: self privateAnnouncer ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } TBlAnnounceable >> ensureAnnouncer [ self explicitRequirement ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } TBlAnnounceable >> privateAnnouncer [ ^ self explicitRequirement ] -{ #category : 'event management' } +{ #category : #'event management' } TBlAnnounceable >> unsubscribe: anObject [ "Unsubscribe all subscriptions of anObject from the receiver" @@ -44,14 +42,14 @@ TBlAnnounceable >> unsubscribe: anObject [ self announcerDo: [ :anAnnouncer | anAnnouncer unsubscribe: anObject ] ] -{ #category : 'event management' } +{ #category : #'event management' } TBlAnnounceable >> whenAnnouncement: anAnnouncementClass do: aValuable [ self ensureAnnouncer. self privateAnnouncer when: anAnnouncementClass do: aValuable ] -{ #category : 'event management' } +{ #category : #'event management' } TBlAnnounceable >> whenAnnouncement: anAnnouncementClass send: aSelector to: anObject [ self ensureAnnouncer. diff --git a/src/Bloc/TBlAnnouncerProvider.trait.st b/src/Bloc/TBlAnnouncerProvider.trait.st index 696dec68a..2d47203c4 100644 --- a/src/Bloc/TBlAnnouncerProvider.trait.st +++ b/src/Bloc/TBlAnnouncerProvider.trait.st @@ -2,50 +2,48 @@ I provide an announcer with necessary methods " Trait { - #name : 'TBlAnnouncerProvider', + #name : #TBlAnnouncerProvider, #instVars : [ 'privateAnnouncer', 'privateAnnouncerIsPlugged' ], #traits : 'TBlAnnounceable', #classTraits : 'TBlAnnounceable classTrait', - #category : 'Bloc-Basic-Support', - #package : 'Bloc', - #tag : 'Basic-Support' + #category : 'Bloc-Basic-Support' } -{ #category : 'event management' } +{ #category : #'event management' } TBlAnnouncerProvider >> announce: anAnnouncement [ self announcerIsPlugged ifFalse: [ ^ self ]. self announcerDo: [ :ann | ann announce: anAnnouncement ] ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } TBlAnnouncerProvider >> announcerIsPlugged [ ^ privateAnnouncerIsPlugged ifNil: [ privateAnnouncerIsPlugged := true ] ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } TBlAnnouncerProvider >> ensureAnnouncer [ privateAnnouncer ifNil: [ privateAnnouncer := Announcer new ] ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } TBlAnnouncerProvider >> privateAnnouncer [ ^ privateAnnouncer ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } TBlAnnouncerProvider >> resetAnnouncer [ privateAnnouncer := nil ] -{ #category : 'private - accessing' } +{ #category : #'private - accessing' } TBlAnnouncerProvider >> unplugAnnouncerWhile: aBlock [ privateAnnouncerIsPlugged := false. diff --git a/src/Bloc/TBlAssertUIProcess.trait.st b/src/Bloc/TBlAssertUIProcess.trait.st index d3332a00a..b385e2bf2 100644 --- a/src/Bloc/TBlAssertUIProcess.trait.st +++ b/src/Bloc/TBlAssertUIProcess.trait.st @@ -4,13 +4,11 @@ I should be used by ${class:BlElement}$. " Trait { - #name : 'TBlAssertUIProcess', - #category : 'Bloc-Utilities - Debugging', - #package : 'Bloc', - #tag : 'Utilities - Debugging' + #name : #TBlAssertUIProcess, + #category : 'Bloc-Utilities - Debugging' } -{ #category : 'asserting' } +{ #category : #asserting } TBlAssertUIProcess >> assertUIProcess [ "Make sure that I am executing in a UI process" | aCurrentProcess aUIProcess | diff --git a/src/Bloc/TBlDebug.trait.st b/src/Bloc/TBlDebug.trait.st index 487f6f8ea..6f255a819 100644 --- a/src/Bloc/TBlDebug.trait.st +++ b/src/Bloc/TBlDebug.trait.st @@ -7,13 +7,11 @@ I contain useful debug utility methods that can be enabled / disabled with: ]]] " Trait { - #name : 'TBlDebug', - #category : 'Bloc-Utilities - Debugging', - #package : 'Bloc', - #tag : 'Utilities - Debugging' + #name : #TBlDebug, + #category : 'Bloc-Utilities - Debugging' } -{ #category : 'debug - asserting' } +{ #category : #'debug - asserting' } TBlDebug classSide >> assert: aBlock [ "Throw an assertion error if aBlock does not evaluates to true. We check for true explicitly to make the assertion fail for non booleans. @@ -24,7 +22,7 @@ TBlDebug classSide >> assert: aBlock [ ifTrue: [ aBlock value == true ifFalse: [ AssertionFailure signal: 'Assertion failed' ] ] ] -{ #category : 'debug - asserting' } +{ #category : #'debug - asserting' } TBlDebug classSide >> assert: aBlock description: aStringOrBlock [ "Throw an assertion error if aBlock does not evaluates to true. @@ -34,21 +32,21 @@ TBlDebug classSide >> assert: aBlock description: aStringOrBlock [ ifTrue: [ aBlock value == true ifFalse: [ AssertionFailure signal: aStringOrBlock value ] ] ] -{ #category : 'debug - asserting' } +{ #category : #'debug - asserting' } TBlDebug classSide >> assertionsEnabled [ ^ Bloc assertionsEnabled ] -{ #category : 'debug - asserting' } +{ #category : #'debug - asserting' } TBlDebug >> assert: aBlock [ "Throw an assertion error if aBlock does not evaluates to true" self class assert: aBlock ] -{ #category : 'debug - asserting' } +{ #category : #'debug - asserting' } TBlDebug >> assert: aBlock description: aStringOrBlock [ "Throw an assertion error if aBlock does not evaluates to true." diff --git a/src/Bloc/TBlElementCommonStyles.trait.st b/src/Bloc/TBlElementCommonStyles.trait.st index 0ee11a6c9..90d35b1c4 100644 --- a/src/Bloc/TBlElementCommonStyles.trait.st +++ b/src/Bloc/TBlElementCommonStyles.trait.st @@ -1,96 +1,94 @@ Trait { - #name : 'TBlElementCommonStyles', - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #name : #TBlElementCommonStyles, + #category : 'Bloc-Basic-Style' } -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> default [ ^ self styleFor: BlElementState default ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> default: aBlock [ aBlock value: self default ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> deselected [ ^ self styleFor: BlElementState deselected ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> deselected: aBlock [ aBlock value: self deselected ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> disabled [ ^ self styleFor: BlElementState disabled ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> disabled: aBlock [ aBlock value: self disabled ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> enabled [ ^ self styleFor: BlElementState enabled ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> enabled: aBlock [ aBlock value: self enabled ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> focused [ ^ self styleFor: BlElementState focused ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> focused: aBlock [ aBlock value: self focused ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> hovered [ ^ self styleFor: BlElementState hovered ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> hovered: aBlock [ aBlock value: self hovered ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> pressed [ ^ self styleFor: BlElementState pressed ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> pressed: aBlock [ aBlock value: self pressed ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> selected [ ^ self styleFor: BlElementState selected ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> selected: aBlock [ aBlock value: self selected ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> unfocused [ ^ self styleFor: BlElementState unfocused ] -{ #category : 'api - styles' } +{ #category : #'api - styles' } TBlElementCommonStyles >> unfocused: aBlock [ aBlock value: self unfocused ] diff --git a/src/Bloc/TBlElementProperties.trait.st b/src/Bloc/TBlElementProperties.trait.st index bd0529520..0561d970f 100644 --- a/src/Bloc/TBlElementProperties.trait.st +++ b/src/Bloc/TBlElementProperties.trait.st @@ -1,148 +1,146 @@ Trait { - #name : 'TBlElementProperties', - #category : 'Bloc-Basic-Properties', - #package : 'Bloc', - #tag : 'Basic-Properties' + #name : #TBlElementProperties, + #category : 'Bloc-Basic-Properties' } -{ #category : 'adding' } +{ #category : #adding } TBlElementProperties >> addProperty: aBlElementProperty [ self explicitRequirement ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> background: aPaint [ self addProperty: (BlElementBackgroundProperty new background: aPaint) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> border: aBlBorder [ self addProperty: (BlElementBorderProperty new border: aBlBorder) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> do: anApplyBlock [ self do: anApplyBlock after: [ ] ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> do: anApplyBlock after: aCleanBlock [ self addProperty: (BlElementDynamicProperty new applyAction: anApplyBlock; cleanAction: aCleanBlock) ] -{ #category : 'api - properties constraints' } +{ #category : #'api - properties constraints' } TBlElementProperties >> effect: aBlEffect [ self addProperty: (BlElementEffectProperty new effect: aBlEffect) ] -{ #category : 'api - properties font' } +{ #category : #'api - properties font' } TBlElementProperties >> fontSize: aBlElementPropertyLength [ self addProperty: (BlElementFontSizeProperty new fontSize: aBlElementPropertyLength) ] -{ #category : 'api - properties font' } +{ #category : #'api - properties font' } TBlElementProperties >> fontSizeEm: aNumber [ self fontSize: (BlValueWithUnit em: aNumber) ] -{ #category : 'api - properties font' } +{ #category : #'api - properties font' } TBlElementProperties >> fontSizePt: aNumber [ self fontSize: (BlValueWithUnit pt: aNumber) ] -{ #category : 'api - properties font' } +{ #category : #'api - properties font' } TBlElementProperties >> fontSizeRem: aNumber [ self fontSize: (BlValueWithUnit rem: aNumber) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> foreground: aPaint [ self addProperty: (BlElementForegroundProperty new foreground: aPaint) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> geometry: aBlElementGeometry [ self addProperty: (BlElementGeometryProperty new geometry: aBlElementGeometry) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> gone [ self visibility: BlVisibility gone ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> hExact: aWidth [ self addProperty: (BlElementLayoutHorizontalResizerProperty new exact: aWidth) ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> hFitContent [ self addProperty: (BlElementLayoutHorizontalResizerProperty new fitContent) ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> hFitContentLimited [ self addProperty: (BlElementLayoutHorizontalResizerProperty new fitContentLimited) ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> hMatchParent [ self addProperty: (BlElementLayoutHorizontalResizerProperty new matchParent) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> hidden [ self visibility: BlVisibility hidden ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> layout: aBlLayout [ self addProperty: (BlElementLayoutProperty new layout: aBlLayout) ] -{ #category : 'api - properties constraints' } +{ #category : #'api - properties constraints' } TBlElementProperties >> margin: aBlInsets [ self addProperty: (BlElementMarginProperty new margin: aBlInsets) ] -{ #category : 'api - properties constraints' } +{ #category : #'api - properties constraints' } TBlElementProperties >> padding: aBlInsets [ self addProperty: (BlElementPaddingProperty new padding: aBlInsets) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> scaleBy: aNumber [ self addProperty: (BlElementTransformationScaleProperty new scaleFactor: aNumber) ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> vExact: aHeight [ self addProperty: (BlElementLayoutVerticalResizerProperty new exact: aHeight) ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> vFitContent [ self addProperty: (BlElementLayoutVerticalResizerProperty new fitContent) ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> vFitContentLimited [ self addProperty: (BlElementLayoutVerticalResizerProperty new fitContentLimited) ] -{ #category : 'api - properties layout' } +{ #category : #'api - properties layout' } TBlElementProperties >> vMatchParent [ self addProperty: (BlElementLayoutVerticalResizerProperty new matchParent) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> visibility: aBlVisibility [ self addProperty: (BlElementVisibilityProperty new visibility: aBlVisibility) ] -{ #category : 'api - properties' } +{ #category : #'api - properties' } TBlElementProperties >> visible [ self visibility: BlVisibility visible ] diff --git a/src/Bloc/TBlElementStyles.trait.st b/src/Bloc/TBlElementStyles.trait.st index 1adc4fd1c..2d7ad52ce 100644 --- a/src/Bloc/TBlElementStyles.trait.st +++ b/src/Bloc/TBlElementStyles.trait.st @@ -1,17 +1,15 @@ Trait { - #name : 'TBlElementStyles', - #category : 'Bloc-Basic-Style', - #package : 'Bloc', - #tag : 'Basic-Style' + #name : #TBlElementStyles, + #category : 'Bloc-Basic-Style' } -{ #category : 'private - adding' } +{ #category : #'private - adding' } TBlElementStyles >> basicAddStyle: aStyle [ self explicitRequirement ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } TBlElementStyles >> newStyleForState: aBlElementState [ ^ BlElementStyle new @@ -19,7 +17,7 @@ TBlElementStyles >> newStyleForState: aBlElementState [ yourself ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } TBlElementStyles >> styleFor: aBlElementState [ ^ self @@ -32,7 +30,7 @@ TBlElementStyles >> styleFor: aBlElementState [ aNewStyle ] ] -{ #category : 'private - adding' } +{ #category : #'private - adding' } TBlElementStyles >> styleForState: aState ifFound: aFoundBlock ifNone: aNoneBlock [ self explicitRequirement diff --git a/src/Bloc/TBlEventTarget.trait.st b/src/Bloc/TBlEventTarget.trait.st index 8cd8943c7..a2c2b2fc2 100644 --- a/src/Bloc/TBlEventTarget.trait.st +++ b/src/Bloc/TBlEventTarget.trait.st @@ -3,28 +3,26 @@ I implement a basic infrastructure of event management. Any object that needs to be able to handle events should use me. " Trait { - #name : 'TBlEventTarget', - #category : 'Bloc-Events-Dispatcher', - #package : 'Bloc', - #tag : 'Events-Dispatcher' + #name : #TBlEventTarget, + #category : 'Bloc-Events-Dispatcher' } -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> addEventFilter: anEventHandler [ self eventDispatcher addEventFilter: anEventHandler ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> addEventFilterOn: anEventClass do: aBlock [ self addEventFilter: (BlEventHandler on: anEventClass do: aBlock) ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> addEventHandler: anEventHandler [ self eventDispatcher addEventHandler: anEventHandler ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> addEventHandlerIfNotPresent: anEventHandler [ (self hasEventHandler: anEventHandler) ifTrue: [ ^ self ]. @@ -32,17 +30,17 @@ TBlEventTarget >> addEventHandlerIfNotPresent: anEventHandler [ self addEventHandler: anEventHandler ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> addEventHandlerOn: anEventClass do: aBlock [ self addEventHandler: (BlEventHandler on: anEventClass do: aBlock) ] -{ #category : 'shortcut management' } +{ #category : #'shortcut management' } TBlEventTarget >> addShortcut: aShortcut [ self eventDispatcher addShortcut: aShortcut ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> buildEventDispatchChain: aBlEventDispatcherChain [ "Note: Dispatcher chain is persistent - I return a new instance" @@ -57,7 +55,7 @@ TBlEventTarget >> buildEventDispatchChain: aBlEventDispatcherChain [ ^ aResultChain ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> buildEventDispatchChain: aBlEventDispatcherChain upTo: anOtherEventTarget [ "Build an event dispatch chain up to but excluding a given other event target Note: Dispatcher chain is persistent - I return a new instance" @@ -73,7 +71,7 @@ TBlEventTarget >> buildEventDispatchChain: aBlEventDispatcherChain upTo: anOther ^ aResultChain ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> dispatchEvent: anEvent [ "I only call my event dispatcher, so the event can be only handled by my event handlers/filters" @@ -87,7 +85,7 @@ TBlEventTarget >> dispatchEvent: anEvent [ ifTrue: [ self eventDispatcher dispatchEvent: anEvent ] ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } TBlEventTarget >> eventDispatcher [ "Return an object responsible for event dispatching" @@ -95,7 +93,7 @@ TBlEventTarget >> eventDispatcher [ ^ self explicitRequirement ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> fireEvent: anEvent [ "I fire provided event building an event dispatcher chain (from target to the root element) and dispatch the event with it." @@ -111,17 +109,17 @@ TBlEventTarget >> fireEvent: anEvent [ aDispatcherChain dispatchEvent: anEvent ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> hasEventFilter: anEventHandler [ ^ self eventDispatcher hasFilter: anEventHandler ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> hasEventHandler: anEventHandler [ ^ self eventDispatcher hasHandler: anEventHandler ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } TBlEventTarget >> hasNextEventTarget [ "Return true if this event target has a logical successor within a dispatch chain. For example, in case of visual components next event target is a parent, meaning @@ -132,7 +130,7 @@ TBlEventTarget >> hasNextEventTarget [ ^ false ] -{ #category : 'event management accessing' } +{ #category : #'event management accessing' } TBlEventTarget >> nextEventTarget [ "Return next event target that should be contained in dispatch chain. Note: returned object must use TBlEventTarget trait!" @@ -141,49 +139,49 @@ TBlEventTarget >> nextEventTarget [ self error: 'Override me if there is a next event target.' ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> removeEventFilter: anEventHandler [ self eventDispatcher removeEventFilter: anEventHandler ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> removeEventFiltersSuchThat: aBlock [ self eventDispatcher removeEventFiltersSuchThat: aBlock ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> removeEventHandler: anEventHandler [ self eventDispatcher removeEventHandler: anEventHandler ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> removeEventHandlersSuchThat: aBlock [ self eventDispatcher removeEventHandlersSuchThat: aBlock ] -{ #category : 'shortcut management' } +{ #category : #'shortcut management' } TBlEventTarget >> removeShortcut: aShortcut [ self eventDispatcher removeShortcut: aShortcut ] -{ #category : 'shortcut management' } +{ #category : #'shortcut management' } TBlEventTarget >> removeShortcutsWithCombination: aBlKeyCombination [ self eventDispatcher removeAllShortcutsWithCombination: aBlKeyCombination ] -{ #category : 'shortcut management' } +{ #category : #'shortcut management' } TBlEventTarget >> shortcuts [ ^ self eventDispatcher shortcutHandler shortcuts ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> when: anEventClass do: aBlock [ self addEventHandlerOn: anEventClass do: aBlock ] -{ #category : 'event management' } +{ #category : #'event management' } TBlEventTarget >> when: anEventClass doOnce: aBlock [ | anEventHandler | diff --git a/src/Bloc/TBlHostSpace.trait.st b/src/Bloc/TBlHostSpace.trait.st index 8c09dbbd5..4e0499611 100644 --- a/src/Bloc/TBlHostSpace.trait.st +++ b/src/Bloc/TBlHostSpace.trait.st @@ -6,71 +6,69 @@ An Host Space is an actual screen area provided by the underlying Host. This area is typically an host-specific window. " Trait { - #name : 'TBlHostSpace', + #name : #TBlHostSpace, #instVars : [ 'host', 'space', 'universe', 'renderer' ], - #category : 'Bloc-Universe - Host', - #package : 'Bloc', - #tag : 'Universe - Host' + #category : 'Bloc-Universe - Host' } -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> close [ self explicitRequirement ] -{ #category : 'initialization' } +{ #category : #initialization } TBlHostSpace >> createBufferSurfaceRenderer [ "Answer a new `BlHostSurfaceRenderer`." ^ self explicitRequirement ] -{ #category : 'initialization' } +{ #category : #initialization } TBlHostSpace >> createFormSurfaceRenderer [ "Answer a new `BlHostSurfaceRenderer`." ^ self explicitRequirement ] -{ #category : 'host space - cursor' } +{ #category : #'host space - cursor' } TBlHostSpace >> cursor: aCursor [ "Change current cursor image/view to the given one." self explicitRequirement ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } TBlHostSpace >> densityDpi [ "Return the screen density expressed as the number of dots-per-inch." ^ self explicitRequirement ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> detachHost [ host := nil ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> detachSpace [ space := nil ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> detachUniverse [ universe := nil ] -{ #category : 'host space - events' } +{ #category : #'host space - events' } TBlHostSpace >> enqueueEvent: aBlEvent [ "I dispatch events directly to the universe or space as soon as they come" @@ -83,17 +81,17 @@ TBlHostSpace >> enqueueEvent: aBlEvent [ self space dispatchEvent: aBlEvent ] -{ #category : 'host space - events' } +{ #category : #'host space - events' } TBlHostSpace >> fetchedEventsDo: aBlock [ "Flush event queue and evaluate a given block with every queued event as argument" ] -{ #category : 'host space - events' } +{ #category : #'host space - events' } TBlHostSpace >> generateEvents [ "Generate more complex state change events such as window scale event when resolution of the screen changes" ] -{ #category : 'host space - testing' } +{ #category : #'host space - testing' } TBlHostSpace >> hasResized [ "Return true if renderer extent changed. It may happen if window moved between displays with different DPI, @@ -102,27 +100,27 @@ TBlHostSpace >> hasResized [ ^ self renderer hasResized: self ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> host [ "Return a host that was used to create this host space" ^ host ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> host: aBlHost [ "Assign a host that was used to create this host space" host := aBlHost ] -{ #category : 'initialization' } +{ #category : #initialization } TBlHostSpace >> initializeRenderer [ renderer initializeForHostSpace: self ] -{ #category : 'host space - testing' } +{ #category : #'host space - testing' } TBlHostSpace >> isVisible [ "Return true if underlying window is shown, false otherwise. Note: If window was shown and then minimized it is still considered to be visible. @@ -131,7 +129,7 @@ TBlHostSpace >> isVisible [ ^ self explicitRequirement ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } TBlHostSpace >> logicalSize [ "Returns the logical size of the host's client area (instance of `BlLogicalDisplaySize`). The client area is the content of the window, excluding the title bar and borders. @@ -140,43 +138,43 @@ TBlHostSpace >> logicalSize [ ^ self explicitRequirement ] -{ #category : 'host space - rendering' } +{ #category : #'host space - rendering' } TBlHostSpace >> makeCurrent [ "When displaying visual content on the screen very often a window framebuffer must be marked as a current." ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> maximize [ self explicitRequirement ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> maximized [ ^ self explicitRequirement ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> minimize [ self explicitRequirement ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> minimized [ ^ self explicitRequirement ] -{ #category : 'host space - testing' } +{ #category : #'host space - testing' } TBlHostSpace >> needsRebuild [ "Return true if window should be recreated after user saved and quit Pharo." ^ self explicitRequirement ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } TBlHostSpace >> physicalSize [ "Return a physical host size which is what the framebuffer size should be (Instance of `BlPhysicalDisplaySize`). This size may differ from the logical size on high DPI (Retina) screens. @@ -185,32 +183,32 @@ TBlHostSpace >> physicalSize [ ^ self explicitRequirement ] -{ #category : 'host space - rendering' } +{ #category : #'host space - rendering' } TBlHostSpace >> render: aSpace [ "Render a given abstract space on an underlying window or visual area" self renderer render: self ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> renderer [ "Return the host renderer used to render the elements of my spaces." ^ renderer ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> renderer: aBlHostRenderer [ renderer := aBlHostRenderer ] -{ #category : 'host space - rendering' } +{ #category : #'host space - rendering' } TBlHostSpace >> requestRedraw [ "Space needs to redraw the window" ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } TBlHostSpace >> scaleFactor [ "Return a scaling dpi factor from logical to physical coordinates. On high DPI displays, scaling factor is > 1." @@ -234,65 +232,65 @@ TBlHostSpace >> scaleFactor [ ^ aWidthScale ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> show [ self explicitRequirement ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> space [ "Return a space I am assigned to." ^ space ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> space: aSpace [ "Assign me to a given space." space := aSpace ] -{ #category : 'host space - testing' } +{ #category : #'host space - testing' } TBlHostSpace >> supportsBufferSurface [ "Return true if this host space can work with a buffer surface, false otherwise." ^ self host supportsBufferSurface ] -{ #category : 'host space - testing' } +{ #category : #'host space - testing' } TBlHostSpace >> supportsFormSurface [ "Return true if this host space can work with form surface, false otherwise." ^ self host supportsFormSurface ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> toBack [ self explicitRequirement ] -{ #category : 'host space - displaying' } +{ #category : #'host space - displaying' } TBlHostSpace >> toFront [ self explicitRequirement ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> universe [ ^ universe ] -{ #category : 'host space - accessing' } +{ #category : #'host space - accessing' } TBlHostSpace >> universe: aBlParallelUniverse [ universe := aBlParallelUniverse ] -{ #category : 'host space - geometry' } +{ #category : #'host space - geometry' } TBlHostSpace >> windowExtent: anExtent [ self explicitRequirement diff --git a/src/Bloc/TBlLayoutChildNode.trait.st b/src/Bloc/TBlLayoutChildNode.trait.st index e1433ec24..83cf6e83a 100644 --- a/src/Bloc/TBlLayoutChildNode.trait.st +++ b/src/Bloc/TBlLayoutChildNode.trait.st @@ -1,16 +1,14 @@ Trait { - #name : 'TBlLayoutChildNode', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #TBlLayoutChildNode, + #category : 'Bloc-Layouts-Model' } -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> bottom [ ^ self position y + self height ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> bounds [ @@ -19,7 +17,7 @@ TBlLayoutChildNode >> bounds [ extent: self extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> extent [ "Return the size of the node in the parent coordinate system" @@ -27,55 +25,55 @@ TBlLayoutChildNode >> extent [ ^ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> height [ ^ self extent y ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> layoutBounds [ ^ self explicitRequirement ] -{ #category : 'api - measure' } +{ #category : #'api - measure' } TBlLayoutChildNode >> measure: anExtentSpec [ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutChildNode >> measurement: aBlLayoutNodeMeasurement [ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutChildNode >> parent [ ^ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutChildNode >> parent: aBlLayoutParentNode [ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> perimeter [ ^ (self width + self height) * 2 ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } TBlLayoutChildNode >> popAction [ ^ self explicitRequirement ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } TBlLayoutChildNode >> popActions [ @@ -84,7 +82,7 @@ TBlLayoutChildNode >> popActions [ [ (eachAction := self popAction) notNil ] whileTrue: [ aStream nextPut: eachAction ] ] ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> position [ "Return a position of the top left corner in the parent coordinate system" @@ -92,7 +90,7 @@ TBlLayoutChildNode >> position [ ^ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> position: aPoint [ "Set position of the top left corner in the parent coordinate system" @@ -100,31 +98,31 @@ TBlLayoutChildNode >> position: aPoint [ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutChildNode >> privateMeasurement [ ^ self explicitRequirement ] -{ #category : 'api - actions' } +{ #category : #'api - actions' } TBlLayoutChildNode >> pushAction: aBlLayoutNodeElementAction [ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> right [ ^ self position x + self width ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutChildNode >> userData [ ^ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutChildNode >> width [ diff --git a/src/Bloc/TBlLayoutNode.trait.st b/src/Bloc/TBlLayoutNode.trait.st index 30e6773d7..341e45230 100644 --- a/src/Bloc/TBlLayoutNode.trait.st +++ b/src/Bloc/TBlLayoutNode.trait.st @@ -1,120 +1,118 @@ Trait { - #name : 'TBlLayoutNode', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #TBlLayoutNode, + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> constraints [ ^ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> constraints: aBlLayoutConstraints [ self explicitRequirement ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> fitContent [ self hFitContent; vFitContent ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> hExact: aNumber [ self constraints horizontal exact: aNumber ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> hFitContent [ self constraints horizontal fitContent ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> hMatchParent [ self constraints horizontal matchParent ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> horizontalResizer [ ^ self constraints horizontal resizer ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> isHorizontalMatchParent [ ^ self horizontalResizer isMatchParent ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> isVerticalMatchParent [ ^ self verticalResizer isMatchParent ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> margin [ ^ self constraints margin ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> matchParent [ self hMatchParent; vMatchParent ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> maxExtent [ ^ self maxWidth @ self maxHeight ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> maxHeight [ ^ self constraints maxHeight ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> maxWidth [ ^ self constraints maxWidth ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> minExtent [ ^ self minWidth @ self minHeight ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> minHeight [ ^ self constraints minHeight ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> minWidth [ ^ self constraints minWidth ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutNode >> padding [ ^ self constraints padding ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> vExact: aNumber [ self constraints vertical exact: aNumber ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> vFitContent [ self constraints vertical fitContent ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> vMatchParent [ self constraints vertical matchParent ] -{ #category : 'api - resizer' } +{ #category : #'api - resizer' } TBlLayoutNode >> verticalResizer [ ^ self constraints vertical resizer ] diff --git a/src/Bloc/TBlLayoutParentNode.trait.st b/src/Bloc/TBlLayoutParentNode.trait.st index c7d1d4d5d..5bd60f6be 100644 --- a/src/Bloc/TBlLayoutParentNode.trait.st +++ b/src/Bloc/TBlLayoutParentNode.trait.st @@ -1,60 +1,58 @@ Trait { - #name : 'TBlLayoutParentNode', - #category : 'Bloc-Layouts-Model', - #package : 'Bloc', - #tag : 'Layouts-Model' + #name : #TBlLayoutParentNode, + #category : 'Bloc-Layouts-Model' } -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutParentNode >> children [ ^ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutParentNode >> children: aBlLayoutNodeChildren [ self explicitRequirement ] -{ #category : 'api - enumerating' } +{ #category : #'api - enumerating' } TBlLayoutParentNode >> childrenDo: aBlock [ self children do: aBlock ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutParentNode >> extent [ ^ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutParentNode >> extent: aPoint [ self explicitRequirement ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } TBlLayoutParentNode >> extentSpec [ ^ self explicitRequirement ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } TBlLayoutParentNode >> extentSpec: aBlExtentMeasurementSpec [ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutParentNode >> height [ ^ self extent y ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } TBlLayoutParentNode >> heightSpec [ ^ self extentSpec heightSpec ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutParentNode >> layoutExtent [ self deprecated: 'Use #extent instead.' @@ -63,7 +61,7 @@ TBlLayoutParentNode >> layoutExtent [ ^ self extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutParentNode >> measuredExtent [ @@ -74,7 +72,7 @@ TBlLayoutParentNode >> measuredExtent [ ^ self extent ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutParentNode >> measuredExtent: aPoint [ self deprecated: 'Please use extent: instead.' @@ -85,27 +83,27 @@ TBlLayoutParentNode >> measuredExtent: aPoint [ self extent: aPoint ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutParentNode >> parent [ ^ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutParentNode >> position [ ^ self explicitRequirement ] -{ #category : 'accessing' } +{ #category : #accessing } TBlLayoutParentNode >> position: aPoint [ ^ self explicitRequirement ] -{ #category : 'api - geometry' } +{ #category : #'api - geometry' } TBlLayoutParentNode >> width [ ^ self extent x ] -{ #category : 'api - extent spec' } +{ #category : #'api - extent spec' } TBlLayoutParentNode >> widthSpec [ ^ self extentSpec widthSpec ] diff --git a/src/Bloc/TBlSpaceProperties.trait.st b/src/Bloc/TBlSpaceProperties.trait.st index 628d5567f..f5da83868 100644 --- a/src/Bloc/TBlSpaceProperties.trait.st +++ b/src/Bloc/TBlSpaceProperties.trait.st @@ -5,13 +5,11 @@ I must be implemented by all host spaces for window specific implementation. By using this Trait in both Space and HostSpace we make sure that they have the same uniform API " Trait { - #name : 'TBlSpaceProperties', - #category : 'Bloc-Space', - #package : 'Bloc', - #tag : 'Space' + #name : #TBlSpaceProperties, + #category : 'Bloc-Space' } -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> borderless [ "Return true if underlying window is now borderless, false otherwise" @@ -19,14 +17,14 @@ TBlSpaceProperties >> borderless [ ^ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> borderless: aBoolean [ "Make host window borderless if true is given" self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> fullscreen [ "Return true if an underlying window is in fullscreen mode, false otherwise" @@ -35,7 +33,7 @@ TBlSpaceProperties >> fullscreen [ ^ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> fullscreen: aBoolean [ "Switch underlying window to fullscreen if true is given and exit fullscreen mode if false is given" @@ -43,7 +41,7 @@ TBlSpaceProperties >> fullscreen: aBoolean [ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> fullsize [ "Return true if an underlying window is in fullsize mode, false otherwise. @@ -54,7 +52,7 @@ TBlSpaceProperties >> fullsize [ ^ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> fullsize: aBoolean [ "Switch underlying window to fullsize if true is given and exit fullsize mode if false is given. @@ -63,14 +61,14 @@ TBlSpaceProperties >> fullsize: aBoolean [ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> icon: aForm [ "Change window's icon to the given one" self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> position [ "Return window's position in screen coordinates" @@ -78,7 +76,7 @@ TBlSpaceProperties >> position [ ^ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> position: aPoint [ "Change window's position to a given point in screen coordinates" @@ -86,7 +84,7 @@ TBlSpaceProperties >> position: aPoint [ ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> resizable [ "Return true if underlying window is resizable, false otherwise" @@ -94,14 +92,14 @@ TBlSpaceProperties >> resizable [ ^ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> resizable: aBoolean [ "Make underlying window resizable if true is given" self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> title [ "Return window's title as a string" @@ -109,7 +107,7 @@ TBlSpaceProperties >> title [ ^ self explicitRequirement ] -{ #category : 'window - properties' } +{ #category : #'window - properties' } TBlSpaceProperties >> title: aString [ "Change window's title" diff --git a/src/Bloc/TBlTelemetry.trait.st b/src/Bloc/TBlTelemetry.trait.st index 7b31a95f9..f1f02ffea 100644 --- a/src/Bloc/TBlTelemetry.trait.st +++ b/src/Bloc/TBlTelemetry.trait.st @@ -1,11 +1,9 @@ Trait { - #name : 'TBlTelemetry', - #category : 'Bloc-Space - Telemetry', - #package : 'Bloc', - #tag : 'Space - Telemetry' + #name : #TBlTelemetry, + #category : 'Bloc-Space - Telemetry' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } TBlTelemetry >> emit [ self tasks ifNotEmpty: [ :theTasks | (BlTelemetrySignal new @@ -14,24 +12,24 @@ TBlTelemetry >> emit [ self reset ] -{ #category : 'tasks' } +{ #category : #tasks } TBlTelemetry >> finishSync [ ] -{ #category : 'tasks' } +{ #category : #tasks } TBlTelemetry >> reset [ ] -{ #category : 'tasks' } +{ #category : #tasks } TBlTelemetry >> startSync: aNameBlock [ ] -{ #category : 'tasks' } +{ #category : #tasks } TBlTelemetry >> tasks [ ^ BlTelemetryTasks new ] -{ #category : 'tasks' } +{ #category : #tasks } TBlTelemetry >> timeSync: aNameBlock during: aBlock [ self startSync: aNameBlock. ^ aBlock ensure: [ self finishSync ] diff --git a/src/Bloc/TBlTransformable.trait.st b/src/Bloc/TBlTransformable.trait.st index 80f3209c1..2ff09c361 100644 --- a/src/Bloc/TBlTransformable.trait.st +++ b/src/Bloc/TBlTransformable.trait.st @@ -2,19 +2,17 @@ I define an interface that transformable objects should implement in order to support affine transformations " Trait { - #name : 'TBlTransformable', - #category : 'Bloc-Basic-Transformations', - #package : 'Bloc', - #tag : 'Basic-Transformations' + #name : #TBlTransformable, + #category : 'Bloc-Basic-Transformations' } -{ #category : 'transformations' } +{ #category : #transformations } TBlTransformable >> transform [ ^ BlTransformationBuilder on: self ] -{ #category : 'transformations' } +{ #category : #transformations } TBlTransformable >> transformDo: aBlock [ | aTransformationBuilder | @@ -23,7 +21,7 @@ TBlTransformable >> transformDo: aBlock [ aTransformationBuilder apply ] -{ #category : 'transformations' } +{ #category : #transformations } TBlTransformable >> transformation [ "Return a `BlElementTransformation` that represents a description of my transformation. It can either be a local transformation being a composition of affine transformations or @@ -32,7 +30,7 @@ TBlTransformable >> transformation [ ^ self explicitRequirement ] -{ #category : 'transformations' } +{ #category : #transformations } TBlTransformable >> transformation: aBlElementTransformation [ self explicitRequirement diff --git a/src/Bloc/UndefinedObject.extension.st b/src/Bloc/UndefinedObject.extension.st index ce779aa52..905bf45f2 100644 --- a/src/Bloc/UndefinedObject.extension.st +++ b/src/Bloc/UndefinedObject.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'UndefinedObject' } +Extension { #name : #UndefinedObject } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } UndefinedObject >> asBlocElementId [ ^ BlElementId noId ] diff --git a/src/Bloc/Unicode.extension.st b/src/Bloc/Unicode.extension.st index 00ad418c4..ef65f80d6 100644 --- a/src/Bloc/Unicode.extension.st +++ b/src/Bloc/Unicode.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'Unicode' } +Extension { #name : #Unicode } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } Unicode class >> isPrintable: aCharacter [ | value codeCat | diff --git a/src/Bloc/UnixPlatform.extension.st b/src/Bloc/UnixPlatform.extension.st index def52ee62..cd69d9f17 100644 --- a/src/Bloc/UnixPlatform.extension.st +++ b/src/Bloc/UnixPlatform.extension.st @@ -1,6 +1,6 @@ -Extension { #name : 'UnixPlatform' } +Extension { #name : #UnixPlatform } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } UnixPlatform >> primaryModifier [ ^ BlAlternativeCombination new key: KeyboardKey controlLeft; @@ -8,7 +8,7 @@ UnixPlatform >> primaryModifier [ yourself ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } UnixPlatform >> secondaryModifier [ ^ BlAlternativeCombination new key: KeyboardKey altLeft; diff --git a/src/Bloc/WinPlatform.extension.st b/src/Bloc/WinPlatform.extension.st index c4be5ea2e..3f9c8323f 100644 --- a/src/Bloc/WinPlatform.extension.st +++ b/src/Bloc/WinPlatform.extension.st @@ -1,12 +1,12 @@ -Extension { #name : 'WinPlatform' } +Extension { #name : #WinPlatform } -{ #category : '*Bloc' } +{ #category : #'*Bloc' } WinPlatform >> defaultScrollingVelocity [ ^ 100 ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } WinPlatform >> primaryModifier [ ^ BlAlternativeCombination new key: KeyboardKey controlLeft; @@ -14,7 +14,7 @@ WinPlatform >> primaryModifier [ yourself ] -{ #category : '*Bloc' } +{ #category : #'*Bloc' } WinPlatform >> secondaryModifier [ ^ BlAlternativeCombination new key: KeyboardKey altLeft; diff --git a/src/Bloc/package.st b/src/Bloc/package.st index fc02f7179..1deef64ec 100644 --- a/src/Bloc/package.st +++ b/src/Bloc/package.st @@ -1 +1 @@ -Package { #name : 'Bloc' } +Package { #name : #Bloc }