--- a/SelHierV.st Tue Oct 22 19:56:16 1996 +0200
+++ b/SelHierV.st Tue Oct 22 23:48:37 1996 +0200
@@ -18,7 +18,7 @@
category:'Views-Text'
!
-!SelectionInHierarchyView class methodsFor:'documentation'!
+!SelectionInHierarchyView class methodsFor:'documentation'!
copyright
"
@@ -74,6 +74,7 @@
[exEnd]
same, with nice connecting links:
+ (sorry - this works only with some fonts - see comment in #getListFromModel)
[exBegin]
|top hierarchy hierarchyV scroller|
@@ -208,83 +209,109 @@
"Modified: 10.10.94 / 16:13:38 / W.Olberding"!
getListFromModel
- "Get list entries from model.
- Answer them as idented Text."
+ "Get list entries from model.
+ Answer them as idented Text."
- | listOfNodes textList textLine treeLevels isLastOnLevel oldLevel |
+ |listOfNodes textList textLine treeLevels isLastOnLevel oldLevel
+ blockGraphicCharacters|
- listOfNodes := model list.
- listOfNodes isNil ifTrue:[^ #()].
+ listOfNodes := model list.
+ listOfNodes isNil ifTrue:[^ #()].
- showConnectingLines ifFalse:[
- textList := listOfNodes collect: [ :aNode |
- textLine := ReadWriteStream on: String new.
- aNode level timesRepeat: [
- textLine space; space.
- ].
- textLine nextPutAll: aNode name.
- aNode isExpandable ifTrue: [
- textLine nextPutAll: ' ...'.
- ].
- textLine contents.
- ].
- ] ifTrue:[
- isLastOnLevel:=Set new.
- treeLevels:=Set new.
- oldLevel:=0.
+ showConnectingLines ifFalse:[
+ textList := listOfNodes collect: [ :aNode |
+ textLine := ReadWriteStream on: String new.
+ aNode level timesRepeat: [
+ textLine space; space.
+ ].
+ textLine nextPutAll: aNode name.
+ aNode isExpandable ifTrue: [
+ textLine nextPutAll: ' ...'.
+ ].
+ textLine contents.
+ ].
+ ] ifTrue:[
+ "/ claus:
+ "/ mhmh - the AEG code depends on those blockGraphic
+ "/ characters being in the font.
+ "/
+ "/ how can we find out what characters there are ?
+ "/ (X maps missing chars to a space).
+ "/ we should really rewrite this to use a private bitmap font ...
- listOfNodes reverseDo: [ :aNode |
- (treeLevels includes:(aNode level)) ifFalse:[
- isLastOnLevel add:aNode.
- treeLevels add:(aNode level).
- ].
- aNode level < oldLevel ifTrue:[
- treeLevels remove:oldLevel.
- ].
- oldLevel:=aNode level.
- ].
+"/ blockGraphicCharacters := Array with:$|
+"/ with:$+
+"/ with:$+
+"/ with:$-.
+
+ blockGraphicCharacters := Array with:(Character value:25)
+ with:(Character value:14)
+ with:(Character value:21)
+ with:(Character value:18).
+
+ isLastOnLevel:=Set new.
+ treeLevels:=Set new.
+ oldLevel:=0.
- treeLevels:=Set new.
- oldLevel:=0.
- textList := listOfNodes collect: [ :aNode |
- textLine := ReadWriteStream on: String new.
+ listOfNodes reverseDo: [ :aNode |
+ (treeLevels includes:(aNode level)) ifFalse:[
+ isLastOnLevel add:aNode.
+ treeLevels add:(aNode level).
+ ].
+ aNode level < oldLevel ifTrue:[
+ treeLevels remove:oldLevel.
+ ].
+ oldLevel:=aNode level.
+ ].
- 1 to:((aNode level)-1) do: [ :l |
- (treeLevels includes:l) ifTrue:[
- textLine space; nextPutAll:((Character value:25)printString); space.
- ]ifFalse:[
- textLine space; space; space.
- ]
- ].
- treeLevels add:(aNode level).
- oldLevel:=aNode level.
+ treeLevels:=Set new.
+ oldLevel:=0.
+ textList := listOfNodes collect: [ :aNode |
+ textLine := ReadWriteStream on: String new.
+
+ 1 to:((aNode level)-1) do: [ :l |
+ (treeLevels includes:l) ifTrue:[
+"/ original: textLine space; nextPutAll:((Character value:25)printString); space.
+ textLine space; nextPut:(blockGraphicCharacters at:1); space.
+ ]ifFalse:[
+ textLine space; space; space.
+ ]
+ ].
+ treeLevels add:(aNode level).
+ oldLevel:=aNode level.
- (aNode = (listOfNodes first)) ifFalse:[
- textLine space.
- (isLastOnLevel includes:aNode)ifTrue:[
- textLine nextPutAll:((Character value:14)printString).
- treeLevels remove:(aNode level).
- ]ifFalse:[
- textLine nextPutAll:((Character value:21)printString).
- ].
- textLine nextPutAll:((Character value:18)printString).
- ].
- aNode isExpandable ifTrue: [
- textLine nextPutAll: '[+]'.
- ]ifFalse:[
- aNode isCollapsable ifTrue: [
- textLine nextPutAll: '[-]'.
- ]ifFalse:[textLine nextPutAll:((Character value:18)printString).].
- ].
+ (aNode = (listOfNodes first)) ifFalse:[
+ textLine space.
+ (isLastOnLevel includes:aNode)ifTrue:[
+"/ original: textLine nextPutAll:((Character value:14)printString).
+ textLine nextPut:(blockGraphicCharacters at:2).
+ treeLevels remove:(aNode level).
+ ] ifFalse:[
+"/ original: textLine nextPutAll:((Character value:21)printString).
+ textLine nextPut:(blockGraphicCharacters at:3).
+ ].
+"/ original: textLine nextPutAll:((Character value:18)printString).
+ textLine nextPut:(blockGraphicCharacters at:4).
+ ].
+ aNode isExpandable ifTrue: [
+ textLine nextPutAll: '[+]'.
+ ] ifFalse:[
+ aNode isCollapsable ifTrue: [
+ textLine nextPutAll: '[-]'.
+ ] ifFalse:[
+"/ original: textLine nextPutAll:((Character value:18)printString).
+ textLine nextPut:(blockGraphicCharacters at:4).
+ ].
+ ].
- textLine nextPutAll:' ', aNode name.
- textLine contents.
- ].
- ].
+ textLine nextPutAll:' ', aNode name.
+ textLine contents.
+ ].
+ ].
- ^textList
+ ^textList
- "Modified: 10.10.94 / 16:13:39 / W.Olberding"
+ "Modified: 10.10.94 / 16:13:39 / W.Olberding"
!
getSelectionFromModel
@@ -327,8 +354,8 @@
"Modified: 10.10.94 / 16:13:38 / W.Olberding"! !
-!SelectionInHierarchyView class methodsFor:'documentation'!
+!SelectionInHierarchyView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelHierV.st,v 1.6 1996-10-11 14:46:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelHierV.st,v 1.7 1996-10-22 21:48:37 cg Exp $'
! !
--- a/SelectionInHierarchyView.st Tue Oct 22 19:56:16 1996 +0200
+++ b/SelectionInHierarchyView.st Tue Oct 22 23:48:37 1996 +0200
@@ -18,7 +18,7 @@
category:'Views-Text'
!
-!SelectionInHierarchyView class methodsFor:'documentation'!
+!SelectionInHierarchyView class methodsFor:'documentation'!
copyright
"
@@ -74,6 +74,7 @@
[exEnd]
same, with nice connecting links:
+ (sorry - this works only with some fonts - see comment in #getListFromModel)
[exBegin]
|top hierarchy hierarchyV scroller|
@@ -208,83 +209,109 @@
"Modified: 10.10.94 / 16:13:38 / W.Olberding"!
getListFromModel
- "Get list entries from model.
- Answer them as idented Text."
+ "Get list entries from model.
+ Answer them as idented Text."
- | listOfNodes textList textLine treeLevels isLastOnLevel oldLevel |
+ |listOfNodes textList textLine treeLevels isLastOnLevel oldLevel
+ blockGraphicCharacters|
- listOfNodes := model list.
- listOfNodes isNil ifTrue:[^ #()].
+ listOfNodes := model list.
+ listOfNodes isNil ifTrue:[^ #()].
- showConnectingLines ifFalse:[
- textList := listOfNodes collect: [ :aNode |
- textLine := ReadWriteStream on: String new.
- aNode level timesRepeat: [
- textLine space; space.
- ].
- textLine nextPutAll: aNode name.
- aNode isExpandable ifTrue: [
- textLine nextPutAll: ' ...'.
- ].
- textLine contents.
- ].
- ] ifTrue:[
- isLastOnLevel:=Set new.
- treeLevels:=Set new.
- oldLevel:=0.
+ showConnectingLines ifFalse:[
+ textList := listOfNodes collect: [ :aNode |
+ textLine := ReadWriteStream on: String new.
+ aNode level timesRepeat: [
+ textLine space; space.
+ ].
+ textLine nextPutAll: aNode name.
+ aNode isExpandable ifTrue: [
+ textLine nextPutAll: ' ...'.
+ ].
+ textLine contents.
+ ].
+ ] ifTrue:[
+ "/ claus:
+ "/ mhmh - the AEG code depends on those blockGraphic
+ "/ characters being in the font.
+ "/
+ "/ how can we find out what characters there are ?
+ "/ (X maps missing chars to a space).
+ "/ we should really rewrite this to use a private bitmap font ...
- listOfNodes reverseDo: [ :aNode |
- (treeLevels includes:(aNode level)) ifFalse:[
- isLastOnLevel add:aNode.
- treeLevels add:(aNode level).
- ].
- aNode level < oldLevel ifTrue:[
- treeLevels remove:oldLevel.
- ].
- oldLevel:=aNode level.
- ].
+"/ blockGraphicCharacters := Array with:$|
+"/ with:$+
+"/ with:$+
+"/ with:$-.
+
+ blockGraphicCharacters := Array with:(Character value:25)
+ with:(Character value:14)
+ with:(Character value:21)
+ with:(Character value:18).
+
+ isLastOnLevel:=Set new.
+ treeLevels:=Set new.
+ oldLevel:=0.
- treeLevels:=Set new.
- oldLevel:=0.
- textList := listOfNodes collect: [ :aNode |
- textLine := ReadWriteStream on: String new.
+ listOfNodes reverseDo: [ :aNode |
+ (treeLevels includes:(aNode level)) ifFalse:[
+ isLastOnLevel add:aNode.
+ treeLevels add:(aNode level).
+ ].
+ aNode level < oldLevel ifTrue:[
+ treeLevels remove:oldLevel.
+ ].
+ oldLevel:=aNode level.
+ ].
- 1 to:((aNode level)-1) do: [ :l |
- (treeLevels includes:l) ifTrue:[
- textLine space; nextPutAll:((Character value:25)printString); space.
- ]ifFalse:[
- textLine space; space; space.
- ]
- ].
- treeLevels add:(aNode level).
- oldLevel:=aNode level.
+ treeLevels:=Set new.
+ oldLevel:=0.
+ textList := listOfNodes collect: [ :aNode |
+ textLine := ReadWriteStream on: String new.
+
+ 1 to:((aNode level)-1) do: [ :l |
+ (treeLevels includes:l) ifTrue:[
+"/ original: textLine space; nextPutAll:((Character value:25)printString); space.
+ textLine space; nextPut:(blockGraphicCharacters at:1); space.
+ ]ifFalse:[
+ textLine space; space; space.
+ ]
+ ].
+ treeLevels add:(aNode level).
+ oldLevel:=aNode level.
- (aNode = (listOfNodes first)) ifFalse:[
- textLine space.
- (isLastOnLevel includes:aNode)ifTrue:[
- textLine nextPutAll:((Character value:14)printString).
- treeLevels remove:(aNode level).
- ]ifFalse:[
- textLine nextPutAll:((Character value:21)printString).
- ].
- textLine nextPutAll:((Character value:18)printString).
- ].
- aNode isExpandable ifTrue: [
- textLine nextPutAll: '[+]'.
- ]ifFalse:[
- aNode isCollapsable ifTrue: [
- textLine nextPutAll: '[-]'.
- ]ifFalse:[textLine nextPutAll:((Character value:18)printString).].
- ].
+ (aNode = (listOfNodes first)) ifFalse:[
+ textLine space.
+ (isLastOnLevel includes:aNode)ifTrue:[
+"/ original: textLine nextPutAll:((Character value:14)printString).
+ textLine nextPut:(blockGraphicCharacters at:2).
+ treeLevels remove:(aNode level).
+ ] ifFalse:[
+"/ original: textLine nextPutAll:((Character value:21)printString).
+ textLine nextPut:(blockGraphicCharacters at:3).
+ ].
+"/ original: textLine nextPutAll:((Character value:18)printString).
+ textLine nextPut:(blockGraphicCharacters at:4).
+ ].
+ aNode isExpandable ifTrue: [
+ textLine nextPutAll: '[+]'.
+ ] ifFalse:[
+ aNode isCollapsable ifTrue: [
+ textLine nextPutAll: '[-]'.
+ ] ifFalse:[
+"/ original: textLine nextPutAll:((Character value:18)printString).
+ textLine nextPut:(blockGraphicCharacters at:4).
+ ].
+ ].
- textLine nextPutAll:' ', aNode name.
- textLine contents.
- ].
- ].
+ textLine nextPutAll:' ', aNode name.
+ textLine contents.
+ ].
+ ].
- ^textList
+ ^textList
- "Modified: 10.10.94 / 16:13:39 / W.Olberding"
+ "Modified: 10.10.94 / 16:13:39 / W.Olberding"
!
getSelectionFromModel
@@ -327,8 +354,8 @@
"Modified: 10.10.94 / 16:13:38 / W.Olberding"! !
-!SelectionInHierarchyView class methodsFor:'documentation'!
+!SelectionInHierarchyView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInHierarchyView.st,v 1.6 1996-10-11 14:46:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInHierarchyView.st,v 1.7 1996-10-22 21:48:37 cg Exp $'
! !