-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCompositeGraphMorph.class.st
More file actions
64 lines (53 loc) · 1.83 KB
/
Copy pathCompositeGraphMorph.class.st
File metadata and controls
64 lines (53 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Class {
#name : #CompositeGraphMorph,
#superclass : #Object,
#category : #'Mathematics-Graphs-Morphic'
}
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> addComponent: aGraphMorph [
self addMorph: aGraphMorph proportionalWidth: 1
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> componentsDo: aBlock [
self submorphsDo: [:each| (each isKindOf: GraphMorph) ifTrue: [aBlock value: each]]
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> dimension: anInteger [
self componentsDo: [:each| each dimension: anInteger]
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> edgeAt: anEdge [
^ self nodeAt: anEdge ifAbsent: [self error: 'edge not found']
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> edgeAt: anEdge ifAbsent: exceptionBlock [
self componentsDo: [:each| (each edgeAt: anEdge ifAbsent: []) ifNotNil: [:edge| ^edge]].
^ exceptionBlock value
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> edgesAndLabelsDo: aBlock [
self componentsDo: [:each| each edgesAndLabelsDo: aBlock]
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> hideLabels [
self componentsDo: [:each| each hideLabels]
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> initialize [
super initialize.
self color: Color transparent.
self morphExtent: 600 @ 300
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> nodeAt: anObject [
^ self nodeAt: anObject ifAbsent: [self error: 'node not found']
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> nodeAt: anObject ifAbsent: exceptionBlock [
self componentsDo: [:each| (each nodeAt: anObject ifAbsent: []) ifNotNil: [:node| ^node]].
^ exceptionBlock value
]
{ #category : #'as yet unclassified' }
CompositeGraphMorph >> nodesDo: aBlock [
self componentsDo: [:each| each nodesDo: aBlock]
]