Skip to content

Commit

Permalink
Merge branch 'deleteMorphButton' into feature/ps/timeline-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ol-Ba committed Jul 17, 2022
2 parents 72a6d04 + 78608e5 commit 1f5cacf
Show file tree
Hide file tree
Showing 53 changed files with 300 additions and 54 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
Expand Up @@ -13,5 +13,6 @@ buildButtonBarWith: aBuilder
self buildPlayButtonWith: aBuilder.
self buildResetButtonWith: aBuilder.
self buildLoadJsonButtonWith: aBuilder.
self buildAddKeyframeButtonWith: aBuilder. };
self buildAddKeyframeButtonWith: aBuilder.
self buildDeleteMorphButtonWith: aBuilder. };
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
buildComponents
buildDeleteMorphButtonWith: aBuilder
| rightFraction leftFraction |

rightFraction := 7 * (1 / self numberButtons).
leftFraction := 6 * (1 / self numberButtons).
^ aBuilder pluggableButtonSpec new model: self;
label: 'Delete Morph';
action: #deleteMorph;
frame: (LayoutFrame new topFraction: 0;
bottomFraction: 1;
rightFraction: rightFraction;
leftFraction: leftFraction;
yourself);
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
clearComponents
clearPropertyEditorPanel

self propertyEditorPanel submorphs do: [:each| each abandon].
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
eventHandling
deleteMorph: aProcess
"
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] ifFalse: [false]))
ifTrue: [self selectedTreeNode targetMorph removeFlexShell. self propertyList remove: each. each targetMorph abandon. ].].
self propertyTreeMorph update: self propertyTreeMorph getChildrenSelector.
self propertyEditorPanel submorphs do: [:each| each abandon].
self timeline submorphs do: [:each| each abandon].
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
@@ -0,0 +1,21 @@
eventHandling
deleteMorph
"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 removeMorphProperties.

"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 clearPropertyEditorPanel.
self timeline clearTimeline.




Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
notclassified
isPropertyToDelete: aProperty

^ self selectedTreeNode targetMorph = aProperty targetMorph or:
(self selectedTreeNode targetMorph hasSubmorphs
ifTrue:
[self selectedTreeNode targetMorph submorphs first = aProperty targetMorph]
ifFalse:
[false]).
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
buildComponents
numberButtons
^ 6.
^ 7.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
clearComponents
removeMorphProperties

self propertyList copy do: [:each |
(self isPropertyToDelete: each)
ifTrue: [self propertyList remove: each.].].
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
accessing
selectedTreeNode: aNode
selectedTreeNode := aNode.

