1Newsqueak2 2'Langexplr 3' 4 5class ShapesExperiment usingLib: platform = ( 6"A small experiment for using Hopscotch shape classes ." 7| 8 CanvasDependent = platform CanvasDependent. 9 Presenter = platform HPresenter. 10 Subject = platform Subject. 11 EllipseShape = platform EllipseShape. 12 Color = platform Color. 13| 14) 15( 16 17class ShapesExperimentSubject = Subject( 18"Subject for shapes experiment" 19| 20 21| 22) 23('as yet unclassified' 24createPresenter = ( 25 ^ShapesExperimentPresenter new subject: self. 26) 27 28) 29 30class ShapesExperimentPresenter = Presenter ( 31"A presenter for a small experiment of using shape classes" 32| 33| 34) 35('as yet unclassified' 36controlPoint = ( 37 ^ControlPoint new. 38) 39 40definition = ( 41 ^ column: { 42 canvas: { 43 at: 10 @ 10 display: controlPoint. 44 at: 15 @ 10 display: controlPoint. 45 } 46 } 47) 48 49) 50 51class ControlPoint = CanvasDependent( 52"A class that represents a small point in the screen" 53| 54| 55) 56('as yet unclassified' 57addVisualsTo: container = ( 58 container add: visual. 59 updateLayout. 60) 61 62createVisual = ( 63 | s | 64 s:: EllipseShape new size: 5@5 . 65 s color: Color red. 66 ^ s 67) 68 69)) 70