Thursday, 8 September 2011


So here's how I'm thinking about this. A selection is an object, which contains a list of the staff elements which have been selected. We don't select staff areas, i.e. the container for the actual stave.

The model should manage the selection object, in response to the controller interpreting gestures, e.g.
  • click and hold mouse button gesture with no shift key down means we need to create a selection object; 
  • dragging the mouse while the mouse key remains held creates a visual rectangle and as that rectangle is drawn, any staff elements which fall within it have their selected property set and they are included in the list in the selection object. Only elements which are completely contained within the selection rectangle are included in the selection object;
  • when the mouse key is released, and a selection object exists, the selection object is complete, nothing actually needs to happen as a result of this gesture though;
  • click and hold mouse button with shift key down means start a new visual rectangle for including objects but any objects that become contained within the rectangle get appended to the existing selection object;
The ability to append to a selection means the selected objects need to be represented visually in a manner other than the mouse drag created selection rectangle. The elements could for example be rendered in a different way, e.g. colour blue if selected, or perhaps slightly enlarged (don't know how difficult that is). For now let's decide that unselected elements are black, selected ones are blue.

Keyboard gestures also drive selection actions.
  • Shift and arrow keys draw the same selection rectangle, ie work like the click and hold gesture, with shift down, i.e. append to existing selection else create new. 
  • If you want to unselect the selection a mouse click does that or a keyboard navigation gesture does.
  • Any new input of course will replace a selection, i.e. select 3 notes then enter a new one mean the 3 get deleted and the one new one gets placed at the start of the selection.
  • Navigation gestures need examination. Does down arrow mean go down a line and forget any selection, or does it mean move the selection down? I think it means the former, let's think about a text component example, if you select a bunch of text then hit down arrow the caret moves down and the selection is forgotten.
Probably need to integrate with the cut and paste API, which in turn integrates with that horrible java drag'n'drop API.

Time to cogitate ...

No comments:

Post a Comment