Skip to content

Commit

Permalink
hello
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisCnockaert authored and AlexisCnockaert committed Jun 26, 2024
1 parent 2bc149e commit e14d7d0
Show file tree
Hide file tree
Showing 37 changed files with 431 additions and 341 deletions.
4 changes: 2 additions & 2 deletions Mooflod/BlElement.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #BlElement }
Extension { #name : 'BlElement' }

{ #category : #'*Mooflod' }
{ #category : '*Mooflod' }
BlElement >> newMooflodSkin [

^ MfBasicMooflodSkin new
Expand Down
8 changes: 5 additions & 3 deletions Mooflod/MfBasicMooflodSkin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ I'm the root of all the skins of the MooFlod project.
"
Class {
#name : #MfBasicMooflodSkin,
#superclass : #ToBasicSkin,
#category : 'Mooflod-Core'
#name : 'MfBasicMooflodSkin',
#superclass : 'ToBasicSkin',
#category : 'Mooflod-Core',
#package : 'Mooflod',
#tag : 'Core'
}
10 changes: 6 additions & 4 deletions Mooflod/MfCircleElement.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #MfCircleElement,
#superclass : #ToElement,
#category : 'Mooflod-FractalCircleWidget'
#name : 'MfCircleElement',
#superclass : 'ToElement',
#category : 'Mooflod-FractalCircleWidget',
#package : 'Mooflod',
#tag : 'FractalCircleWidget'
}

{ #category : #initialization }
{ #category : 'initialization' }
MfCircleElement >> initialize [

super initialize.
Expand Down
34 changes: 18 additions & 16 deletions Mooflod/MfFilledSquareElement.class.st
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
Class {
#name : #MfFilledSquareElement,
#superclass : #ToElement,
#name : 'MfFilledSquareElement',
#superclass : 'ToElement',
#instVars : [
'currentY',
'fill'
],
#classVars : [
'value'
],
#category : 'Mooflod-FilledSquareWidget'
#category : 'Mooflod-FilledSquareWidget',
#package : 'Mooflod',
#tag : 'FilledSquareWidget'
}

{ #category : #example }
{ #category : 'example' }
MfFilledSquareElement class >> exampleSimpleFilledSquare [

<script>
Expand All @@ -28,31 +30,31 @@ MfFilledSquareElement class >> exampleSimpleFilledSquare [
^ aSquare
]

{ #category : #accessing }
{ #category : 'accessing' }
MfFilledSquareElement >> currentY [

^currentY
]

{ #category : #initialization }
{ #category : 'initialization' }
MfFilledSquareElement >> defaultGeometry [

^BlSquareGeometry new
]

{ #category : #accessing }
{ #category : 'accessing' }
MfFilledSquareElement >> fill [
^fill
]

{ #category : #initialization }
{ #category : 'initialization' }
MfFilledSquareElement >> initFill [

fill := MfFillingLineElement new .
self addChild: fill
]

{ #category : #initialization }
{ #category : 'initialization' }
MfFilledSquareElement >> initialize [

super initialize.
Expand All @@ -64,7 +66,7 @@ MfFilledSquareElement >> initialize [
value := 0
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
MfFilledSquareElement >> openFilledSquare: aSquare [

| space |
Expand All @@ -77,26 +79,26 @@ MfFilledSquareElement >> openFilledSquare: aSquare [
^ aSquare
]

{ #category : #initialization }
{ #category : 'initialization' }
MfFilledSquareElement >> setValue: aValue [
(aValue between: 0 and: 100) ifTrue: [ self value: aValue ].
self updateSquare.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
MfFilledSquareElement >> squareExtent [

currentY := 0.
^ 200 @ 200
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
MfFilledSquareElement >> updateFill: anY [

fill size:200@anY
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
MfFilledSquareElement >> updateSquare [

currentY := 0.
Expand All @@ -105,12 +107,12 @@ MfFilledSquareElement >> updateSquare [
self updateFill: currentY ]
]

{ #category : #evaluating }
{ #category : 'evaluating' }
MfFilledSquareElement >> value [
^value
]

{ #category : #accessing }
{ #category : 'accessing' }
MfFilledSquareElement >> value: aValue [

value:= aValue
Expand Down
12 changes: 7 additions & 5 deletions Mooflod/MfFilledSquareElementTest.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #MfFilledSquareElementTest,
#superclass : #TestCase,
#category : 'Mooflod-FilledSquareWidget'
#name : 'MfFilledSquareElementTest',
#superclass : 'TestCase',
#category : 'Mooflod-FilledSquareWidget',
#package : 'Mooflod',
#tag : 'FilledSquareWidget'
}

{ #category : #tests }
{ #category : 'tests' }
MfFilledSquareElementTest >> testSquareIsFilledCorrectly [

| square |
Expand All @@ -14,7 +16,7 @@ MfFilledSquareElementTest >> testSquareIsFilledCorrectly [
self assert: square currentY equals: 112
]

{ #category : #tests }
{ #category : 'tests' }
MfFilledSquareElementTest >> testSquaredIsNotFilledAtAllAtInitialization [

| square |
Expand Down
10 changes: 6 additions & 4 deletions Mooflod/MfFillingLineElement.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #MfFillingLineElement,
#superclass : #ToElement,
#category : 'Mooflod-FilledSquareWidget'
#name : 'MfFillingLineElement',
#superclass : 'ToElement',
#category : 'Mooflod-FilledSquareWidget',
#package : 'Mooflod',
#tag : 'FilledSquareWidget'
}

{ #category : #initialization }
{ #category : 'initialization' }
MfFillingLineElement >> initialize [

super initialize.
Expand Down
32 changes: 17 additions & 15 deletions Mooflod/MfFractalCircleElement.class.st
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Class {
#name : #MfFractalCircleElement,
#superclass : #ToElement,
#name : 'MfFractalCircleElement',
#superclass : 'ToElement',
#instVars : [
'currentX',
'currentY',
'value',
'nbOfChilds'
],
#category : 'Mooflod-FractalCircleWidget'
#category : 'Mooflod-FractalCircleWidget',
#package : 'Mooflod',
#tag : 'FractalCircleWidget'
}

{ #category : #example }
{ #category : 'example' }
MfFractalCircleElement class >> exampleSimpleFractalCircle [

<script>
Expand All @@ -26,21 +28,21 @@ MfFractalCircleElement class >> exampleSimpleFractalCircle [
^ c
]

{ #category : #initialization }
{ #category : 'initialization' }
MfFractalCircleElement >> circleExtent [

^ 390 @ 390
]

{ #category : #internal }
{ #category : 'internal' }
MfFractalCircleElement >> createCircle: x y: anY [

| c |
c := MfCircleElement new size: x @ anY.
self addChild: c
]

{ #category : #internal }
{ #category : 'internal' }
MfFractalCircleElement >> createCircle: x y: anY color: aColor [

| c color |
Expand All @@ -50,24 +52,24 @@ MfFractalCircleElement >> createCircle: x y: anY color: aColor [
self addChild: c
]

{ #category : #accessing }
{ #category : 'accessing' }
MfFractalCircleElement >> currentX [

^currentX.
]

{ #category : #accessing }
{ #category : 'accessing' }
MfFractalCircleElement >> currentY [
^currentY.
]

{ #category : #initialization }
{ #category : 'initialization' }
MfFractalCircleElement >> defaultGeometry [

^ BlCircleGeometry new matchExtent: self extent.
]

{ #category : #initialization }
{ #category : 'initialization' }
MfFractalCircleElement >> initialize [

super initialize.
Expand All @@ -79,13 +81,13 @@ MfFractalCircleElement >> initialize [
value := 0
]

{ #category : #accessing }
{ #category : 'accessing' }
MfFractalCircleElement >> numberOfCircles [

^nbOfChilds
]

{ #category : #'public api' }
{ #category : 'public api' }
MfFractalCircleElement >> setValue: aValue [

(aValue between: 0 and: 100)
Expand All @@ -95,7 +97,7 @@ MfFractalCircleElement >> setValue: aValue [
self updateCircles
]

{ #category : #internal }
{ #category : 'internal' }
MfFractalCircleElement >> updateCircles [

| c |
Expand All @@ -109,7 +111,7 @@ MfFractalCircleElement >> updateCircles [
self createCircle: currentX y: currentY color: c ]
]

{ #category : #evaluating }
{ #category : 'evaluating' }
MfFractalCircleElement >> value [

^value.
Expand Down
14 changes: 8 additions & 6 deletions Mooflod/MfFractalCircleElementTest.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #MfFractalCircleElementTest,
#superclass : #TestCase,
#category : 'Mooflod-FractalCircleWidget'
#name : 'MfFractalCircleElementTest',
#superclass : 'TestCase',
#category : 'Mooflod-FractalCircleWidget',
#package : 'Mooflod',
#tag : 'FractalCircleWidget'
}

{ #category : #tests }
{ #category : 'tests' }
MfFractalCircleElementTest >> testIfCirclesAreAddedCorrectly [

| circle |
Expand All @@ -14,7 +16,7 @@ MfFractalCircleElementTest >> testIfCirclesAreAddedCorrectly [
self assert: circle numberOfCircles equals: 20.
]

{ #category : #tests }
{ #category : 'tests' }
MfFractalCircleElementTest >> testIfValueIsInitializedCorrectly [

| circle |
Expand All @@ -23,7 +25,7 @@ MfFractalCircleElementTest >> testIfValueIsInitializedCorrectly [
self assert: circle value equals: 12
]

{ #category : #tests }
{ #category : 'tests' }
MfFractalCircleElementTest >> testNothingAddedIfValueIsTooHigh [

| circle |
Expand Down
10 changes: 6 additions & 4 deletions Mooflod/MfInputElementSkin.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #MfInputElementSkin,
#superclass : #MfBasicMooflodSkin,
#category : 'Mooflod-InputWidget'
#name : 'MfInputElementSkin',
#superclass : 'MfBasicMooflodSkin',
#category : 'Mooflod-InputWidget',
#package : 'Mooflod',
#tag : 'InputWidget'
}

{ #category : #'event handling' }
{ #category : 'event handling' }
MfInputElementSkin >> installLookEvent: anEvent [
"when installing the skin, changes the properties of widget mentionned down here"

Expand Down
Loading

0 comments on commit e14d7d0

Please sign in to comment.