Section 3

Determine Push Regions

We will begin with writing a new unit test to validate push direction selection within the inside click-region. If you open up a workspace and inspect the results of sending the #regionRectangle message to our CellClickRegionInside class you can see its current dimensions.

Within our cell, the subdivided inside-click-region looks like this (with the current sized coordinates shown).

Note that when we describe graphics operations in Squeak the coordinate system has increasing values of "x" as you move to the right and increasing values of "y" as you travel downwards on the screen.

When the user hovers the mouse over the subdivided click region shown the "push east" arrow should appear.

We can now describe several points of interest for testing.

Label Point Push
A 10@10 East
B 20@10 South
C 15@15 East
D 10@20 East
E 20@20 North
F 11@13 East
G 14@16 North
H 19@17 West
I 15@1 South

We make some arbitrary decision about push intent when the dots were on the exact corners and on the lines. Here is the new unit test case. We don't expect this to work yet since we haven't written any push detection code.

The new test case class is CellClickInsideRegionPushTestCase.

Index Page Next Page

Copyright © 2007, 2008, 2009, 2010 Stephan B Wessels