aNode canRenderUI
ifTrue: [self
insertMorph: (aNode buildUIWith: self toolBuilder)
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@
"addPropertiesToImageMorphOn:" : "FH 8/1/2021 18:47",
"addPropertiesToMorphOn:" : "FH 8/1/2021 18:47",
"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",
"buildAddMorphButtonWith:" : "FH 8/1/2021 18:35",
"buildButtonBarWith:" : "FH 8/1/2021 18:35",
"buildButtonBarWith:" : "lka 7/1/2022 16:07",
"buildDeleteMorphButtonWith:" : "lka 7/1/2022 16:15",
"buildInformationBarWith:" : "DM 8/4/2020 16:12",
"buildLoadJsonButtonWith:" : "FH 8/1/2021 18:37",
"buildLoadingMainWindow:" : "SG 5/21/2022 13:24",
"buildMainWindowWith:" : "SG 5/21/2022 14:11",
"buildPlayButtonWith:" : "FH 8/1/2021 18:39",
"buildPositionUIPanelWith:" : "FH 8/1/2021 18:39",
"buildPropertiesTreeWith:" : "FH 8/1/2021 18:42",
"buildPropertiesTreeWith:" : "ob 7/12/2022 18:57",
"buildResetButtonWith:" : "FH 8/1/2021 18:43",
"buildSaveButtonWith:" : "FH 8/1/2021 18:44",
"buildTimeline:" : "FH 8/1/2021 18:44",
"buildWith:" : "FH 8/1/2021 18:44",
"buildWith:" : "ob 6/20/2022 20:40",
"clearPropertyEditorPanel" : "NR 7/16/2022 17:01",
"collectAllEmptyPanels" : "FH 8/1/2021 18:44",
"collectInformationBar" : "FH 8/1/2021 18:44",
"collectPropertyTreeMorph" : "FH 8/1/2021 18:44",
Expand All @@ -35,6 +37,8 @@
"createTextPropertyOn:" : "LW 7/26/2021 16:44",
"defaultEmptyPanels" : "DM 8/7/2020 17:37",
"defaultPropertyPanelPosition" : "mjs 7/31/2021 16:18",
"deleteMorph" : "NR 7/16/2022 17:09",
"deleteMorph:" : "NR 7/16/2022 16:55",
"editorTitle" : "LH 8/4/2020 10:31",
"editorTitle:" : "DM 8/3/2020 15:40",
"emptyPanels" : "DM 8/7/2020 17:37",
Expand All @@ -48,15 +52,16 @@
"informationBarText:" : "FH 8/1/2021 18:50",
"initialize" : "FH 8/1/2021 18:49",
"initializeJsonHandler" : "FH 8/1/2021 18:49",
"initializePropertyEditorPanel" : "FH 8/1/2021 18:49",
"initializePropertyEditorPanel" : "ob 7/12/2022 18:00",
"insertMorph:Into:" : "FH 8/1/2021 18:46",
"isPropertyToDelete:" : "NR 7/16/2022 17:17",
"jsonHandler" : "CL 7/5/2021 17:17",
"jsonHandler:" : "FH 8/1/2021 18:24",
"loadJsonWithExceptionHandling:" : "FH 8/1/2021 18:48",
"mainWindow" : "JIZ 6/3/2020 17:04",
"mainWindow:" : "JIZ 6/3/2020 17:04",
"messagePlayAnimations" : "CL 5/27/2021 13:48",
"numberButtons" : "CL 5/30/2021 14:05",
"numberButtons" : "lka 7/1/2022 16:04",
"playAnimations" : "SG 5/23/2022 18:41",
"propertyEditorPanel" : "DM 6/22/2020 01:27",
"propertyEditorPanel:" : "DM 6/12/2020 20:41",
Expand All @@ -68,6 +73,7 @@
"propertyStartEnd:" : "DM 8/6/2020 10:53",
"propertyTreeMorph" : "DM 6/22/2020 01:28",
"propertyTreeMorph:" : "DM 6/18/2020 08:59",
"removeMorphProperties" : "NR 7/16/2022 17:18",
"resetTargetMorph" : "FH 8/1/2021 18:48",
"saveAnimations" : "FH 8/1/2021 18:48",
"savedAnimationText" : "mjs 7/31/2021 15:08",
Expand All @@ -82,8 +88,6 @@
"timelines:" : "DM 8/6/2020 10:53",
"toolBuilder" : "JIZ 6/3/2020 17:00",
"toolBuilder:" : "JIZ 6/3/2020 16:59",
"treeSpec" : "FH 8/1/2021 18:27",
"treeSpec:" : "FH 8/1/2021 18:27",
"updateInformationText:" : "FH 8/1/2021 18:50",
"windowReference" : "DM 8/4/2020 13:19",
"windowReference:" : "DM 8/4/2020 13:19" } }
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"propertyList",
"selectedTreeNode",
"toolBuilder",
"treeSpec",
"propertyEditorPanelChildren",
"mainWindow",
"informationBarText",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
initialization
on: anAnimationsEditorTrack withPosition: aPoint withFrame: aFrame withValue: aValue withAnimationsEditor: anAnimationsEditor
^ self basicNew track: anAnimationsEditorTrack;
frame: aFrame;
value: aValue;
initialize;
setCenteredPosition: aPoint;
animationsEditor: anAnimationsEditor;
yourself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
animationsEditor: anObject
animationsEditor := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
animationsEditor
^ animationsEditor
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
handlesMouseDown: anEvent
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
mouseDown: anEvent
anEvent redButtonPressed
ifTrue: [
self setValueAndFrame.
self animationsEditor selectedTreeNode: self selectProperty.
].
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
as yet unclassified
selectProperty
|targetMorph property parentProperty propertyList|
"targetMorph := self animationsEditor propertyList second."
parentProperty := self track property parentProperty title.
propertyList := self animationsEditor propertyList.
targetMorph := propertyList detect: [:each | parentProperty match: each title].


