// creo il dataset
String[] labels = new String[enters.size()];
for (int i = 0; i < enters.size(); i++) {
labels[i] = enters.get(i).toString();
}
DefaultCategoryDataset enterDirectionDataset = datasetCreator
.createDirectionDataset(false, new int[] {},
computeReg(entersMatch), labels,
"entrati da ");
// creao il grafico
ProvenienzaChartCreator enterDirectionFactory = new ProvenienzaChartCreator(
enterDirectionDataset, "Provenienza sciatori");
JFreeChart enterDirectionChart = enterDirectionFactory
.createChart();
enterDirectionPanel = new ChartPanel(
enterDirectionChart);
enterDirectionPanel.setBorder(BorderFactory
.createLineBorder(Color.RED));
CategoryPlot cp = enterDirectionChart.getCategoryPlot();
BarRenderer renderer = (BarRenderer) cp.getRenderer();
// for (int c = 0; c < matchList.size(); c++) {
// renderer.setSeriesPaint(c, matchList.get(c)
// .getColor());
// }
enterDirectionPanel.setPreferredSize(new Dimension(400,
300));
enterDirectionPanel.setRangeZoomable(false);
/* DIREZIONI SCIATORI RIPARTITI DA PISTA */
// calcolo la lista di matchdata radioUscite
ArrayList<MatchData> exitsMatch = new ArrayList<MatchData>();
for (Integer id : skierExitMap.keySet())
exitsMatch.add(computeMatchTokens(id, tokens,
skierExitMap.get(id), TOKEN_SIZE));
// creo il dataset
labels = new String[exits.size()];
for (int i = 0; i < exits.size(); i++) {
labels[i] = exits.get(i).toString();
}
DefaultCategoryDataset exitDirectionDataset = datasetCreator
.createDirectionDataset(false,
computeStopped(exitsMatch),
computeReg(exitsMatch), labels,
"verso ");
// creao il grafico
DirectionChartCreator exitDirectionFactory = new DirectionChartCreator(
exitDirectionDataset,
"Direzione sciatori ripartiti da pista");
JFreeChart exitDirectionChart = exitDirectionFactory
.createChart();
exitDirectionPanel = new ChartPanel(exitDirectionChart);
exitDirectionPanel.setPreferredSize(new Dimension(400,
300));
exitDirectionPanel.setRangeZoomable(false);
exitDirectionPanel.setBorder(BorderFactory
.createLineBorder(Color.RED));
/* DIREZIONI SCIATORI PROVENDIENTI DA */
// calcolo la lista di datamatch
ArrayList<DirectionMatchData> directionmatchlist = new ArrayList<DirectionMatchData>();
listOfMatch = new ArrayList<ChartPanel>();
for (DirectionData data : directions) {
DirectionMatchData direction = new DirectionMatchData();
direction.setFrom(data.getFrom());
for (ExitDirectionData extdata : data.getListOfTo()) {
direction.add(computeMatchTokens(
extdata.getTo(), tokens,
extdata.getListOfTraks(), TOKEN_SIZE));
}
directionmatchlist.add(direction);
}
// creo il dataset
for (DirectionMatchData dirmatch : directionmatchlist) {
labels = new String[dirmatch.listOfTo.size()];
for (int i = 0; i < dirmatch.getListOfTo().size(); i++) {
labels[i] = String.valueOf(dirmatch
.getListOfTo().get(i).getId());
}
DefaultCategoryDataset directionDataset = datasetCreator
.createDirectionDataset(false,
computeStopped(dirmatch
.getListOfTo()),
computeReg(dirmatch.getListOfTo()),
labels, "verso ");