Skip to content

Commit

Permalink
delete morph from the world sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Ol-Ba committed Jul 13, 2022
1 parent 761549e commit 6cc9ebd
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
buildComponents
addSelectedMorphFor: anEvent
self addTargetMorph: (self getDeepestMorph: self currentHand selectedObject at: anEvent position).
self selectedTreeNode: (self addTargetMorph: (self getDeepestMorph: self currentHand selectedObject at: anEvent position)).
self currentHand removeMouseListener: self.

self updateInformationText: 'Added new Morph'.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
messaging
deleteMorph: aProcess
"NEEDS REFACTORING"
"selected tree node needs to be set to some property when the morph is added"
"not tested on other morphs apart from normal morph"
self selectedTreeNode ifNil: [^ 'break'].

self propertyList copy do: [:each |
Transcript show: self propertyList first ; cr.

"(self selectedTreeNode targetMorph = each targetMorph or: ((self selectedTreeNode isFlexed) ifTrue: [self selectedTreeNode owner = each targetMorph] ifFalse: [false])) "
(self selectedTreeNode targetMorph = each targetMorph or: (self selectedTreeNode targetMorph hasSubmorphs ifTrue: [self selectedTreeNode targetMorph submorphs first = each targetMorph] ifFalse: [false])) "checks if selected tree node or it's child (because it can be a transformation morph that has target morph a child) the same as the one of the morphs in the property list"
ifTrue: [self selectedTreeNode targetMorph removeFlexShell. self propertyList remove: each. each targetMorph abandon. ].].

"to do: delete the JSON! for that look in animations editor property animated >> deleteAllKeyframes"
self propertyTreeMorph update: self propertyTreeMorph getChildrenSelector.

"need to terminate process for each property"

"self selectedTreeNode process terminate." "doesnot work"

"self propertyTreeMorph submorphs do: [:every | every process terminate]." "not right place to terminate"
self propertyEditorPanel submorphs do: [:each| each abandon]. "clear property editor panel"
self timeline submorphs do: [:each| each abandon]. "leaves the background and scroll panel from timeline. Fiqure out how to delete it"
Transcript show: 'process'; cr.
Transcript show: aProcess isBlocked; cr.
aProcess terminate.
Transcript show: 'process2'; cr.



Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ deleteMorph
"not tested on other morphs apart from normal morph"
self selectedTreeNode ifNil: [^ 'break'].
self propertyList copy do: [:each |

Transcript show: self propertyList first ; cr.

(self selectedTreeNode targetMorph = each targetMorph or: (self selectedTreeNode targetMorph hasSubmorphs ifTrue: [self selectedTreeNode targetMorph submorphs first = each targetMorph])) "checks if selected tree node or it's child (because it can be a transformation morph that has target morph a child) the same as the one of the morphs in the property list"
ifTrue: [self selectedTreeNode targetMorph removeFlexShell. self propertyList remove: each. each targetMorph abandon. ].].
ifTrue: [self selectedTreeNode targetMorph removeFlexShell. self propertyList remove: each. each targetMorph abandon. ].].

"to do: delete the JSON! for that look in animations editor property animated >> deleteAllKeyframes"
self propertyTreeMorph update: self propertyTreeMorph getChildrenSelector.

"need to terminate process for each property"

"self selectedTreeNode process terminate." "doesnot work"

