Skip to content

Commit c048b46

Browse files
committed
Create model, clean up morph
Working towards getting the morph to update its value based on the heat values in the model. Also get mouse events working to properly inject and remove heat.
1 parent e48b7b4 commit c048b46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+183
-47
lines changed

AmigaJuggler.package/.filetree

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"noMethodMetaData" : true,
3+
"separateMethodMetaAndSource" : false,
4+
"useCypressPropertiesFile" : true }

AmigaJuggler.package/JPoint.class/README.md

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"class" : {
3+
},
4+
"instance" : {
5+
} }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"category" : "AmigaJuggler-Core",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
],
7+
"commentStamp" : "",
8+
"instvars" : [
9+
"x",
10+
"y",
11+
"z" ],
12+
"name" : "JPoint",
13+
"pools" : [
14+
],
15+
"super" : "Object",
16+
"type" : "normal" }

AmigaJuggler.package/JVector.class/README.md

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"class" : {
3+
},
4+
"instance" : {
5+
} }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"category" : "AmigaJuggler-Core",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
],
7+
"commentStamp" : "",
8+
"instvars" : [
9+
"x",
10+
"y",
11+
"z" ],
12+
"name" : "JVector",
13+
"pools" : [
14+
],
15+
"super" : "Object",
16+
"type" : "normal" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SystemOrganization addCategory: #'AmigaJuggler-Core'!

AmigaJuggler.package/monticello.meta/initializers.st

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(name 'AmigaJuggler')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(name 'AmigaJuggler-jmg.1' message 'Starting up Amiga Juggler implementation again.' id '6095d379-47c2-dc4d-b058-fd990c2b7ae6' date '7 March 2014' time '10:06:30.098 am' author 'jmg' ancestors () stepChildren ())

AmigaJuggler.package/properties.json

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

HeatDistribution.package/HeatMapModel.class/README.md

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
as yet unclassified
2+
ofSize: anExtent
3+
| heatMapModel |
4+
heatMapModel := self new.
5+
heatMapModel setSize: anExtent.
6+
^ heatMapModel
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
as yet unclassified
2+
addHeat: aPoint
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
as yet unclassified
2+
getHeatMap
3+
^ heatMap.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
initialize-release
2+
initialize
3+
super initialize.
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
as yet unclassified
2+
removeHeat: aPoint.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
private
2+
setSize: anExtent
3+
x := anExtent x.
4+
y := anExtent y.
5+
heatMap := FloatArray ofSize: (x * y).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"class" : {
3+
"ofSize:" : "jmg 3/7/2014 14:58" },
4+
"instance" : {
5+
"addHeat:" : "jmg 3/7/2014 14:20",
6+
"getHeatMap" : "jmg 3/7/2014 14:29",
7+
"initialize" : "jmg 3/7/2014 10:22",
8+
"removeHeat:" : "jmg 3/7/2014 14:28",
9+
"setSize:" : "jmg 3/7/2014 14:58" } }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"category" : "HeatDistribution",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
],
7+
"commentStamp" : "",
8+
"instvars" : [
9+
"heatMap",
10+
"x",
11+
"y" ],
12+
"name" : "HeatMapModel",
13+
"pools" : [
14+
],
15+
"super" : "Object",
16+
"type" : "normal" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
accessing
2+
backingCanvas
3+
backingCanvas
4+
ifNil: [backingCanvas := FormCanvas extent: 400 @ 300. backingCanvas fillColor: (Color white).].
5+
^ backingCanvas
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
drawing
2+
drawOn: aCanvas
3+
| heatMap |
4+
super drawOn: aCanvas.
5+
heatMap := self model getHeatMap.
6+
7+
aCanvas drawImage: self backingCanvas form at: self bounds topLeft
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
event handling
2-
handlesMouseDown: evt
3-
^ true.
2+
handlesMouseDown: evt
3+
^ true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
event handling
2+
handlesMouseOver: evt
3+
^ true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
event handling
2+
handlesMouseOverDragging: evt
3+
^ true

HeatDistribution.package/HeatMapMorph.class/instance/initialize.st

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ initialization
22
initialize
33
super initialize.
44
self extent: 400 @ 300.
5-
self color: Color white.
5+
model := HeatMapModel ofSize: 400 * 300.
6+
backingCanvas := FormCanvas extent: 400 @ 300.
7+
backingCanvas fillColor: (Color white).
8+
self color: Color white.
9+
mouseInBounds := false.
10+
currentLocation := nil

