Rev 1565 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1565 | Rev 1574 | ||
---|---|---|---|
1 | package pt.estgp.estgweb.services.questionarios.utils; |
1 | package pt.estgp.estgweb.services.questionarios.pedagogico.reportprocessors.utils; |
2 | 2 | ||
3 | import java.io.Serializable; |
3 | import java.io.Serializable; |
4 | import java.util.ArrayList; |
4 | import java.util.ArrayList; |
5 | 5 | ||
6 | /** |
6 | /** |
7 | * Created by jorgemachado on 07/12/16. |
7 | * Created by jorgemachado on 07/12/16. |
8 | */ |
8 | */ |
9 | public class ChartTable implements 1.5.0/docs/api/java/io/Serializable.html">Serializable{ |
9 | public class ChartTable implements 1.5.0/docs/api/java/io/Serializable.html">Serializable{ |
10 | 10 | ||
11 | public static int NUMBER_CHARTS_ROW = 3; |
11 | public static int NUMBER_CHARTS_ROW = 3; |
12 | 12 | ||
13 | ArrayList<ChartsRow> chartsRow = new ArrayList<ChartsRow>(); |
13 | ArrayList<ChartsRow> chartsRow = new ArrayList<ChartsRow>(); |
14 | 14 | ||
15 | /*public List<PerguntaStats> generateCompleteListPerguntas() |
15 | /*public List<PerguntaStats> generateCompleteListPerguntas() |
16 | { |
16 | { |
17 | List<PerguntaStats> perguntas = new ArrayList<PerguntaStats>(); |
17 | List<PerguntaStats> perguntas = new ArrayList<PerguntaStats>(); |
18 | for(ChartsRow row: chartsRow) |
18 | for(ChartsRow row: chartsRow) |
19 | { |
19 | { |
20 | for(PerguntaStats p : row.getPerguntaStats()) |
20 | for(PerguntaStats p : row.getPerguntaStats()) |
21 | perguntas.add(p); |
21 | perguntas.add(p); |
22 | } |
22 | } |
23 | return perguntas; |
23 | return perguntas; |
24 | }*/ |
24 | }*/ |
25 | 25 | ||
26 | public void addChart(PerguntaStats chart) |
26 | public void addChart(PerguntaStats chart) |
27 | { |
27 | { |
28 | if(chartsRow.size() == 0 || chartsRow.get(chartsRow.size() - 1).getPerguntaStats().size() >= NUMBER_CHARTS_ROW) |
28 | if(chartsRow.size() == 0 || chartsRow.get(chartsRow.size() - 1).getPerguntaStats().size() >= NUMBER_CHARTS_ROW) |
29 | { |
29 | { |
30 | chartsRow.add(new ChartsRow()); |
30 | chartsRow.add(new ChartsRow()); |
31 | } |
31 | } |
32 | chartsRow.get(chartsRow.size() - 1).getPerguntaStats().add(chart); |
32 | chartsRow.get(chartsRow.size() - 1).getPerguntaStats().add(chart); |
33 | } |
33 | } |
34 | 34 | ||
35 | public ArrayList<ChartsRow> getChartsRow() { |
35 | public ArrayList<ChartsRow> getChartsRow() { |
36 | return chartsRow; |
36 | return chartsRow; |
37 | } |
37 | } |
38 | 38 | ||
39 | public void setChartsRow(ArrayList<ChartsRow> chartsRow) { |
39 | public void setChartsRow(ArrayList<ChartsRow> chartsRow) { |
40 | this.chartsRow = chartsRow; |
40 | this.chartsRow = chartsRow; |
41 | } |
41 | } |
42 | 42 | ||
43 | public static class ChartsRow implements 1.5.0/docs/api/java/io/Serializable.html">Serializable |
43 | public static class ChartsRow implements 1.5.0/docs/api/java/io/Serializable.html">Serializable |
44 | { |
44 | { |
45 | ArrayList<PerguntaStats> perguntaStats = new ArrayList<PerguntaStats>(); |
45 | ArrayList<PerguntaStats> perguntaStats = new ArrayList<PerguntaStats>(); |
46 | 46 | ||
47 | public ArrayList<PerguntaStats> getPerguntaStats() { |
47 | public ArrayList<PerguntaStats> getPerguntaStats() { |
48 | return perguntaStats; |
48 | return perguntaStats; |
49 | } |
49 | } |
50 | 50 | ||
51 | public void setPerguntaStats(ArrayList<PerguntaStats> perguntaStats) { |
51 | public void setPerguntaStats(ArrayList<PerguntaStats> perguntaStats) { |
52 | this.perguntaStats = perguntaStats; |
52 | this.perguntaStats = perguntaStats; |
53 | } |
53 | } |
54 | } |
54 | } |
55 | } |
55 | } |
56 | 56 | ||
57 | 57 | ||
58 | 58 |