-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathPyramidBlocGeometryPlugin.class.st
More file actions
94 lines (79 loc) · 2.58 KB
/
PyramidBlocGeometryPlugin.class.st
File metadata and controls
94 lines (79 loc) · 2.58 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
Class {
#name : #PyramidBlocGeometryPlugin,
#superclass : #Object,
#traits : 'TPyramidPlugin',
#classTraits : 'TPyramidPlugin classTrait',
#instVars : [
'propertiesManager'
],
#category : #'Pyramid-Bloc-plugin-bloc-geometry'
}
{ #category : #accessing }
PyramidBlocGeometryPlugin class >> cornerRadii [
| property |
property := PyramidProperty new
name: 'Corner radius';
command: PyramidRoundedRectangleCornerRadiiCommand new;
inputPresenterClass:
PyramidCornerRadiiInputPresenter;
yourself.
property inputPresenterModel help:
'Change the corner radius of the geometry. For example:
- "10" to set a radius of 10 px on each corner.
- "10 20" to set a radius of 10 px on the top-left and bottom-right corner and 20 px on the top-right and bottom-left corner.
- "10 20 30 40" to set a radius of 10 px on top-left, 20 px on top-right, 30 px on bottom-right and 40 px on bottom-left.'.
^ property
]
{ #category : #accessing }
PyramidBlocGeometryPlugin class >> geometry [
| property |
property := PyramidProperty new
name: 'Geo';
command: PyramidGeometryCommand new;
inputPresenterClass: PyramidMagicButtonsInputPresenter;
yourself.
self geometryClasses do: [ :each |
property inputPresenterModel addButtonModel:
each asPyramidMagicButton ].
^ property
]
{ #category : #'as yet unclassified' }
PyramidBlocGeometryPlugin class >> geometryClasses [
^ {
BlRectangleGeometry.
BlRoundedRectangleGeometry.
BlSquareGeometry.
BlEllipseGeometry.
BlCircleGeometry.
BlAnnulusSectorGeometry.
BlTriangleGeometry.
BlLineGeometry .
BlPolylineGeometry.
BlBezierCurveGeometry.
BlPolygonGeometry }
]
{ #category : #adding }
PyramidBlocGeometryPlugin >> addPanelsOn: aPyramidSimpleWindow [
aPyramidSimpleWindow at: #tabRight addItem: [ :builder |
builder
makeTab: self propertiesManager mainPresenter
label: 'Geo'
icon: (Smalltalk ui icons iconNamed: #box)
order: 4 ]
]
{ #category : #connecting }
PyramidBlocGeometryPlugin >> connectOn: aPyramidEditor [
propertiesManager projectModel: aPyramidEditor projectModel.
propertiesManager commandExecutor:
aPyramidEditor commandExecutor
]
{ #category : #initialization }
PyramidBlocGeometryPlugin >> initialize [
propertiesManager := PyramidPropertiesManagerForSelection new.
propertiesManager addProperty: self class geometry.
propertiesManager addProperty: self class cornerRadii.
]
{ #category : #adding }
PyramidBlocGeometryPlugin >> propertiesManager [
^ propertiesManager
]