GoSelection stack type

Hi,

I want to know if the GoSelection stack is FIFO or FILO…?
I have selected several GoNodes on my workflow : when I copy/paste the selection, all my pasted GoNodes are disordered…

Thanks for your help…

Disordered how?

Did you do the selection with a drag-box, or using Shift-Click?
The Primary selection is the first in the list... so if you do click, shift-click, shift-click to select 3 items, the first is the primary, the next 2 are secondary. If you shift-click the first one (to de-select it), the primary selection moves to the second object.

Hi Jake,

There are the following actions :

  • I have a workflow with a specific GoNode like an “IF” (subgraph with 2 GoBranch)
  • I add successively 2 GoNode to my left branch (node1, node2)
  • I insert a 3rd one between them (node3)

I want to move this 3 GoNode from left branch to right branch and therefore I select my 3 GoNode directly in the GoView : when I look in the GoSelection, the selection list is : node1, node2, node3… that’s my problem !
The selection cannot be ordered as the workflow way ?

Thanks for your help.

Selection is maintained in the order things were selected, or the order they were found during a drag-box selection.
Selection is a generic mechanism within GoDiagram, we don't make any attempt to make it understand the symantics of the particular application.
You could derive your own GoSelection-based class and change Add to honor the ordering in the diagram.
Or you could just create a method that created an ordered collection of nodes, give the collection represented by the selection. (this is what I'd do...) There's a section in the User Guide on traversing diagrams.

My problem comes from the fact that the inserted node (node3) was selected when I use the drag-box selection… no ?

Right… the drag box selection just iterates through the document finding objects inside the selection rectangle… so the objects in the selection are likely (although I don’t think we guarantee it) to show up in the order they were added to the document.