When an object is selected, a path of contents indices and/or character indices down to the selected location is returned. Control points/cursor location should be drawn for selected objects.
The transform parameter contains the full transform from current contents coordinates to the coordinates of your panel.
As part of its paint() method it should first draw all of its contents using the paint() method from group and should then check to see if it has a "selected" path. If it does then it should find that object using the path, retrieve its control points using the controls() method and draw the control points. Note that this must correctly handle the transformations of any nested groups.
The objects should respond to select() and controls() in the following ways:
This object has no controls of its own.
Select{ contents:[ Line{x1:10,y1:20,x2:30, y2:40, thickness:3, color:{r:255,g:255,b:0} }, Rect{ left:5,top:10,width:30, height:50, thickness:1, border:{r:0,g:0,b:0} }, Rect{ left:30,top:30,width:30, height:50, thickness:1, border:{r:0,g:0,b:0}, fill:{r:100,g:100,b:200} }, Ellipse{ left:5,top:70,width:30, height:50, thickness:1, border:{r:0,g:0,b:0} }, Ellipse{ left:30,top:90,width:30, height:50, thickness:1, border:{r:0,g:0,b:0}, fill:{r:100,g:100,b:200} }, Text{ text:"Hello", x:5,y:180,font:"sans-serif",size:10 }, Polyline{ points:[ {x:40,y:10}, {x:50,y:20}, {x:60,y:10} ], thickness:4, color:{r:100,g:255,b:100} }, Polygon{ points:[ {x:5,y:220}, {x:35,y:220}, {x:20,y:250} ], thickness:2, border:{r:0,g:0,b:0}, fill:{r:200,g:200,b:255} } ], selected: [1] }
Select{ contents:[ Line{x1:10,y1:20,x2:30, y2:40, thickness:3, color:{r:255,g:255,b:0} }, Rect{ left:5,top:10,width:30, height:50, thickness:1, border:{r:0,g:0,b:0} }, Rect{ left:30,top:30,width:30, height:50, thickness:1, border:{r:0,g:0,b:0}, fill:{r:100,g:100,b:200} }, Ellipse{ left:5,top:70,width:30, height:50, thickness:1, border:{r:0,g:0,b:0} }, Ellipse{ left:30,top:90,width:30, height:50, thickness:1, border:{r:0,g:0,b:0}, fill:{r:100,g:100,b:200} }, Text{ text:"Hello", x:5,y:180,font:"sans-serif",size:10 }, Polyline{ points:[ {x:40,y:10}, {x:50,y:20}, {x:60,y:10} ], thickness:4, color:{r:100,g:255,b:100} }, Polygon{ points:[ {x:5,y:220}, {x:35,y:220}, {x:20,y:250} ], thickness:2, border:{r:0,g:0,b:0}, fill:{r:200,g:200,b:255} }, Rect{ left:0,top:0,width:4,height:2, fill:{r:255, g:200,b:200} } ], selected:[1], sx:1.0, sy:2.0, tx:400, ty:500, rotate:45 }