January 2014
Intermediate to advanced
736 pages
70h 43m
English
Class DoodleView’s static and instance variables (Fig. 7.21, lines 30–43) are used to manage the data for the set of lines that the user is currently drawing and to draw those lines. Line 38 creates the pathMap, which maps each finger ID (known as a pointer) to a corresponding Path object for the lines currently being drawn. Lines 39–40 create the previousPointMap, which maintains the last point for each finger—as each finger moves, we draw a line from its current point to its previous point. We discuss the other fields as we use them in class DoodleView.
26 // the main screen that is painted27 public class DoodleView extends View28 {29 // used to determine whether ...
Read now
Unlock full access