Skip to content

Commit

Permalink
Partial refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Ol-Ba committed Jun 9, 2022
1 parent 6d6e067 commit 883f315
Show file tree
Hide file tree
Showing 22 changed files with 91 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
on: anAnimationsEditorTimeline withPosition: aPosition withExtent: anExtent
^ self basicNew timeline: anAnimationsEditorTimeline;
initialize;
position: aPosition;
extent: anExtent;
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
on: anAnimationsEditorTimeline withPositionY: aPoint withExtent: anotherPoint
^ self basicNew timeline: anAnimationsEditorTimeline;
initialize;
"position: (self startMargin @ aPoint);"
extent: anotherPoint ;
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
animationDuration

^ self timeline endTime - self timeline startTime.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
as yet unclassified
initialize

super initialize.
self
extent: 3@100;
"extent: 3@100;"
color: Color black;
position: self startMargin@25.
position: (self startMargin@25). "get rid of magic number" "Cascade expected ->"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
as yet unclassified
lineWidth
^3

^3.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
positionY: anObject
positionY := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
positionY
^ positionY
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
setMovingSpeedPerHundredMilliseconds

self speed: (self timeline width - (self startMargin) - (self endMargin)) / self animationDuration * 100.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
speed: anObject
speed := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
speed
^ speed
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
as yet unclassified
step
|duration offset endPositionX|

| endPositionX|

endPositionX := self timeline width - (self endMargin).
"duration := (self timeline endTime - self timeline startTime)/100. --> richtige Zeit"
(self position x >= endPositionX) ifTrue: [self abandon]
ifFalse:
[

duration := (self timeline endTime - self timeline startTime)/100.
offset := (self timeline width - (self startMargin) - (self endMargin)) / duration.
self position: self position + (offset@0).]
[self position: self position + (1@0* self speed).].

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
as yet unclassified
stepTime
^1
^100
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{
"class" : {
"on:" : "SG 5/21/2022 16:01" },
"on:" : "SG 5/21/2022 16:01",
"on:withPosition:withExtent:" : "ob 6/9/2022 21:39",
"on:withPositionY:withExtent:" : "ob 6/9/2022 21:40" },
"instance" : {
"initialize" : "SG 5/23/2022 18:57",
"lineWidth" : "SG 5/23/2022 18:47",
"step" : "ob 6/9/2022 19:29",
"stepTime" : "SG 5/23/2022 18:37" } }
"animationDuration" : "ob 6/9/2022 21:31",
"initialize" : "ob 6/9/2022 21:29",
"lineWidth" : "ob 6/9/2022 20:18",
"positionY" : "ob 6/9/2022 21:26",
"positionY:" : "ob 6/9/2022 21:26",
"setMovingSpeedPerHundredMilliseconds" : "ob 6/9/2022 21:31",
"speed" : "ob 6/9/2022 20:26",
"speed:" : "ob 6/9/2022 20:26",
"step" : "ob 6/9/2022 20:45",
"stepTime" : "ob 6/9/2022 20:15" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
],
"commentStamp" : "",
"instvars" : [
"movingLine" ],
"movingLine",
"speed",
"positionY" ],
"name" : "AnimationsEditorMovingLine",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
animationDuration
^ (self endTime - self startTime).

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
},
"instance" : {
"addStartFrame" : "MH 7/8/2021 10:20",
"animationDuration" : "ob 6/9/2022 21:31",
"animationString" : "DM 7/8/2020 15:19",
"buildEndFrameWith:" : "FH 8/1/2021 19:30",
"buildEndInputWith:" : "FH 8/1/2021 19:30",
Expand All @@ -13,7 +14,6 @@
"canRenderUI" : "DM 8/6/2020 10:11",
"defaultEndTime" : "mjs 8/1/2021 13:45",
"defaultStartTime" : "DM 8/6/2020 10:37",
"duration" : "DM 8/4/2020 16:44",
"endTime" : "FH 8/1/2021 19:29",
"endTime:" : "FH 8/1/2021 19:29",
"endTimeAsString" : "FH 8/1/2021 19:29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
creation
createMovingLine
|numberOfProperties|
numberOfProperties := 0.

self property subproperties
do: [:subproperty |
numberOfProperties := numberOfProperties + 1].

self
movingLine: (AnimationsEditorMovingLine on: self);
addMorphFront: movingLine.
movingLine: (AnimationsEditorMovingLine on: self withPositionY: self trackHeight withExtent: 3@(numberOfProperties * self trackHeight));
addMorphFront: movingLine.
self movingLine setMovingSpeedPerHundredMilliseconds.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"addTrackFor:withPosition:" : "MH 8/1/2021 18:58",
"animationsEditor" : "MH 8/1/2021 18:56",
"animationsEditor:" : "MH 8/1/2021 18:56",
"createMovingLine" : "SG 5/21/2022 20:37",
"createMovingLine" : "ob 6/9/2022 21:38",
"createTracks" : "MH 8/1/2021 18:58",
"deleteTracks" : "MH 8/1/2021 18:48",
"endTime" : "MH 8/1/2021 18:57",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
inaccuracyFactor

^1.
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
testing
testMovingLineInRightPosition
| positionProperty d|
positionProperty := (self animationsEditorInstance propertyList at: 2) subproperties at: 'position'.
self animationsEditorInstance selectedTreeNode: positionProperty.
positionProperty
positionX: 555;
positionY: 555;
frame: 1000;
addKeyframe.

"self animationsEditorInstance playAnimations."
"self timeline createMovingLine."
d:= Morph new extent: 3@100;
| movingLine |

movingLine:= Morph new extent: 3@100;
color: Color black;
position: 105@25.
500 timesRepeat: [self moveMovingLine: d].
Transcript show: d position x.
d comeToFront.
"delay := Delay forMilliseconds: 500."
"Delay forMilliseconds: 500. "

"self movingLine stopStepping. "
5 timesRepeat: [self moveMovingLine: movingLine].
Transcript show: movingLine position x.
movingLine comeToFront.


self assert: (d position) = ((self timeline width - 130)/2+105).
Transcript show: ' '.
Transcript show: ((self timeline width - 130)/2+105).
self assert: ((movingLine position x) between: ((self timeline width - 130)/2+105 - (5*self inaccuracyFactor)) and: ((self timeline width - 130)/2+105)).



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"endFrame" : "MH 8/1/2021 18:42",
"endMargin" : "ob 5/29/2022 17:48",
"frameNumber100" : "NB 8/1/2021 14:52",
"inaccuracyFactor" : "ob 6/9/2022 20:56",
"keyframeHeightOn:" : "NB 8/1/2021 14:07",
"keyframeWidthOn:" : "NB 8/1/2021 14:07",
"middleOfAnimationTime" : "NB 8/1/2021 16:09",
Expand All @@ -27,7 +28,7 @@
"tearDown" : "NB 8/1/2021 12:38",
"testAddKeyframeToRightPosition" : "NB 8/1/2021 15:22",
"testDistanceBetweenKeyframes" : "mjs 8/1/2021 16:45",
"testMovingLineInRightPosition" : "ob 5/29/2022 17:56",
"testMovingLineInRightPosition" : "ob 6/9/2022 21:00",
"testMovingLineInitializedInRightPosition" : "ob 5/29/2022 17:34",
"timeline" : "MH 8/1/2021 18:43",
"timeline:" : "MH 8/1/2021 18:43",
Expand Down

0 comments on commit 883f315

Please sign in to comment.