Skip to content

Commit

Permalink
Merge pull request #85 from hpi-swa-teaching/feature/ButtonDelete
Browse files Browse the repository at this point in the history
Feature/button delete
  • Loading branch information
Noel-Bastubbe committed Jul 20, 2022
2 parents fbd0300 + a377c51 commit 4455c89
Show file tree
Hide file tree
Showing 78 changed files with 336 additions and 112 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,23 @@
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].

aProcess terminate.




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: [
(aNode isActivated)
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:" : "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",
"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:" : "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/18/2022 18:35",
"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" : "NR 6/26/2022 15:00",
"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,22 +73,21 @@
"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",
"seedProperties" : "Noel Bastubbe 6/22/2022 11:27",
"selectMorphByHand" : "FH 8/1/2021 18:49",
"selectedTreeNode" : "JIZ 5/27/2020 15:31",
"selectedTreeNode:" : "ob 6/26/2022 19:02",
"selectedTreeNode:" : "ob 7/12/2022 19:48",
"switchTimelineToMorphWith:" : "FH 8/1/2021 18:49",
"timeline" : "FH 8/1/2021 18:27",
"timeline:" : "FH 8/1/2021 18:27",
"timelines" : "FH 8/1/2021 18:49",
"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,4 @@
constants
defaultColor

^ Color orange.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
events
handleMouseEnter: anEvent

self color: self mouseOverColor.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
events
handleMouseLeave: anEvent

self color: self defaultColor.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ initialization
initialize

super initialize.
self color: Color orange.
self color: self defaultColor.
self extent: 15@15.
"self addFlexShell.
self owner transform setAngle: 0.8."
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
mouseOverColor

^ Color red.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
"instance" : {
"animationsEditor" : "SG 6/17/2022 15:43",
"animationsEditor:" : "SG 6/17/2022 15:43",
"defaultColor" : "NR 7/18/2022 10:49",
"frame" : "mjs 7/31/2021 15:46",
"frame:" : "mjs 7/31/2021 15:46",
"handleMouseEnter:" : "NR 7/18/2022 10:51",
"handleMouseLeave:" : "NR 7/18/2022 10:51",
"handlesMouseDown:" : "SG 6/17/2022 14:57",
"initialize" : "mjs 7/31/2021 15:45",
"initialize" : "NR 7/18/2022 10:50",
"mouseDown:" : "SG 6/25/2022 16:11",
"mouseOverColor" : "NR 7/18/2022 10:49",
"selectProperty" : "SG 6/27/2022 19:17",
"setCenteredPosition:" : "FH 8/1/2021 19:04",
"setValueAndFrame" : "SG 6/25/2022 16:10",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
initialization
as yet unclassified
on: anAnimationsEditorTimeline withExtent: anotherPoint
^ self basicNew timeline: anAnimationsEditorTimeline;
initialize;
extent: anotherPoint ;
yourself.

^ self basicNew timeline: anAnimationsEditorTimeline;
initialize;
extent: anotherPoint ;
yourself.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
initialization
initialize
super initialize.
self
color: Color black;
position: self startMargin @ self trackHeight;
playMovingAnimation.
self
color: Color black;
position: self startMargin@self trackHeight;
playMovingAnimation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
constants
lineWidth
^ 3.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
accessing
playMovingAnimation
| animation |

animation:= (AnimPropertyAnimation
on: self
property: #position
start: self position
end: self position + (self animationDuration@0)
duration: self animationDuration)
start;
register;
finishBlock: [self abandon].
on: self
property: #position
start: self position
end: self position + (self animationDuration@0)
duration: self animationDuration)
start;
register;
finishBlock: [self abandon].
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"class" : {
"on:withExtent:" : "Noel Bastubbe 7/4/2022 15:27" },
"on:withExtent:" : "NR 7/18/2022 11:25" },
"instance" : {
"animationDuration" : "ob 6/9/2022 21:31",
"initialize" : "Noel Bastubbe 7/12/2022 11:42",
"playMovingAnimation" : "Noel Bastubbe 7/12/2022 11:57" } }
"initialize" : "NR 7/18/2022 11:26",
"lineWidth" : "ob 6/9/2022 20:18",
"playMovingAnimation" : "NR 7/18/2022 11:34" } }
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
initialization
initialize


super initialize.
self isActivated: false.
self addStartFrame.
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 @@ -20,14 +20,14 @@
"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 6/26/2022 17:01",
"deactivateProperty" : "ob 7/12/2022 18:51",
"defaultFrame" : "MH 7/8/2021 11:33",
"defaultValue" : "MH 7/8/2021 11:33",
"deleteAllKeyframes" : "ob 6/26/2022 18:58",
"executeCompositeAnimation:" : "FH 8/1/2021 19:11",
"frame" : "MH 7/8/2021 11:08",
"frame:" : "MH 7/8/2021 11:10",
"initialize" : "NR 6/26/2022 14:32",
"initialize" : "NR 7/18/2022 18:30",
"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
Loading

0 comments on commit 4455c89

Please sign in to comment.