table-view.json
4.47 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
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
{
// a tree of actors
/*
* 4 by 4 table:
* |------------------------------------|
* | | 2(right,top)| | |
* | - - - |----------------|---|----|
* | | | | |
* | | | | |
* | | | | |
* | - - - | - - - - - |--------|
* | | | | |
* | 1 | | | |
* | | 3 | 4 | |
* | |aligned to | | |
* | |(left, center) | | |
* | - - - | - - - - - |--------|
* | | | ' |
* | | | ' |
* | | | 5 |
* | | | ' |
* | | | ' |
* |------------------------------------|
*/
"stage": [{
"name":"simple-table",
"type":"TableView",
"background":{
"color": [0.5,0.5,0,1]
},
"parent-origin": "CENTER",
"size":[400,400,1],
"rows": 4,
"columns": 4,
"cell-padding": [10, 5],
"layout-rows": { // set the height of the rows
"0": { "policy": "fixed", "value": 40 },
"1": { "policy": "relative", "value": 0.33 },
"2": { "policy": "fit", "value": 0 }
},
"layout-columns": { // set the widths of the columns
"0": { "policy": "fit", "value": 0 },
"2": { "policy": "relative", "value": 0.2 },
"3": { "policy": "fixed", "value": 30 }
},
"actors": [{
"name":"gallery-1",
"type":"ImageActor",
"height-resize-policy":"FILL_TO_PARENT",
"image": {
"filename": "{DALI_IMAGE_DIR}gallery-small-1.jpg"
},
"custom-properties": { // properties registered dynamically
"cell-index": [0,0], // property to specify the top-left cell this child occupies
"row-span":4, // property to specify how many rows this child occupies, if not set, default value is 1
"column-span":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1
}
},{
"name":"gallery-2",
"type":"ImageActor",
"height-resize-policy":"FILL_TO_PARENT",
"image": {
"filename": "{DALI_IMAGE_DIR}gallery-small-2.jpg"
},
"custom-properties": { // properties registered dynamically
"cell-index": [0,1],
"cell-horizontal-alignment": "right" // property to specify how to align horizontally inside the cells, if not set, default value is 'left'
}
},{
"name":"gallery-3",
"type":"ImageActor",
"image": {
"filename": "{DALI_IMAGE_DIR}gallery-small-3.jpg"
},
"custom-properties": {
"cell-index":[1,1],
"row-span":3,
"cell-horizontal-alignment": "left",// property to specify how to align horizontally inside the cells, if not set, default value is 'left'
"cell-vertical-alignment": "center" // property to specify how to align vertically inside the cells, if not set, default value is 'top'
}
}, {
"name":"gallery-4",
"type":"ImageActor",
"width-resize-policy":"FILL_TO_PARENT",
"image": {
"filename": "{DALI_IMAGE_DIR}gallery-small-4.jpg"
},
"custom-properties": {
"cell-index":[2,2]
}
}, {
"name":"gallery-5",
"type":"ImageActor",
"width-resize-policy":"FILL_TO_PARENT",
"height-resize-policy":"FILL_TO_PARENT",
"image": {
"filename": "{DALI_IMAGE_DIR}gallery-small-5.jpg"
},
"custom-properties": {
"cell-index":[3,2],
"column-span": 2
}
}]
}]
}