"self propertyTreeMorph submorphs do: [:every | every process terminate]." "not right place to terminate"
self propertyEditorPanel submorphs do: [:each| each abandon]. "clear property editor panel"
self timeline submorphs do: [:each| each abandon]. "leaves the background and scroll panel from timeline. Fiqure out how to delete it"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"addPropertiesToImageMorphOn:" : "FH 8/1/2021 18:47",
"addPropertiesToMorphOn:" : "NR 6/26/2022 14:09",
"addPropertiesToTextMorphOn:" : "FH 8/1/2021 18:47",
"addSelectedMorphFor:" : "LW 7/31/2021 12:50",
"addSelectedMorphFor:" : "ob 7/13/2022 12:39",
"addSubPropertiesOn:" : "FH 8/1/2021 18:48",
"addTargetMorph:" : "FH 8/1/2021 18:48",
"buildAddKeyframeButtonWith:" : "FH 8/1/2021 18:32",
Expand Down Expand Up @@ -36,7 +36,8 @@
"createTextPropertyOn:" : "LW 7/26/2021 16:44",
"defaultEmptyPanels" : "DM 8/7/2020 17:37",
"defaultPropertyPanelPosition" : "mjs 7/31/2021 16:18",
"deleteMorph" : "ob 7/12/2022 21:19",
"deleteMorph" : "ob 7/13/2022 12:09",
"deleteMorph:" : "ob 7/13/2022 12:28",
"editorTitle" : "LH 8/4/2020 10:31",
"editorTitle:" : "DM 8/3/2020 15:40",
"emptyPanels" : "DM 8/7/2020 17:37",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
initialization
initialize
"|planProcess|"


super initialize.
self isActivated: false.
self addStartFrame.
"planProcess := [
self process: [
[ 1 seconds asDelay wait.
self targetMorph isInWorld ifFalse: [self animationsEditor deleteMorph. planProcess terminate.]. the question is if the process actually terminates
self targetMorph isInWorld ifFalse: [self animationsEditor deleteMorph: self process.].
] repeat.
] fork."
] fork.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
process: anObject
process := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
process
^ process
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"executeCompositeAnimation:" : "FH 8/1/2021 19:11",
"frame" : "MH 7/8/2021 11:08",
"frame:" : "MH 7/8/2021 11:10",
"initialize" : "ob 7/12/2022 21:16",
"initialize" : "ob 7/13/2022 12:10",
"isActivated" : "ob 6/26/2022 18:59",
"isActivated:" : "ob 6/26/2022 18:59",
"isFirstFrame" : "MH 7/8/2021 11:31",
Expand All @@ -36,6 +36,8 @@
"messageKeyframeOutOfBounds" : "MH 7/8/2021 11:36",
"messageNotEnoughKeyframes" : "CL 7/29/2021 12:05",
"playAnimationWithStartEnd:" : "FH 8/1/2021 19:12",
"process" : "ob 7/12/2022 22:34",
"process:" : "ob 7/12/2022 22:34",
"resetTargetMorph" : "LW 7/9/2021 15:34",
"setAnimationProperty:" : "MH 7/8/2021 11:03",
"setStartValue" : "MH 7/8/2021 11:31",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"targetFrame",
"targetValues",
"currentValue",
"isActivated" ],
"isActivated",
"process" ],
"name" : "AnimationsEditorPropertyAnimated",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ running
setUp
super setUp.
self morph: self morphClass new openInWorld.
self property: (self propertyClass on: self morph).
self property: (self propertyClass on: self morph).
self property process terminate.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"property" : "MH 8/1/2021 18:28",
"property:" : "MH 8/1/2021 18:28",
"propertyClass" : "CL 7/29/2021 11:42",
"setUp" : "LW 7/27/2021 11:45",
"setUp" : "ob 7/13/2022 12:40",
"tearDown" : "LW 7/27/2021 11:53" } }
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"tearDown" : "SG 6/22/2022 14:15",
"testAddKeyframeToRightPosition" : "Noel Bastubbe 6/13/2022 19:27",
"testDistanceBetweenKeyframes" : "mjs 8/1/2021 16:45",
"testDurationDisplay" : " 7/1/2022 15:59:00",
"testDurationDisplay" : "7/1/2022 15:59:00",
"testHeightOfTimeline" : "6/17/2022 14:09:29",
"testMovingLineInRightPosition" : "ob 6/13/2022 18:16",
"testMovingLineInitializedInRightPosition" : "ob 5/29/2022 17:34",
Expand Down

0 comments on commit 6cc9ebd

Please sign in to comment.