Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup #26

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Extension { #name : #BlAffineCompositeTransformation }

{ #category : #'*Bloc-Serialization-Stash' }
BlAffineCompositeTransformation >> allSetterAndGettersForMyStash [
BlAffineCompositeTransformation >> stashAccessors [

^ self transformations flatCollect: [ :each | each allSetterAndGettersForMyStash ]
<stashAccessors>
^ self transformations flatCollect: [ :each |
each allSetterAndGettersForMyStash ]
]
20 changes: 8 additions & 12 deletions src/Bloc-Serialization-Stash/BlFlowLayout.extension.st
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
Extension { #name : #BlFlowLayout }

{ #category : #'*Bloc-Serialization-Stash' }
BlFlowLayout >> allSetterAndGettersForMyStash [
BlFlowLayout >> asStashConstructor [

self orientation isVertical ifTrue: [ ^ 'BlFlowLayout vertical' ].
^ 'BlFlowLayout horizontal'
]

{ #category : #'*Bloc-Serialization-Stash' }
BlFlowLayout >> stashAccessors [

"We ovverride this method to take into account the default value of alignment"
<stashAccessors>
| settersAndGetters |
settersAndGetters := OrderedCollection new.
(verticalAlignment == self defaultVerticalAlignment and: [
horizontalAlignment == self defaultHorizontalAlignment ]) ifFalse: [
settersAndGetters addAll: self allSetterAndGettersForMyStashForMyTraits ].
self direction == self defaultDirection ifFalse: [
settersAndGetters add: #direction ].
^ settersAndGetters
]

{ #category : #'*Bloc-Serialization-Stash' }
BlFlowLayout >> asStashConstructor [

self orientation isVertical ifTrue: [ ^ 'BlFlowLayout vertical' ].
^ 'BlFlowLayout horizontal'
]
19 changes: 8 additions & 11 deletions src/Bloc-Serialization-Stash/BlLinearLayout.extension.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
Extension { #name : #BlLinearLayout }

{ #category : #'*Bloc-Serialization-Stash' }
BlLinearLayout >> allSetterAndGettersForMyStash [
BlLinearLayout >> asStashConstructor [

self isVertical ifTrue: [ ^ 'BlLinearLayout vertical' ].
^ 'BlLinearLayout horizontal'
]

{ #category : #'*Bloc-Serialization-Stash' }
BlLinearLayout >> stashAccessors [
"We ovverride this method to take into account the default value of alignment"

<stashAccessors>
| settersAndGetters |
settersAndGetters := OrderedCollection new.
(verticalAlignment == self defaultVerticalAlignment and: [
horizontalAlignment == self defaultHorizontalAlignment ]) ifFalse: [
settersAndGetters addAll: self allSetterAndGettersForMyStashForMyTraits ].
cellSpacing == 0.0 ifFalse: [ settersAndGetters add: #cellSpacing ].
interspace == 0.0 ifFalse: [ settersAndGetters add: #interspace ].
self direction == self defaultDirection ifFalse: [
Expand All @@ -23,10 +27,3 @@ BlLinearLayout >> allSetterAndGettersForMyStash [
settersAndGetters add: #weightSum ].
^ settersAndGetters
]

{ #category : #'*Bloc-Serialization-Stash' }
BlLinearLayout >> asStashConstructor [

self isVertical ifTrue: [ ^ 'BlLinearLayout vertical' ].
^ 'BlLinearLayout horizontal'
]
6 changes: 0 additions & 6 deletions src/Bloc-Serialization-Stash/BlTextElement.extension.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
Extension { #name : #BlTextElement }

{ #category : #'*Bloc-Serialization-Stash' }
BlTextElement >> allSetterAndGettersForMyStash [

^ super allSetterAndGettersForMyStash , { #text }
]

{ #category : #'*Bloc-Serialization-Stash' }
BlTextElement >> stashAccessors [

Expand Down
40 changes: 25 additions & 15 deletions src/Bloc-Serialization-Stash/TBlAlignable.extension.st
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
Extension { #name : #TBlAlignable }

{ #category : #'*Bloc-Serialization-Stash' }
TBlAlignable >> allSetterAndGettersOfTraitForMyStash: anObject [
TBlAlignable >> defaultStashAlignementTest [

^ { ([ :alignement |
| val |
val := #alignNone.
alignement isAlignTopLeft ifTrue: [ val := #alignTopLeft ].
alignement isAlignTopCenter ifTrue: [ val := #alignTopCenter ].
alignement isAlignTopRight ifTrue: [ val := #alignTopRight ].
alignement isAlignCenterLeft ifTrue: [ val := #alignCenterLeft ].
alignement isAlignCenter ifTrue: [ val := #alignCenter ].
alignement isAlignCenterRight ifTrue: [ val := #alignCenterRight ].
alignement isAlignBottomLeft ifTrue: [ val := #alignBottomLeft ].
alignement isAlignBottomCenter ifTrue: [
val := #alignBottomCenter ].
alignement isAlignBottomRight ifTrue: [ val := #alignBottomRight ].
val ] -> self) onlySetOnStash }
^ (self verticalAlignment == self defaultVerticalAlignment and: [
self horizontalAlignment == self defaultHorizontalAlignment ])
]

{ #category : #'*Bloc-Serialization-Stash' }
TBlAlignable >> stashAccessorForTBlAlignable [

<stashAccessors>
self defaultStashAlignementTest ifTrue: [ ^ { } ].
self isAlignTopLeft ifTrue: [ ^ { #alignTopLeft onlySetOnStash } ].
self isAlignTopCenter ifTrue: [ ^ { #alignTopCenter onlySetOnStash } ].
self isAlignTopRight ifTrue: [ ^ { #alignTopRight onlySetOnStash } ].
self isAlignCenterLeft ifTrue: [
^ { #alignCenterLeft onlySetOnStash } ].
self isAlignCenter ifTrue: [ ^ { #alignCenter onlySetOnStash } ].
self isAlignCenterRight ifTrue: [
^ { #alignCenterRight onlySetOnStash } ].
self isAlignBottomLeft ifTrue: [
^ { #alignBottomLeft onlySetOnStash } ].
self isAlignBottomCenter ifTrue: [
^ { #alignBottomCenter onlySetOnStash } ].
self isAlignBottomRight ifTrue: [
^ { #alignBottomRight onlySetOnStash } ].
^ { }
]
Loading