HeatDistribution.package/HeatMapMorph.class/instance/leftButtonDown..st

-3
This file was deleted.

HeatDistribution.package/HeatMapMorph.class/instance/leftButtonDown.st

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
accessing
2+
model
3+
model
4+
ifNil: [model := HeatMapModel ofSize: self extent].
5+
^ model

HeatDistribution.package/HeatMapMorph.class/instance/mouseButtonDown.st

-2
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
event handling
2-
mouseDown: evt
3-
evt yellowButtonPressed
4-
ifTrue: [self rightButtonDown: true. ].
5-
evt redButtonPressed
6-
ifTrue: [self leftButtonDown: true].
2+
mouseDown: evt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
event handling
2+
mouseEnter: evt
3+
mouseInBounds := true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
event handling
2+
mouseEnterDragging: evt
3+
evt hand mouseFocus == self
4+
ifTrue: [ mouseInBounds := true].
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
event handling
2+
mouseLeave: evt
3+
mouseInBounds := false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
event handling
2+
mouseLeaveDragging: evt
3+
evt hand mouseFocus == self
4+
ifTrue: [ mouseInBounds := false]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
event handling
2+
mouseMove: evt
3+
super mouseMove: evt

HeatDistribution.package/HeatMapMorph.class/instance/mouseUp..st

-6
This file was deleted.

HeatDistribution.package/HeatMapMorph.class/instance/rightButtonDown..st

-3
This file was deleted.

HeatDistribution.package/HeatMapMorph.class/instance/rightButtonDown.st

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
stepping and presenter
22
step
3-
WorldState addDeferredUIMessage: [Transcript show: 'step'; cr.].
3+
mouseInBounds
4+
ifTrue: [| clickPoint |
5+
clickPoint := self currentHand lastEvent cursorPoint - self bounds topLeft.
6+
self currentHand lastEvent redButtonPressed
7+
ifTrue: [self backingCanvas form colorAt: clickPoint put: Color red.
8+
self model addHeat: clickPoint].
9+
self currentHand lastEvent yellowButtonPressed
10+
ifTrue: [self backingCanvas form colorAt: clickPoint put: Color white.
11+
self model removeHeat: clickPoint.]].
12+
self changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
testing
22
stepTime
3-
^ 1000
3+
^ 0

HeatDistribution.package/HeatMapMorph.class/methodProperties.json

+15-11
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
"class" : {
33
},
44
"instance" : {
5-
"handlesMouseDown:" : "jmg 2/11/2014 11:21",
6-
"initialize" : "jmg 2/11/2014 11:28",
7-
"leftButtonDown" : "jmg 2/11/2014 11:18",
8-
"leftButtonDown:" : "jmg 2/11/2014 11:18",
9-
"mouseButtonDown" : "jmg 2/11/2014 11:20",
10-
"mouseDown:" : "jmg 2/11/2014 11:25",
11-
"mouseUp:" : "jmg 2/11/2014 11:26",
12-
"rightButtonDown" : "jmg 2/11/2014 11:19",
13-
"rightButtonDown:" : "jmg 2/11/2014 11:19",
14-
"step" : "jmg 2/11/2014 11:27",
15-
"stepTime" : "jmg 2/11/2014 11:28" } }
5+
"backingCanvas" : "jmg 3/7/2014 13:56",
6+
"drawOn:" : "jmg 3/7/2014 15:07",
7+
"handlesMouseDown:" : "jmg 3/7/2014 14:22",
8+
"handlesMouseOver:" : "jmg 3/7/2014 10:52",
9+
"handlesMouseOverDragging:" : "jmg 3/7/2014 10:52",
10+
"initialize" : "jmg 3/7/2014 13:56",
11+
"model" : "jmg 3/7/2014 14:17",
12+
"mouseDown:" : "jmg 3/7/2014 14:27",
13+
"mouseEnter:" : "jmg 3/7/2014 13:36",
14+
"mouseEnterDragging:" : "jmg 3/7/2014 13:36",
15+
"mouseLeave:" : "jmg 3/7/2014 13:36",
16+
"mouseLeaveDragging:" : "jmg 3/7/2014 13:36",
17+
"mouseMove:" : "jmg 3/7/2014 10:59",
18+
"step" : "jmg 3/7/2014 14:28",
19+
"stepTime" : "jmg 3/7/2014 13:59" } }

