Re: The Trunk: Tools-mt.553.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.553.mcz

Levente Uzonyi-2
I consider the depth filter to be a bad idea, because I see no value in
filtering only the next 1, 2 or 3 levels.

I can imagine two possible use cases:
1. filter only the tree nodes already opened - great when some nodes may
be proxies.
2. filter the whole tree - what most users would expect to see
This could be a simple boolean preference.

The actual filtering should be done with a single tree traversal.

Levente

On Fri, 13 Mar 2015, [hidden email] wrote:

> Marcel Taeumel uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-mt.553.mcz
>
> ==================== Summary ====================
>
> Name: Tools-mt.553
> Author: mt
> Time: 13 March 2015, 10:31:03.81 am
> UUID: 8a53e27d-a4d2-1b4d-b899-7433bf6d5424
> Ancestors: Tools-mt.552
>
> Filtering changed to support a depth offset. Will be used to filter subtrees and support separate exploration activities in a large tree structure. The depth-limit will then be applied together with the offset.
>
> =============== Diff against Tools-mt.552 ===============
>
> Item was changed:
>  ----- Method: IndentingListItemMorph>>applyFilter: (in category 'filtering') -----
>  applyFilter: filter
>
> + self
> + applyFilter: filter
> + depthOffset: self indentLevel.!
> - | selfMatch childMatch |
> - self isExpanded ifTrue: [self toggleExpandedState].
> -
> - selfMatch := self matches: filter.
> - childMatch := self matchesAnyChild: filter.
> -
> - selfMatch | childMatch ifFalse: [^ self hide].
> -
> - selfMatch ifTrue: [
> - self backgroundColor: ((Color gray: 0.85) alpha: 0.5)].
> - childMatch ifTrue: [
> - self toggleExpandedState.
> - self childrenDo: [:child | child applyFilter: filter]].!
>
> Item was added:
> + ----- Method: IndentingListItemMorph>>applyFilter:depthOffset: (in category 'filtering') -----
> + applyFilter: filter depthOffset: offset
> +
> + | selfMatch childMatch |
> + self isExpanded ifTrue: [self toggleExpandedState].
> +
> + selfMatch := self matches: filter.
> + childMatch := self matchesAnyChild: filter depthOffset: offset.
> +
> + selfMatch | childMatch ifFalse: [^ self hide].
> +
> + selfMatch ifTrue: [
> + self backgroundColor: ((Color gray: 0.85) alpha: 0.5)].
> + childMatch ifTrue: [
> + self toggleExpandedState.
> + self childrenDo: [:child | child applyFilter: filter depthOffset: offset]].!
>
> Item was removed:
> - ----- Method: IndentingListItemMorph>>matchesAnyChild: (in category 'filtering') -----
> - matchesAnyChild: pattern
> -
> - | maxDepth next current |
> - maxDepth := PluggableTreeMorph maximumSearchDepth - self indentLevel.
> - maxDepth <= 0 ifTrue: [^ false].
> -
> - next := (self getChildren collect: [:obj | 1 -> obj]) asOrderedCollection.
> - [next notEmpty] whileTrue: [
> - current := next removeFirst.
> -
> - (self matches: pattern in: current value)
> - ifTrue: [^ true].
> -
> - current key < maxDepth ifTrue: [
> - next addAll: ((self getChildrenFor: current value) collect: [:obj | (current key + 1) -> obj])].
> - ].
> -
> - ^ false!
>
> Item was added:
> + ----- Method: IndentingListItemMorph>>matchesAnyChild:depthOffset: (in category 'filtering') -----
> + matchesAnyChild: pattern depthOffset: offset
> +
> + | maxDepth next current |
> + maxDepth := PluggableTreeMorph maximumSearchDepth - self indentLevel + offset.
> + maxDepth <= 0 ifTrue: [^ false].
> +
> + next := (self getChildren collect: [:obj | 1 -> obj]) asOrderedCollection.
> + [next notEmpty] whileTrue: [
> + current := next removeFirst.
> +
> + (self matches: pattern in: current value)
> + ifTrue: [^ true].
> +
> + current key < maxDepth ifTrue: [
> + next addAll: ((self getChildrenFor: current value) collect: [:obj | (current key + 1) -> obj])].
> + ].
> +
> + ^ false!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.553.mcz

Chris Muller-3
3.  Collect an attribute of a collection (see screenshot).

This is possible only when depth is 2 and "Filterable Lists by labels
only" is set.

On Fri, Mar 20, 2015 at 12:56 PM, Levente Uzonyi <[hidden email]> wrote:

