/
SpGridConstraints.class.st
86 lines (66 loc) · 1.34 KB
/
SpGridConstraints.class.st
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
"
I am the constraints in which an element is placed into a grid layout.
I have a position and a span.
"
Class {
#name : #SpGridConstraints,
#superclass : #SpLayoutConstraints,
#traits : 'SpTAlignable',
#classTraits : 'SpTAlignable classTrait',
#instVars : [
'position',
'span'
],
#category : #'Spec2-Layout-Grid'
}
{ #category : #'instance creation' }
SpGridConstraints class >> at: aPoint [
^ self new
position: aPoint;
yourself
]
{ #category : #'instance creation' }
SpGridConstraints class >> at: aPoint span: spanPoint [
^ self new
position: aPoint;
span: spanPoint;
yourself
]
{ #category : #accessing }
SpGridConstraints >> column [
^ self position x
]
{ #category : #accessing }
SpGridConstraints >> columnSpan [
^ self span x
]
{ #category : #initialization }
SpGridConstraints >> initialize [
super initialize.
self position: 1@1.
self span: 1@1
]
{ #category : #accessing }
SpGridConstraints >> position [
^ position
]
{ #category : #accessing }
SpGridConstraints >> position: aPoint [
position := aPoint
]
{ #category : #accessing }
SpGridConstraints >> row [
^ self position y
]
{ #category : #accessing }
SpGridConstraints >> rowSpan [
^ self span y
]
{ #category : #accessing }
SpGridConstraints >> span [
^ span
]
{ #category : #accessing }
SpGridConstraints >> span: anObject [
span := anObject
]