targetMorph hasSubproperties
ifTrue: [property := targetMorph subproperties detect: [:each| self track property asString match: each asString]].
^property


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
as yet unclassified
setValueAndFrame
|property selectedFrame selectedValue|
property := self selectProperty.
selectedFrame:= self frame.
selectedValue := property targetValues at: self frame.
self track property currentValue: selectedValue.
self track property targetFrame: selectedFrame.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"class" : {
"on:withPosition:withFrame:withValue:" : "FH 8/1/2021 19:05" },
"on:withPosition:withFrame:withValue:" : "FH 8/1/2021 19:05",
"on:withPosition:withFrame:withValue:withAnimationsEditor:" : "SG 6/17/2022 15:45" },
"instance" : {
"defaultColor" : "ps 7/11/2022 00:40",
"frame" : "mjs 7/31/2021 15:46",
Expand All @@ -10,6 +11,7 @@
"initialize" : "ps 7/11/2022 00:40",
"mouseOverColor" : "ps 7/11/2022 00:40",
"setCenteredPosition:" : "FH 8/1/2021 19:04",
"setValueAndFrame" : "SG 6/25/2022 16:10",
"track" : "mjs 7/31/2021 15:46",
"track:" : "mjs 7/31/2021 15:46",
"value:" : "mjs 7/31/2021 15:46" } }
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"instvars" : [
"track",
"frame",
"value" ],
"value",
"animationsEditor" ],
"name" : "AnimationsEditorKeyframe",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
initialization
initialize


super initialize.
self addStartFrame.
self isActivated: false.
self addStartFrame.
"self process: [
[ 1 seconds asDelay wait.
self targetMorph isInWorld ifFalse: [self animationsEditor deleteMorph: self process.].
] repeat.
] 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 @@ -15,18 +15,23 @@
"createCompositeAnimationWith:withKey:withPreviousKey:" : "FH 8/1/2021 19:10",
"currentValue" : "MH 7/8/2021 11:08",
"currentValue:" : "MH 7/8/2021 11:08",
"deactivateProperty" : "ob 7/12/2022 18:51",
"defaultFrame" : "MH 7/8/2021 11:33",
"defaultValue" : "MH 7/8/2021 11:33",
"executeCompositeAnimation:" : "FH 8/1/2021 19:11",
"frame" : "MH 7/8/2021 11:08",
"frame:" : "MH 7/8/2021 11:10",
"initialize" : "MH 7/8/2021 10:28",
"initialize" : "NR 7/16/2022 16:50",
"isActivated" : "ob 6/26/2022 18:59",
"isActivated:" : "ob 6/26/2022 18:59",
"isFirstFrame" : "MH 7/8/2021 11:31",
"isKey:outOfBound:" : "MH 7/8/2021 11:36",
"isKeyframeExceptStartFrameExistent" : "FH 8/1/2021 19:11",
"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 @@ -9,7 +9,9 @@
"targetDuration",
"targetFrame",
"targetValues",
"currentValue" ],
"currentValue",
"isActivated",
"process" ],
"name" : "AnimationsEditorPropertyAnimated",
"pools" : [
],
Expand Down
Loading

0 comments on commit 1f5cacf

Please sign in to comment.