HeatDistribution.package/HeatMapMorph.class/properties.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"commentStamp" : "",
88
"instvars" : [
99
"leftButtonDown",
10-
"rightButtonDown" ],
10+
"rightButtonDown",
11+
"model",
12+
"mouseInBounds",
13+
"currentLocation",
14+
"backingCanvas" ],
1115
"name" : "HeatMapMorph",
1216
"pools" : [
1317
],
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'HeatDistribution-jmg.2' message '' id '004f95eb-b054-b94b-8527-8b83ea5527e4' date '11 February 2014' time '4:57:29.088 pm' author 'jmg' ancestors ((name 'HeatDistribution-jmg.1' message 'HeatMapMorph now responds to input.' id 'be8a4c02-286a-784e-8952-dabc743c8876' date '11 February 2014' time '11:28:54.988 am' author 'jmg' ancestors () stepChildren ())) stepChildren ())
1+
(name 'HeatDistribution-jmg.4' message 'Remove unneeded methods, start getting model ready to store heat values.' id '349cb710-1db5-0444-b5be-42693140eabd' date '7 March 2014' time '3:10:16.173 pm' author 'jmg' ancestors ((name 'HeatDistribution-jmg.3' message 'Mouse Events working along with some work starting to get the heat map up and ready to be updated.' id '40fdd430-7dc1-ce42-9602-07f202828d43' date '7 March 2014' time '2:09:24.901 pm' author 'jmg' ancestors ((name 'HeatDistribution-jmg.2' message '' id '004f95eb-b054-b94b-8527-8b83ea5527e4' date '11 February 2014' time '4:57:29.088 pm' author 'jmg' ancestors ((name 'HeatDistribution-jmg.1' message 'HeatMapMorph now responds to input.' id 'be8a4c02-286a-784e-8952-dabc743c8876' date '11 February 2014' time '11:28:54.988 am' author 'jmg' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())

Interpolation.package/LinearInterpolator.class/class/startValue.delta.duration..st

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
as yet unclassified
1+
instance creation
22
startValue: aStartNumber delta: aDeltaNumber duration: aDurationNumber
33
^ self new
44
privateStartValue: aStartNumber
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
as yet unclassified
1+
calculate
22
lerp: currentPosition
33
^ delta * (currentPosition / duration) + startNumber

Interpolation.package/LinearInterpolator.class/instance/privateStartValue.privateDelta.privateDuration..st

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
as yet unclassified
1+
private
22
privateStartValue: aStartNumber privateDelta: aDeltaNumber privateDuration: aDurationNumber
33
startNumber := aStartNumber.
44
delta := aDeltaNumber.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'Interpolation-jmg.4' message 'lerp works.' id '7e24d242-82d8-b444-afa9-f04f9b709fd6' date '11 February 2014' time '5:19:09.046 pm' author 'jmg' ancestors ((name 'Interpolation-jmg.3' message 'empty log message' id '3b150cd6-7743-094f-bf6b-d5e7ead5a405' date '11 February 2014' time '5:06:56.661 pm' author 'jmg' ancestors ((name 'Interpolation-jmg.2' message 'lerp' id '4c13c92e-e281-1f4c-9178-539e7e51a60e' date '11 February 2014' time '5:06:22.743 pm' author 'jmg' ancestors ((name 'Interpolation-jmg.1' message '' id 'a771f2f2-1c47-5749-a5bc-ae2c8712af10' date '11 February 2014' time '4:57:59.574 pm' author 'jmg' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
1+
(name 'Interpolation-jmg.5' message 'Categorize methods.' id '53f5c00f-c734-354e-aee3-c0b5ffad1cf9' date '7 March 2014' time '3:09:46.797 pm' author 'jmg' ancestors ((name 'Interpolation-jmg.4' message 'lerp works.' id '7e24d242-82d8-b444-afa9-f04f9b709fd6' date '11 February 2014' time '5:19:09.046 pm' author 'jmg' ancestors ((name 'Interpolation-jmg.3' message 'empty log message' id '3b150cd6-7743-094f-bf6b-d5e7ead5a405' date '11 February 2014' time '5:06:56.661 pm' author 'jmg' ancestors ((name 'Interpolation-jmg.2' message 'lerp' id '4c13c92e-e281-1f4c-9178-539e7e51a60e' date '11 February 2014' time '5:06:22.743 pm' author 'jmg' ancestors ((name 'Interpolation-jmg.1' message '' id 'a771f2f2-1c47-5749-a5bc-ae2c8712af10' date '11 February 2014' time '4:57:59.574 pm' author 'jmg' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())

0 commit comments

Comments
 (0)