That is really great!  A few minor observations...

1. Referring to attached image, when clicking on a node to remove it, an extra space arises between node 1 & node 2.  It looks about the same space as at the right margin - almost like a margin was going to be added as a space on the left margin but node 1 was pushed to 0@0.

2. If elements have been moved vertically, then a vertical offset then if the bottom element (eg 7) is deleted, then an offset is introduced between the elements each side of the deleted element (eg 6 & 8 as shown).  However if the top element is deleted (eg 6) then the vertical offset is between nodes 1 & 2.

3. It would be good to have an option where a deleted element doesn't rearrange all the nodes.  For instance where nodes 6 & 7 are offset, if node 7 is deleted, node 6 stays where it is.  I can see that being useful but can't pin down an exact use case at this time.

All the above are low-priority.

cheers -ben

Alexandre Bergel wrote:
Easy!

Just add the line "outterNode resizeStrategy:  ROShrinkingParent new." 

The complete script is:
-=-=-=-=-=-=-=-=-=-=-=-=
	outterNode := view node: 'hello' forIt: [ 
	view shape rectangle withText.
	view interaction on: ROMouseClick do: [ :event | 
		outterNode removeElement: event element. 
		ROHorizontalLineLayout on: outterNode elements.
		
		ROShrikingSize on: outterNode. 
		event element signalUpdate  ].
	 
	view nodes: (1 to: 20).
	].
	
	"Make the outter node shrink when it can"
	outterNode resizeStrategy:  ROShrinkingParent new.
-=-=-=-=-=-=-=-=-=-=-=-=

You need to update Roassal to 1.120 for this however.

Cheers,
Alexandre


On Sep 15, 2012, at 11:07 PM, Ben Coman <btc@openInWorld.com> wrote:

  
Thanks Alexandre.  That works well for when elements are removed.  Could you also extend the example so that the bounding box shrinks dynamically as items are dragged around.
For example, if I drag for node '10' downwards, currently the parent extent grows dynamically, but if I move '10' back to its original position, it does not shrink.

cheers -ben

Alexandre Bergel wrote:
    
Hi Ben!

You will find a first shoot of this feature. Using the Mondrian DSL, you can have:

	outterNode := view node: 'hello' forIt: [ 
	view shape rectangle withText.
	view interaction on: ROMouseClick do: [ :event | 
		outterNode removeElement: event element. 
		ROHorizontalLineLayout on: outterNode elements.
		
		ROShrikingSize on: outterNode. 
		event element signalUpdate  ].
	 
	view nodes: (1 to: 20).
	].

It is also available from the Example/Mondrian/interactions/shrikingSize menu.

In Roassal 1.118

Cheers,
Alexandre


On Sep 10, 2012, at 3:01 PM, Ben Coman 
<btc@openInWorld.com>
 wrote:

  

      
Just one more thing that has been playing on my mind.  It is really a nice feature that the parent element grows when the child is moved past its boundary, but would be more good if it also shrank when the child element is moved back towards center.

cheers ben
_______________________________________________
Moose-dev mailing list

Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

    

        
  

      
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev