-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathPyramidGeometryInputModel.class.st
More file actions
123 lines (89 loc) · 2.26 KB
/
PyramidGeometryInputModel.class.st
File metadata and controls
123 lines (89 loc) · 2.26 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Class {
#name : #PyramidGeometryInputModel,
#superclass : #Object,
#instVars : [
'buttonPresenter',
'blocIcon',
'defaultGeometry',
'help',
'input'
],
#category : #'Pyramid-Bloc-plugin-bloc-geometry'
}
{ #category : #accessing }
PyramidGeometryInputModel >> blocIcon [
^ blocIcon
]
{ #category : #accessing }
PyramidGeometryInputModel >> blocIcon: anObject [
blocIcon := anObject
]
{ #category : #initialization }
PyramidGeometryInputModel >> buttonPresenter [
^ buttonPresenter
]
{ #category : #accessing }
PyramidGeometryInputModel >> defaultGeometry [
^ defaultGeometry
]
{ #category : #accessing }
PyramidGeometryInputModel >> defaultGeometry: anObject [
defaultGeometry := anObject
]
{ #category : #'error handling' }
PyramidGeometryInputModel >> error [
self buttonPresenter icon: self iconError; help: 'Will do nothing'; action: [ ]
]
{ #category : #accessing }
PyramidGeometryInputModel >> help [
^ help
]
{ #category : #accessing }
PyramidGeometryInputModel >> help: anObject [
help := anObject
]
{ #category : #'as yet unclassified' }
PyramidGeometryInputModel >> iconColor: aColor [
^ (self blocIcon background: aColor) exportAsForm
]
{ #category : #'as yet unclassified' }
PyramidGeometryInputModel >> iconError [
^self iconColor: (Color fromHexString: 'FFDB42')
]
{ #category : #'as yet unclassified' }
PyramidGeometryInputModel >> iconNormal [
^self iconColor: (Color fromHexString: 'a7a7a7')
]
{ #category : #'as yet unclassified' }
PyramidGeometryInputModel >> iconSelected [
^self iconColor: (Color fromHexString: 'AFD5FA')
]
{ #category : #initialization }
PyramidGeometryInputModel >> initialize [
buttonPresenter := SpButtonPresenter new.
]
{ #category : #accessing }
PyramidGeometryInputModel >> input [
^ input
]
{ #category : #accessing }
PyramidGeometryInputModel >> input: anObject [
input := anObject
]
{ #category : #'error handling' }
PyramidGeometryInputModel >> normal [
self buttonPresenter
icon: self iconNormal;
help: self help;
action: [
self input value: self defaultGeometry.
self input whenValueChangedDo value: self defaultGeometry. ]
]
{ #category : #'error handling' }
PyramidGeometryInputModel >> selected [
self buttonPresenter
icon: self iconSelected;
help: self help;
action: [
]
]