Skip to content

Commit

Permalink
Merge pull request #577 from pharo-graphics/RescueDucasseExampleCleanup
Browse files Browse the repository at this point in the history
Rescue ducasse example cleanup
  • Loading branch information
tinchodias authored Aug 14, 2024
2 parents cb4eecd + fa0e884 commit 7aa3072
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 159 deletions.
9 changes: 0 additions & 9 deletions src/Bloc-Examples/BlGridLayoutUsageTest.class.st

This file was deleted.

18 changes: 0 additions & 18 deletions src/Bloc-Examples/BlHandlerAnnouncerRegistryExamplesTest.class.st

This file was deleted.

18 changes: 0 additions & 18 deletions src/Bloc-Examples/BlHandlerArrayRegistryExamplesTest.class.st

This file was deleted.

1 change: 0 additions & 1 deletion src/Bloc-Infinite/BlInfiniteDataSourceManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ BlInfiniteDataSourceManager >> dispatchCommand: aCommand to: anInfiniteElement [
BlInfiniteDataSourceManager >> hasCommands [
"Return true if there are both pending and postponed commands,
otherwise false"
<return: #Boolean>

^ self hasPendingCommands and: [ self hasPostponedCommands ]
]
Expand Down
1 change: 0 additions & 1 deletion src/Bloc-Infinite/BlInfiniteLayoutOrientation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ BlInfiniteLayoutOrientation >> startWithPadding [
{ #category : #geometry }
BlInfiniteLayoutOrientation >> totalSpace [
"Returns the total space to layout"
<return: #Number>

^ self endWithPadding - self startWithPadding
]
Expand Down
15 changes: 9 additions & 6 deletions src/Bloc-Layout/BlGridLayoutAxis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ BlGridLayoutAxis >> arcs [

{ #category : #'computing links' }
BlGridLayoutAxis >> backwardLinks [
<return: #BlGridPackedMap key: #Interval value: #BlGridMutableInteger>
"Return a BlGridPackedMap whose key is an interval and value is aBlGridMutableInteger"

backwardLinks
ifNil: [ backwardLinks := self createLinks: false ].
Expand Down Expand Up @@ -299,7 +299,8 @@ BlGridLayoutAxis >> createArcs [

{ #category : #'computing group bounds' }
BlGridLayoutAxis >> createGroupBounds [
<return: #BlGridPackedMap key: #BlGridLayoutSpec value: #BlGridLayoutBounds>
"Return a BlGridPackedMap whose key is an BlGridLayoutSpec and value is BlGridLayoutBounds"

|assocs|

assocs := OrderedCollection new.
Expand All @@ -313,7 +314,8 @@ BlGridLayoutAxis >> createGroupBounds [

{ #category : #'computing links' }
BlGridLayoutAxis >> createLinks: isMin [
<return: #BlGridPackedMap key: #Interval value: #BlGridMutableInteger>
"Return a BlGridPackedMap whose key is an interval and value is aBlGridMutableInteger"

| theLinks |

theLinks := OrderedCollection new.
Expand Down Expand Up @@ -359,7 +361,7 @@ BlGridLayoutAxis >> element: anElement [

{ #category : #'computing links' }
BlGridLayoutAxis >> forwardLinks [
<return: #BlGridPackedMap key: #Interval value: #BlGridMutableInteger>
"Return a BlGridPackedMap whose key is an interval and value is aBlGridMutableInteger"

forwardLinks
ifNil: [ forwardLinks := self createLinks: true ].
Expand All @@ -376,7 +378,8 @@ BlGridLayoutAxis >> groupArcsByFirstVertex: theArcs [
"Group arcs by their first vertex, returning an array of arrays of Arcs.
This is linear in the number of arcs.
theArcs is collection of BlGridLayoutArc."
<return: #Array of: #Array of: #BlGridLayoutArc>
"return an Array of Array of BlGridLayoutArc"

| n groups sizes |

n := self count + 1.
Expand All @@ -402,7 +405,7 @@ BlGridLayoutAxis >> groupArcsByFirstVertex: theArcs [

{ #category : #'computing group bounds' }
BlGridLayoutAxis >> groupBounds [
<return: #BlGridPackedMap key: #BlGridLayoutSpec value: #BlGridLayoutBounds>
"Return a BlGridPackedMap whose key is a BlGridLayoutSpec and value is aBlGridLayoutBounds"

groupBounds
ifNil: [ groupBounds := self createGroupBounds ].
Expand Down
1 change: 0 additions & 1 deletion src/Bloc-Text-Rope/BlRopedTextIterator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ BlRopedTextIterator >> hasPrevious [
{ #category : #'iterator - enumeration' }
BlRopedTextIterator >> next [
"Return an item (character) at current position and move one to the right"
<return: #Character or: #Object>

^ iterator next
]
Expand Down
1 change: 0 additions & 1 deletion src/Bloc-Text/BlSubTextIterator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ BlSubTextIterator >> hasPrevious [
{ #category : #'iterator - enumeration' }
BlSubTextIterator >> next [
"Return an item (character) at current position and move one to the right"
<return: #Character or: #Object>

^ iterator next
]
Expand Down
1 change: 0 additions & 1 deletion src/Bloc-Text/BlTextIterator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ BlTextIterator >> hasPrevious [
{ #category : #'iterator - enumeration' }
BlTextIterator >> next [
"Return an item (character) at current position and move one to the right"
<return: #Character or: #Object>

^ self subclassResponsibility
]
Expand Down
2 changes: 1 addition & 1 deletion src/Bloc-Text/BlTextReadStream.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ BlTextReadStream >> iterator: aBlTextIterator [
{ #category : #'stream - enumeration' }
BlTextReadStream >> next [
"Return an item (character) at current position and move one to the right"
<return: #Character or: #Object>

^ self iterator next
]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
"
I contain examples of a grid layout
I show how different resizing strategies work and how to build advanced layouts with the help of a grid
I have been automatically converted and probably manually tweaked from BlGridLayoutUsageExamples. Pay attention there is an important design decision in such tests. First to let GT people execute them, the tests and helpers are tagged with <gtExample> do not remove them, let also the <label:...>.
Finally and more important such tests should not use setup because every method should be in capacity of returning a fully working object called an example :)
"
Class {
#name : #BlGridLayoutUsageExamples,
#superclass : #BlExamplesTest,
#category : #'Bloc-Examples-Documentation'
#name : #BlGridLayoutUsageTest,
#superclass : #TestCase,
#category : #'Bloc-UnitedTests'
}

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleDistributed2x2Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleDistributed2x2Grid [

<sampleInstance>
<demo>
| e1 e2 e3 e4 el |
e1 := BlElement new
constraintsDo: [ :c |
Expand Down Expand Up @@ -54,11 +51,10 @@ BlGridLayoutUsageExamples >> exampleDistributed2x2Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleDistributedWithSpan2x2Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleDistributedWithSpan2x2Grid [

<sampleInstance>
<demo>
| e1 e2 e3 el |
e1 := BlElement new
constraintsDo: [ :c |
Expand Down Expand Up @@ -94,11 +90,10 @@ BlGridLayoutUsageExamples >> exampleDistributedWithSpan2x2Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleDistributedWithWeight2x2Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleDistributedWithWeight2x2Grid [

<sampleInstance>
<demo>
| e1 e2 e3 e4 el |
e1 := BlElement new
constraintsDo: [ :c |
Expand Down Expand Up @@ -140,11 +135,10 @@ BlGridLayoutUsageExamples >> exampleDistributedWithWeight2x2Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleHorizontal2x1Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleHorizontal2x1Grid [

<sampleInstance>
<demo>
| e1 e2 el |
e1 := BlElement new
size: 150 asPoint;
Expand All @@ -166,11 +160,10 @@ BlGridLayoutUsageExamples >> exampleHorizontal2x1Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleHorizontalSpacing2x1Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleHorizontalSpacing2x1Grid [

<sampleInstance>
<demo>
| e1 e2 el |
e1 := BlElement new
constraintsDo: [ :c |
Expand All @@ -196,11 +189,10 @@ BlGridLayoutUsageExamples >> exampleHorizontalSpacing2x1Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleInCellAlignment2x2Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleInCellAlignment2x2Grid [

<sampleInstance>
<demo>
| e1 e2 e3 el |
e1 := BlElement new
constraintsDo: [ :c |
Expand Down Expand Up @@ -237,11 +229,10 @@ BlGridLayoutUsageExamples >> exampleInCellAlignment2x2Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleNautilusGrid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleNautilusGrid [

<sampleInstance>
<demo>
| e1 e2 e3 e4 e5 el |
e1 := BlElement new
constraintsDo: [ :c |
Expand Down Expand Up @@ -290,11 +281,10 @@ BlGridLayoutUsageExamples >> exampleNautilusGrid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleSimple2x2Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleSimple2x2Grid [

<sampleInstance>
<demo>
| e1 e2 e3 e4 el |
e1 := BlElement new
size: 150 asPoint;
Expand Down Expand Up @@ -326,11 +316,10 @@ BlGridLayoutUsageExamples >> exampleSimple2x2Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleSpacing9x9Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleSpacing9x9Grid [

<sampleInstance>
<demo>
| children el dim |
dim := 9.

Expand Down Expand Up @@ -358,11 +347,10 @@ BlGridLayoutUsageExamples >> exampleSpacing9x9Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleVertical1x2Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleVertical1x2Grid [

<sampleInstance>
<demo>
| e1 e2 el |
e1 := BlElement new
size: 150 asPoint;
Expand All @@ -384,11 +372,10 @@ BlGridLayoutUsageExamples >> exampleVertical1x2Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> exampleVerticalSpacing1x2Grid [
{ #category : #fixture }
BlGridLayoutUsageTest >> testExampleVerticalSpacing1x2Grid [

<sampleInstance>
<demo>
| e1 e2 el |
e1 := BlElement new
constraintsDo: [ :c |
Expand All @@ -414,11 +401,10 @@ BlGridLayoutUsageExamples >> exampleVerticalSpacing1x2Grid [
^ el
]

{ #category : #examples }
BlGridLayoutUsageExamples >> verticalSpan [
{ #category : #fixture }
BlGridLayoutUsageTest >> testVerticalSpan [

<sampleInstance>
<demo>
| grid child1 child2 child3 |
grid := BlElement new.
grid size: 500 @ 400.
Expand Down
Loading

0 comments on commit 7aa3072

Please sign in to comment.