> I consider the depth filter to be a bad idea, because I see no value in
> filtering only the next 1, 2 or 3 levels.
>
> I can imagine two possible use cases:
> 1. filter only the tree nodes already opened - great when some nodes may be
> proxies.
> 2. filter the whole tree - what most users would expect to see
> This could be a simple boolean preference.
>
> The actual filtering should be done with a single tree traversal.
>
> Levente
>
>
> On Fri, 13 Mar 2015, [hidden email] wrote:
>
>> Marcel Taeumel uploaded a new version of Tools to project The Trunk:
>> http://source.squeak.org/trunk/Tools-mt.553.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Tools-mt.553
>> Author: mt
>> Time: 13 March 2015, 10:31:03.81 am
>> UUID: 8a53e27d-a4d2-1b4d-b899-7433bf6d5424
>> Ancestors: Tools-mt.552
>>
>> Filtering changed to support a depth offset. Will be used to filter
>> subtrees and support separate exploration activities in a large tree
>> structure. The depth-limit will then be applied together with the offset.
>>
>> =============== Diff against Tools-mt.552 ===============
>>
>> Item was changed:
>>  ----- Method: IndentingListItemMorph>>applyFilter: (in category
>> 'filtering') -----
>>  applyFilter: filter
>>
>> +       self
>> +               applyFilter: filter
>> +               depthOffset: self indentLevel.!
>> -       | selfMatch childMatch |
>> -       self isExpanded ifTrue: [self toggleExpandedState].
>> -
>> -       selfMatch := self matches: filter.
>> -       childMatch := self matchesAnyChild: filter.
>> -
>> -       selfMatch | childMatch ifFalse: [^ self hide].
>> -
>> -       selfMatch ifTrue: [
>> -               self backgroundColor: ((Color gray: 0.85) alpha: 0.5)].
>> -       childMatch ifTrue: [
>> -               self toggleExpandedState.
>> -               self childrenDo: [:child | child applyFilter: filter]].!
>>
>> Item was added:
>> + ----- Method: IndentingListItemMorph>>applyFilter:depthOffset: (in
>> category 'filtering') -----
>> + applyFilter: filter depthOffset: offset
>> +
>> +       | selfMatch childMatch |
>> +       self isExpanded ifTrue: [self toggleExpandedState].
>> +
>> +       selfMatch := self matches: filter.
>> +       childMatch := self matchesAnyChild: filter depthOffset: offset.
>> +
>> +       selfMatch | childMatch ifFalse: [^ self hide].
>> +
>> +       selfMatch ifTrue: [
>> +               self backgroundColor: ((Color gray: 0.85) alpha: 0.5)].
>> +       childMatch ifTrue: [
>> +               self toggleExpandedState.
>> +               self childrenDo: [:child | child applyFilter: filter
>> depthOffset: offset]].!
>>
>> Item was removed:
>> - ----- Method: IndentingListItemMorph>>matchesAnyChild: (in category
>> 'filtering') -----
>> - matchesAnyChild: pattern
>> -
>> -       | maxDepth next current |
>> -       maxDepth := PluggableTreeMorph maximumSearchDepth - self
>> indentLevel.
>> -       maxDepth <= 0 ifTrue: [^ false].
>> -
>> -       next := (self getChildren collect: [:obj | 1 -> obj])
>> asOrderedCollection.
>> -       [next notEmpty] whileTrue: [
>> -               current := next removeFirst.
>> -
>> -               (self matches: pattern in: current value)
>> -                       ifTrue: [^ true].
>> -
>> -               current key < maxDepth ifTrue: [
>> -                       next addAll: ((self getChildrenFor: current value)
>> collect: [:obj | (current key + 1) -> obj])].
>> -               ].
>> -
>> -       ^ false!
>>
>> Item was added:
>> + ----- Method: IndentingListItemMorph>>matchesAnyChild:depthOffset: (in
>> category 'filtering') -----
>> + matchesAnyChild: pattern depthOffset: offset
>> +
>> +       | maxDepth next current |
>> +       maxDepth := PluggableTreeMorph maximumSearchDepth - self
>> indentLevel + offset.
>> +       maxDepth <= 0 ifTrue: [^ false].
>> +
>> +       next := (self getChildren collect: [:obj | 1 -> obj])
>> asOrderedCollection.
>> +       [next notEmpty] whileTrue: [
>> +               current := next removeFirst.
>> +
>> +               (self matches: pattern in: current value)
>> +                       ifTrue: [^ true].
>> +
>> +               current key < maxDepth ifTrue: [
>> +                       next addAll: ((self getChildrenFor: current value)
>> collect: [:obj | (current key + 1) -> obj])].
>> +               ].
>> +
>> +       ^ false!
>>
>>
>>
>



collect-format.png (23K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.553.mcz

marcel.taeumel (old)
In reply to this post by Levente Uzonyi-2
Fitering the whole tree may break for infinitely deep structures.

Filtering the already opened tree nodes? What do you mean?

We should move filtering one level up to start at the list where the current selection is. Just considering Tobias' new Font tool. Hmmm... but then we would have to change the selection in a freshly opened object explorer to filter the list of instance variables...

I don't think that the depth filter is a bad idea in general. It depends on your scenarios. Levente, maybe you could elaborate a little bit more the scenarios you have in mind. I optimized the filter for the exploration idea, I explained in the other thread. :)

Best,
Marcel