Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyan11 committed Oct 1, 2024
1 parent 05009ed commit 311ddae
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 46 deletions.
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 } ].
^ { }
]

0 comments on commit 311ddae

Please sign in to comment.