The Trunk: Tools-mt.553.mcz

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

The Trunk: Tools-mt.553.mcz

commits-2
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!