Tools__ViewTreeApplication.st
changeset 3568 5004640f2a10
parent 3551 94a23bbd725b
child 3573 fc569c283368
equal deleted inserted replaced
3566:278888b1ca84 3568:5004640f2a10
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2007 by eXept Software AG
     4  COPYRIGHT (c) 2007 by eXept Software AG
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  4362 ! !
  4364 ! !
  4363 
  4365 
  4364 !ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection protocol'!
  4366 !ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection protocol'!
  4365 
  4367 
  4366 changed:aParameter with:oldSelection
  4368 changed:aParameter with:oldSelection
  4367     "update the visibility staus of the current selection
  4369     "update the visibility status of the current selection
  4368     "
  4370     "
  4369     |unselected rootView rootItem selSize|
  4371     |unselected rootView rootItem selSize|
  4370 
  4372 
  4371     selSize := selection size.
  4373     selSize := selection size.
  4372 
  4374 
  4373     selSize == 0 ifTrue:[
  4375     selSize == 0 ifTrue:[
  4374 	selectedSuperItems := #().
  4376         selectedSuperItems := #().
  4375     ] ifFalse:[
  4377     ] ifFalse:[
  4376 	selSize == 1 ifTrue:[
  4378         selSize == 1 ifTrue:[
  4377 	    selectedSuperItems := Array with:(selection at:1).
  4379             selectedSuperItems := Array with:(selection at:1).
  4378 	] ifFalse:[
  4380         ] ifFalse:[
  4379 	    rootItem := listOfItems root.
  4381             rootItem := listOfItems root.
  4380 
  4382 
  4381 	    (selection includesIdentical:rootItem) ifTrue:[
  4383             (selection includesIdentical:rootItem) ifTrue:[
  4382 		selectedSuperItems := Array with:rootItem.
  4384                 selectedSuperItems := Array with:rootItem.
  4383 	    ] ifFalse:[
  4385             ] ifFalse:[
  4384 		selectedSuperItems := OrderedCollection new:selSize.
  4386                 selectedSuperItems := OrderedCollection new:selSize.
  4385 
  4387 
  4386 		selection do:[:anItem|
  4388                 selection do:[:anItem|
  4387 		    anItem parentsDetect:[:el| selection includesIdentical:el ]
  4389                     anItem parentsDetect:[:el| selection includesIdentical:el ]
  4388 				  ifNone:[ selectedSuperItems add:anItem ].
  4390                                   ifNone:[ selectedSuperItems add:anItem ].
  4389 		].
  4391                 ].
  4390 	    ]
  4392             ]
  4391 	]
  4393         ]
  4392     ].
  4394     ].
  4393 
  4395 
  4394     (     hiddenLevel == 0
  4396     (     hiddenLevel == 0
  4395      and:[(rootView := listOfItems rootView) notNil
  4397      and:[(rootView := listOfItems rootView) notNil
  4396      and:[rootView shown]]
  4398      and:[rootView shown]]
  4397     ) ifTrue:[
  4399     ) ifTrue:[
  4398 	selSize == 0 ifTrue:[
  4400         selSize == 0 ifTrue:[
  4399 	    "/ must redraw the old selection unselected
  4401             "/ must redraw the old selection unselected
  4400 	    self redrawUnselected:oldSelection andLock:false
  4402             self redrawUnselected:oldSelection andLock:false
  4401 	] ifFalse:[
  4403         ] ifFalse:[
  4402 	    self invalidateSelection.
  4404             self invalidateSelection.
  4403 
  4405 
  4404 	    oldSelection size ~~ 0 ifTrue:[
  4406             oldSelection size ~~ 0 ifTrue:[
  4405 		"/ must redraw all elements no longer in the selection
  4407                 "/ must redraw all elements no longer in the selection
  4406 		unselected := oldSelection select:[:el| (selection includesIdentical:el) not ].
  4408                 unselected := oldSelection select:[:el| (selection includesIdentical:el) not ].
  4407 		self redrawUnselected:unselected andLock:false.
  4409                 self redrawUnselected:unselected andLock:false.
  4408 	    ]
  4410             ]
  4409 	]
  4411         ]
  4410     ].
  4412     ].
  4411     super changed:aParameter with:oldSelection.
  4413     super changed:aParameter with:oldSelection.
       
  4414 
       
  4415     "Modified (comment): / 29-06-2018 / 08:25:36 / Claus Gittinger"
  4412 !
  4416 !
  4413 
  4417 
  4414 setValue:aNewSelection
  4418 setValue:aNewSelection
  4415     "set the selection without notifying
  4419     "set the selection without notifying
  4416     "
  4420     "