Changed DALI_*_DIR to DEMO_*_DIR
[platform/core/uifw/dali-demo.git] / resources / scripts / table-view.json
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 {
18   // a tree of actors
19   /*
20    *  4 by 4 table:
21    * |------------------------------------|
22    * |          |    2(right,top)|   |    |
23    * |  -  -  - |----------------|---|----|
24    * |          |                |   |    |
25    * |          |                |   |    |
26    * |          |                |   |    |
27    * |  -  -  - |  -  -  -  -  - |--------|
28    * |          |                |   |    |
29    * |    1     |                |   |    |
30    * |          |  3             | 4 |    |
31    * |          |aligned to      |   |    |
32    * |          |(left, center)  |   |    |
33    * |  -  -  - |  -  -  -  -  - |--------|
34    * |          |                |   '    |
35    * |          |                |   '    |
36    * |          |                |   5    |
37    * |          |                |   '    |
38    * |          |                |   '    |
39    * |------------------------------------|
40   */
41
42   "stage": [{
43       "name":"simpleTable",
44       "type":"TableView",
45       "background":{
46         "color": [0.5,0.5,0,1]
47         },
48       "parentOrigin": "CENTER",
49       "size":[400,400,1],
50       "rows": 4,
51       "columns": 4,
52       "cellPadding": [10, 5],
53       "layoutRows": {  // set the height of the rows
54         "0": { "policy": "fixed", "value": 40 },
55         "1": { "policy": "relative", "value": 0.33 },
56         "2": { "policy": "fit", "value": 0 }
57       },
58       "layoutColumns": { // set the widths of the columns
59         "0": { "policy": "fit", "value": 0 },
60         "2": { "policy": "relative", "value": 0.2 },
61         "3": { "policy": "fixed", "value": 30 }
62       },
63       "actors": [{
64           "name":"gallery1",
65           "type":"ImageActor",
66           "heightResizePolicy":"FILL_TO_PARENT",
67           "image": {
68             "filename": "{DEMO_IMAGE_DIR}gallery-small-1.jpg"
69           },
70           "customProperties": { // properties registered dynamically
71             "cellIndex": [0,0], // property to specify the top-left cell this child occupies
72             "rowSpan":4, // property to specify how many rows this child occupies, if not set, default value is 1
73             "columnSpan":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1
74           }
75         },{
76           "name":"gallery2",
77           "type":"ImageActor",
78           "heightResizePolicy":"FILL_TO_PARENT",
79           "image": {
80             "filename": "{DEMO_IMAGE_DIR}gallery-small-2.jpg"
81           },
82           "customProperties": { // properties registered dynamically
83             "cellIndex": [0,1],
84             "cellHorizontalAlignment": "right" // property to specify how to align horizontally inside the cells, if not set, default value is 'left'
85           }
86         },{
87           "name":"gallery3",
88           "type":"ImageActor",
89           "image": {
90             "filename": "{DEMO_IMAGE_DIR}gallery-small-3.jpg"
91           },
92           "customProperties": {
93             "cellIndex":[1,1],
94             "rowSpan":3,
95             "cellHorizontalAlignment": "left",// property to specify how to align horizontally inside the cells, if not set, default value is 'left'
96             "cellVerticalAlignment": "center" // property to specify how to align vertically inside the cells, if not set, default value is 'top'
97           }
98         }, {
99           "name":"gallery4",
100           "type":"ImageActor",
101           "widthResizePolicy":"FILL_TO_PARENT",
102           "image": {
103             "filename": "{DEMO_IMAGE_DIR}gallery-small-4.jpg"
104           },
105           "customProperties": {
106             "cellIndex":[2,2]
107           }
108         }, {
109           "name":"gallery5",
110           "type":"ImageActor",
111           "widthResizePolicy":"FILL_TO_PARENT",
112           "heightResizePolicy":"FILL_TO_PARENT",
113           "image": {
114             "filename": "{DEMO_IMAGE_DIR}gallery-small-5.jpg"
115           },
116           "customProperties": {
117             "cellIndex":[3,2],
118             "columnSpan": 2
119           }
120         }]
121     }]
122 }