Skip to content

Package: AbstractGridDescription

AbstractGridDescription

nameinstructionbranchcomplexitylinemethod
AbstractGridDescription()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
AbstractGridDescription(int, int, List)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
getColumns()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getGrid()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getRows()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setColumns(int)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setGrid(List)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setRows(int)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: * Lucas Köhler - Refactoring
14: ******************************************************************************/
15: package org.eclipse.emf.ecp.view.model.common;
16:
17: import java.util.List;
18:
19: /**
20: * A {@link AbstractGridDescription} describes the grid of the renderer using a list of {@link AbstractGridCell
21: * GridCells} and the number of rows and columns it has.
22: *
23: * @author Eugen Neufeld
24: * @author Lucas Köhler
25: * @param <GRIDCELL> the grid cell type (e.g. SWT or JavaFX grid cell)
26: *
27: */
28: public abstract class AbstractGridDescription<GRIDCELL extends AbstractGridCell<?>> {
29:
30:         private List<GRIDCELL> grid;
31:         private int rows;
32:
33:         private int columns;
34:
35:         /**
36:          * Creating an empty grid.
37:          */
38:         public AbstractGridDescription() {
39:
40:         }
41:
42:         /**
43:          * Creating a filled grid.
44:          *
45:          * @param rows number of rows in this description
46:          * @param columns number of columns in this description
47:          * @param grid the List of {@link AbstractGridCell GridCells} describing the grid
48:          */
49:         public AbstractGridDescription(int rows, int columns, List<GRIDCELL> grid) {
50:                 this.grid = grid;
51:                 this.rows = rows;
52:                 this.columns = columns;
53:         }
54:
55:         /**
56:          * The {@link AbstractGridCell GridCells} describing the grid.
57:          *
58:          * @return the grid
59:          */
60:         public List<GRIDCELL> getGrid() {
61:                 return grid;
62:         }
63:
64:         /**
65:          * Number of rows in this Grid.
66:          *
67:          * @return the rows
68:          */
69:         public int getRows() {
70:                 return rows;
71:         }
72:
73:         /**
74:          * Number of columns in this grid.
75:          *
76:          * @return the columns
77:          */
78:         public int getColumns() {
79:                 return columns;
80:         }
81:
82:         /**
83:          * List of {@link AbstractGridCell GridCells}.
84:          *
85:          * @param grid the grid to set
86:          */
87:         public void setGrid(List<GRIDCELL> grid) {
88:                 this.grid = grid;
89:         }
90:
91:         /**
92:          * Sets the number of rows.
93:          *
94:          * @param rows the rows to set
95:          */
96:         public void setRows(int rows) {
97:                 this.rows = rows;
98:         }
99:
100:         /**
101:          * Sets the number of columns.
102:          *
103:          * @param columns the columns to set
104:          */
105:         public void setColumns(int columns) {
106:                 this.columns = columns;
107:         }
108: }