I'm creating a diagramming application and am trying to find a good design for dealing with selection of objects and operations on the selection.First some context:The individually selectable objects in the above diagram are the green block, the blue triangles and the black line. There could be multiple of each.Blue triangles are considered part of the block and are always on the edge of a blockThe user must be able to select any combination of the above objectsThere is an object in the application for each of the visible objectsThese objects know how to draw themselves on the canvasThe block maintains the information about which spots on its edge are taken by which triangles.Desired behaviour:The appearance of objects should be different based on whether they are part of the selectionThe application should allow the user to select all objects in a rectangular areaFor dragging a selection:if blocks (and optionally some lines and triangles) are selected, dragging should move all selected objects together as one groupif only triangles of the same block are selected, then dragging should rotate them around their block along the edgeDesign constraints/preferences:Keep knowledge of what dragging does to a group of objects in one place and out of the objects themselvesDo not put detailed knowledge of all diagram objects into the object that manages the dragging operationWhat would be a good design for implementing this behaviour in the application?
Good OO design for selected object manipulation in a diagramming application
design;object oriented design;gui